2010-06-30 18:16:22 +05:30
|
|
|
// Cyphesis Online RPG Server and AI Engine
|
|
|
|
|
// Copyright (C) 2009 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.
|
2012-09-12 15:03:18 +01:00
|
|
|
//
|
2010-06-30 18:16:22 +05:30
|
|
|
// 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.
|
2012-09-12 15:03:18 +01:00
|
|
|
//
|
2010-06-30 18:16:22 +05:30
|
|
|
// 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
|
|
|
|
|
|
|
|
|
|
// $Id$
|
|
|
|
|
|
2011-02-15 09:30:46 +00:00
|
|
|
#ifdef NDEBUG
|
|
|
|
|
#undef NDEBUG
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef DEBUG
|
|
|
|
|
#define DEBUG
|
|
|
|
|
#endif
|
|
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
#include "TestBase.h"
|
|
|
|
|
#include "TestWorld.h"
|
2012-08-01 19:42:36 +01:00
|
|
|
|
2010-06-30 18:16:22 +05:30
|
|
|
#include "server/ServerAccount.h"
|
2012-09-12 15:03:18 +01:00
|
|
|
|
2010-06-30 18:16:22 +05:30
|
|
|
#include "server/Connection.h"
|
2012-09-12 15:03:18 +01:00
|
|
|
#include "server/ServerRouting.h"
|
2012-09-15 00:07:46 +01:00
|
|
|
#include "server/TeleportAuthenticator.h"
|
2010-06-30 18:16:22 +05:30
|
|
|
|
2012-09-14 21:04:53 +01:00
|
|
|
#include "rulesets/Character.h"
|
2010-06-30 18:16:22 +05:30
|
|
|
|
2012-11-23 11:05:59 +00:00
|
|
|
#include "common/CommSocket.h"
|
2012-09-12 15:03:18 +01:00
|
|
|
#include "common/compose.hpp"
|
2010-06-30 18:16:22 +05:30
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
#include <Atlas/Objects/RootEntity.h>
|
2012-09-14 21:04:53 +01:00
|
|
|
#include <Atlas/Objects/Operation.h>
|
2010-06-30 18:16:22 +05:30
|
|
|
#include <Atlas/Objects/SmartPtr.h>
|
|
|
|
|
|
|
|
|
|
#include <cassert>
|
|
|
|
|
|
|
|
|
|
using Atlas::Message::MapType;
|
|
|
|
|
using Atlas::Objects::Root;
|
|
|
|
|
using Atlas::Objects::Entity::RootEntity;
|
2012-09-14 00:40:14 +01:00
|
|
|
using Atlas::Objects::Operation::RootOperation;
|
2010-06-30 18:16:22 +05:30
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
using String::compose;
|
|
|
|
|
|
|
|
|
|
class ServerAccounttest : public Cyphesis::TestBase
|
|
|
|
|
{
|
|
|
|
|
protected:
|
|
|
|
|
long m_id_counter;
|
2010-06-30 18:16:22 +05:30
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
ServerRouting * m_server;
|
|
|
|
|
Connection * m_connection;
|
2012-09-12 15:10:11 +01:00
|
|
|
ServerAccount * m_account;
|
2012-09-14 21:04:53 +01:00
|
|
|
|
|
|
|
|
static Entity * TestWorld_addNewEntity_ret_value;
|
2010-06-30 18:16:22 +05:30
|
|
|
public:
|
2012-09-12 15:03:18 +01:00
|
|
|
ServerAccounttest();
|
2010-06-30 18:16:22 +05:30
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
void setup();
|
|
|
|
|
void teardown();
|
2010-06-30 18:16:22 +05:30
|
|
|
|
2012-09-14 00:40:14 +01:00
|
|
|
void test_getType();
|
|
|
|
|
void test_characterError();
|
2012-09-14 21:04:53 +01:00
|
|
|
void test_createObject_not_obj();
|
|
|
|
|
void test_createObject_non_entity();
|
|
|
|
|
void test_createObject_failed();
|
|
|
|
|
void test_createObject_success();
|
|
|
|
|
void test_createObject_success_refo();
|
2012-09-15 00:01:13 +01:00
|
|
|
void test_createObject_no_possess();
|
|
|
|
|
void test_createObject_possess_non_string();
|
|
|
|
|
void test_createObject_success_possess();
|
2012-09-14 21:04:53 +01:00
|
|
|
void test_addNewEntity_failed();
|
|
|
|
|
void test_addNewEntity_success();
|
|
|
|
|
void test_addNewEntity_unconnected();
|
|
|
|
|
|
|
|
|
|
static Entity * get_TestWorld_addNewEntity_ret_value();
|
2010-06-30 18:16:22 +05:30
|
|
|
};
|
|
|
|
|
|
2012-09-14 21:04:53 +01:00
|
|
|
Entity * ServerAccounttest::TestWorld_addNewEntity_ret_value;
|
|
|
|
|
|
|
|
|
|
Entity * ServerAccounttest::get_TestWorld_addNewEntity_ret_value()
|
|
|
|
|
{
|
|
|
|
|
return TestWorld_addNewEntity_ret_value;
|
|
|
|
|
}
|
|
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
ServerAccounttest::ServerAccounttest() : m_id_counter(0L),
|
|
|
|
|
m_server(0),
|
|
|
|
|
m_connection(0),
|
|
|
|
|
m_account(0)
|
|
|
|
|
{
|
2012-09-14 00:40:14 +01:00
|
|
|
ADD_TEST(ServerAccounttest::test_getType);
|
|
|
|
|
ADD_TEST(ServerAccounttest::test_characterError);
|
2012-09-14 21:04:53 +01:00
|
|
|
ADD_TEST(ServerAccounttest::test_createObject_not_obj);
|
|
|
|
|
ADD_TEST(ServerAccounttest::test_createObject_non_entity);
|
|
|
|
|
ADD_TEST(ServerAccounttest::test_createObject_failed);
|
|
|
|
|
ADD_TEST(ServerAccounttest::test_createObject_success);
|
|
|
|
|
ADD_TEST(ServerAccounttest::test_createObject_success_refo);
|
2012-09-15 00:01:13 +01:00
|
|
|
ADD_TEST(ServerAccounttest::test_createObject_no_possess);
|
|
|
|
|
ADD_TEST(ServerAccounttest::test_createObject_possess_non_string);
|
|
|
|
|
ADD_TEST(ServerAccounttest::test_createObject_success_possess);
|
2012-09-14 21:04:53 +01:00
|
|
|
ADD_TEST(ServerAccounttest::test_addNewEntity_failed);
|
|
|
|
|
ADD_TEST(ServerAccounttest::test_addNewEntity_success);
|
|
|
|
|
ADD_TEST(ServerAccounttest::test_addNewEntity_unconnected);
|
2012-09-12 15:03:18 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ServerAccounttest::setup()
|
|
|
|
|
{
|
|
|
|
|
Entity * gw = new Entity(compose("%1", m_id_counter),
|
|
|
|
|
m_id_counter++);
|
|
|
|
|
m_server = new ServerRouting(*new TestWorld(*gw),
|
|
|
|
|
"5529d7a4-0158-4dc1-b4a5-b5f260cac635",
|
|
|
|
|
"bad621d4-616d-4faf-b9e6-471d12b139a9",
|
|
|
|
|
compose("%1", m_id_counter), m_id_counter++,
|
|
|
|
|
compose("%1", m_id_counter), m_id_counter++);
|
|
|
|
|
m_connection = new Connection(*(CommSocket*)0, *m_server,
|
|
|
|
|
"8d18a4e8-f14f-4a46-997e-ada120d5438f",
|
|
|
|
|
compose("%1", m_id_counter), m_id_counter++);
|
|
|
|
|
m_account = new ServerAccount(m_connection,
|
|
|
|
|
"6c9f3236-5de7-4ba4-8b7a-b0222df0af38",
|
|
|
|
|
"fa1a03a2-a745-4033-85cb-bb694e921e62",
|
|
|
|
|
compose("%1", m_id_counter), m_id_counter++);
|
2012-09-15 00:07:46 +01:00
|
|
|
|
|
|
|
|
TeleportAuthenticator::init();
|
2012-09-12 15:03:18 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ServerAccounttest::teardown()
|
|
|
|
|
{
|
2012-09-15 00:07:46 +01:00
|
|
|
TeleportAuthenticator::del();
|
|
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
delete m_server;
|
2012-09-13 00:02:41 +01:00
|
|
|
delete m_account;
|
|
|
|
|
delete m_connection;
|
2012-09-12 15:03:18 +01:00
|
|
|
}
|
|
|
|
|
|
2012-09-14 00:40:14 +01:00
|
|
|
void ServerAccounttest::test_getType()
|
|
|
|
|
{
|
|
|
|
|
const char * type = m_account->getType();
|
|
|
|
|
|
|
|
|
|
ASSERT_EQUAL(std::string("server"), type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ServerAccounttest::test_characterError()
|
|
|
|
|
{
|
|
|
|
|
RootOperation op;
|
|
|
|
|
Root arg;
|
|
|
|
|
OpVector res;
|
|
|
|
|
|
|
|
|
|
int result = m_account->characterError(op, arg, res);
|
|
|
|
|
|
|
|
|
|
ASSERT_EQUAL(result, -1);
|
|
|
|
|
}
|
|
|
|
|
|
2012-09-14 21:04:53 +01:00
|
|
|
void ServerAccounttest::test_createObject_not_obj()
|
2012-09-14 00:40:14 +01:00
|
|
|
{
|
2012-09-14 21:04:53 +01:00
|
|
|
std::string type_str("unimportant_string");
|
|
|
|
|
Root arg;
|
|
|
|
|
RootOperation op;
|
|
|
|
|
OpVector res;
|
|
|
|
|
|
|
|
|
|
arg->setObjtype("foo");
|
|
|
|
|
|
|
|
|
|
m_account->createObject(type_str, arg, op, res);
|
|
|
|
|
|
|
|
|
|
ASSERT_EQUAL(res.size(), 1u);
|
|
|
|
|
|
|
|
|
|
const RootOperation & reply = res.front();
|
|
|
|
|
|
|
|
|
|
ASSERT_EQUAL(reply->getClassNo(),
|
|
|
|
|
Atlas::Objects::Operation::ERROR_NO);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ServerAccounttest::test_createObject_non_entity()
|
|
|
|
|
{
|
|
|
|
|
std::string type_str("unimportant_string");
|
|
|
|
|
Root arg;
|
|
|
|
|
RootOperation op;
|
|
|
|
|
OpVector res;
|
|
|
|
|
|
|
|
|
|
m_account->createObject(type_str, arg, op, res);
|
|
|
|
|
|
|
|
|
|
ASSERT_TRUE(res.empty());
|
2012-09-14 00:40:14 +01:00
|
|
|
}
|
|
|
|
|
|
2012-09-14 21:04:53 +01:00
|
|
|
void ServerAccounttest::test_createObject_failed()
|
2012-09-12 15:03:18 +01:00
|
|
|
{
|
2012-09-14 21:04:53 +01:00
|
|
|
TestWorld_addNewEntity_ret_value = 0;
|
|
|
|
|
|
|
|
|
|
std::string type_str("unimportant_string");
|
|
|
|
|
RootEntity arg;
|
|
|
|
|
RootOperation op;
|
|
|
|
|
OpVector res;
|
|
|
|
|
|
|
|
|
|
m_account->createObject(type_str, arg, op, res);
|
|
|
|
|
|
|
|
|
|
ASSERT_EQUAL(res.size(), 1u);
|
|
|
|
|
|
|
|
|
|
const RootOperation & reply = res.front();
|
|
|
|
|
|
|
|
|
|
ASSERT_EQUAL(reply->getClassNo(),
|
|
|
|
|
Atlas::Objects::Operation::ERROR_NO);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ServerAccounttest::test_createObject_success()
|
|
|
|
|
{
|
|
|
|
|
long cid = m_id_counter++;
|
|
|
|
|
TestWorld_addNewEntity_ret_value = new Character(compose("%1", cid), cid);
|
|
|
|
|
|
|
|
|
|
std::string type_str("unimportant_string");
|
|
|
|
|
RootEntity arg;
|
|
|
|
|
RootOperation op;
|
|
|
|
|
OpVector res;
|
|
|
|
|
|
|
|
|
|
m_account->createObject(type_str, arg, op, res);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ASSERT_EQUAL(res.size(), 1u);
|
|
|
|
|
|
|
|
|
|
const RootOperation & reply = res.front();
|
|
|
|
|
|
|
|
|
|
ASSERT_EQUAL(reply->getClassNo(),
|
|
|
|
|
Atlas::Objects::Operation::INFO_NO);
|
|
|
|
|
|
|
|
|
|
delete TestWorld_addNewEntity_ret_value;
|
|
|
|
|
TestWorld_addNewEntity_ret_value = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ServerAccounttest::test_createObject_success_refo()
|
|
|
|
|
{
|
|
|
|
|
long cid = m_id_counter++;
|
|
|
|
|
TestWorld_addNewEntity_ret_value = new Character(compose("%1", cid), cid);
|
|
|
|
|
|
|
|
|
|
std::string type_str("unimportant_string");
|
|
|
|
|
RootEntity arg;
|
|
|
|
|
RootOperation op;
|
|
|
|
|
op->setSerialno(44295);
|
|
|
|
|
OpVector res;
|
|
|
|
|
|
|
|
|
|
m_account->createObject(type_str, arg, op, res);
|
|
|
|
|
|
|
|
|
|
ASSERT_EQUAL(res.size(), 1u);
|
|
|
|
|
|
|
|
|
|
const RootOperation & reply = res.front();
|
|
|
|
|
|
|
|
|
|
ASSERT_EQUAL(reply->getClassNo(),
|
|
|
|
|
Atlas::Objects::Operation::INFO_NO);
|
|
|
|
|
ASSERT_TRUE(!reply->isDefaultRefno());
|
|
|
|
|
ASSERT_EQUAL(reply->getRefno(), op->getSerialno());
|
|
|
|
|
|
|
|
|
|
delete TestWorld_addNewEntity_ret_value;
|
|
|
|
|
TestWorld_addNewEntity_ret_value = 0;
|
|
|
|
|
}
|
|
|
|
|
|
2012-09-15 00:01:13 +01:00
|
|
|
void ServerAccounttest::test_createObject_no_possess()
|
|
|
|
|
{
|
|
|
|
|
long cid = m_id_counter++;
|
|
|
|
|
TestWorld_addNewEntity_ret_value = new Character(compose("%1", cid), cid);
|
|
|
|
|
|
|
|
|
|
std::string type_str("unimportant_string");
|
|
|
|
|
RootEntity arg;
|
|
|
|
|
RootEntity arg2;
|
|
|
|
|
RootOperation op;
|
|
|
|
|
op->setArgs1(arg);
|
|
|
|
|
op->modifyArgs().push_back(arg2);
|
|
|
|
|
OpVector res;
|
|
|
|
|
|
|
|
|
|
m_account->createObject(type_str, arg, op, res);
|
|
|
|
|
|
|
|
|
|
// FIXME No error to the client!
|
|
|
|
|
ASSERT_TRUE(res.empty());
|
|
|
|
|
|
|
|
|
|
delete TestWorld_addNewEntity_ret_value;
|
|
|
|
|
TestWorld_addNewEntity_ret_value = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ServerAccounttest::test_createObject_possess_non_string()
|
|
|
|
|
{
|
|
|
|
|
long cid = m_id_counter++;
|
|
|
|
|
TestWorld_addNewEntity_ret_value = new Character(compose("%1", cid), cid);
|
|
|
|
|
|
|
|
|
|
std::string type_str("unimportant_string");
|
|
|
|
|
RootEntity arg;
|
|
|
|
|
RootEntity arg2;
|
|
|
|
|
arg2->setAttr("possess_key", 23);
|
|
|
|
|
RootOperation op;
|
|
|
|
|
op->setArgs1(arg);
|
|
|
|
|
op->modifyArgs().push_back(arg2);
|
|
|
|
|
OpVector res;
|
|
|
|
|
|
|
|
|
|
m_account->createObject(type_str, arg, op, res);
|
|
|
|
|
|
|
|
|
|
// FIXME No error to the client!
|
|
|
|
|
ASSERT_TRUE(res.empty());
|
|
|
|
|
|
|
|
|
|
delete TestWorld_addNewEntity_ret_value;
|
|
|
|
|
TestWorld_addNewEntity_ret_value = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ServerAccounttest::test_createObject_success_possess()
|
|
|
|
|
{
|
|
|
|
|
long cid = m_id_counter++;
|
|
|
|
|
TestWorld_addNewEntity_ret_value = new Character(compose("%1", cid), cid);
|
|
|
|
|
|
|
|
|
|
std::string type_str("unimportant_string");
|
|
|
|
|
RootEntity arg;
|
|
|
|
|
RootEntity arg2;
|
|
|
|
|
arg2->setAttr("possess_key", "unimportant_string");
|
|
|
|
|
RootOperation op;
|
|
|
|
|
op->setArgs1(arg);
|
|
|
|
|
op->modifyArgs().push_back(arg2);
|
|
|
|
|
OpVector res;
|
|
|
|
|
|
|
|
|
|
m_account->createObject(type_str, arg, op, res);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ASSERT_EQUAL(res.size(), 1u);
|
|
|
|
|
|
|
|
|
|
const RootOperation & reply = res.front();
|
|
|
|
|
|
|
|
|
|
ASSERT_EQUAL(reply->getClassNo(),
|
|
|
|
|
Atlas::Objects::Operation::INFO_NO);
|
|
|
|
|
|
|
|
|
|
delete TestWorld_addNewEntity_ret_value;
|
|
|
|
|
TestWorld_addNewEntity_ret_value = 0;
|
|
|
|
|
}
|
|
|
|
|
|
2012-09-14 21:04:53 +01:00
|
|
|
void ServerAccounttest::test_addNewEntity_failed()
|
|
|
|
|
{
|
|
|
|
|
TestWorld_addNewEntity_ret_value = 0;
|
|
|
|
|
|
|
|
|
|
std::string type_str("unimportant_string");
|
|
|
|
|
RootEntity arg;
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
LocatedEntity * e = m_account->addNewEntity(type_str, arg, arg);
|
2012-09-14 21:04:53 +01:00
|
|
|
|
|
|
|
|
ASSERT_NULL(e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ServerAccounttest::test_addNewEntity_success()
|
|
|
|
|
{
|
|
|
|
|
long cid = m_id_counter++;
|
|
|
|
|
Entity * c = new Character(compose("%1", cid), cid);
|
|
|
|
|
TestWorld_addNewEntity_ret_value = c;
|
|
|
|
|
|
|
|
|
|
std::string type_str("unimportant_string");
|
|
|
|
|
RootEntity arg;
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
LocatedEntity * e = m_account->addNewEntity(type_str, arg, arg);
|
2012-09-14 21:04:53 +01:00
|
|
|
|
|
|
|
|
ASSERT_EQUAL(c, e);
|
|
|
|
|
|
|
|
|
|
delete TestWorld_addNewEntity_ret_value;
|
|
|
|
|
TestWorld_addNewEntity_ret_value = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ServerAccounttest::test_addNewEntity_unconnected()
|
|
|
|
|
{
|
|
|
|
|
m_account->m_connection = 0;
|
|
|
|
|
|
|
|
|
|
std::string type_str("unimportant_string");
|
|
|
|
|
RootEntity arg;
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
LocatedEntity * e = m_account->addNewEntity(type_str, arg, arg);
|
2012-09-14 21:04:53 +01:00
|
|
|
|
|
|
|
|
ASSERT_NULL(e);
|
2012-09-12 15:03:18 +01:00
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
void TestWorld::message(const Operation & op, LocatedEntity & ent)
|
2012-09-12 15:03:18 +01:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
LocatedEntity * TestWorld::addNewEntity(const std::string &,
|
2012-09-12 15:03:18 +01:00
|
|
|
const Atlas::Objects::Entity::RootEntity &)
|
|
|
|
|
{
|
2012-09-14 21:04:53 +01:00
|
|
|
Entity * ne = ServerAccounttest::get_TestWorld_addNewEntity_ret_value();
|
|
|
|
|
if (ne != 0) {
|
|
|
|
|
ne->m_location.m_loc = &m_gameWorld;
|
|
|
|
|
ne->m_location.m_pos = Point3D(0,0,0);
|
|
|
|
|
assert(ne->m_location.isValid());
|
|
|
|
|
}
|
|
|
|
|
return ne;
|
2010-06-30 18:16:22 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int main()
|
|
|
|
|
{
|
2012-09-12 15:03:18 +01:00
|
|
|
ServerAccounttest t;
|
2010-06-30 18:16:22 +05:30
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
return t.run();
|
|
|
|
|
}
|
2011-05-05 18:00:14 +01:00
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
// stubs
|
2010-06-30 18:16:22 +05:30
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
#include "server/Connection.h"
|
|
|
|
|
#include "server/Persistence.h"
|
2010-06-30 18:16:22 +05:30
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
#include "common/globals.h"
|
|
|
|
|
#include "common/id.h"
|
|
|
|
|
#include "common/log.h"
|
2010-06-30 18:16:22 +05:30
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
#include <cstdlib>
|
2010-06-30 18:16:22 +05:30
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
Account::Account(Connection * conn,
|
|
|
|
|
const std::string & uname,
|
|
|
|
|
const std::string & passwd,
|
|
|
|
|
const std::string & id,
|
|
|
|
|
long intId) :
|
2012-11-13 00:09:05 +00:00
|
|
|
ConnectableRouter(id, intId, conn),
|
2012-09-12 15:03:18 +01:00
|
|
|
m_username(uname), m_password(passwd)
|
|
|
|
|
{
|
|
|
|
|
}
|
2010-06-30 18:16:22 +05:30
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
Account::~Account()
|
|
|
|
|
{
|
|
|
|
|
}
|
2010-06-30 18:16:22 +05:30
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
LocatedEntity * Account::addNewCharacter(const std::string & typestr,
|
2012-09-12 15:03:18 +01:00
|
|
|
const RootEntity & ent,
|
|
|
|
|
const Root & arg)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2010-06-30 18:16:22 +05:30
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
int Account::connectCharacter(LocatedEntity *chr)
|
2012-09-12 15:03:18 +01:00
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2010-06-30 18:16:22 +05:30
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
const char * Account::getType() const
|
|
|
|
|
{
|
|
|
|
|
return "account";
|
|
|
|
|
}
|
2010-06-30 18:16:22 +05:30
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
void Account::store() const
|
|
|
|
|
{
|
|
|
|
|
}
|
2010-06-30 18:16:22 +05:30
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
void Account::createObject(const std::string & type_str,
|
|
|
|
|
const Root & arg,
|
|
|
|
|
const Operation & op,
|
|
|
|
|
OpVector & res)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Account::addToMessage(MapType & omap) const
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Account::addToEntity(const RootEntity & ent) const
|
|
|
|
|
{
|
|
|
|
|
}
|
2010-06-30 18:16:22 +05:30
|
|
|
|
2012-12-04 20:39:35 +00:00
|
|
|
void Account::externalOperation(const Operation & op, Link &)
|
2012-11-13 23:33:23 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
void Account::operation(const Operation & op, OpVector & res)
|
|
|
|
|
{
|
|
|
|
|
}
|
2010-06-30 18:16:22 +05:30
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
void Account::LogoutOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
2010-06-30 18:16:22 +05:30
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
void Account::CreateOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
2010-06-30 18:16:22 +05:30
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
void Account::SetOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
2010-06-30 18:16:22 +05:30
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
void Account::ImaginaryOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
2010-06-30 18:16:22 +05:30
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
void Account::TalkOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
2010-06-30 18:16:22 +05:30
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
void Account::LookOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
2010-06-30 18:16:22 +05:30
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
void Account::GetOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
2010-06-30 18:16:22 +05:30
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
void Account::OtherOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
2010-06-30 18:16:22 +05:30
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
Connection::Connection(CommSocket & client,
|
|
|
|
|
ServerRouting & svr,
|
|
|
|
|
const std::string & addr,
|
|
|
|
|
const std::string & id, long iid) :
|
|
|
|
|
Link(client, id, iid), m_obsolete(false),
|
|
|
|
|
m_server(svr)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Account * Connection::newAccount(const std::string & type,
|
|
|
|
|
const std::string & username,
|
|
|
|
|
const std::string & passwd,
|
|
|
|
|
const std::string & id, long intId)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2010-06-30 18:16:22 +05:30
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
int Connection::verifyCredentials(const Account &,
|
|
|
|
|
const Atlas::Objects::Root &) const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Connection::~Connection()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2012-12-04 20:39:35 +00:00
|
|
|
void Connection::externalOperation(const Operation & op, Link &)
|
2012-11-13 23:33:23 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
void Connection::operation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Connection::LoginOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
2010-06-30 18:16:22 +05:30
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
void Connection::LogoutOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Connection::CreateOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Connection::GetOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
void Connection::addEntity(LocatedEntity * ent)
|
2012-09-12 15:03:18 +01:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2012-11-13 00:09:05 +00:00
|
|
|
ConnectableRouter::ConnectableRouter(const std::string & id,
|
2012-09-12 15:03:18 +01:00
|
|
|
long iid,
|
|
|
|
|
Connection *c) :
|
|
|
|
|
Router(id, iid),
|
|
|
|
|
m_connection(c)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2012-11-13 00:09:05 +00:00
|
|
|
ConnectableRouter::~ConnectableRouter()
|
2012-09-12 15:03:18 +01:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ServerRouting::ServerRouting(BaseWorld & wrld,
|
|
|
|
|
const std::string & ruleset,
|
|
|
|
|
const std::string & name,
|
|
|
|
|
const std::string & id, long intId,
|
|
|
|
|
const std::string & lId, long lIntId) :
|
|
|
|
|
Router(id, intId),
|
|
|
|
|
m_svrRuleset(ruleset), m_svrName(name),
|
|
|
|
|
m_numClients(0), m_world(wrld), m_lobby(*(Lobby*)0)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ServerRouting::~ServerRouting()
|
|
|
|
|
{
|
2012-09-13 00:02:41 +01:00
|
|
|
delete &m_world;
|
2012-09-12 15:03:18 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ServerRouting::addToMessage(Atlas::Message::MapType & omap) const
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ServerRouting::addToEntity(const Atlas::Objects::Entity::RootEntity & ent) const
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Account * ServerRouting::getAccountByName(const std::string & username)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ServerRouting::addAccount(Account * a)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2012-12-04 20:39:35 +00:00
|
|
|
void ServerRouting::externalOperation(const Operation & op, Link &)
|
2012-11-14 00:12:02 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ServerRouting::operation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
TeleportAuthenticator * TeleportAuthenticator::m_instance = NULL;
|
|
|
|
|
|
|
|
|
|
int TeleportAuthenticator::addTeleport(const std::string &entity_id,
|
|
|
|
|
const std::string &possess_key)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int TeleportAuthenticator::removeTeleport(const std::string &entity_id)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
LocatedEntity *TeleportAuthenticator::authenticateTeleport(const std::string &entity_id,
|
2012-09-12 15:03:18 +01:00
|
|
|
const std::string &possess_key)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Persistence * Persistence::m_instance = NULL;
|
|
|
|
|
|
|
|
|
|
Persistence::Persistence() : m_db(*(Database*)0)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Persistence * Persistence::instance()
|
|
|
|
|
{
|
|
|
|
|
if (m_instance == NULL) {
|
|
|
|
|
m_instance = new Persistence();
|
2010-06-30 18:16:22 +05:30
|
|
|
}
|
2012-09-12 15:03:18 +01:00
|
|
|
return m_instance;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Persistence::putAccount(const Account & ac)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Character::Character(const std::string & id, long intId) :
|
2012-12-04 23:39:22 +00:00
|
|
|
Thing(id, intId),
|
2012-09-12 15:03:18 +01:00
|
|
|
m_movement(*(Movement*)0),
|
|
|
|
|
m_mind(0), m_externalMind(0)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Character::~Character()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Character::operation(const Operation & op, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2012-12-04 20:39:35 +00:00
|
|
|
void Character::externalOperation(const Operation & op, Link &)
|
2012-09-12 15:03:18 +01:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Character::ImaginaryOperation(const Operation & op, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Character::InfoOperation(const Operation & op, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Character::TickOperation(const Operation & op, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Character::TalkOperation(const Operation & op, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Character::NourishOperation(const Operation & op, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Character::UseOperation(const Operation & op, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Character::WieldOperation(const Operation & op, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Character::AttackOperation(const Operation & op, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Character::ActuateOperation(const Operation & op, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Character::mindActuateOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Character::mindAttackOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Character::mindCombineOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Character::mindCreateOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Character::mindDeleteOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Character::mindDivideOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Character::mindEatOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Character::mindGoalInfoOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Character::mindImaginaryOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Character::mindLookOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Character::mindMoveOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Character::mindSetOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Character::mindSetupOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Character::mindTalkOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Character::mindThoughtOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Character::mindTickOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Character::mindTouchOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Character::mindUpdateOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Character::mindUseOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Character::mindWieldOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Character::mindOtherOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Character::sendMind(const Operation & op, OpVector & res)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Thing::Thing(const std::string & id, long intId) :
|
2012-12-04 23:48:40 +00:00
|
|
|
Entity(id, intId)
|
2012-09-12 15:03:18 +01:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Thing::~Thing()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Thing::DeleteOperation(const Operation & op, OpVector & res)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Thing::MoveOperation(const Operation & op, OpVector & res)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Thing::SetOperation(const Operation & op, OpVector & res)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Thing::LookOperation(const Operation & op, OpVector & res)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Thing::CreateOperation(const Operation & op, OpVector & res)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Thing::UpdateOperation(const Operation & op, OpVector & res)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Entity::Entity(const std::string & id, long intId) :
|
2013-01-14 09:59:54 +00:00
|
|
|
LocatedEntity(id, intId), m_motion(0)
|
2012-09-12 15:03:18 +01:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Entity::~Entity()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Entity::destroy()
|
|
|
|
|
{
|
|
|
|
|
destroyed.emit();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Entity::ActuateOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Entity::AppearanceOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Entity::AttackOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Entity::CombineOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Entity::CreateOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Entity::DeleteOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Entity::DisappearanceOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Entity::DivideOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Entity::EatOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Entity::GetOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Entity::InfoOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
2010-06-30 18:16:22 +05:30
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
void Entity::ImaginaryOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Entity::LookOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Entity::MoveOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
2010-06-30 18:16:22 +05:30
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
void Entity::NourishOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
2010-06-30 18:16:22 +05:30
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
void Entity::SetOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
2010-06-30 18:16:22 +05:30
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
void Entity::SightOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
2010-06-30 18:16:22 +05:30
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
void Entity::SoundOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Entity::TalkOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Entity::TickOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Entity::TouchOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Entity::UpdateOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Entity::UseOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Entity::WieldOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2012-12-04 20:39:35 +00:00
|
|
|
void Entity::externalOperation(const Operation & op, Link &)
|
2012-09-12 15:03:18 +01:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Entity::operation(const Operation & op, OpVector & res)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Entity::addToMessage(Atlas::Message::MapType & omap) const
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Entity::addToEntity(const Atlas::Objects::Entity::RootEntity & ent) const
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PropertyBase * Entity::setAttr(const std::string & name,
|
|
|
|
|
const Atlas::Message::Element & attr)
|
|
|
|
|
{
|
2010-06-30 18:16:22 +05:30
|
|
|
return 0;
|
|
|
|
|
}
|
2012-09-06 13:48:40 +01:00
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
const PropertyBase * Entity::getProperty(const std::string & name) const
|
2012-09-11 22:53:15 +01:00
|
|
|
{
|
2012-09-12 15:03:18 +01:00
|
|
|
return 0;
|
2012-09-11 22:53:15 +01:00
|
|
|
}
|
|
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
PropertyBase * Entity::modProperty(const std::string & name)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
PropertyBase * Entity::setProperty(const std::string & name,
|
|
|
|
|
PropertyBase * prop)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Entity::installDelegate(int class_no, const std::string & delegate)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Domain * Entity::getMovementDomain()
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Entity::sendWorld(const Operation & op)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
void Entity::onContainered()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Entity::onUpdated()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Entity::callOperation(const Operation & op, OpVector & res)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
LocatedEntity::LocatedEntity(const std::string & id, long intId) :
|
|
|
|
|
Router(id, intId),
|
|
|
|
|
m_refCount(0), m_seq(0),
|
2013-01-14 09:59:54 +00:00
|
|
|
m_script(0), m_type(0), m_flags(0), m_contains(0)
|
2012-09-12 15:03:18 +01:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
LocatedEntity::~LocatedEntity()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool LocatedEntity::hasAttr(const std::string & name) const
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int LocatedEntity::getAttr(const std::string & name,
|
|
|
|
|
Atlas::Message::Element & attr) const
|
|
|
|
|
{
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int LocatedEntity::getAttrType(const std::string & name,
|
|
|
|
|
Atlas::Message::Element & attr,
|
|
|
|
|
int type) const
|
|
|
|
|
{
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PropertyBase * LocatedEntity::setAttr(const std::string & name,
|
|
|
|
|
const Atlas::Message::Element & attr)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const PropertyBase * LocatedEntity::getProperty(const std::string & name) const
|
2012-09-06 13:48:40 +01:00
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2012-09-12 15:03:18 +01:00
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
PropertyBase * LocatedEntity::modProperty(const std::string & name)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PropertyBase * LocatedEntity::setProperty(const std::string & name,
|
|
|
|
|
PropertyBase * prop)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void LocatedEntity::installDelegate(int, const std::string &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void LocatedEntity::destroy()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Domain * LocatedEntity::getMovementDomain()
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void LocatedEntity::sendWorld(const Operation & op)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2012-09-12 15:03:18 +01:00
|
|
|
void LocatedEntity::onContainered()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void LocatedEntity::onUpdated()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void LocatedEntity::makeContainer()
|
|
|
|
|
{
|
|
|
|
|
if (m_contains == 0) {
|
|
|
|
|
m_contains = new LocatedEntitySet;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void LocatedEntity::merge(const MapType & ent)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Link::Link(CommSocket & socket, const std::string & id, long iid) :
|
|
|
|
|
Router(id, iid), m_encoder(0), m_commSocket(socket)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Link::~Link()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Link::send(const Operation & op) const
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Link::disconnect()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BaseWorld * BaseWorld::m_instance = 0;
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
BaseWorld::BaseWorld(LocatedEntity & gw) : m_gameWorld(gw)
|
2012-09-12 15:03:18 +01:00
|
|
|
{
|
|
|
|
|
m_instance = this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BaseWorld::~BaseWorld()
|
|
|
|
|
{
|
|
|
|
|
m_instance = 0;
|
2012-09-13 00:02:41 +01:00
|
|
|
delete &m_gameWorld;
|
2012-09-12 15:03:18 +01:00
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
LocatedEntity * BaseWorld::getEntity(const std::string & id) const
|
2012-09-12 15:03:18 +01:00
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
LocatedEntity * BaseWorld::getEntity(long id) const
|
2012-09-12 15:03:18 +01:00
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Router::Router(const std::string & id, long intId) : m_id(id),
|
|
|
|
|
m_intId(intId)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Router::~Router()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Router::addToMessage(Atlas::Message::MapType & omap) const
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Router::addToEntity(const Atlas::Objects::Entity::RootEntity & ent) const
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Router::error(const Operation & op,
|
|
|
|
|
const std::string & errstring,
|
|
|
|
|
OpVector & res,
|
|
|
|
|
const std::string & to) const
|
|
|
|
|
{
|
2012-09-14 21:04:53 +01:00
|
|
|
res.push_back(Atlas::Objects::Operation::Error());
|
2012-09-12 15:03:18 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Location::Location() : m_loc(0)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
long integerId(const std::string & id)
|
|
|
|
|
{
|
|
|
|
|
long intId = strtol(id.c_str(), 0, 10);
|
|
|
|
|
if (intId == 0 && id != "0") {
|
|
|
|
|
intId = -1L;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return intId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void logEvent(LogEvent lev, const std::string & msg)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void log(LogLevel lvl, const std::string & msg)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool database_flag = false;
|
2012-10-25 10:42:04 -04:00
|
|
|
|
|
|
|
|
#include <common/Shaker.h>
|
|
|
|
|
|
|
|
|
|
Shaker::Shaker()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
std::string Shaker::generateSalt(size_t length)
|
|
|
|
|
{
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|