2010-11-18 16:42:57 +00:00
|
|
|
// Cyphesis Online RPG Server and AI Engine
|
|
|
|
|
// Copyright (C) 2010 Alistair Riddoch
|
|
|
|
|
//
|
|
|
|
|
// This program is free software; you can redistribute it and/or modify
|
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
|
// the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
// (at your option) any later version.
|
|
|
|
|
//
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
//
|
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
|
// along with this program; if not, write to the Free Software Foundation,
|
|
|
|
|
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
|
|
|
|
|
|
|
2011-02-15 09:30:46 +00:00
|
|
|
#ifdef NDEBUG
|
|
|
|
|
#undef NDEBUG
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef DEBUG
|
|
|
|
|
#define DEBUG
|
|
|
|
|
#endif
|
|
|
|
|
|
2019-11-20 23:03:40 +01:00
|
|
|
#include "client/cyclient/BaseClient.h"
|
2020-03-22 23:36:52 +01:00
|
|
|
#include "../NullPropertyManager.h"
|
2021-06-27 16:27:10 +02:00
|
|
|
#include "rules/SimpleTypeStore.h"
|
2010-11-18 16:42:57 +00:00
|
|
|
|
|
|
|
|
#include <Atlas/Objects/RootOperation.h>
|
|
|
|
|
|
|
|
|
|
#include <cassert>
|
|
|
|
|
|
|
|
|
|
using Atlas::Objects::Root;
|
|
|
|
|
using Atlas::Objects::Operation::RootOperation;
|
|
|
|
|
|
2019-09-10 22:42:28 +02:00
|
|
|
Atlas::Objects::Factories factories;
|
|
|
|
|
|
2010-11-19 00:59:45 +00:00
|
|
|
class TestBaseClient : public BaseClient
|
|
|
|
|
{
|
|
|
|
|
public:
|
2021-06-27 16:27:10 +02:00
|
|
|
explicit TestBaseClient(boost::asio::io_context& io_context, TypeStore& typeStore) : BaseClient(io_context, factories, typeStore) { }
|
2010-11-19 00:59:45 +00:00
|
|
|
|
2020-03-22 23:36:52 +01:00
|
|
|
void idle() override { }
|
2010-11-19 00:59:45 +00:00
|
|
|
};
|
|
|
|
|
|
2010-11-18 16:42:57 +00:00
|
|
|
int main()
|
|
|
|
|
{
|
2020-03-22 23:36:52 +01:00
|
|
|
NullPropertyManager propertyManager;
|
2021-06-27 16:27:10 +02:00
|
|
|
SimpleTypeStore typeStore(propertyManager);
|
2019-06-24 21:12:55 +02:00
|
|
|
boost::asio::io_context io_context;
|
2010-11-19 00:59:45 +00:00
|
|
|
{
|
2021-06-27 16:27:10 +02:00
|
|
|
BaseClient * bc = new TestBaseClient{io_context, typeStore};
|
2010-11-19 00:59:45 +00:00
|
|
|
|
|
|
|
|
delete bc;
|
|
|
|
|
}
|
|
|
|
|
|
2010-11-22 18:35:11 +00:00
|
|
|
{
|
2021-06-27 16:27:10 +02:00
|
|
|
BaseClient * bc = new TestBaseClient{io_context, typeStore};
|
2010-11-22 18:35:11 +00:00
|
|
|
|
|
|
|
|
bc->createAccount("8e7e4452-f666-11df-8027-00269e5444b3", "84abee0c-f666-11df-8f7e-00269e5444b3");
|
|
|
|
|
|
|
|
|
|
delete bc;
|
|
|
|
|
}
|
|
|
|
|
|
2010-11-19 00:59:45 +00:00
|
|
|
{
|
2021-06-27 16:27:10 +02:00
|
|
|
BaseClient * bc = new TestBaseClient{io_context, typeStore};
|
2010-11-19 00:59:45 +00:00
|
|
|
|
|
|
|
|
bc->createSystemAccount();
|
|
|
|
|
|
|
|
|
|
delete bc;
|
|
|
|
|
}
|
|
|
|
|
|
2010-11-22 18:35:11 +00:00
|
|
|
{
|
2021-06-27 16:27:10 +02:00
|
|
|
BaseClient * bc = new TestBaseClient{io_context, typeStore};
|
2010-11-22 18:35:11 +00:00
|
|
|
|
|
|
|
|
bc->createCharacter("9e7f4004-f666-11df-a327-00269e5444b3");
|
|
|
|
|
|
|
|
|
|
delete bc;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
2021-06-27 16:27:10 +02:00
|
|
|
BaseClient * bc = new TestBaseClient{io_context, typeStore};
|
2010-11-22 18:35:11 +00:00
|
|
|
|
|
|
|
|
bc->logout();
|
|
|
|
|
|
|
|
|
|
delete bc;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
2021-06-27 16:27:10 +02:00
|
|
|
BaseClient * bc = new TestBaseClient{io_context, typeStore};
|
2010-11-22 18:35:11 +00:00
|
|
|
|
|
|
|
|
bc->handleNet();
|
|
|
|
|
|
|
|
|
|
delete bc;
|
|
|
|
|
}
|
|
|
|
|
|
2010-11-18 16:42:57 +00:00
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// stubs
|
|
|
|
|
|
2019-11-20 23:03:40 +01:00
|
|
|
#include "client/cyclient/CreatorClient.h"
|
2010-11-18 16:42:57 +00:00
|
|
|
|
|
|
|
|
#include "common/log.h"
|
|
|
|
|
|
|
|
|
|
#include <cstdlib>
|
|
|
|
|
|
2020-01-20 23:17:55 +01:00
|
|
|
#include "../stubs/rules/ai/stubBaseMind.h"
|
2021-06-27 16:27:10 +02:00
|
|
|
#include "../stubs/rules/stubSimpleTypeStore.h"
|
|
|
|
|
#include "../stubs/common/stubTypeNode.h"
|
2020-01-20 23:17:55 +01:00
|
|
|
#include "../stubs/client/cyclient/stubCreatorClient.h"
|
2015-05-23 16:47:45 +02:00
|
|
|
|
2018-10-27 13:13:45 +02:00
|
|
|
#define STUB_ClientConnection_pop
|
2010-11-18 16:42:57 +00:00
|
|
|
RootOperation ClientConnection::pop()
|
|
|
|
|
{
|
2013-08-12 22:05:01 +02:00
|
|
|
return RootOperation(nullptr);
|
2010-11-18 16:42:57 +00:00
|
|
|
}
|
|
|
|
|
|
2020-01-20 23:17:55 +01:00
|
|
|
#include "../stubs/client/cyclient/stubClientConnection.h"
|
|
|
|
|
#include "../stubs/client/cyclient/stubCharacterClient.h"
|
|
|
|
|
#include "../stubs/rules/ai/stubMemMap.h"
|
|
|
|
|
#include "../stubs/common/stubAtlasStreamClient.h"
|
|
|
|
|
#include "../stubs/common/stublog.h"
|
2020-03-22 23:36:52 +01:00
|
|
|
#include "../stubs/common/stubProperty.h"
|
|
|
|
|
#include "../stubs/common/stubPropertyManager.h"
|
2010-11-18 16:42:57 +00:00
|
|
|
|
|
|
|
|
std::string create_session_username()
|
|
|
|
|
{
|
|
|
|
|
return "admin_test";
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-20 23:17:55 +01:00
|
|
|
#include "../stubs/common/stubid.h"
|
2021-06-20 15:40:33 +02:00
|
|
|
#include "../stubs/rules/ai/stubMemEntity.h"
|
2020-01-20 23:17:55 +01:00
|
|
|
#include "../stubs/rules/stubLocatedEntity.h"
|
|
|
|
|
#include "../stubs/common/stubRouter.h"
|
2020-09-18 22:21:25 +02:00
|
|
|
#include "../stubs/common/stubcustom.h"
|
2020-01-20 23:17:55 +01:00
|
|
|
#include "../stubs/rules/stubLocation.h"
|