2013-01-08 19:23:50 +00:00
|
|
|
// Cyphesis Online RPG Server and AI Engine
|
|
|
|
|
// Copyright (C) 2013 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef NDEBUG
|
|
|
|
|
#undef NDEBUG
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef DEBUG
|
|
|
|
|
#define DEBUG
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include "TestBase.h"
|
|
|
|
|
|
|
|
|
|
#include "server/CorePropertyManager.h"
|
|
|
|
|
|
|
|
|
|
#include "rulesets/Character.h"
|
|
|
|
|
#include "rulesets/Domain.h"
|
|
|
|
|
#include "rulesets/Entity.h"
|
|
|
|
|
#include "rulesets/ExternalMind.h"
|
|
|
|
|
|
|
|
|
|
#include "common/CommSocket.h"
|
|
|
|
|
#include "common/Inheritance.h"
|
2013-01-08 22:55:00 +00:00
|
|
|
#include "common/PropertyFactory.h"
|
2013-01-08 19:23:50 +00:00
|
|
|
#include "common/SystemTime.h"
|
|
|
|
|
|
|
|
|
|
#include "TestWorld.h"
|
|
|
|
|
|
2014-08-26 21:05:18 +02:00
|
|
|
#include "stubs/rulesets/stubCharacter.h"
|
2016-06-26 15:48:04 +02:00
|
|
|
#include "stubs/rulesets/stubPropelProperty.h"
|
2014-08-26 21:05:18 +02:00
|
|
|
|
2013-01-08 19:23:50 +00:00
|
|
|
#include <Atlas/Objects/SmartPtr.h>
|
|
|
|
|
#include <Atlas/Objects/Anonymous.h>
|
|
|
|
|
#include <Atlas/Objects/Operation.h>
|
|
|
|
|
|
|
|
|
|
#include <cassert>
|
|
|
|
|
|
|
|
|
|
using Atlas::Message::Element;
|
|
|
|
|
using Atlas::Message::ListType;
|
|
|
|
|
using Atlas::Message::MapType;
|
|
|
|
|
using Atlas::Objects::Root;
|
|
|
|
|
using Atlas::Objects::Entity::RootEntity;
|
|
|
|
|
|
2013-01-08 22:55:00 +00:00
|
|
|
class MinimalProperty : public PropertyBase {
|
|
|
|
|
public:
|
|
|
|
|
MinimalProperty() { }
|
|
|
|
|
virtual int get(Atlas::Message::Element & val) const { return 0; }
|
|
|
|
|
virtual void set(const Atlas::Message::Element & val) { }
|
|
|
|
|
virtual MinimalProperty * copy() const { return 0; }
|
|
|
|
|
};
|
|
|
|
|
|
2013-01-08 19:23:50 +00:00
|
|
|
class CorePropertyManagertest : public Cyphesis::TestBase
|
|
|
|
|
{
|
|
|
|
|
CorePropertyManager * m_propertyManager;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
CorePropertyManagertest();
|
|
|
|
|
|
|
|
|
|
void setup();
|
|
|
|
|
void teardown();
|
|
|
|
|
|
2013-01-08 22:55:00 +00:00
|
|
|
void test_addProperty_int();
|
|
|
|
|
void test_addProperty_float();
|
|
|
|
|
void test_addProperty_string();
|
|
|
|
|
void test_addProperty_list();
|
|
|
|
|
void test_addProperty_map();
|
|
|
|
|
void test_addProperty_none();
|
|
|
|
|
void test_addProperty_named();
|
2013-02-22 15:51:32 +00:00
|
|
|
void test_installFactory();
|
2018-04-25 20:09:14 +02:00
|
|
|
|
|
|
|
|
Inheritance* m_inheritance;
|
2013-01-08 19:23:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
CorePropertyManagertest::CorePropertyManagertest()
|
|
|
|
|
{
|
2013-01-08 22:55:00 +00:00
|
|
|
ADD_TEST(CorePropertyManagertest::test_addProperty_int);
|
|
|
|
|
ADD_TEST(CorePropertyManagertest::test_addProperty_float);
|
|
|
|
|
ADD_TEST(CorePropertyManagertest::test_addProperty_string);
|
|
|
|
|
ADD_TEST(CorePropertyManagertest::test_addProperty_list);
|
|
|
|
|
ADD_TEST(CorePropertyManagertest::test_addProperty_map);
|
|
|
|
|
ADD_TEST(CorePropertyManagertest::test_addProperty_none);
|
|
|
|
|
ADD_TEST(CorePropertyManagertest::test_addProperty_named);
|
2013-02-22 15:51:32 +00:00
|
|
|
ADD_TEST(CorePropertyManagertest::test_installFactory);
|
2013-01-08 19:23:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CorePropertyManagertest::setup()
|
|
|
|
|
{
|
2018-04-25 20:09:14 +02:00
|
|
|
m_inheritance = new Inheritance();
|
2013-01-08 19:23:50 +00:00
|
|
|
m_propertyManager = new CorePropertyManager;
|
2013-01-08 22:55:00 +00:00
|
|
|
m_propertyManager->m_propertyFactories.insert(
|
|
|
|
|
std::make_pair("named_type", new PropertyFactory<MinimalProperty>)
|
|
|
|
|
);
|
|
|
|
|
|
2013-01-08 19:23:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CorePropertyManagertest::teardown()
|
|
|
|
|
{
|
2018-04-25 20:09:14 +02:00
|
|
|
delete m_inheritance;
|
2013-01-08 19:23:50 +00:00
|
|
|
delete m_propertyManager;
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-08 22:55:00 +00:00
|
|
|
void CorePropertyManagertest::test_addProperty_int()
|
|
|
|
|
{
|
|
|
|
|
auto * p = m_propertyManager->addProperty("non_existant_type",
|
|
|
|
|
Element::TYPE_INT);
|
|
|
|
|
ASSERT_NOT_NULL(p);
|
|
|
|
|
ASSERT_NOT_NULL(dynamic_cast<Property<int> *>(p));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CorePropertyManagertest::test_addProperty_float()
|
2013-01-08 19:23:50 +00:00
|
|
|
{
|
2013-01-08 22:55:00 +00:00
|
|
|
auto * p = m_propertyManager->addProperty("non_existant_type",
|
|
|
|
|
Element::TYPE_FLOAT);
|
|
|
|
|
ASSERT_NOT_NULL(p);
|
|
|
|
|
ASSERT_NOT_NULL(dynamic_cast<Property<double> *>(p));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CorePropertyManagertest::test_addProperty_string()
|
|
|
|
|
{
|
|
|
|
|
auto * p = m_propertyManager->addProperty("non_existant_type",
|
|
|
|
|
Element::TYPE_STRING);
|
|
|
|
|
ASSERT_NOT_NULL(p);
|
|
|
|
|
ASSERT_NOT_NULL(dynamic_cast<Property<std::string> *>(p));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CorePropertyManagertest::test_addProperty_list()
|
|
|
|
|
{
|
|
|
|
|
auto * p = m_propertyManager->addProperty("non_existant_type",
|
|
|
|
|
Element::TYPE_LIST);
|
|
|
|
|
ASSERT_NOT_NULL(p);
|
|
|
|
|
ASSERT_NOT_NULL(dynamic_cast<SoftProperty *>(p));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CorePropertyManagertest::test_addProperty_map()
|
|
|
|
|
{
|
|
|
|
|
auto * p = m_propertyManager->addProperty("non_existant_type",
|
|
|
|
|
Element::TYPE_MAP);
|
|
|
|
|
ASSERT_NOT_NULL(p);
|
|
|
|
|
ASSERT_NOT_NULL(dynamic_cast<SoftProperty *>(p));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CorePropertyManagertest::test_addProperty_none()
|
|
|
|
|
{
|
|
|
|
|
auto * p = m_propertyManager->addProperty("non_existant_type",
|
|
|
|
|
Element::TYPE_NONE);
|
|
|
|
|
ASSERT_NOT_NULL(p);
|
|
|
|
|
ASSERT_NOT_NULL(dynamic_cast<SoftProperty *>(p));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CorePropertyManagertest::test_addProperty_named()
|
|
|
|
|
{
|
|
|
|
|
auto * p = m_propertyManager->addProperty("named_type",
|
|
|
|
|
Element::TYPE_NONE);
|
|
|
|
|
ASSERT_NOT_NULL(p);
|
|
|
|
|
ASSERT_NOT_NULL(dynamic_cast<MinimalProperty *>(p));
|
2013-01-08 19:23:50 +00:00
|
|
|
}
|
|
|
|
|
|
2013-02-22 15:51:32 +00:00
|
|
|
void CorePropertyManagertest::test_installFactory()
|
|
|
|
|
{
|
|
|
|
|
int ret = m_propertyManager->installFactory(
|
|
|
|
|
"new_named_type",
|
|
|
|
|
Root(),
|
|
|
|
|
new PropertyFactory<MinimalProperty>
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
ASSERT_EQUAL(ret, 0);
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-08 19:23:50 +00:00
|
|
|
int main()
|
|
|
|
|
{
|
|
|
|
|
CorePropertyManagertest t;
|
|
|
|
|
|
|
|
|
|
return t.run();
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
void TestWorld::message(const Operation & op, LocatedEntity & ent)
|
2013-01-08 19:23:50 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
LocatedEntity * TestWorld::addNewEntity(const std::string &,
|
2013-01-08 19:23:50 +00:00
|
|
|
const Atlas::Objects::Entity::RootEntity &)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2017-08-02 10:03:58 +02: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"
|
|
|
|
|
|
|
|
|
|
|
2013-01-08 19:23:50 +00:00
|
|
|
// stubs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "server/ArithmeticBuilder.h"
|
|
|
|
|
#include "server/EntityFactory.h"
|
|
|
|
|
#include "server/Juncture.h"
|
|
|
|
|
#include "server/Persistence.h"
|
|
|
|
|
#include "server/Player.h"
|
|
|
|
|
#include "server/Ruleset.h"
|
|
|
|
|
#include "server/ServerRouting.h"
|
2013-01-10 09:33:25 +00:00
|
|
|
#include "server/TeleportProperty.h"
|
2013-01-08 19:23:50 +00:00
|
|
|
|
|
|
|
|
#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-08 19:23:50 +00:00
|
|
|
#include "rulesets/CalendarProperty.h"
|
2013-01-10 10:07:44 +00:00
|
|
|
#include "rulesets/DecaysProperty.h"
|
2013-01-08 19:23:50 +00:00
|
|
|
#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"
|
2013-03-31 20:37:52 +02:00
|
|
|
#include "rulesets/SuspendedProperty.h"
|
2013-01-08 19:23:50 +00:00
|
|
|
#include "rulesets/TasksProperty.h"
|
|
|
|
|
#include "rulesets/TerrainModProperty.h"
|
|
|
|
|
#include "rulesets/TerrainProperty.h"
|
|
|
|
|
#include "rulesets/TransientProperty.h"
|
|
|
|
|
#include "rulesets/VisibilityProperty.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/LimboProperty.h"
|
|
|
|
|
#include "rulesets/DomainProperty.h"
|
2017-08-02 10:03:58 +02:00
|
|
|
//void Entity::destroy()
|
|
|
|
|
//{
|
|
|
|
|
// destroyed.emit();
|
|
|
|
|
//}
|
|
|
|
|
//
|
|
|
|
|
//void Entity::addToEntity(const Atlas::Objects::Entity::RootEntity & ent) const
|
|
|
|
|
//{
|
|
|
|
|
// ent->setId(getId());
|
|
|
|
|
//}
|
2013-01-08 19:23:50 +00:00
|
|
|
|
2017-08-02 10:03:58 +02:00
|
|
|
#include "stubs/rulesets/stubEntity.h"
|
|
|
|
|
#include "stubs/rulesets/stubLocatedEntity.h"
|
2013-01-08 19:23:50 +00:00
|
|
|
|
2017-08-02 10:03:58 +02:00
|
|
|
#include "stubs/common/stubProperty.h"
|
2014-08-26 21:05:18 +02:00
|
|
|
#include "stubs/common/stubCustom.h"
|
|
|
|
|
#include "stubs/rulesets/stubImmortalProperty.h"
|
|
|
|
|
#include "stubs/rulesets/stubRespawningProperty.h"
|
|
|
|
|
#include "stubs/rulesets/stubSpawnerProperty.h"
|
|
|
|
|
#include "stubs/rulesets/stubTerrainModProperty.h"
|
|
|
|
|
#include "stubs/rulesets/stubTerrainProperty.h"
|
|
|
|
|
#include "stubs/rulesets/stubBBoxProperty.h"
|
|
|
|
|
#include "stubs/rulesets/stubBiomassProperty.h"
|
|
|
|
|
#include "stubs/rulesets/stubBurnSpeedProperty.h"
|
|
|
|
|
#include "stubs/rulesets/stubContainsProperty.h"
|
|
|
|
|
#include "stubs/rulesets/stubDecaysProperty.h"
|
|
|
|
|
#include "stubs/rulesets/stubOutfitProperty.h"
|
|
|
|
|
#include "stubs/rulesets/stubStatusProperty.h"
|
|
|
|
|
#include "stubs/rulesets/stubTasksProperty.h"
|
|
|
|
|
#include "stubs/rulesets/stubSpawnProperty.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"
|
2016-01-20 12:25:29 +01:00
|
|
|
#include "stubs/rulesets/stubModeProperty.h"
|
2016-09-02 23:40:19 +02:00
|
|
|
#include "stubs/rulesets/stubQuaternionProperty.h"
|
|
|
|
|
#include "stubs/rulesets/stubAngularFactorProperty.h"
|
|
|
|
|
#include "stubs/rulesets/stubGeometryProperty.h"
|
|
|
|
|
#include "stubs/rulesets/stubDensityProperty.h"
|
2016-12-19 22:01:23 +01:00
|
|
|
#include "stubs/rulesets/stubVector3Property.h"
|
2018-02-11 21:15:35 +01:00
|
|
|
#include "stubs/rulesets/stubThing.h"
|
2018-03-24 17:06:02 +01:00
|
|
|
#include "stubs/rulesets/stubEntityProperty.h"
|
|
|
|
|
#include "stubs/rulesets/stubInternalProperties.h"
|
|
|
|
|
#include "stubs/rulesets/stubSolidProperty.h"
|
2018-04-25 20:09:14 +02:00
|
|
|
#include "stubs/rulesets/stubPerceptionSightProperty.h"
|
2013-01-08 19:23:50 +00:00
|
|
|
|
|
|
|
|
Account::Account(Connection * conn,
|
|
|
|
|
const std::string & uname,
|
|
|
|
|
const std::string & passwd,
|
|
|
|
|
const std::string & id,
|
|
|
|
|
long intId) :
|
|
|
|
|
ConnectableRouter(id, intId, conn),
|
|
|
|
|
m_username(uname), m_password(passwd)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const char * Account::getType() const
|
|
|
|
|
{
|
|
|
|
|
return "test_account";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Account::store() const
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-06-25 21:42:24 +02:00
|
|
|
bool Account::isPersisted() const {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-08 19:23:50 +00:00
|
|
|
void Account::addToMessage(Atlas::Message::MapType & omap) const
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Account::addToEntity(const Atlas::Objects::Entity::RootEntity & ent) const
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Account::createObject(const std::string & type_str,
|
|
|
|
|
const Atlas::Objects::Root & arg,
|
|
|
|
|
const Operation & op,
|
|
|
|
|
OpVector & res)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2014-01-24 11:06:20 +01:00
|
|
|
LocatedEntity * Account::createCharacterEntity(const std::string &,
|
|
|
|
|
const Atlas::Objects::Entity::RootEntity &,
|
|
|
|
|
const Atlas::Objects::Root &)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-08 19:23:50 +00:00
|
|
|
void Account::externalOperation(const Operation &, Link &)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Account::operation(const Operation & op, OpVector & res)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Account::LogoutOperation(const Operation & op, OpVector & res)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Account::CreateOperation(const Operation & op, OpVector & res)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Account::SetOperation(const Operation & op, OpVector & res)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Account::ImaginaryOperation(const Operation & op, OpVector & res)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Account::TalkOperation(const Operation & op, OpVector & res)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Account::LookOperation(const Operation & op, OpVector & res)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Account::GetOperation(const Operation & op, OpVector & res)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Account::OtherOperation(const Operation & op, OpVector & res)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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)
|
2013-01-08 19:23:50 +00:00
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ConnectableRouter::ConnectableRouter(const std::string & id,
|
|
|
|
|
long iid,
|
|
|
|
|
Connection *c) :
|
|
|
|
|
Router(id, iid),
|
|
|
|
|
m_connection(c)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2018-04-29 16:26:32 +02:00
|
|
|
#define STUB_EntityFactory_newEntity
|
|
|
|
|
template <typename T>
|
|
|
|
|
LocatedEntity* EntityFactory<T>::newEntity(const std::string & id, long intId, const Atlas::Objects::Entity::RootEntity & attributes, LocatedEntity* location)
|
2013-01-08 19:23:50 +00:00
|
|
|
{
|
|
|
|
|
return new Entity(id, intId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class Creator;
|
|
|
|
|
class Plant;
|
|
|
|
|
class Stackable;
|
|
|
|
|
class World;
|
|
|
|
|
|
|
|
|
|
template <>
|
2013-10-23 22:36:55 +02:00
|
|
|
LocatedEntity * EntityFactory<World>::newEntity(const std::string & id, long intId,
|
|
|
|
|
const Atlas::Objects::Entity::RootEntity & attributes, LocatedEntity* location)
|
2013-01-08 19:23:50 +00:00
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <>
|
2013-10-23 22:36:55 +02:00
|
|
|
LocatedEntity * EntityFactory<Character>::newEntity(const std::string & id, long intId,
|
|
|
|
|
const Atlas::Objects::Entity::RootEntity & attributes, LocatedEntity* location)
|
2013-01-08 19:23:50 +00:00
|
|
|
{
|
|
|
|
|
return new Character(id, intId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template class EntityFactory<Thing>;
|
|
|
|
|
template class EntityFactory<Character>;
|
|
|
|
|
template class EntityFactory<Creator>;
|
|
|
|
|
template class EntityFactory<Plant>;
|
|
|
|
|
template class EntityFactory<Stackable>;
|
|
|
|
|
template class EntityFactory<World>;
|
|
|
|
|
|
|
|
|
|
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)
|
2013-01-08 19:23:50 +00:00
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2018-01-30 16:54:49 +01:00
|
|
|
Persistence * Persistence::m_instance = nullptr;
|
2013-01-08 19:23:50 +00:00
|
|
|
|
|
|
|
|
Persistence::Persistence() : m_db(*(Database*)0)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Persistence * Persistence::instance()
|
|
|
|
|
{
|
2018-01-30 16:54:49 +01:00
|
|
|
if (m_instance == nullptr) {
|
2013-01-08 19:23:50 +00:00
|
|
|
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)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2018-04-25 21:05:59 +02:00
|
|
|
#include "stubs/server/stubPlayer.h"
|
2013-01-08 19:23:50 +00:00
|
|
|
|
2018-04-29 11:58:35 +02:00
|
|
|
#include "stubs/server/stubRuleHandler.h"
|
|
|
|
|
|
|
|
|
|
#include "stubs/server/stubTaskRuleHandler.h"
|
|
|
|
|
#include "stubs/server/stubEntityRuleHandler.h"
|
|
|
|
|
#include "stubs/server/stubArchetypeRuleHandler.h"
|
|
|
|
|
#include "stubs/server/stubOpRuleHandler.h"
|
|
|
|
|
#include "stubs/server/stubPropertyRuleHandler.h"
|
|
|
|
|
#include "stubs/server/stubRuleset.h"
|
2018-04-25 20:09:14 +02:00
|
|
|
#include "stubs/server/stubServerRouting.h"
|
2013-01-08 19:23:50 +00:00
|
|
|
|
|
|
|
|
CalendarProperty::CalendarProperty()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int CalendarProperty::get(Element & ent) const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CalendarProperty::set(const Element & ent)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CalendarProperty * CalendarProperty::copy() const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IdProperty * IdProperty::copy() const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AreaProperty::AreaProperty()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AreaProperty::~AreaProperty()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AreaProperty::set(const Atlas::Message::Element & ent)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AreaProperty * AreaProperty::copy() const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
void AreaProperty::apply(LocatedEntity * owner)
|
2013-01-08 19:23:50 +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
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ExternalProperty * ExternalProperty::copy() const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PropertyKit::~PropertyKit()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-08 22:55:00 +00:00
|
|
|
template <class T>
|
|
|
|
|
PropertyBase * PropertyFactory<T>::newProperty()
|
|
|
|
|
{
|
|
|
|
|
return new T();
|
|
|
|
|
}
|
|
|
|
|
|
2013-02-18 10:16:28 +00:00
|
|
|
template <class T>
|
|
|
|
|
PropertyFactory<T> * PropertyFactory<T>::duplicateFactory() const
|
|
|
|
|
{
|
|
|
|
|
return new PropertyFactory<T>;
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-08 22:55:00 +00:00
|
|
|
template class PropertyFactory<MinimalProperty>;
|
|
|
|
|
|
2013-02-14 19:32:24 +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-08 19:23:50 +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
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
LineProperty * LineProperty::copy() const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MindProperty::set(const Element & val)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MindProperty * MindProperty::copy() const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
void MindProperty::apply(LocatedEntity * ent)
|
2013-01-08 19:23:50 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2018-04-26 21:07:47 +02:00
|
|
|
#include "stubs/rulesets/stubVisibilityProperty.h"
|
2013-01-08 19:23:50 +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)
|
2013-01-08 19:23:50 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
void StatisticsProperty::apply(LocatedEntity * ent)
|
2013-01-08 19:23:50 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int StatisticsProperty::get(Element & val) const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void StatisticsProperty::set(const Element & ent)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
StatisticsProperty * StatisticsProperty::copy() const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2018-04-27 20:55:02 +02:00
|
|
|
#include "stubs/rulesets/stubTransientProperty.h"
|
2018-04-26 21:07:47 +02:00
|
|
|
#include "stubs/modules/stubLocation.h"
|
|
|
|
|
|
2013-01-08 19:23:50 +00:00
|
|
|
|
|
|
|
|
BaseWorld * BaseWorld::m_instance = 0;
|
|
|
|
|
|
|
|
|
|
BaseWorld::~BaseWorld()
|
|
|
|
|
{
|
|
|
|
|
m_instance = 0;
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
LocatedEntity * BaseWorld::getEntity(const std::string & id) const
|
2013-01-08 19:23:50 +00:00
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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) { }
|
2013-01-08 19:23:50 +00:00
|
|
|
|
|
|
|
|
CommSocket::~CommSocket()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2018-04-29 16:26:32 +02:00
|
|
|
#include "stubs/common/stubEntityKit.h"
|
|
|
|
|
#include "stubs/server/stubEntityFactory.h"
|
2013-10-23 22:36:55 +02:00
|
|
|
|
|
|
|
|
|
2013-02-22 00:37:39 +00:00
|
|
|
Root atlasType(const std::string & name,
|
|
|
|
|
const std::string & parent,
|
|
|
|
|
bool abstract)
|
|
|
|
|
{
|
|
|
|
|
return Atlas::Objects::Root();
|
|
|
|
|
}
|
|
|
|
|
|
2018-04-25 20:09:14 +02:00
|
|
|
#define STUB_Inheritance_getClass
|
|
|
|
|
const Atlas::Objects::Root& Inheritance::getClass(const std::string & parent)
|
2013-01-08 19:23:50 +00:00
|
|
|
{
|
|
|
|
|
return noClass;
|
|
|
|
|
}
|
|
|
|
|
|
2018-04-25 20:09:14 +02:00
|
|
|
#define STUB_Inheritance_addChild
|
2013-01-08 19:23:50 +00:00
|
|
|
TypeNode * Inheritance::addChild(const Root & obj)
|
|
|
|
|
{
|
|
|
|
|
return new TypeNode(obj->getId());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2018-04-25 20:09:14 +02:00
|
|
|
#include "stubs/common/stubInheritance.h"
|
2013-01-08 19:23:50 +00:00
|
|
|
|
|
|
|
|
|
2013-02-22 09:57:10 +00:00
|
|
|
|
2018-04-25 20:09:14 +02:00
|
|
|
#include "stubs/common/stubMonitors.h"
|
|
|
|
|
#include "stubs/common/stubPropertyManager.h"
|
|
|
|
|
#include "stubs/common/stubShaker.h"
|
2013-02-22 00:37:39 +00:00
|
|
|
|
2013-01-08 19:23:50 +00:00
|
|
|
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
|
|
|
|
|
{
|
|
|
|
|
res.push_back(Atlas::Objects::Operation::Error());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TypeNode::TypeNode(const std::string & name) : m_name(name), m_parent(0)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool TypeNode::isTypeOf(const std::string & base_type) const
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2015-04-09 14:50:45 +02:00
|
|
|
#include "stubs/common/stubVariable.h"
|
2016-01-20 16:14:21 +01:00
|
|
|
#include "stubs/server/stubBuildid.h"
|
2013-01-08 19:23:50 +00:00
|
|
|
|
2013-11-15 00:16:17 +01:00
|
|
|
const char * const CYPHESIS = "cyphesis";
|
2013-01-08 19:23:50 +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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void addToEntity(const Point3D & p, std::vector<double> & vd)
|
|
|
|
|
{
|
|
|
|
|
}
|