2012-11-25 14:48:48 +00:00
|
|
|
// Cyphesis Online RPG Server and AI Engine
|
|
|
|
|
// Copyright (C) 2012 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
|
|
|
|
|
|
|
|
|
|
// $Id$
|
|
|
|
|
|
|
|
|
|
#ifdef NDEBUG
|
|
|
|
|
#undef NDEBUG
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef DEBUG
|
|
|
|
|
#define DEBUG
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include "TestBase.h"
|
|
|
|
|
#include "TestWorld.h"
|
|
|
|
|
|
|
|
|
|
#include "server/Connection.h"
|
|
|
|
|
#include "server/Player.h"
|
|
|
|
|
#include "server/ServerRouting.h"
|
|
|
|
|
|
|
|
|
|
#include "rulesets/Character.h"
|
|
|
|
|
#include "rulesets/ExternalMind.h"
|
|
|
|
|
|
|
|
|
|
#include "common/const.h"
|
2012-11-27 17:08:11 +00:00
|
|
|
#include "common/log.h"
|
2012-11-25 14:48:48 +00:00
|
|
|
#include "common/TypeNode.h"
|
|
|
|
|
|
2012-11-27 19:03:09 +00:00
|
|
|
#include <Atlas/Objects/Operation.h>
|
2012-11-25 14:48:48 +00:00
|
|
|
|
|
|
|
|
#include <cstdio>
|
|
|
|
|
#include <cstring>
|
|
|
|
|
|
|
|
|
|
#include <cassert>
|
|
|
|
|
|
|
|
|
|
using Atlas::Objects::Operation::RootOperation;
|
|
|
|
|
using String::compose;
|
|
|
|
|
|
|
|
|
|
/// Test code paths between account, connection and avatar classes
|
|
|
|
|
class AccountConnectionCharacterintegration : public Cyphesis::TestBase
|
|
|
|
|
{
|
|
|
|
|
protected:
|
|
|
|
|
long m_id_counter;
|
2012-11-27 17:08:11 +00:00
|
|
|
static LogEvent m_logEvent_logged;
|
2012-11-27 19:03:09 +00:00
|
|
|
static Operation m_Link_send_sent;
|
2012-11-25 14:48:48 +00:00
|
|
|
|
|
|
|
|
ServerRouting * m_server;
|
|
|
|
|
Connection * m_connection;
|
|
|
|
|
Account * m_account;
|
|
|
|
|
Character * m_character;
|
|
|
|
|
TypeNode * m_characterType;
|
|
|
|
|
public:
|
|
|
|
|
AccountConnectionCharacterintegration();
|
|
|
|
|
|
|
|
|
|
void setup();
|
|
|
|
|
|
|
|
|
|
void teardown();
|
|
|
|
|
|
|
|
|
|
void test_subscribe();
|
|
|
|
|
void test_connect_existing();
|
2012-11-26 19:59:49 +00:00
|
|
|
void test_unsubscribe();
|
|
|
|
|
void test_unsubscribe_other();
|
2012-11-27 17:08:11 +00:00
|
|
|
|
|
|
|
|
static void logEvent_logged(LogEvent le);
|
2012-11-27 19:03:09 +00:00
|
|
|
static void Link_send_sent(const Operation & op);
|
2012-11-25 14:48:48 +00:00
|
|
|
};
|
|
|
|
|
|
2012-11-27 17:47:32 +00:00
|
|
|
LogEvent AccountConnectionCharacterintegration::m_logEvent_logged = NONE;
|
2012-11-27 19:03:09 +00:00
|
|
|
Operation AccountConnectionCharacterintegration::m_Link_send_sent(0);
|
2012-11-27 17:08:11 +00:00
|
|
|
|
|
|
|
|
void AccountConnectionCharacterintegration::logEvent_logged(LogEvent le)
|
|
|
|
|
{
|
|
|
|
|
m_logEvent_logged = le;
|
|
|
|
|
}
|
|
|
|
|
|
2012-11-27 19:03:09 +00:00
|
|
|
void AccountConnectionCharacterintegration::Link_send_sent(const Operation & op)
|
|
|
|
|
{
|
|
|
|
|
m_Link_send_sent = op;
|
|
|
|
|
}
|
|
|
|
|
|
2012-11-25 14:48:48 +00:00
|
|
|
AccountConnectionCharacterintegration::AccountConnectionCharacterintegration() :
|
|
|
|
|
m_id_counter(0L),
|
|
|
|
|
m_connection(0),
|
|
|
|
|
m_character(0),
|
|
|
|
|
m_characterType(0)
|
|
|
|
|
{
|
|
|
|
|
ADD_TEST(AccountConnectionCharacterintegration::test_subscribe);
|
|
|
|
|
ADD_TEST(AccountConnectionCharacterintegration::test_connect_existing);
|
2012-11-26 19:59:49 +00:00
|
|
|
ADD_TEST(AccountConnectionCharacterintegration::test_unsubscribe);
|
|
|
|
|
ADD_TEST(AccountConnectionCharacterintegration::test_unsubscribe_other);
|
2012-11-25 14:48:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AccountConnectionCharacterintegration::setup()
|
|
|
|
|
{
|
2012-11-27 19:03:09 +00:00
|
|
|
m_Link_send_sent = 0;
|
|
|
|
|
|
2012-11-25 14:48:48 +00:00
|
|
|
Entity * gw = new Entity(compose("%1", m_id_counter),
|
|
|
|
|
m_id_counter++);
|
|
|
|
|
m_server = new ServerRouting(*new TestWorld(*gw),
|
|
|
|
|
"989cfbbe-67e3-4571-858c-488b91e06e7d",
|
|
|
|
|
"10658e5e-373b-4565-b34e-954b9223961e",
|
|
|
|
|
compose("%1", m_id_counter), m_id_counter++,
|
|
|
|
|
compose("%1", m_id_counter), m_id_counter++);
|
|
|
|
|
m_connection = new Connection(*(CommSocket*)0,
|
|
|
|
|
*m_server,
|
|
|
|
|
"a4754783-9909-476b-a418-6997477dff49",
|
|
|
|
|
compose("%1", m_id_counter), m_id_counter++);
|
|
|
|
|
m_account = new Player(m_connection,
|
|
|
|
|
"fred",
|
|
|
|
|
"25846125-f1bb-4963-852e-856a8be45515",
|
|
|
|
|
compose("%1", m_id_counter), m_id_counter++);
|
|
|
|
|
m_character = new Character(compose("%1", m_id_counter), m_id_counter++);
|
|
|
|
|
m_characterType = new TypeNode("test_avatar");
|
|
|
|
|
m_character->setType(m_characterType);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AccountConnectionCharacterintegration::teardown()
|
|
|
|
|
{
|
|
|
|
|
delete m_connection;
|
|
|
|
|
delete m_character;
|
|
|
|
|
delete m_characterType;
|
|
|
|
|
delete m_server;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AccountConnectionCharacterintegration::test_subscribe()
|
|
|
|
|
{
|
|
|
|
|
// Inject an external op through the connection which is from
|
|
|
|
|
// the Character. This should result in the Character being set up
|
|
|
|
|
// for IG with an external mind linked back to the Connection.
|
|
|
|
|
|
|
|
|
|
// Initial state is that the account and character objects already
|
|
|
|
|
// belong to the connection
|
|
|
|
|
m_connection->m_objects[m_account->getIntId()] = m_account;
|
|
|
|
|
m_connection->m_objects[m_character->getIntId()] = m_character;
|
|
|
|
|
|
|
|
|
|
ASSERT_NULL(m_character->m_externalMind)
|
|
|
|
|
|
|
|
|
|
RootOperation op;
|
|
|
|
|
op->setFrom(m_character->getId());
|
|
|
|
|
|
2012-12-04 20:39:35 +00:00
|
|
|
m_connection->externalOperation(op, *m_connection);
|
2012-11-25 14:48:48 +00:00
|
|
|
|
2012-12-02 20:42:28 +00:00
|
|
|
ASSERT_NOT_NULL(m_character->m_externalMind)
|
|
|
|
|
ASSERT_TRUE(m_character->m_externalMind->isLinkedTo(m_connection))
|
2012-11-27 19:03:09 +00:00
|
|
|
ASSERT_TRUE(m_Link_send_sent.isValid());
|
|
|
|
|
ASSERT_EQUAL(m_Link_send_sent->getClassNo(),
|
|
|
|
|
Atlas::Objects::Operation::INFO_NO);
|
2012-11-27 17:47:32 +00:00
|
|
|
ASSERT_EQUAL(m_logEvent_logged, TAKE_CHAR);
|
2012-11-25 14:48:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AccountConnectionCharacterintegration::test_connect_existing()
|
|
|
|
|
{
|
|
|
|
|
// Invote Account::connectCharacter to set up the character for IG
|
|
|
|
|
// with an external mind linked back to the connection.
|
|
|
|
|
|
|
|
|
|
// Initial state is that the account already belongs to the connection,
|
|
|
|
|
// but the character does not yet, as it is new.
|
|
|
|
|
|
|
|
|
|
m_connection->m_objects[m_account->getIntId()] = m_account;
|
|
|
|
|
|
|
|
|
|
ASSERT_TRUE(m_connection->m_objects.find(m_character->getIntId()) ==
|
|
|
|
|
m_connection->m_objects.end())
|
|
|
|
|
|
|
|
|
|
ASSERT_NULL(m_character->m_externalMind)
|
|
|
|
|
|
|
|
|
|
m_account->connectCharacter(m_character);
|
|
|
|
|
|
|
|
|
|
ASSERT_NOT_NULL(m_character->m_externalMind)
|
|
|
|
|
ASSERT_TRUE(m_character->m_externalMind->isLinkedTo(m_connection))
|
|
|
|
|
ASSERT_TRUE(m_connection->m_objects.find(m_character->getIntId()) !=
|
|
|
|
|
m_connection->m_objects.end())
|
2012-11-26 19:59:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AccountConnectionCharacterintegration::test_unsubscribe()
|
|
|
|
|
{
|
|
|
|
|
// Initial state is that the account already belongs to the connection,
|
|
|
|
|
// and the character is linked up.
|
|
|
|
|
|
|
|
|
|
m_connection->m_objects[m_account->getIntId()] = m_account;
|
|
|
|
|
m_connection->m_objects[m_character->getIntId()] = m_character;
|
2012-12-05 09:45:16 +00:00
|
|
|
m_character->linkExternal(m_connection);
|
2012-11-26 19:59:49 +00:00
|
|
|
|
|
|
|
|
ASSERT_TRUE(m_connection->m_objects.find(m_character->getIntId()) !=
|
|
|
|
|
m_connection->m_objects.end())
|
|
|
|
|
ASSERT_NOT_NULL(m_character->m_externalMind)
|
|
|
|
|
ASSERT_TRUE(m_character->m_externalMind->isLinkedTo(m_connection))
|
|
|
|
|
|
|
|
|
|
m_connection->disconnectObject(
|
|
|
|
|
m_connection->m_objects.find(m_character->getIntId()),
|
|
|
|
|
"test_disconnect_event"
|
|
|
|
|
);
|
|
|
|
|
|
2012-11-27 17:08:11 +00:00
|
|
|
ASSERT_EQUAL(m_logEvent_logged, DROP_CHAR);
|
2012-11-26 19:59:49 +00:00
|
|
|
ASSERT_NOT_NULL(m_character->m_externalMind)
|
|
|
|
|
ASSERT_TRUE(!m_character->m_externalMind->isLinked())
|
|
|
|
|
ASSERT_TRUE(!m_character->m_externalMind->isLinkedTo(m_connection))
|
|
|
|
|
ASSERT_TRUE(m_connection->m_objects.find(m_character->getIntId()) !=
|
|
|
|
|
m_connection->m_objects.end())
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AccountConnectionCharacterintegration::test_unsubscribe_other()
|
|
|
|
|
{
|
|
|
|
|
// Initial state is that the account already belongs to the connection,
|
2012-11-27 17:08:11 +00:00
|
|
|
// and the character is linked up to another connection
|
2012-11-26 19:59:49 +00:00
|
|
|
|
|
|
|
|
m_connection->m_objects[m_account->getIntId()] = m_account;
|
|
|
|
|
m_connection->m_objects[m_character->getIntId()] = m_character;
|
|
|
|
|
|
|
|
|
|
Connection * other_connection =
|
|
|
|
|
new Connection(*(CommSocket*)0,
|
|
|
|
|
*m_server,
|
|
|
|
|
"242eedae-6a2e-4c5b-9901-711b14d7e851",
|
|
|
|
|
compose("%1", m_id_counter), m_id_counter++);
|
|
|
|
|
|
2012-12-05 09:45:16 +00:00
|
|
|
m_character->linkExternal(other_connection);
|
2012-11-26 19:59:49 +00:00
|
|
|
|
|
|
|
|
ASSERT_TRUE(m_connection->m_objects.find(m_character->getIntId()) !=
|
|
|
|
|
m_connection->m_objects.end())
|
|
|
|
|
ASSERT_NOT_NULL(m_character->m_externalMind)
|
|
|
|
|
ASSERT_TRUE(m_character->m_externalMind->isLinked())
|
|
|
|
|
ASSERT_TRUE(!m_character->m_externalMind->isLinkedTo(m_connection))
|
|
|
|
|
ASSERT_TRUE(m_character->m_externalMind->isLinkedTo(other_connection))
|
|
|
|
|
|
|
|
|
|
m_connection->disconnectObject(
|
|
|
|
|
m_connection->m_objects.find(m_character->getIntId()),
|
|
|
|
|
"test_disconnect_event"
|
|
|
|
|
);
|
|
|
|
|
|
2012-11-27 17:08:11 +00:00
|
|
|
ASSERT_NOT_EQUAL(m_logEvent_logged, DROP_CHAR);
|
2012-11-26 19:59:49 +00:00
|
|
|
ASSERT_NOT_NULL(m_character->m_externalMind)
|
|
|
|
|
ASSERT_TRUE(m_character->m_externalMind->isLinked())
|
|
|
|
|
ASSERT_TRUE(!m_character->m_externalMind->isLinkedTo(m_connection))
|
|
|
|
|
ASSERT_TRUE(m_character->m_externalMind->isLinkedTo(other_connection))
|
|
|
|
|
ASSERT_TRUE(m_connection->m_objects.find(m_character->getIntId()) !=
|
|
|
|
|
m_connection->m_objects.end())
|
2012-11-25 14:48:48 +00:00
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
void TestWorld::message(const Operation & op, LocatedEntity & ent)
|
2012-11-25 14:48:48 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
LocatedEntity * TestWorld::addNewEntity(const std::string &,
|
2012-11-25 14:48:48 +00:00
|
|
|
const Atlas::Objects::Entity::RootEntity &)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int main()
|
|
|
|
|
{
|
|
|
|
|
AccountConnectionCharacterintegration t;
|
|
|
|
|
|
|
|
|
|
return t.run();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// stubs
|
|
|
|
|
|
|
|
|
|
#include "server/CommServer.h"
|
|
|
|
|
#include "server/Idle.h"
|
|
|
|
|
#include "server/Lobby.h"
|
|
|
|
|
#include "server/Persistence.h"
|
|
|
|
|
#include "server/TeleportAuthenticator.h"
|
|
|
|
|
|
|
|
|
|
#include "rulesets/AtlasProperties.h"
|
|
|
|
|
#include "rulesets/BBoxProperty.h"
|
|
|
|
|
#include "rulesets/Domain.h"
|
|
|
|
|
#include "rulesets/EntityProperty.h"
|
|
|
|
|
#include "rulesets/ExternalProperty.h"
|
|
|
|
|
#include "rulesets/OutfitProperty.h"
|
|
|
|
|
#include "rulesets/Pedestrian.h"
|
|
|
|
|
#include "rulesets/Script.h"
|
|
|
|
|
#include "rulesets/StatusProperty.h"
|
|
|
|
|
#include "rulesets/Task.h"
|
|
|
|
|
#include "rulesets/TasksProperty.h"
|
|
|
|
|
|
|
|
|
|
#include "common/CommSocket.h"
|
|
|
|
|
#include "common/Inheritance.h"
|
|
|
|
|
#include "common/Property_impl.h"
|
|
|
|
|
#include "common/PropertyManager.h"
|
|
|
|
|
|
|
|
|
|
using Atlas::Message::Element;
|
|
|
|
|
using Atlas::Message::MapType;
|
|
|
|
|
using Atlas::Objects::Root;
|
|
|
|
|
using Atlas::Objects::Entity::RootEntity;
|
|
|
|
|
|
|
|
|
|
bool restricted_flag;
|
|
|
|
|
|
|
|
|
|
namespace Atlas { namespace Objects { namespace Operation {
|
|
|
|
|
int ACTUATE_NO = -1;
|
|
|
|
|
int ATTACK_NO = -1;
|
|
|
|
|
int EAT_NO = -1;
|
|
|
|
|
int GOAL_INFO_NO = -1;
|
|
|
|
|
int NOURISH_NO = -1;
|
|
|
|
|
int SETUP_NO = -1;
|
|
|
|
|
int TICK_NO = -1;
|
|
|
|
|
int THOUGHT_NO = -1;
|
|
|
|
|
int UNSEEN_NO = -1;
|
|
|
|
|
int UPDATE_NO = -1;
|
|
|
|
|
} } }
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
Pedestrian::Pedestrian(LocatedEntity & body) : Movement(body)
|
2012-11-25 14:48:48 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Pedestrian::~Pedestrian()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
double Pedestrian::getTickAddition(const Point3D & coordinates,
|
|
|
|
|
const Vector3D & velocity) const
|
|
|
|
|
{
|
|
|
|
|
return consts::basic_tick;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int Pedestrian::getUpdatedLocation(Location & return_location)
|
|
|
|
|
{
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Operation Pedestrian::generateMove(const Location & new_location)
|
|
|
|
|
{
|
|
|
|
|
Atlas::Objects::Operation::RootOperation moveOp;
|
|
|
|
|
return moveOp;
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
Movement::Movement(LocatedEntity & body) : m_body(body),
|
2012-11-25 14:48:48 +00:00
|
|
|
m_serialno(0)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Movement::~Movement()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool Movement::updateNeeded(const Location & location) const
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Movement::reset()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CommServer::CommServer() : m_congested(false)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CommServer::~CommServer()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Idle::Idle(CommServer & svr) : m_idleManager(svr)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Idle::~Idle()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CommSocket::CommSocket(CommServer & svr) : m_commServer(svr) { }
|
|
|
|
|
|
|
|
|
|
CommSocket::~CommSocket()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int CommSocket::flush()
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TeleportAuthenticator * TeleportAuthenticator::m_instance = NULL;
|
|
|
|
|
|
|
|
|
|
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-11-25 14:48:48 +00:00
|
|
|
const std::string &possess_key)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Player::Player(Connection * conn,
|
|
|
|
|
const std::string & username,
|
|
|
|
|
const std::string & passwd,
|
|
|
|
|
const std::string & id,
|
|
|
|
|
long intId) :
|
|
|
|
|
Account(conn, username, passwd, id, intId)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Player::~Player() { }
|
|
|
|
|
|
|
|
|
|
const char * Player::getType() const
|
|
|
|
|
{
|
|
|
|
|
return "player";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Player::addToMessage(MapType & omap) const
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Player::addToEntity(const Atlas::Objects::Entity::RootEntity & ent) const
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int Player::characterError(const Operation & op,
|
|
|
|
|
const Root & ent, OpVector & res) const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ConnectableRouter::ConnectableRouter(const std::string & id,
|
|
|
|
|
long iid,
|
|
|
|
|
Connection *c) :
|
|
|
|
|
Router(id, iid),
|
|
|
|
|
m_connection(c)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ConnectableRouter::~ConnectableRouter()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ServerRouting::addToMessage(Atlas::Message::MapType & omap) const
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ServerRouting::addToEntity(const Atlas::Objects::Entity::RootEntity & ent) const
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2012-12-04 20:39:35 +00:00
|
|
|
void ServerRouting::externalOperation(const Operation &, Link &)
|
2012-11-25 14:48:48 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ServerRouting::operation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Account * ServerRouting::getAccountByName(const std::string & username)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ServerRouting::addAccount(Account * a)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Persistence * Persistence::m_instance = NULL;
|
|
|
|
|
|
|
|
|
|
Persistence::Persistence() : m_db(*(Database*)0)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Persistence * Persistence::instance()
|
|
|
|
|
{
|
|
|
|
|
if (m_instance == NULL) {
|
|
|
|
|
m_instance = new Persistence();
|
|
|
|
|
}
|
|
|
|
|
return m_instance;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Persistence::putAccount(const Account & ac)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Lobby::Lobby(ServerRouting & s, const std::string & id, long intId) :
|
|
|
|
|
Router(id, intId),
|
|
|
|
|
m_server(s)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Lobby::~Lobby()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Lobby::delAccount(Account * ac)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Lobby::addToMessage(MapType & omap) const
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Lobby::addToEntity(const Atlas::Objects::Entity::RootEntity & ent) const
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Lobby::addAccount(Account * ac)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2012-12-04 20:39:35 +00:00
|
|
|
void Lobby::externalOperation(const Operation &, Link &)
|
2012-11-25 14:48:48 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Lobby::operation(const Operation & op, OpVector & res)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ExternalProperty::ExternalProperty(ExternalMind * & data) : m_data(data)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int ExternalProperty::get(Atlas::Message::Element & val) const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ExternalProperty::set(const Atlas::Message::Element & val)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ExternalProperty::add(const std::string & s,
|
|
|
|
|
Atlas::Message::MapType & map) const
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ExternalProperty::add(const std::string & s,
|
|
|
|
|
const Atlas::Objects::Entity::RootEntity & ent) const
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-07 23:03:25 +00:00
|
|
|
ExternalProperty * ExternalProperty::copy() const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2012-11-25 14:48:48 +00:00
|
|
|
Thing::Thing(const std::string & id, long intId) :
|
2012-12-04 23:48:40 +00:00
|
|
|
Entity(id, intId)
|
2012-11-25 14:48:48 +00: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-11-25 14:48:48 +00: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 &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Entity::ImaginaryOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Entity::LookOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Entity::MoveOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Entity::NourishOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Entity::SetOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Entity::SightOperation(const Operation &, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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-11-25 14:48:48 +00: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)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const PropertyBase * Entity::getProperty(const std::string & name) const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PropertyBase * Entity::modProperty(const std::string & name)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PropertyBase * Entity::setProperty(const std::string & name,
|
|
|
|
|
PropertyBase * prop)
|
|
|
|
|
{
|
|
|
|
|
return m_properties[name] = prop;
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
void Entity::installDelegate(int class_no, const std::string & delegate)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Domain * Entity::getMovementDomain()
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Entity::sendWorld(const Operation & op)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2012-11-25 14:48:48 +00:00
|
|
|
void Entity::onContainered()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Entity::onUpdated()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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-11-25 14:48:48 +00: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
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
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-11-25 14:48:48 +00:00
|
|
|
void LocatedEntity::onContainered()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void LocatedEntity::onUpdated()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
EntityProperty::EntityProperty()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int EntityProperty::get(Atlas::Message::Element & val) const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void EntityProperty::set(const Atlas::Message::Element & val)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void EntityProperty::add(const std::string & s,
|
|
|
|
|
Atlas::Message::MapType & map) const
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void EntityProperty::add(const std::string & s,
|
|
|
|
|
const Atlas::Objects::Entity::RootEntity & ent) const
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-07 23:03:25 +00:00
|
|
|
EntityProperty * EntityProperty::copy() const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2012-11-25 14:48:48 +00:00
|
|
|
OutfitProperty::OutfitProperty()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
OutfitProperty::~OutfitProperty()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int OutfitProperty::get(Atlas::Message::Element & val) const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void OutfitProperty::set(const Atlas::Message::Element & val)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void OutfitProperty::add(const std::string & key,
|
|
|
|
|
Atlas::Message::MapType & map) const
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void OutfitProperty::add(const std::string & key,
|
|
|
|
|
const Atlas::Objects::Entity::RootEntity & ent) const
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-07 23:03:25 +00:00
|
|
|
OutfitProperty * OutfitProperty::copy() const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2012-11-25 14:48:48 +00:00
|
|
|
void OutfitProperty::cleanUp()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
void OutfitProperty::wear(LocatedEntity * wearer,
|
2012-11-25 14:48:48 +00:00
|
|
|
const std::string & location,
|
2013-01-17 10:17:07 +00:00
|
|
|
LocatedEntity * garment)
|
2012-11-25 14:48:48 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
void OutfitProperty::itemRemoved(LocatedEntity * garment, LocatedEntity * wearer)
|
2012-11-25 14:48:48 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Task::~Task()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Task::initTask(const Operation & op, OpVector & res)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Task::operation(const Operation & op, OpVector & res)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Task::irrelevant()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TasksProperty::TasksProperty() : PropertyBase(per_ephem), m_task(0)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int TasksProperty::get(Atlas::Message::Element & val) const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TasksProperty::set(const Atlas::Message::Element & val)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-07 23:03:25 +00:00
|
|
|
TasksProperty * TasksProperty::copy() const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
int TasksProperty::startTask(Task *, LocatedEntity *, const Operation &, OpVector &)
|
2012-11-25 14:48:48 +00:00
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
int TasksProperty::updateTask(LocatedEntity *, OpVector &)
|
2012-11-25 14:48:48 +00:00
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
int TasksProperty::clearTask(LocatedEntity *, OpVector &)
|
2012-11-25 14:48:48 +00:00
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
void TasksProperty::stopTask(LocatedEntity *, OpVector &)
|
2012-11-25 14:48:48 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
void TasksProperty::TickOperation(LocatedEntity *, const Operation &, OpVector &)
|
2012-11-25 14:48:48 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
void TasksProperty::UseOperation(LocatedEntity *, const Operation &, OpVector &)
|
2012-11-25 14:48:48 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
HandlerResult TasksProperty::operation(LocatedEntity *, const Operation &, OpVector &)
|
2012-11-25 14:48:48 +00:00
|
|
|
{
|
2013-01-03 23:17:51 +00:00
|
|
|
return OPERATION_IGNORED;
|
2012-11-25 14:48:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PropertyBase::PropertyBase(unsigned int flags) : m_flags(flags)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PropertyBase::~PropertyBase()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-02-13 00:45:36 +00:00
|
|
|
void PropertyBase::install(LocatedEntity *, const std::string & name)
|
2012-11-25 14:48:48 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
void PropertyBase::apply(LocatedEntity *)
|
2012-11-25 14:48:48 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PropertyBase::add(const std::string & s,
|
|
|
|
|
Atlas::Message::MapType & ent) const
|
|
|
|
|
{
|
|
|
|
|
get(ent[s]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PropertyBase::add(const std::string & s,
|
|
|
|
|
const Atlas::Objects::Entity::RootEntity & ent) const
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
HandlerResult PropertyBase::operation(LocatedEntity *,
|
2013-01-03 23:17:51 +00:00
|
|
|
const Operation &,
|
|
|
|
|
OpVector &)
|
|
|
|
|
{
|
|
|
|
|
return OPERATION_IGNORED;
|
|
|
|
|
}
|
|
|
|
|
|
2012-11-25 14:48:48 +00:00
|
|
|
template<>
|
|
|
|
|
void Property<int>::set(const Atlas::Message::Element & e)
|
|
|
|
|
{
|
|
|
|
|
if (e.isInt()) {
|
|
|
|
|
this->m_data = e.asInt();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<>
|
|
|
|
|
void Property<double>::set(const Atlas::Message::Element & e)
|
|
|
|
|
{
|
|
|
|
|
if (e.isNum()) {
|
|
|
|
|
this->m_data = e.asNum();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<>
|
|
|
|
|
void Property<std::string>::set(const Atlas::Message::Element & e)
|
|
|
|
|
{
|
|
|
|
|
if (e.isString()) {
|
|
|
|
|
this->m_data = e.String();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template class Property<int>;
|
|
|
|
|
template class Property<double>;
|
|
|
|
|
template class Property<std::string>;
|
|
|
|
|
|
|
|
|
|
SoftProperty::SoftProperty()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SoftProperty::SoftProperty(const Atlas::Message::Element & data) :
|
|
|
|
|
PropertyBase(0), m_data(data)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int SoftProperty::get(Atlas::Message::Element & val) const
|
|
|
|
|
{
|
|
|
|
|
val = m_data;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SoftProperty::set(const Atlas::Message::Element & val)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-07 23:03:25 +00:00
|
|
|
SoftProperty * SoftProperty::copy() const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2012-11-25 14:48:48 +00:00
|
|
|
ContainsProperty::ContainsProperty(LocatedEntitySet & data) :
|
|
|
|
|
PropertyBase(per_ephem), m_data(data)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int ContainsProperty::get(Atlas::Message::Element & e) const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ContainsProperty::set(const Atlas::Message::Element & e)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ContainsProperty::add(const std::string & s,
|
|
|
|
|
const Atlas::Objects::Entity::RootEntity & ent) const
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-07 23:03:25 +00:00
|
|
|
ContainsProperty * ContainsProperty::copy() const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2012-11-25 14:48:48 +00:00
|
|
|
StatusProperty::StatusProperty()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-08 00:19:23 +00:00
|
|
|
StatusProperty * StatusProperty::copy() const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
void StatusProperty::apply(LocatedEntity * owner)
|
2012-11-25 14:48:48 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BBoxProperty::BBoxProperty()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
void BBoxProperty::apply(LocatedEntity * ent)
|
2012-11-25 14:48:48 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int BBoxProperty::get(Element & val) const
|
|
|
|
|
{
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void BBoxProperty::set(const Element & val)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void BBoxProperty::add(const std::string & key,
|
|
|
|
|
MapType & map) const
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void BBoxProperty::add(const std::string & key,
|
|
|
|
|
const RootEntity & ent) const
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-07 23:03:25 +00:00
|
|
|
BBoxProperty * BBoxProperty::copy() const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2012-11-25 14:48:48 +00:00
|
|
|
PropertyManager * PropertyManager::m_instance = 0;
|
|
|
|
|
|
|
|
|
|
PropertyManager::PropertyManager()
|
|
|
|
|
{
|
|
|
|
|
assert(m_instance == 0);
|
|
|
|
|
m_instance = this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PropertyManager::~PropertyManager()
|
|
|
|
|
{
|
|
|
|
|
m_instance = 0;
|
|
|
|
|
}
|
|
|
|
|
|
2013-02-22 09:57:10 +00:00
|
|
|
int PropertyManager::installFactory(const std::string & type_name,
|
|
|
|
|
const Atlas::Objects::Root & type_desc,
|
|
|
|
|
PropertyKit * factory)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2012-11-25 14:48:48 +00:00
|
|
|
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
|
|
|
|
|
{
|
2012-11-27 19:03:09 +00:00
|
|
|
AccountConnectionCharacterintegration::Link_send_sent(op);
|
2012-11-25 14:48:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Link::sendError(const Operation & op,
|
|
|
|
|
const std::string &,
|
|
|
|
|
const std::string &) const
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Link::disconnect()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Router::clientError(const Operation & op,
|
|
|
|
|
const std::string & errstring,
|
|
|
|
|
OpVector & res,
|
|
|
|
|
const std::string & to) const
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Location::Location() : m_loc(0)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Location::Location(LocatedEntity * rf, const Point3D & pos)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TypeNode::TypeNode(const std::string & name) : m_name(name), m_parent(0)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TypeNode::~TypeNode()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BaseWorld * BaseWorld::m_instance = 0;
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
BaseWorld::BaseWorld(LocatedEntity & gw) : m_gameWorld(gw)
|
2012-11-25 14:48:48 +00:00
|
|
|
{
|
|
|
|
|
m_instance = this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BaseWorld::~BaseWorld()
|
|
|
|
|
{
|
|
|
|
|
m_instance = 0;
|
|
|
|
|
delete &m_gameWorld;
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
LocatedEntity * BaseWorld::getEntity(const std::string & id) const
|
2012-11-25 14:48:48 +00:00
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
LocatedEntity * BaseWorld::getEntity(long id) const
|
2012-11-25 14:48:48 +00:00
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Inheritance * Inheritance::m_instance = NULL;
|
|
|
|
|
|
|
|
|
|
Inheritance::Inheritance() : noClass(0)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Inheritance & Inheritance::instance()
|
|
|
|
|
{
|
|
|
|
|
if (m_instance == NULL) {
|
|
|
|
|
m_instance = new Inheritance();
|
|
|
|
|
}
|
|
|
|
|
return *m_instance;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const TypeNode * Inheritance::getType(const std::string & parent)
|
|
|
|
|
{
|
|
|
|
|
TypeNodeDict::const_iterator I = atlasObjects.find(parent);
|
|
|
|
|
if (I == atlasObjects.end()) {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
return I->second;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const Root & Inheritance::getClass(const std::string & parent)
|
|
|
|
|
{
|
|
|
|
|
return noClass;
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
EntityRef::EntityRef(LocatedEntity* e) : m_inner(e)
|
2012-11-25 14:48:48 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
EntityRef::EntityRef(const EntityRef& ref) : m_inner(ref.m_inner)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
EntityRef& EntityRef::operator=(const EntityRef& ref)
|
|
|
|
|
{
|
|
|
|
|
m_inner = ref.m_inner;
|
|
|
|
|
|
|
|
|
|
return *this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void EntityRef::onEntityDeleted()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const Vector3D distanceTo(const Location & self, const Location & other)
|
|
|
|
|
{
|
|
|
|
|
return Vector3D(1,0,0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<class V>
|
|
|
|
|
const Quaternion quaternionFromTo(const V & from, const V & to)
|
|
|
|
|
{
|
|
|
|
|
return Quaternion(1.f, 0.f, 0.f, 0.f);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template
|
|
|
|
|
const Quaternion quaternionFromTo<Vector3D>(const Vector3D &, const Vector3D&);
|
|
|
|
|
|
|
|
|
|
void log(LogLevel lvl, const std::string & msg)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void logEvent(LogEvent lev, const std::string & msg)
|
|
|
|
|
{
|
2012-11-27 17:08:11 +00:00
|
|
|
AccountConnectionCharacterintegration::logEvent_logged(lev);
|
2012-11-25 14:48:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
long integerId(const std::string & id)
|
|
|
|
|
{
|
|
|
|
|
long intId = strtol(id.c_str(), 0, 10);
|
|
|
|
|
if (intId == 0 && id != "0") {
|
|
|
|
|
intId = -1L;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return intId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static long idGenerator = 0;
|
|
|
|
|
|
|
|
|
|
long newId(std::string & id)
|
|
|
|
|
{
|
|
|
|
|
static char buf[32];
|
|
|
|
|
long new_id = ++idGenerator;
|
|
|
|
|
sprintf(buf, "%ld", new_id);
|
|
|
|
|
id = buf;
|
|
|
|
|
assert(!id.empty());
|
|
|
|
|
return new_id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void addToEntity(const Vector3D & v, std::vector<double> & vd)
|
|
|
|
|
{
|
|
|
|
|
vd.resize(3);
|
|
|
|
|
vd[0] = v[0];
|
|
|
|
|
vd[1] = v[1];
|
|
|
|
|
vd[2] = v[2];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Shaker::Shaker()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string Shaker::generateSalt(size_t length)
|
|
|
|
|
{
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename FloatT>
|
|
|
|
|
int fromStdVector(Point3D & p, const std::vector<FloatT> & vf)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename FloatT>
|
|
|
|
|
int fromStdVector(Vector3D & v, const std::vector<FloatT> & vf)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template int fromStdVector<double>(Point3D & p, const std::vector<double> & vf);
|
|
|
|
|
template int fromStdVector<double>(Vector3D & v, const std::vector<double> & vf);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void hash_password(const std::string & pwd, const std::string & salt,
|
|
|
|
|
std::string & hash )
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int check_password(const std::string & pwd, const std::string & hash)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool database_flag = false;
|