2009-11-16 21:07:52 +00:00
|
|
|
// 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.
|
|
|
|
|
//
|
|
|
|
|
// 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
|
|
|
|
|
|
2012-12-13 14:27:34 +00:00
|
|
|
#include "TestBase.h"
|
2012-08-01 19:42:36 +01:00
|
|
|
|
2009-11-16 21:07:52 +00:00
|
|
|
#include "server/Account.h"
|
2012-12-14 09:04:06 +00:00
|
|
|
#include "server/EntityBuilder.h"
|
|
|
|
|
#include "server/Ruleset.h"
|
2009-11-16 21:07:52 +00:00
|
|
|
#include "server/ServerRouting.h"
|
|
|
|
|
#include "server/Connection.h"
|
|
|
|
|
#include "server/WorldRouter.h"
|
|
|
|
|
|
|
|
|
|
#include "rulesets/Character.h"
|
2010-09-01 14:06:37 +01:00
|
|
|
#include "rulesets/Domain.h"
|
|
|
|
|
#include "rulesets/Entity.h"
|
2012-12-14 12:39:53 +00:00
|
|
|
#include "rulesets/ExternalMind.h"
|
2009-11-16 21:07:52 +00:00
|
|
|
|
2012-12-14 09:04:06 +00:00
|
|
|
#include "common/CommSocket.h"
|
|
|
|
|
#include "common/Inheritance.h"
|
2011-10-31 12:47:56 +01:00
|
|
|
#include "common/SystemTime.h"
|
|
|
|
|
|
2009-11-16 21:07:52 +00:00
|
|
|
#include "TestWorld.h"
|
|
|
|
|
|
|
|
|
|
#include <Atlas/Objects/SmartPtr.h>
|
|
|
|
|
#include <Atlas/Objects/Anonymous.h>
|
2009-11-17 01:37:14 +00:00
|
|
|
#include <Atlas/Objects/Operation.h>
|
2009-11-16 21:07:52 +00:00
|
|
|
|
|
|
|
|
#include <cassert>
|
|
|
|
|
|
2012-12-17 09:32:28 +00:00
|
|
|
using Atlas::Message::Element;
|
2009-11-17 12:37:40 +00:00
|
|
|
using Atlas::Message::ListType;
|
2009-11-17 01:37:14 +00:00
|
|
|
using Atlas::Message::MapType;
|
2009-11-17 12:37:40 +00:00
|
|
|
using Atlas::Objects::Root;
|
2009-11-17 01:37:14 +00:00
|
|
|
using Atlas::Objects::Entity::RootEntity;
|
2009-11-16 21:07:52 +00:00
|
|
|
using Atlas::Objects::Entity::Anonymous;
|
2009-11-17 01:37:14 +00:00
|
|
|
using Atlas::Objects::Operation::Create;
|
|
|
|
|
using Atlas::Objects::Operation::Get;
|
|
|
|
|
using Atlas::Objects::Operation::Imaginary;
|
|
|
|
|
using Atlas::Objects::Operation::Logout;
|
|
|
|
|
using Atlas::Objects::Operation::Look;
|
|
|
|
|
using Atlas::Objects::Operation::Set;
|
|
|
|
|
using Atlas::Objects::Operation::Talk;
|
2009-11-17 02:10:08 +00:00
|
|
|
using Atlas::Objects::Operation::Move;
|
2009-11-16 21:07:52 +00:00
|
|
|
|
2014-02-03 12:19:42 +01:00
|
|
|
class TestCommSocket : public CommSocket
|
|
|
|
|
{
|
2009-11-16 21:07:52 +00:00
|
|
|
public:
|
2014-02-03 12:19:42 +01:00
|
|
|
TestCommSocket() : CommSocket(*(boost::asio::io_service*)0)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
virtual void disconnect()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
virtual int flush()
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2009-11-16 21:07:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class TestAccount : public Account {
|
|
|
|
|
public:
|
|
|
|
|
TestAccount(Connection * conn, const std::string & username,
|
|
|
|
|
const std::string & passwd,
|
|
|
|
|
const std::string & id, long intId) :
|
|
|
|
|
Account(conn, username, passwd, id, intId) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
virtual int characterError(const Operation & op,
|
2010-12-03 22:01:22 +00:00
|
|
|
const Atlas::Objects::Root & ent,
|
2009-11-16 21:07:52 +00:00
|
|
|
OpVector & res) const {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2012-12-13 14:27:34 +00:00
|
|
|
class Accountintegration : public Cyphesis::TestBase
|
2009-11-16 21:07:52 +00:00
|
|
|
{
|
2012-12-13 14:27:34 +00:00
|
|
|
SystemTime * m_time;
|
|
|
|
|
WorldRouter * m_world;
|
|
|
|
|
|
|
|
|
|
ServerRouting * m_server;
|
|
|
|
|
|
2012-12-14 09:04:06 +00:00
|
|
|
CommSocket * m_tc;
|
2012-12-13 14:27:34 +00:00
|
|
|
Connection * m_c;
|
|
|
|
|
TestAccount * m_ac;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
Accountintegration();
|
|
|
|
|
|
|
|
|
|
void setup();
|
|
|
|
|
void teardown();
|
2009-11-16 21:07:52 +00:00
|
|
|
|
2012-12-14 20:28:43 +00:00
|
|
|
void test_addNewCharacter();
|
|
|
|
|
void test_getType();
|
|
|
|
|
void test_addToMessage();
|
|
|
|
|
void test_addToEntity();
|
2012-12-14 20:27:16 +00:00
|
|
|
void test_CreateOperation();
|
2012-12-14 20:25:52 +00:00
|
|
|
void test_GetOperation();
|
2012-12-14 20:24:39 +00:00
|
|
|
void test_ImaginaryOperation();
|
2012-12-14 20:22:20 +00:00
|
|
|
void test_LookOperation();
|
2012-12-14 20:14:28 +00:00
|
|
|
void test_SetOperation();
|
2012-12-14 19:56:12 +00:00
|
|
|
void test_TalkOperation();
|
2012-12-14 19:49:30 +00:00
|
|
|
void test_LogoutOperation();
|
2012-12-14 12:39:53 +00:00
|
|
|
void test_connectCharacter_entity();
|
|
|
|
|
void test_connectCharacter_character();
|
2012-12-13 14:27:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Accountintegration::Accountintegration()
|
|
|
|
|
{
|
2012-12-14 20:28:43 +00:00
|
|
|
ADD_TEST(Accountintegration::test_addNewCharacter);
|
|
|
|
|
ADD_TEST(Accountintegration::test_getType);
|
|
|
|
|
ADD_TEST(Accountintegration::test_addToMessage);
|
|
|
|
|
ADD_TEST(Accountintegration::test_addToEntity);
|
2012-12-14 20:27:16 +00:00
|
|
|
ADD_TEST(Accountintegration::test_CreateOperation);
|
2012-12-14 20:25:52 +00:00
|
|
|
ADD_TEST(Accountintegration::test_GetOperation);
|
2012-12-14 20:24:39 +00:00
|
|
|
ADD_TEST(Accountintegration::test_ImaginaryOperation);
|
2012-12-14 20:22:20 +00:00
|
|
|
ADD_TEST(Accountintegration::test_LookOperation);
|
2012-12-14 20:14:28 +00:00
|
|
|
ADD_TEST(Accountintegration::test_SetOperation);
|
2012-12-14 19:56:12 +00:00
|
|
|
ADD_TEST(Accountintegration::test_TalkOperation);
|
2012-12-14 19:49:30 +00:00
|
|
|
ADD_TEST(Accountintegration::test_LogoutOperation);
|
2012-12-14 12:39:53 +00:00
|
|
|
ADD_TEST(Accountintegration::test_connectCharacter_entity);
|
|
|
|
|
ADD_TEST(Accountintegration::test_connectCharacter_character);
|
2012-12-13 14:27:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Accountintegration::setup()
|
|
|
|
|
{
|
|
|
|
|
m_time = new SystemTime;
|
|
|
|
|
m_world = new WorldRouter(*m_time);
|
2009-11-16 21:07:52 +00:00
|
|
|
|
2012-12-13 14:27:34 +00:00
|
|
|
m_server = new ServerRouting(*m_world, "noruleset", "unittesting",
|
2009-11-16 21:07:52 +00:00
|
|
|
"1", 1, "2", 2);
|
|
|
|
|
|
2014-02-03 12:19:42 +01:00
|
|
|
m_tc = new TestCommSocket();
|
2012-12-13 14:27:34 +00:00
|
|
|
m_c = new Connection(*m_tc, *m_server, "addr", "3", 3);
|
|
|
|
|
m_ac = new TestAccount(m_c, "user", "password", "4", 4);
|
|
|
|
|
}
|
2009-11-16 21:07:52 +00:00
|
|
|
|
2012-12-13 14:27:34 +00:00
|
|
|
void Accountintegration::teardown()
|
|
|
|
|
{
|
|
|
|
|
delete m_ac;
|
2012-12-14 09:04:06 +00:00
|
|
|
delete m_world;
|
|
|
|
|
EntityBuilder::del();
|
|
|
|
|
Ruleset::del();
|
|
|
|
|
Inheritance::clear();
|
2012-12-13 14:27:34 +00:00
|
|
|
}
|
2009-11-16 21:07:52 +00:00
|
|
|
|
2012-12-14 20:28:43 +00:00
|
|
|
void Accountintegration::test_addNewCharacter()
|
2012-12-13 14:27:34 +00:00
|
|
|
{
|
2012-12-14 09:04:06 +00:00
|
|
|
Anonymous new_char;
|
2013-01-17 10:17:07 +00:00
|
|
|
LocatedEntity * chr = m_ac->addNewCharacter("thing", new_char,
|
|
|
|
|
RootEntity());
|
2012-12-14 09:04:06 +00:00
|
|
|
assert(chr != 0);
|
2009-11-16 21:07:52 +00:00
|
|
|
|
2012-12-14 09:04:06 +00:00
|
|
|
std::cout << "Test 1" << std::endl << std::flush;
|
|
|
|
|
}
|
2009-11-17 01:37:14 +00:00
|
|
|
|
2012-12-14 20:28:43 +00:00
|
|
|
void Accountintegration::test_getType()
|
2012-12-14 09:04:06 +00:00
|
|
|
{
|
|
|
|
|
m_ac->getType();
|
|
|
|
|
}
|
2009-11-17 01:37:14 +00:00
|
|
|
|
2012-12-14 20:28:43 +00:00
|
|
|
void Accountintegration::test_addToMessage()
|
2012-12-14 09:04:06 +00:00
|
|
|
{
|
|
|
|
|
MapType emap;
|
|
|
|
|
m_ac->addToMessage(emap);
|
|
|
|
|
}
|
2009-11-17 01:37:14 +00:00
|
|
|
|
2012-12-14 20:28:43 +00:00
|
|
|
void Accountintegration::test_addToEntity()
|
2012-12-14 09:04:06 +00:00
|
|
|
{
|
|
|
|
|
RootEntity ent;
|
|
|
|
|
m_ac->addToEntity(ent);
|
|
|
|
|
}
|
2009-11-17 01:37:14 +00:00
|
|
|
|
2012-12-14 20:27:16 +00:00
|
|
|
void Accountintegration::test_CreateOperation()
|
2012-12-14 09:04:06 +00:00
|
|
|
{
|
|
|
|
|
Anonymous op_arg;
|
|
|
|
|
op_arg->setParents(std::list<std::string>(1, "game_entity"));
|
|
|
|
|
op_arg->setName("Bob");
|
2012-12-14 20:27:16 +00:00
|
|
|
|
|
|
|
|
Create op;
|
|
|
|
|
op->setArgs1(op_arg);
|
|
|
|
|
|
|
|
|
|
OpVector res;
|
2012-12-14 09:04:06 +00:00
|
|
|
m_ac->operation(op, res);
|
|
|
|
|
}
|
2009-11-17 01:37:14 +00:00
|
|
|
|
2012-12-14 20:25:52 +00:00
|
|
|
void Accountintegration::test_GetOperation()
|
2012-12-14 09:04:06 +00:00
|
|
|
{
|
|
|
|
|
Anonymous op_arg;
|
|
|
|
|
op_arg->setParents(std::list<std::string>());
|
2012-12-14 20:25:52 +00:00
|
|
|
|
|
|
|
|
Get op;
|
|
|
|
|
op->setArgs1(op_arg);
|
|
|
|
|
|
|
|
|
|
OpVector res;
|
2012-12-14 09:04:06 +00:00
|
|
|
m_ac->operation(op, res);
|
|
|
|
|
}
|
2009-11-17 01:37:14 +00:00
|
|
|
|
2012-12-14 20:24:39 +00:00
|
|
|
void Accountintegration::test_ImaginaryOperation()
|
2012-12-14 09:04:06 +00:00
|
|
|
{
|
|
|
|
|
Anonymous op_arg;
|
|
|
|
|
op_arg->setLoc("2");
|
2012-12-14 20:24:39 +00:00
|
|
|
|
|
|
|
|
Imaginary op;
|
|
|
|
|
op->setArgs1(op_arg);
|
|
|
|
|
op->setSerialno(1);
|
|
|
|
|
|
|
|
|
|
OpVector res;
|
2012-12-14 09:04:06 +00:00
|
|
|
m_ac->operation(op, res);
|
2012-12-14 20:24:39 +00:00
|
|
|
|
|
|
|
|
// FIXME Test response is sent to Lobby
|
2012-12-14 09:04:06 +00:00
|
|
|
}
|
2009-11-17 01:37:14 +00:00
|
|
|
|
2012-12-14 20:22:20 +00:00
|
|
|
void Accountintegration::test_LookOperation()
|
2012-12-14 09:04:06 +00:00
|
|
|
{
|
|
|
|
|
Anonymous new_char;
|
2013-01-17 10:17:07 +00:00
|
|
|
LocatedEntity * chr = m_ac->addNewCharacter("thing", new_char,
|
|
|
|
|
RootEntity());
|
2012-12-14 09:04:06 +00:00
|
|
|
|
|
|
|
|
Anonymous op_arg;
|
|
|
|
|
op_arg->setId("1");
|
|
|
|
|
op_arg->setId(chr->getId());
|
2012-12-14 20:22:20 +00:00
|
|
|
|
|
|
|
|
Look op;
|
|
|
|
|
op->setArgs1(op_arg);
|
|
|
|
|
|
|
|
|
|
OpVector res;
|
2012-12-14 09:04:06 +00:00
|
|
|
m_ac->operation(op, res);
|
2012-12-14 20:22:20 +00:00
|
|
|
|
|
|
|
|
// FIXME This doesn't test a lot
|
2012-12-14 09:04:06 +00:00
|
|
|
}
|
2009-11-17 01:37:14 +00:00
|
|
|
|
2012-12-14 20:14:28 +00:00
|
|
|
void Accountintegration::test_SetOperation()
|
2012-12-14 09:04:06 +00:00
|
|
|
{
|
|
|
|
|
Anonymous new_char;
|
2013-01-17 10:17:07 +00:00
|
|
|
LocatedEntity * chr = m_ac->addNewCharacter("thing", new_char,
|
|
|
|
|
RootEntity());
|
2012-12-14 20:14:28 +00:00
|
|
|
BBox newBox(WFMath::Point<3>(-0.5, -0.5, 0.0),
|
|
|
|
|
WFMath::Point<3>(-0.5, -0.5, 2.0));
|
|
|
|
|
chr->m_location.setBBox(newBox);
|
2012-12-14 09:04:06 +00:00
|
|
|
|
|
|
|
|
Anonymous op_arg;
|
2012-12-14 20:14:28 +00:00
|
|
|
|
2012-12-14 09:04:06 +00:00
|
|
|
op_arg->setId(chr->getId());
|
|
|
|
|
op_arg->setAttr("guise", "foo");
|
|
|
|
|
op_arg->setAttr("height", 3.0);
|
|
|
|
|
op_arg->setAttr("tasks", ListType());
|
2012-12-14 20:14:28 +00:00
|
|
|
|
|
|
|
|
Set op;
|
|
|
|
|
op->setArgs1(op_arg);
|
|
|
|
|
|
|
|
|
|
OpVector res;
|
2012-12-14 09:04:06 +00:00
|
|
|
m_ac->operation(op, res);
|
2012-12-14 20:14:28 +00:00
|
|
|
|
|
|
|
|
// FIXME Ensure character has been modified
|
2012-12-14 09:04:06 +00:00
|
|
|
}
|
2009-11-17 01:37:14 +00:00
|
|
|
|
2012-12-14 19:56:12 +00:00
|
|
|
void Accountintegration::test_TalkOperation()
|
2012-12-14 09:04:06 +00:00
|
|
|
{
|
|
|
|
|
Anonymous op_arg;
|
|
|
|
|
op_arg->setParents(std::list<std::string>());
|
|
|
|
|
op_arg->setLoc("1");
|
2012-12-14 19:56:12 +00:00
|
|
|
|
|
|
|
|
Talk op;
|
|
|
|
|
op->setSerialno(1);
|
|
|
|
|
op->setArgs1(op_arg);
|
|
|
|
|
|
|
|
|
|
OpVector res;
|
2012-12-14 09:04:06 +00:00
|
|
|
m_ac->operation(op, res);
|
2012-12-14 19:56:12 +00:00
|
|
|
|
|
|
|
|
// FIXME Sound op should have been sent to the lobby
|
2012-12-14 09:04:06 +00:00
|
|
|
}
|
2009-11-16 21:07:52 +00:00
|
|
|
|
2012-12-14 19:49:30 +00:00
|
|
|
void Accountintegration::test_LogoutOperation()
|
2012-12-14 09:04:06 +00:00
|
|
|
{
|
|
|
|
|
Logout op;
|
|
|
|
|
op->setSerialno(1);
|
2012-12-14 19:49:30 +00:00
|
|
|
|
2012-12-14 09:04:06 +00:00
|
|
|
Anonymous op_arg;
|
|
|
|
|
op_arg->setParents(std::list<std::string>());
|
2012-12-14 19:49:30 +00:00
|
|
|
op->setArgs1(op_arg);
|
|
|
|
|
|
|
|
|
|
OpVector res;
|
2012-12-14 09:04:06 +00:00
|
|
|
m_ac->operation(op, res);
|
2012-12-14 19:49:30 +00:00
|
|
|
|
|
|
|
|
// FIXME Account should have been removed from Lobby, and also from
|
|
|
|
|
// Connection
|
2012-12-14 09:04:06 +00:00
|
|
|
}
|
2009-11-17 02:10:08 +00:00
|
|
|
|
2012-12-14 12:39:53 +00:00
|
|
|
void Accountintegration::test_connectCharacter_entity()
|
2012-12-14 09:04:06 +00:00
|
|
|
{
|
|
|
|
|
Entity *e = new Entity("7", 7);
|
2010-11-26 22:22:36 +00:00
|
|
|
|
2012-12-14 09:04:06 +00:00
|
|
|
int ret = m_ac->connectCharacter(e);
|
2012-12-14 12:39:53 +00:00
|
|
|
ASSERT_NOT_EQUAL(ret, 0);
|
2012-12-14 09:04:06 +00:00
|
|
|
}
|
2010-11-26 22:22:36 +00:00
|
|
|
|
2012-12-14 12:39:53 +00:00
|
|
|
void Accountintegration::test_connectCharacter_character()
|
2012-12-14 09:04:06 +00:00
|
|
|
{
|
|
|
|
|
Character * e = new Character("8", 8);
|
2010-11-26 22:22:36 +00:00
|
|
|
|
2012-12-14 09:04:06 +00:00
|
|
|
int ret = m_ac->connectCharacter(e);
|
2012-12-14 12:39:53 +00:00
|
|
|
ASSERT_EQUAL(ret, 0);
|
|
|
|
|
ASSERT_NOT_NULL(e->m_externalMind);
|
|
|
|
|
ASSERT_TRUE(e->m_externalMind->isLinkedTo(m_c));
|
2012-12-13 14:27:34 +00:00
|
|
|
}
|
2009-11-16 21:07:52 +00:00
|
|
|
|
2012-12-13 14:27:34 +00:00
|
|
|
int main()
|
|
|
|
|
{
|
|
|
|
|
database_flag = false;
|
|
|
|
|
|
|
|
|
|
Accountintegration t;
|
|
|
|
|
|
|
|
|
|
return t.run();
|
2009-11-16 21:07:52 +00:00
|
|
|
}
|
2012-09-06 13:48:40 +01:00
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
void TestWorld::message(const Operation & op, LocatedEntity & ent)
|
2012-09-11 22:53:15 +01:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
LocatedEntity * TestWorld::addNewEntity(const std::string &,
|
2012-09-06 13:48:40 +01:00
|
|
|
const Atlas::Objects::Entity::RootEntity &)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2012-12-17 09:32:28 +00:00
|
|
|
|
|
|
|
|
// stubs
|
|
|
|
|
|
2013-01-07 23:03:25 +00:00
|
|
|
#include "Property_stub_impl.h"
|
|
|
|
|
|
2012-12-17 09:32:28 +00:00
|
|
|
#include "server/ArithmeticBuilder.h"
|
|
|
|
|
#include "server/EntityFactory.h"
|
2013-10-23 22:36:55 +02:00
|
|
|
#include "server/ArchetypeFactory.h"
|
2012-12-17 09:32:28 +00:00
|
|
|
#include "server/Juncture.h"
|
|
|
|
|
#include "server/Persistence.h"
|
|
|
|
|
#include "server/Player.h"
|
|
|
|
|
#include "server/Ruleset.h"
|
2013-01-10 09:33:25 +00:00
|
|
|
#include "server/TeleportProperty.h"
|
2012-12-17 09:32:28 +00:00
|
|
|
|
|
|
|
|
#include "rulesets/Motion.h"
|
|
|
|
|
#include "rulesets/Pedestrian.h"
|
|
|
|
|
#include "rulesets/AreaProperty.h"
|
|
|
|
|
#include "rulesets/AtlasProperties.h"
|
|
|
|
|
#include "rulesets/BBoxProperty.h"
|
2013-01-09 22:26:12 +00:00
|
|
|
#include "rulesets/BiomassProperty.h"
|
2013-01-09 22:48:40 +00:00
|
|
|
#include "rulesets/BurnSpeedProperty.h"
|
2013-01-10 10:07:44 +00:00
|
|
|
#include "rulesets/DecaysProperty.h"
|
2012-12-17 09:32:28 +00:00
|
|
|
#include "rulesets/CalendarProperty.h"
|
|
|
|
|
#include "rulesets/EntityProperty.h"
|
|
|
|
|
#include "rulesets/ExternalProperty.h"
|
|
|
|
|
#include "rulesets/InternalProperties.h"
|
|
|
|
|
#include "rulesets/LineProperty.h"
|
|
|
|
|
#include "rulesets/MindProperty.h"
|
|
|
|
|
#include "rulesets/OutfitProperty.h"
|
|
|
|
|
#include "rulesets/SolidProperty.h"
|
|
|
|
|
#include "rulesets/SpawnProperty.h"
|
|
|
|
|
#include "rulesets/StatusProperty.h"
|
|
|
|
|
#include "rulesets/StatisticsProperty.h"
|
|
|
|
|
#include "rulesets/TasksProperty.h"
|
|
|
|
|
#include "rulesets/TerrainModProperty.h"
|
|
|
|
|
#include "rulesets/TerrainProperty.h"
|
|
|
|
|
#include "rulesets/TransientProperty.h"
|
|
|
|
|
#include "rulesets/VisibilityProperty.h"
|
2013-03-31 20:37:52 +02:00
|
|
|
#include "rulesets/SuspendedProperty.h"
|
2013-10-02 15:46:32 +02:00
|
|
|
#include "rulesets/SpawnerProperty.h"
|
2013-11-16 21:05:45 +01:00
|
|
|
#include "rulesets/ImmortalProperty.h"
|
|
|
|
|
#include "rulesets/RespawningProperty.h"
|
2014-09-07 20:32:25 +02:00
|
|
|
#include "rulesets/DefaultLocationProperty.h"
|
2014-09-29 19:24:05 +02:00
|
|
|
#include "rulesets/DomainProperty.h"
|
|
|
|
|
#include "rulesets/LimboProperty.h"
|
2013-10-23 22:36:55 +02:00
|
|
|
#include "rulesets/Creator.h"
|
|
|
|
|
#include "rulesets/Plant.h"
|
|
|
|
|
#include "rulesets/Stackable.h"
|
2012-12-17 09:32:28 +00:00
|
|
|
|
|
|
|
|
#include "common/const.h"
|
|
|
|
|
#include "common/globals.h"
|
|
|
|
|
#include "common/log.h"
|
|
|
|
|
#include "common/Monitors.h"
|
|
|
|
|
#include "common/PropertyFactory.h"
|
|
|
|
|
#include "common/system.h"
|
|
|
|
|
#include "common/TypeNode.h"
|
|
|
|
|
#include "common/Variable.h"
|
|
|
|
|
|
2014-08-26 21:05:18 +02:00
|
|
|
#include "stubs/rulesets/stubSpawnProperty.h"
|
|
|
|
|
#include "stubs/rulesets/stubRespawningProperty.h"
|
|
|
|
|
#include "stubs/rulesets/stubImmortalProperty.h"
|
|
|
|
|
#include "stubs/rulesets/stubTerrainModProperty.h"
|
|
|
|
|
#include "stubs/rulesets/stubTerrainProperty.h"
|
|
|
|
|
#include "stubs/rulesets/stubDecaysProperty.h"
|
|
|
|
|
#include "stubs/rulesets/stubBurnSpeedProperty.h"
|
|
|
|
|
#include "stubs/rulesets/stubBiomassProperty.h"
|
|
|
|
|
#include "stubs/rulesets/stubSpawnerProperty.h"
|
|
|
|
|
#include "stubs/rulesets/stubBBoxProperty.h"
|
2014-09-07 20:32:25 +02:00
|
|
|
#include "stubs/rulesets/stubDefaultLocationProperty.h"
|
2014-09-29 19:24:05 +02:00
|
|
|
#include "stubs/rulesets/stubLimboProperty.h"
|
|
|
|
|
#include "stubs/rulesets/stubDomainProperty.h"
|
2014-12-28 17:50:48 +01:00
|
|
|
#include "stubs/rulesets/stubSuspendedProperty.h"
|
2015-05-23 16:47:45 +02:00
|
|
|
#include "stubs/rulesets/stubProxyMind.h"
|
|
|
|
|
#include "stubs/rulesets/stubBaseMind.h"
|
|
|
|
|
#include "stubs/rulesets/stubMemEntity.h"
|
|
|
|
|
#include "stubs/rulesets/stubMemMap.h"
|
2016-01-18 16:21:00 +01:00
|
|
|
#include "stubs/rulesets/stubTransformsProperty.h"
|
2016-01-20 12:25:29 +01:00
|
|
|
#include "stubs/rulesets/stubModeProperty.h"
|
|
|
|
|
#include "stubs/rulesets/stubModeSpecProperty.h"
|
2016-01-20 16:50:17 +01:00
|
|
|
#include "stubs/rulesets/stubForcesProperty.h"
|
2016-01-20 12:25:29 +01:00
|
|
|
#include "stubs/rulesets/stubCreator.h"
|
2016-06-26 15:48:04 +02:00
|
|
|
#include "stubs/rulesets/stubPropelProperty.h"
|
2016-01-20 12:25:29 +01:00
|
|
|
|
2015-05-23 16:47:45 +02:00
|
|
|
#include "stubs/server/stubExternalMindsManager.h"
|
|
|
|
|
#include "stubs/server/stubExternalMindsConnection.h"
|
|
|
|
|
#include "stubs/common/stubOperationsDispatcher.h"
|
|
|
|
|
#include "stubs/modules/stubWorldTime.h"
|
2014-08-26 21:05:18 +02:00
|
|
|
#include "stubs/common/stubCustom.h"
|
2015-04-09 14:50:45 +02:00
|
|
|
#include "stubs/common/stubVariable.h"
|
|
|
|
|
#include "stubs/common/stubMonitors.h"
|
2012-12-17 09:32:28 +00:00
|
|
|
|
|
|
|
|
ArithmeticBuilder * ArithmeticBuilder::m_instance = 0;
|
|
|
|
|
|
|
|
|
|
ArithmeticBuilder::ArithmeticBuilder()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ArithmeticBuilder * ArithmeticBuilder::instance()
|
|
|
|
|
{
|
|
|
|
|
if (m_instance == 0) {
|
|
|
|
|
m_instance = new ArithmeticBuilder;
|
|
|
|
|
}
|
|
|
|
|
return m_instance;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ArithmeticScript * ArithmeticBuilder::newArithmetic(const std::string & name,
|
2013-01-17 10:17:07 +00:00
|
|
|
LocatedEntity * owner)
|
2012-12-17 09:32:28 +00:00
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2013-10-23 22:36:55 +02:00
|
|
|
Plant::Plant(const std::string& id, long idInt)
|
|
|
|
|
:Thing::Thing(id, idInt)
|
2012-12-17 09:32:28 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-23 22:36:55 +02:00
|
|
|
Plant::~Plant(){}
|
2012-12-17 09:32:28 +00:00
|
|
|
|
2013-10-23 22:36:55 +02:00
|
|
|
void Plant::NourishOperation(const Operation & op, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Plant::TickOperation(const Operation & op, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Plant::TouchOperation(const Operation & op, OpVector &)
|
2012-12-17 09:32:28 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-23 22:36:55 +02:00
|
|
|
Stackable::Stackable(const std::string& id, long idInt)
|
|
|
|
|
:Thing::Thing(id, idInt)
|
2012-12-17 09:32:28 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-23 22:36:55 +02:00
|
|
|
Stackable::~Stackable(){}
|
|
|
|
|
|
|
|
|
|
void Stackable::CombineOperation(const Operation & op, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Stackable::DivideOperation(const Operation & op, OpVector &)
|
|
|
|
|
{
|
|
|
|
|
}
|
2012-12-17 09:32:28 +00:00
|
|
|
|
|
|
|
|
Juncture::~Juncture()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Juncture::externalOperation(const Operation & op, Link &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Juncture::operation(const Operation & op, OpVector & res)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Juncture::addToMessage(MapType & omap) const
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Juncture::addToEntity(const RootEntity & ent) const
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Juncture::LoginOperation(const Operation & op, OpVector & res)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Juncture::OtherOperation(const Operation & op, OpVector & res)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
int Juncture::teleportEntity(const LocatedEntity * ent)
|
2012-12-17 09:32:28 +00:00
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Account * Persistence::getAccount(const std::string & name)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Persistence::putAccount(const Account & ac)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Persistence::registerCharacters(Account & ac,
|
|
|
|
|
const EntityDict & worldObjects)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-06-25 21:42:24 +02:00
|
|
|
void Persistence::addCharacter(const Account &, const LocatedEntity &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Persistence::delCharacter(const std::string &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2012-12-17 09:32:28 +00:00
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Ruleset * Ruleset::m_instance = NULL;
|
|
|
|
|
|
|
|
|
|
Ruleset::~Ruleset()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CalendarProperty::CalendarProperty()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int CalendarProperty::get(Element & ent) const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CalendarProperty::set(const Element & ent)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-07 23:03:25 +00:00
|
|
|
CalendarProperty * CalendarProperty::copy() const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2012-12-17 09:32:28 +00:00
|
|
|
|
|
|
|
|
IdProperty::IdProperty(const std::string & data) : PropertyBase(per_ephem),
|
|
|
|
|
m_data(data)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int IdProperty::get(Atlas::Message::Element & e) const
|
|
|
|
|
{
|
|
|
|
|
e = m_data;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void IdProperty::set(const Atlas::Message::Element & e)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void IdProperty::add(const std::string & key,
|
|
|
|
|
Atlas::Message::MapType & ent) const
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void IdProperty::add(const std::string & key,
|
|
|
|
|
const Atlas::Objects::Entity::RootEntity & ent) const
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-07 23:03:25 +00:00
|
|
|
IdProperty * IdProperty::copy() const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2012-12-17 09:32:28 +00:00
|
|
|
AreaProperty::AreaProperty()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AreaProperty::~AreaProperty()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AreaProperty::set(const Atlas::Message::Element & ent)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-08 00:19:23 +00:00
|
|
|
AreaProperty * AreaProperty::copy() const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
void AreaProperty::apply(LocatedEntity * owner)
|
2012-12-17 09:32:28 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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-12-17 09:32:28 +00:00
|
|
|
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-12-17 09:32:28 +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-12-17 09:32:28 +00:00
|
|
|
void OutfitProperty::cleanUp()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
void OutfitProperty::wear(LocatedEntity * wearer,
|
2012-12-17 09:32:28 +00:00
|
|
|
const std::string & location,
|
2013-01-17 10:17:07 +00:00
|
|
|
LocatedEntity * garment)
|
2012-12-17 09:32:28 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
void OutfitProperty::itemRemoved(LocatedEntity * garment, LocatedEntity * wearer)
|
2012-12-17 09:32:28 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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-12-17 09:32:28 +00:00
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
int TasksProperty::updateTask(LocatedEntity *, OpVector &)
|
2012-12-17 09:32:28 +00:00
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
int TasksProperty::clearTask(LocatedEntity *, OpVector &)
|
2012-12-17 09:32:28 +00:00
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
void TasksProperty::stopTask(LocatedEntity *, OpVector &)
|
2012-12-17 09:32:28 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
void TasksProperty::TickOperation(LocatedEntity *, const Operation &, OpVector &)
|
2012-12-17 09:32:28 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
void TasksProperty::UseOperation(LocatedEntity *, const Operation &, OpVector &)
|
2012-12-17 09:32:28 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
HandlerResult TasksProperty::operation(LocatedEntity *, const Operation &, OpVector &)
|
2012-12-17 09:32:28 +00:00
|
|
|
{
|
2013-01-03 23:17:51 +00:00
|
|
|
return OPERATION_IGNORED;
|
2012-12-17 09:32:28 +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-12-17 09:32:28 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2014-08-25 22:42:00 +02:00
|
|
|
void PropertyBase::remove(LocatedEntity *, const std::string & name)
|
2013-11-24 20:07:56 +01:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
void PropertyBase::apply(LocatedEntity *)
|
2012-12-17 09:32:28 +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-12-17 09:32:28 +00:00
|
|
|
template class Property<int>;
|
|
|
|
|
template class Property<double>;
|
|
|
|
|
template class Property<std::string>;
|
|
|
|
|
template class Property<ListType>;
|
|
|
|
|
template class Property<MapType>;
|
|
|
|
|
template class Property<std::vector<std::string>>;
|
|
|
|
|
|
|
|
|
|
PropertyKit::~PropertyKit()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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-12-17 09:32:28 +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-12-17 09:32:28 +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-12-17 09:32:28 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-02-13 21:24:18 +00:00
|
|
|
void TeleportProperty::install(LocatedEntity * owner, const std::string & name)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
HandlerResult TeleportProperty::operation(LocatedEntity * ent,
|
|
|
|
|
const Operation & op,
|
|
|
|
|
OpVector & res)
|
2013-01-10 09:33:25 +00:00
|
|
|
{
|
|
|
|
|
return OPERATION_IGNORED;
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
Pedestrian::Pedestrian(LocatedEntity & body) : Movement(body)
|
2012-12-17 09:32:28 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SetupProperty::SetupProperty()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-07 23:03:25 +00:00
|
|
|
SetupProperty * SetupProperty::copy() const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2013-02-13 00:45:36 +00:00
|
|
|
void SetupProperty::install(LocatedEntity * ent, const std::string & name)
|
2012-12-17 09:32:28 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TickProperty::TickProperty()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-07 23:03:25 +00:00
|
|
|
TickProperty * TickProperty::copy() const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
void TickProperty::apply(LocatedEntity * ent)
|
2012-12-17 09:32:28 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SimpleProperty::SimpleProperty()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int SimpleProperty::get(Element & ent) const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SimpleProperty::set(const Element & ent)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-07 23:03:25 +00:00
|
|
|
SimpleProperty * SimpleProperty::copy() const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
void SimpleProperty::apply(LocatedEntity * owner)
|
2012-12-17 09:32:28 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
LineProperty::LineProperty()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int LineProperty::get(Element & ent) const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void LineProperty::set(const Element & ent)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void LineProperty::add(const std::string & s, MapType & ent) const
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-07 23:03:25 +00:00
|
|
|
LineProperty * LineProperty::copy() const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2015-05-23 16:47:45 +02:00
|
|
|
MindProperty::MindProperty()
|
2012-12-17 09:32:28 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-28 13:17:23 +00:00
|
|
|
MindProperty::~MindProperty()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2012-12-17 09:32:28 +00:00
|
|
|
void MindProperty::set(const Element & val)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-07 23:03:25 +00:00
|
|
|
MindProperty * MindProperty::copy() const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
void MindProperty::apply(LocatedEntity * ent)
|
2012-12-17 09:32:28 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
VisibilityProperty::VisibilityProperty()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-08 00:19:23 +00:00
|
|
|
VisibilityProperty::~VisibilityProperty()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
VisibilityProperty * VisibilityProperty::copy() const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
void VisibilityProperty::apply(LocatedEntity * ent)
|
2012-12-17 09:32:28 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
StatisticsProperty::StatisticsProperty() : m_script(0)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
StatisticsProperty::~StatisticsProperty()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-02-13 00:45:36 +00:00
|
|
|
void StatisticsProperty::install(LocatedEntity * ent, const std::string & name)
|
2012-12-17 09:32:28 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
void StatisticsProperty::apply(LocatedEntity * ent)
|
2012-12-17 09:32:28 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int StatisticsProperty::get(Element & val) const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void StatisticsProperty::set(const Element & ent)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-07 23:03:25 +00:00
|
|
|
StatisticsProperty * StatisticsProperty::copy() const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2012-12-17 09:32:28 +00:00
|
|
|
SolidProperty::SolidProperty()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int SolidProperty::get(Element & ent) const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SolidProperty::set(const Element & ent)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-07 23:03:25 +00:00
|
|
|
SolidProperty * SolidProperty::copy() const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
void SolidProperty::apply(LocatedEntity * owner)
|
2012-12-17 09:32:28 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TransientProperty::TransientProperty()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-08 00:19:23 +00:00
|
|
|
TransientProperty::~TransientProperty()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TransientProperty * TransientProperty::copy() const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2013-02-13 00:45:36 +00:00
|
|
|
void TransientProperty::install(LocatedEntity * ent, const std::string & name)
|
2012-12-17 09:32:28 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
void TransientProperty::apply(LocatedEntity * ent)
|
2012-12-17 09:32:28 +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::Move moveOp;
|
|
|
|
|
return moveOp;
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
Movement::Movement(LocatedEntity & body) : m_body(body),
|
2012-12-17 09:32:28 +00:00
|
|
|
m_serialno(0)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Movement::~Movement()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool Movement::updateNeeded(const Location & location) const
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Movement::reset()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-29 19:24:05 +02:00
|
|
|
#include "stubs/rulesets/stubMotion.h"
|
2016-01-20 16:14:21 +01:00
|
|
|
#include "stubs/server/stubBuildid.h"
|
2012-12-17 09:32:28 +00:00
|
|
|
|
|
|
|
|
bool_config_register::bool_config_register(bool & var,
|
|
|
|
|
const char * section,
|
|
|
|
|
const char * setting,
|
|
|
|
|
const char * help)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2014-02-03 12:19:42 +01:00
|
|
|
CommSocket::CommSocket(boost::asio::io_service & svr) : m_io_service(svr) { }
|
2012-12-17 09:32:28 +00:00
|
|
|
|
|
|
|
|
CommSocket::~CommSocket()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-23 22:36:55 +02:00
|
|
|
EntityKit::EntityKit() : m_type(0),
|
2012-12-17 09:32:28 +00:00
|
|
|
m_createdCount(0)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
EntityKit::~EntityKit()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void EntityKit::addProperties()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void EntityKit::updateProperties()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-23 22:36:55 +02:00
|
|
|
ArchetypeFactory::ArchetypeFactory()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ArchetypeFactory::ArchetypeFactory(ArchetypeFactory& rhs)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ArchetypeFactory::~ArchetypeFactory()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ArchetypeFactory::addProperties()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ArchetypeFactory::updateProperties()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ArchetypeFactory * ArchetypeFactory::duplicateFactory()
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
LocatedEntity * ArchetypeFactory::newEntity(const std::string & id, long intId,
|
|
|
|
|
const Atlas::Objects::Entity::RootEntity & attributes, LocatedEntity* location)
|
|
|
|
|
{
|
|
|
|
|
return new Entity(id, intId);
|
|
|
|
|
}
|
|
|
|
|
|
2013-02-22 00:37:39 +00:00
|
|
|
Root atlasType(const std::string & name,
|
|
|
|
|
const std::string & parent,
|
|
|
|
|
bool abstract)
|
|
|
|
|
{
|
|
|
|
|
return Atlas::Objects::Root();
|
|
|
|
|
}
|
|
|
|
|
|
2012-12-17 09:32:28 +00:00
|
|
|
Inheritance * Inheritance::m_instance = NULL;
|
|
|
|
|
|
|
|
|
|
Inheritance::Inheritance() : noClass(0)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Inheritance & Inheritance::instance()
|
|
|
|
|
{
|
|
|
|
|
if (m_instance == NULL) {
|
|
|
|
|
m_instance = new Inheritance();
|
|
|
|
|
}
|
|
|
|
|
return *m_instance;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const Root & Inheritance::getClass(const std::string & parent)
|
|
|
|
|
{
|
|
|
|
|
return noClass;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const TypeNode * Inheritance::getType(const std::string & parent)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool Inheritance::isTypeOf(const TypeNode * instance,
|
|
|
|
|
const std::string & base_type) const
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool Inheritance::isTypeOf(const std::string & instance,
|
|
|
|
|
const std::string & base_type) const
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TypeNode * Inheritance::addChild(const Root & obj)
|
|
|
|
|
{
|
|
|
|
|
return new TypeNode(obj->getId());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Inheritance::clear()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Shaker::Shaker()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string Shaker::generateSalt(size_t length)
|
|
|
|
|
{
|
|
|
|
|
return std::string("x", length * 2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TypeNode::TypeNode(const std::string & name) : m_name(name), m_parent(0)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool TypeNode::isTypeOf(const std::string & base_type) const
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-23 22:36:55 +02:00
|
|
|
void TypeNode::addProperties(const Atlas::Message::MapType & attributes)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TypeNode::updateProperties(const Atlas::Message::MapType & attributes)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-11-15 00:16:17 +01:00
|
|
|
const char * const CYPHESIS = "cyphesis";
|
2012-12-17 09:32:28 +00:00
|
|
|
|
|
|
|
|
static const char * DEFAULT_INSTANCE = "cyphesis";
|
|
|
|
|
|
|
|
|
|
std::string instance(DEFAULT_INSTANCE);
|
|
|
|
|
int timeoffset = 0;
|
|
|
|
|
bool database_flag = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 log(LogLevel lvl, const std::string & msg)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void logEvent(LogEvent lev, const std::string & msg)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Root atlasClass(const std::string & name, const std::string & parent)
|
|
|
|
|
{
|
|
|
|
|
return Root();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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 -1;
|
|
|
|
|
}
|