2006-01-19 Al Riddoch <alriddoch@zepler.org>
* aiclient/ClientAccount.cpp, aiclient/ClientAccount.h,
aiclient/ClientConnection.cpp, aiclient/ClientConnection.h,
aiclient/client.cpp, aiclient/client.h, client/BaseClient.cpp,
client/BaseClient.h, client/CharacterClient.cpp,
client/CharacterClient.h, client/ClientConnection.cpp,
client/ClientConnection.h, client/CreatorClient.cpp,
client/CreatorClient.h, client/ObserverClient.cpp,
client/ObserverClient.h, client/Py_CreatorClient.cpp,
client/Py_CreatorClient.h, client/client.cpp,
client/define_world.cpp, client/define_world.h, common/Add.h,
common/Affect.h, common/AtlasFileLoader.cpp,
common/AtlasFileLoader.h, common/Attack.h, common/BaseEntity.cpp,
common/BaseEntity.h, common/BaseWorld.cpp, common/BaseWorld.h,
common/Burn.h, common/Chop.h, common/Connect.h, common/CustomOp.cpp,
common/CustomOp.h, common/CustomOp_impl.h, common/Cut.h,
common/Database.cpp, common/Database.h, common/Delve.h, common/Dig.h,
common/Eat.h, common/FormattedXMLWriter.cpp,
common/FormattedXMLWriter.h, common/Generic.h, common/Load.h,
common/Monitor.h, common/Mow.h, common/Nourish.h,
common/OOGThing.cpp, common/OOGThing.h, common/Property.cpp,
common/Property.h, common/Property_impl.h, common/Save.h,
common/Setup.h, common/Tick.h, common/Unseen.h, common/Update.h,
common/Use.h, common/Wield.h, common/accountbase.cpp,
common/accountbase.h, common/const.cpp, common/const.h,
common/custom.cpp, common/debug.h, common/globals.cpp,
common/globals.h, common/id.cpp, common/id.h, common/inheritance.cpp,
common/inheritance.h, common/inheritance_impl.h, common/log.cpp,
common/log.h, common/newid.cpp, common/nls.h, common/op_switch.h,
common/operations.cpp, common/operations.h, common/random.h,
common/refno.h, common/serialno.cpp, common/serialno.h,
common/system.cpp, common/system.h, common/terrain_utils.cpp,
common/terrain_utils.h, common/type_utils.h, common/types.h,
common/utility.cpp, common/utility.h, modules/DateTime.cpp,
modules/DateTime.h, modules/Location.cpp, modules/Location.h,
modules/WorldTime.cpp, modules/WorldTime.h, physics/BBox.cpp,
physics/BBox.h, physics/Collision.cpp, physics/Collision.h,
physics/Quaternion.cpp, physics/Quaternion.h, physics/Vector3D.cpp,
physics/Vector3D.h, physics/VectorPol.h, rulesets/Area.cpp,
rulesets/Area.h, rulesets/AreaProperty.cpp, rulesets/AreaProperty.h,
rulesets/ArithmeticScript.cpp, rulesets/ArithmeticScript.h,
rulesets/BaseMind.cpp, rulesets/BaseMind.h,
rulesets/CalendarProperty.cpp, rulesets/CalendarProperty.h,
rulesets/Character.cpp, rulesets/Character.h, rulesets/Combat.cpp,
rulesets/Combat.h, rulesets/Container.cpp, rulesets/Container.h,
rulesets/Creator.cpp, rulesets/Creator.h, rulesets/Entity.cpp,
rulesets/Entity.h, rulesets/EntityProperties.cpp,
rulesets/Entity_getLocation.h, rulesets/Fell.cpp, rulesets/Fell.h,
rulesets/Food.cpp, rulesets/Food.h, rulesets/Line.cpp,
rulesets/Line.h, rulesets/LineProperty.cpp, rulesets/LineProperty.h,
rulesets/MemEntity.cpp, rulesets/MemEntity.h, rulesets/MemMap.cpp,
rulesets/MemMap.h, rulesets/MemMap_methods.h,
rulesets/MindFactory.cpp, rulesets/MindFactory.h, rulesets/Missile.h,
rulesets/Motion.cpp, rulesets/Motion.h, rulesets/Movement.cpp,
rulesets/Movement.h, rulesets/Pedestrian.cpp, rulesets/Pedestrian.h,
rulesets/Plant.cpp, rulesets/Plant.h, rulesets/Py_BBox.cpp,
rulesets/Py_BBox.h, rulesets/Py_EntityWrapper.h,
rulesets/Py_Location.cpp, rulesets/Py_Location.h,
rulesets/Py_Map.cpp, rulesets/Py_Map.h, rulesets/Py_Mind.cpp,
rulesets/Py_Mind.h, rulesets/Py_Object.cpp, rulesets/Py_Object.h,
rulesets/Py_Operation.cpp, rulesets/Py_Operation.h,
rulesets/Py_Oplist.cpp, rulesets/Py_Oplist.h, rulesets/Py_Optime.cpp,
rulesets/Py_Optime.h, rulesets/Py_Point3D.cpp, rulesets/Py_Point3D.h,
rulesets/Py_Property.cpp, rulesets/Py_Property.h,
rulesets/Py_Quaternion.cpp, rulesets/Py_Quaternion.h,
rulesets/Py_RootEntity.cpp, rulesets/Py_RootEntity.h,
rulesets/Py_Statistics.cpp, rulesets/Py_Statistics.h,
rulesets/Py_Task.cpp, rulesets/Py_Task.h, rulesets/Py_Thing.cpp,
rulesets/Py_Thing.h, rulesets/Py_Vector3D.cpp,
rulesets/Py_Vector3D.h, rulesets/Py_World.cpp, rulesets/Py_World.h,
rulesets/Py_WorldTime.cpp, rulesets/Py_WorldTime.h,
rulesets/PythonArithmeticScript.cpp,
rulesets/PythonArithmeticScript.h, rulesets/PythonMindScript.cpp,
rulesets/PythonMindScript.h, rulesets/PythonScript.cpp,
rulesets/PythonScript.h, rulesets/PythonThingScript.cpp,
rulesets/PythonThingScript.h, rulesets/PythonWrapper.cpp,
rulesets/PythonWrapper.h, rulesets/Python_API.cpp,
rulesets/Python_API.h, rulesets/Python_Script_Utils.h,
rulesets/Script.cpp, rulesets/Script.h, rulesets/Stackable.cpp,
rulesets/Stackable.h, rulesets/Statistics.cpp, rulesets/Statistics.h,
rulesets/StatisticsProperty.cpp, rulesets/StatisticsProperty.h,
rulesets/Structure.cpp, rulesets/Structure.h, rulesets/Task.cpp,
rulesets/Task.h, rulesets/TaskScript.cpp, rulesets/TaskScript.h,
rulesets/TerrainProperty.cpp, rulesets/TerrainProperty.h,
rulesets/Thing.cpp, rulesets/Thing.h, rulesets/ThingFactory.cpp,
rulesets/ThingFactory.h, rulesets/World.cpp, rulesets/World.h,
rulesets/attributes.h, server/Account.cpp, server/Account.h,
server/Admin.cpp, server/Admin.h, server/ArithmeticFactory.cpp,
server/ArithmeticFactory.h, server/CommClient.cpp,
server/CommClient.h, server/CommIdleSocket.cpp,
server/CommIdleSocket.h, server/CommListener.cpp,
server/CommListener.h, server/CommLocalClient.cpp,
server/CommLocalClient.h, server/CommMDNSPublisher.cpp,
server/CommMDNSPublisher.h, server/CommMaster.cpp,
server/CommMaster.h, server/CommMetaClient.cpp,
server/CommMetaClient.h, server/CommPSQLSocket.cpp,
server/CommPSQLSocket.h, server/CommPeer.cpp,
server/CommPeer.h, server/CommPeerListener.cpp,
server/CommPeerListener.h, server/CommRemoteClient.cpp,
server/CommRemoteClient.h, server/CommServer.cpp,
server/CommServer.h, server/CommSlaveClient.cpp,
server/CommSlaveClient.h, server/CommSlaveListener.cpp,
server/CommSlaveListener.h, server/CommSocket.cpp,
server/CommSocket.h, server/CommUnixListener.cpp,
server/CommUnixListener.h, server/Connection.cpp,
server/Connection.h, server/Connection_methods.h,
server/EntityFactory.cpp, server/EntityFactory.h,
server/ExternalMind.cpp, server/ExternalMind.h,
server/Idle.cpp, server/Idle.h, server/Lobby.cpp, server/Lobby.h,
server/Master.cpp, server/Master.h, server/Peer.cpp, server/Peer.h,
server/Persistance.cpp, server/Persistance.h,
server/PersistantThingFactory.cpp, server/PersistantThingFactory.h,
server/PersistantThingFactory_impl.h, server/Persistor.cpp,
server/Persistor.h, server/Persistor_impl.h,
server/Player.cpp, server/Player.h, server/Restoration.cpp,
server/Restoration.h, server/Restorer.cpp, server/Restorer.h,
server/Restorer_impl.h, server/ScriptFactory.cpp,
server/ScriptFactory.h, server/ServerRouting.cpp,
server/ServerRouting.h, server/ServerRouting_methods.h,
server/SlaveClientConnection.cpp, server/SlaveClientConnection.h,
server/TaskFactory.cpp, server/TaskFactory.h,
server/TrustedConnection.cpp, server/TrustedConnection.h,
server/WorldRouter.cpp, server/WorldRouter.h,
server/server.cpp, server/server.h, server/slave.cpp,
tests/Areatest.cpp, tests/BaseEntitytest.cpp,
tests/Charactertest.cpp, tests/Containertest.cpp,
tests/Creatortest.cpp, tests/EntityExerciser.h,
tests/EntityFactorytest.cpp, tests/Entitytest.cpp,
tests/Foodtest.cpp, tests/IGEntityExerciser.h,
tests/Linetest.cpp, tests/Locationtest.cpp, tests/OOGThingtest.cpp,
tests/Planttest.cpp, tests/Propertytest.cpp, tests/Stackabletest.cpp,
tests/Structuretest.cpp, tests/Tasktest.cpp, tests/TestWorld.h,
tests/Thingtest.cpp, tests/WorldTimetest.cpp, tests/Worldtest.cpp,
tests/allOperations.h, tests/collisiontest.cpp, tests/consttest.cpp,
tests/distancetest.cpp, tests/emergencetest.cpp,
tests/inheritancetest.cpp, tests/logtest.cpp, tests/randomtest.cpp,
tests/systemtest.cpp, tests/transformtest.cpp,
tests/type_utilstest.cpp, tests/utilitytest.cpp,
tools/AdminClient.cpp, tools/AdminClient.h, tools/cyaddrules.cpp,
tools/cycmd.cpp, tools/cyconfig.cpp, tools/cyconvertrules.cpp,
tools/cyctrl.cpp, tools/cydbload.cpp, tools/cydumprules.cpp,
tools/cyisoload.cpp, tools/cyloadrules.cpp, tools/cypasswd.cpp,
tools/cywatchdog.cpp: Replace the copyright and license statements
with new versions that include disclaimer of warranty, and
permit distribution under later versions of the GPL.
2006-01-19 02:17:06 +00:00
|
|
|
// Cyphesis Online RPG Server and AI Engine
|
2004-12-08 16:36:42 +00:00
|
|
|
// Copyright (C) 2000-2004 Alistair Riddoch
|
2006-01-19 Al Riddoch <alriddoch@zepler.org>
* aiclient/ClientAccount.cpp, aiclient/ClientAccount.h,
aiclient/ClientConnection.cpp, aiclient/ClientConnection.h,
aiclient/client.cpp, aiclient/client.h, client/BaseClient.cpp,
client/BaseClient.h, client/CharacterClient.cpp,
client/CharacterClient.h, client/ClientConnection.cpp,
client/ClientConnection.h, client/CreatorClient.cpp,
client/CreatorClient.h, client/ObserverClient.cpp,
client/ObserverClient.h, client/Py_CreatorClient.cpp,
client/Py_CreatorClient.h, client/client.cpp,
client/define_world.cpp, client/define_world.h, common/Add.h,
common/Affect.h, common/AtlasFileLoader.cpp,
common/AtlasFileLoader.h, common/Attack.h, common/BaseEntity.cpp,
common/BaseEntity.h, common/BaseWorld.cpp, common/BaseWorld.h,
common/Burn.h, common/Chop.h, common/Connect.h, common/CustomOp.cpp,
common/CustomOp.h, common/CustomOp_impl.h, common/Cut.h,
common/Database.cpp, common/Database.h, common/Delve.h, common/Dig.h,
common/Eat.h, common/FormattedXMLWriter.cpp,
common/FormattedXMLWriter.h, common/Generic.h, common/Load.h,
common/Monitor.h, common/Mow.h, common/Nourish.h,
common/OOGThing.cpp, common/OOGThing.h, common/Property.cpp,
common/Property.h, common/Property_impl.h, common/Save.h,
common/Setup.h, common/Tick.h, common/Unseen.h, common/Update.h,
common/Use.h, common/Wield.h, common/accountbase.cpp,
common/accountbase.h, common/const.cpp, common/const.h,
common/custom.cpp, common/debug.h, common/globals.cpp,
common/globals.h, common/id.cpp, common/id.h, common/inheritance.cpp,
common/inheritance.h, common/inheritance_impl.h, common/log.cpp,
common/log.h, common/newid.cpp, common/nls.h, common/op_switch.h,
common/operations.cpp, common/operations.h, common/random.h,
common/refno.h, common/serialno.cpp, common/serialno.h,
common/system.cpp, common/system.h, common/terrain_utils.cpp,
common/terrain_utils.h, common/type_utils.h, common/types.h,
common/utility.cpp, common/utility.h, modules/DateTime.cpp,
modules/DateTime.h, modules/Location.cpp, modules/Location.h,
modules/WorldTime.cpp, modules/WorldTime.h, physics/BBox.cpp,
physics/BBox.h, physics/Collision.cpp, physics/Collision.h,
physics/Quaternion.cpp, physics/Quaternion.h, physics/Vector3D.cpp,
physics/Vector3D.h, physics/VectorPol.h, rulesets/Area.cpp,
rulesets/Area.h, rulesets/AreaProperty.cpp, rulesets/AreaProperty.h,
rulesets/ArithmeticScript.cpp, rulesets/ArithmeticScript.h,
rulesets/BaseMind.cpp, rulesets/BaseMind.h,
rulesets/CalendarProperty.cpp, rulesets/CalendarProperty.h,
rulesets/Character.cpp, rulesets/Character.h, rulesets/Combat.cpp,
rulesets/Combat.h, rulesets/Container.cpp, rulesets/Container.h,
rulesets/Creator.cpp, rulesets/Creator.h, rulesets/Entity.cpp,
rulesets/Entity.h, rulesets/EntityProperties.cpp,
rulesets/Entity_getLocation.h, rulesets/Fell.cpp, rulesets/Fell.h,
rulesets/Food.cpp, rulesets/Food.h, rulesets/Line.cpp,
rulesets/Line.h, rulesets/LineProperty.cpp, rulesets/LineProperty.h,
rulesets/MemEntity.cpp, rulesets/MemEntity.h, rulesets/MemMap.cpp,
rulesets/MemMap.h, rulesets/MemMap_methods.h,
rulesets/MindFactory.cpp, rulesets/MindFactory.h, rulesets/Missile.h,
rulesets/Motion.cpp, rulesets/Motion.h, rulesets/Movement.cpp,
rulesets/Movement.h, rulesets/Pedestrian.cpp, rulesets/Pedestrian.h,
rulesets/Plant.cpp, rulesets/Plant.h, rulesets/Py_BBox.cpp,
rulesets/Py_BBox.h, rulesets/Py_EntityWrapper.h,
rulesets/Py_Location.cpp, rulesets/Py_Location.h,
rulesets/Py_Map.cpp, rulesets/Py_Map.h, rulesets/Py_Mind.cpp,
rulesets/Py_Mind.h, rulesets/Py_Object.cpp, rulesets/Py_Object.h,
rulesets/Py_Operation.cpp, rulesets/Py_Operation.h,
rulesets/Py_Oplist.cpp, rulesets/Py_Oplist.h, rulesets/Py_Optime.cpp,
rulesets/Py_Optime.h, rulesets/Py_Point3D.cpp, rulesets/Py_Point3D.h,
rulesets/Py_Property.cpp, rulesets/Py_Property.h,
rulesets/Py_Quaternion.cpp, rulesets/Py_Quaternion.h,
rulesets/Py_RootEntity.cpp, rulesets/Py_RootEntity.h,
rulesets/Py_Statistics.cpp, rulesets/Py_Statistics.h,
rulesets/Py_Task.cpp, rulesets/Py_Task.h, rulesets/Py_Thing.cpp,
rulesets/Py_Thing.h, rulesets/Py_Vector3D.cpp,
rulesets/Py_Vector3D.h, rulesets/Py_World.cpp, rulesets/Py_World.h,
rulesets/Py_WorldTime.cpp, rulesets/Py_WorldTime.h,
rulesets/PythonArithmeticScript.cpp,
rulesets/PythonArithmeticScript.h, rulesets/PythonMindScript.cpp,
rulesets/PythonMindScript.h, rulesets/PythonScript.cpp,
rulesets/PythonScript.h, rulesets/PythonThingScript.cpp,
rulesets/PythonThingScript.h, rulesets/PythonWrapper.cpp,
rulesets/PythonWrapper.h, rulesets/Python_API.cpp,
rulesets/Python_API.h, rulesets/Python_Script_Utils.h,
rulesets/Script.cpp, rulesets/Script.h, rulesets/Stackable.cpp,
rulesets/Stackable.h, rulesets/Statistics.cpp, rulesets/Statistics.h,
rulesets/StatisticsProperty.cpp, rulesets/StatisticsProperty.h,
rulesets/Structure.cpp, rulesets/Structure.h, rulesets/Task.cpp,
rulesets/Task.h, rulesets/TaskScript.cpp, rulesets/TaskScript.h,
rulesets/TerrainProperty.cpp, rulesets/TerrainProperty.h,
rulesets/Thing.cpp, rulesets/Thing.h, rulesets/ThingFactory.cpp,
rulesets/ThingFactory.h, rulesets/World.cpp, rulesets/World.h,
rulesets/attributes.h, server/Account.cpp, server/Account.h,
server/Admin.cpp, server/Admin.h, server/ArithmeticFactory.cpp,
server/ArithmeticFactory.h, server/CommClient.cpp,
server/CommClient.h, server/CommIdleSocket.cpp,
server/CommIdleSocket.h, server/CommListener.cpp,
server/CommListener.h, server/CommLocalClient.cpp,
server/CommLocalClient.h, server/CommMDNSPublisher.cpp,
server/CommMDNSPublisher.h, server/CommMaster.cpp,
server/CommMaster.h, server/CommMetaClient.cpp,
server/CommMetaClient.h, server/CommPSQLSocket.cpp,
server/CommPSQLSocket.h, server/CommPeer.cpp,
server/CommPeer.h, server/CommPeerListener.cpp,
server/CommPeerListener.h, server/CommRemoteClient.cpp,
server/CommRemoteClient.h, server/CommServer.cpp,
server/CommServer.h, server/CommSlaveClient.cpp,
server/CommSlaveClient.h, server/CommSlaveListener.cpp,
server/CommSlaveListener.h, server/CommSocket.cpp,
server/CommSocket.h, server/CommUnixListener.cpp,
server/CommUnixListener.h, server/Connection.cpp,
server/Connection.h, server/Connection_methods.h,
server/EntityFactory.cpp, server/EntityFactory.h,
server/ExternalMind.cpp, server/ExternalMind.h,
server/Idle.cpp, server/Idle.h, server/Lobby.cpp, server/Lobby.h,
server/Master.cpp, server/Master.h, server/Peer.cpp, server/Peer.h,
server/Persistance.cpp, server/Persistance.h,
server/PersistantThingFactory.cpp, server/PersistantThingFactory.h,
server/PersistantThingFactory_impl.h, server/Persistor.cpp,
server/Persistor.h, server/Persistor_impl.h,
server/Player.cpp, server/Player.h, server/Restoration.cpp,
server/Restoration.h, server/Restorer.cpp, server/Restorer.h,
server/Restorer_impl.h, server/ScriptFactory.cpp,
server/ScriptFactory.h, server/ServerRouting.cpp,
server/ServerRouting.h, server/ServerRouting_methods.h,
server/SlaveClientConnection.cpp, server/SlaveClientConnection.h,
server/TaskFactory.cpp, server/TaskFactory.h,
server/TrustedConnection.cpp, server/TrustedConnection.h,
server/WorldRouter.cpp, server/WorldRouter.h,
server/server.cpp, server/server.h, server/slave.cpp,
tests/Areatest.cpp, tests/BaseEntitytest.cpp,
tests/Charactertest.cpp, tests/Containertest.cpp,
tests/Creatortest.cpp, tests/EntityExerciser.h,
tests/EntityFactorytest.cpp, tests/Entitytest.cpp,
tests/Foodtest.cpp, tests/IGEntityExerciser.h,
tests/Linetest.cpp, tests/Locationtest.cpp, tests/OOGThingtest.cpp,
tests/Planttest.cpp, tests/Propertytest.cpp, tests/Stackabletest.cpp,
tests/Structuretest.cpp, tests/Tasktest.cpp, tests/TestWorld.h,
tests/Thingtest.cpp, tests/WorldTimetest.cpp, tests/Worldtest.cpp,
tests/allOperations.h, tests/collisiontest.cpp, tests/consttest.cpp,
tests/distancetest.cpp, tests/emergencetest.cpp,
tests/inheritancetest.cpp, tests/logtest.cpp, tests/randomtest.cpp,
tests/systemtest.cpp, tests/transformtest.cpp,
tests/type_utilstest.cpp, tests/utilitytest.cpp,
tools/AdminClient.cpp, tools/AdminClient.h, tools/cyaddrules.cpp,
tools/cycmd.cpp, tools/cyconfig.cpp, tools/cyconvertrules.cpp,
tools/cyctrl.cpp, tools/cydbload.cpp, tools/cydumprules.cpp,
tools/cyisoload.cpp, tools/cyloadrules.cpp, tools/cypasswd.cpp,
tools/cywatchdog.cpp: Replace the copyright and license statements
with new versions that include disclaimer of warranty, and
permit distribution under later versions of the GPL.
2006-01-19 02:17:06 +00:00
|
|
|
//
|
|
|
|
|
// 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
|
2001-01-26 16:38:23 +00:00
|
|
|
|
2007-06-19 13:19:57 +00:00
|
|
|
// $Id: server.cpp,v 1.145 2007-06-19 13:19:58 alriddoch Exp $
|
2006-10-26 00:48:00 +00:00
|
|
|
|
2004-11-11 14:26:21 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
|
#include "config.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
2001-06-04 15:24:13 +00:00
|
|
|
#include "CommServer.h"
|
2002-12-19 20:04:37 +00:00
|
|
|
#include "CommListener.h"
|
2004-12-15 00:55:54 +00:00
|
|
|
#include "CommPeerListener.h"
|
2003-03-16 Al Riddoch <alriddoch@zepler.org>
* common/globals.cpp, common/globals.h: Add global variable for
the local state directory.
* server/Account.cpp, server/Admin.cpp, server/Admin.h,
server/Player.cpp: Tighten up some operation checking and add Create
handler to Admin in preparation for handling creation of new OOG
things.
* server/CommLocalClient.cpp, server/CommLocalClient.h,
server/CommRemoteClient.cpp, server/CommRemoteClient.h,
server/CommUnixListener.cpp, server/CommUnixListener.h,
server/CommClient.cpp, server/CommClient.h,
server/CommListener.cpp, server/Connection.cpp,
server/Connection.h, server/server.cpp:
Create new listener and connection classes using unix sockets
to allow local trusted connections.
* client/ClientConnection.cpp, client/ClientConnection.h,
client/CommClient.h, client/CreatorClient.cpp,
client/ObserverClient.cpp: Add capability to connect over
unix socket.
2003-03-16 21:26:06 +00:00
|
|
|
#include "CommUnixListener.h"
|
2003-10-27 01:59:53 +00:00
|
|
|
#include "CommPSQLSocket.h"
|
2002-12-19 20:04:37 +00:00
|
|
|
#include "CommMetaClient.h"
|
2004-11-11 14:26:21 +00:00
|
|
|
#include "CommMDNSPublisher.h"
|
2002-07-14 21:04:50 +00:00
|
|
|
#include "ServerRouting.h"
|
|
|
|
|
#include "EntityFactory.h"
|
|
|
|
|
#include "Persistance.h"
|
2002-12-19 21:49:58 +00:00
|
|
|
#include "Restoration.h"
|
2003-03-07 00:22:12 +00:00
|
|
|
#include "WorldRouter.h"
|
2005-01-13 00:38:41 +00:00
|
|
|
#include "Admin.h"
|
2002-07-14 21:04:50 +00:00
|
|
|
|
2003-03-07 00:22:12 +00:00
|
|
|
#include "rulesets/Python_API.h"
|
|
|
|
|
#include "rulesets/MindFactory.h"
|
2006-08-03 11:18:28 +00:00
|
|
|
#include "rulesets/Entity.h"
|
2002-07-14 21:04:50 +00:00
|
|
|
|
2005-01-13 00:38:41 +00:00
|
|
|
#include "common/id.h"
|
2003-03-07 00:22:12 +00:00
|
|
|
#include "common/log.h"
|
2005-01-13 00:38:41 +00:00
|
|
|
#include "common/const.h"
|
2003-03-07 00:22:12 +00:00
|
|
|
#include "common/debug.h"
|
|
|
|
|
#include "common/globals.h"
|
|
|
|
|
#include "common/inheritance.h"
|
2005-11-11 Al Riddoch <alriddoch@zepler.org>
* common/BaseEntity.h, common/OOGThing.cpp, common/OOGThing.h,
server/Account.cpp, server/Account.h, server/Admin.cpp,
server/Admin.h, server/Connection.cpp, server/ExternalMind.cpp,
server/ExternalMind.h, server/Lobby.cpp, server/Lobby.h,
server/Peer.cpp, server/Persistance.cpp, server/Player.cpp,
server/Player.h, server/ServerRouting.cpp,
server/SlaveClientConnection.cpp, server/server.cpp:
Add integer ID handling to accounts, and some other OOG
objects.
2005-11-11 16:03:14 +00:00
|
|
|
#include "common/compose.hpp"
|
2003-03-07 00:22:12 +00:00
|
|
|
#include "common/system.h"
|
2004-01-10 02:19:23 +00:00
|
|
|
#include "common/nls.h"
|
2002-07-14 21:04:50 +00:00
|
|
|
|
2006-01-04 15:06:46 +00:00
|
|
|
#include <varconf/config.h>
|
2000-08-13 20:36:18 +00:00
|
|
|
|
2004-11-16 12:27:27 +00:00
|
|
|
#include <sstream>
|
|
|
|
|
|
2001-02-04 07:08:07 +00:00
|
|
|
static const bool debug_flag = false;
|
2000-08-13 20:36:18 +00:00
|
|
|
|
2000-12-03 14:23:26 +00:00
|
|
|
int main(int argc, char ** argv)
|
|
|
|
|
{
|
2006-03-25 10:55:53 +00:00
|
|
|
if (security_check() != SECURITY_OKAY) {
|
|
|
|
|
log(CRITICAL, "Security Error. Exiting.");
|
|
|
|
|
return EXIT_SECURITY_ERROR;
|
|
|
|
|
}
|
|
|
|
|
|
2001-10-06 16:52:02 +00:00
|
|
|
interactive_signals();
|
2001-04-10 19:05:14 +00:00
|
|
|
|
2007-04-28 15:21:17 +00:00
|
|
|
int config_status = loadConfig(argc, argv, true);
|
|
|
|
|
if (config_status < 0) {
|
|
|
|
|
if (config_status == CONFIG_VERSION) {
|
|
|
|
|
std::cout << argv[0] << " (cyphesis) " << consts::version
|
|
|
|
|
<< " (WorldForge build " << consts::buildId << ")"
|
|
|
|
|
<< std::endl << std::flush;
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
} else if (config_status == CONFIG_HELP) {
|
2007-04-28 16:45:13 +00:00
|
|
|
showUsage(argv[0], USAGE_SERVER);
|
2007-04-28 15:21:17 +00:00
|
|
|
return 0;
|
|
|
|
|
} else if (config_status != CONFIG_ERROR) {
|
|
|
|
|
log(ERROR, "Unknown error reading configuration.");
|
|
|
|
|
}
|
2002-01-13 Al Riddoch <alriddoch@zepler.org>
* client/client.cpp, server/server.cpp, common/globals.cpp,
common/globals.h, tools/cycmd.cpp, tools/cydbload.cpp,
tools/cypasswd.cpp: Move code for handling loading of config
from the command line, user config and global config, into
globals.cpp, and make use of it in all tools.
* tools/cycmd.cpp: Fix objtype on server set commands.
* common/Database.cpp, common/Database.h: Implemented new database
interface to PostgreSQL to replace inadequate db3 code.
* common/database.cpp, common/database.h: Old code removed from the
build.
* common/accountbase.h, server/Admin.cpp, server/Persistance.cpp,
server/server.cpp, tools/cydbload.cpp: Fixed for minor changes
in the low level database API.
* common/globals.h, common/globals.cpp, rulesets/EntityFactory.cpp,
server/Admin.cpp, server/CommServer.cpp,
Remove varconf header from globals.h, and put in .cpp files
where it belongs.
2002-01-13 17:24:53 +00:00
|
|
|
// Fatal error loading config file
|
2002-10-03 10:51:59 +00:00
|
|
|
return EXIT_CONFIG_ERROR;
|
2001-07-12 16:10:41 +00:00
|
|
|
}
|
2001-11-24 13:23:17 +00:00
|
|
|
|
2001-10-07 01:08:25 +00:00
|
|
|
if (daemon_flag) {
|
|
|
|
|
int pid = daemonise();
|
|
|
|
|
if (pid == -1) {
|
2002-12-19 20:04:37 +00:00
|
|
|
return EXIT_FORK_ERROR;
|
2001-10-07 01:08:25 +00:00
|
|
|
} else if (pid > 0) {
|
2002-10-03 10:51:59 +00:00
|
|
|
return EXIT_SUCCESS;
|
2001-10-07 01:08:25 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2007-02-20 00:52:41 +00:00
|
|
|
if (global_conf->findItem("cyphesis", "usedatabase")) {
|
|
|
|
|
database_flag = global_conf->getItem("cyphesis","usedatabase");
|
|
|
|
|
}
|
|
|
|
|
|
2002-01-02 Al Riddoch <alriddoch@zepler.org>
* common/Database.h: Declaration for register relations.
* server/Account.cpp, server/Account.h, server/Admin.cpp,
server/Admin.h, server/Connection.cpp, server/Player.cpp,
server/Player.h, server/ServerRouting.cpp,
server/ServerRouting.h: Properlly separate username and id from
account, and use the database code to assign numerical ids to
account objects. Eliminate extraneous member variables in account.
* server/CommClient.cpp, server/CommServer.cpp,
server/CommServer.h, server/server.cpp:
Eliminate storing server name string twice.
2003-01-02 08:52:56 +00:00
|
|
|
// If we are a daemon logging to syslog, we need to set it up.
|
2002-07-14 21:04:50 +00:00
|
|
|
initLogger();
|
|
|
|
|
|
2001-10-07 01:08:25 +00:00
|
|
|
// Initialise the persistance subsystem. If we have been built with
|
|
|
|
|
// database support, this will open the various databases used to
|
|
|
|
|
// store server data.
|
2007-02-20 00:52:41 +00:00
|
|
|
if (database_flag) {
|
2005-01-13 00:38:41 +00:00
|
|
|
int dbstatus = Persistance::init();
|
|
|
|
|
if (dbstatus < 0) {
|
2007-02-20 01:12:48 +00:00
|
|
|
database_flag = false;
|
2007-02-20 14:56:31 +00:00
|
|
|
log(ERROR, "Error opening database. Database disabled.");
|
2005-01-13 00:38:41 +00:00
|
|
|
if (dbstatus == -2) {
|
|
|
|
|
log(INFO, "Database connection established, but unable to create required tables.");
|
|
|
|
|
log(INFO, "Please ensure that any obsolete database tables have been removed.");
|
|
|
|
|
} else {
|
|
|
|
|
log(INFO, "Unable to connect to the RDBMS.");
|
|
|
|
|
log(INFO, "Please ensure that the RDBMS is running, the cyphesis database exists and is accessible to the user running cyphesis.");
|
|
|
|
|
}
|
2007-02-20 14:56:31 +00:00
|
|
|
log(INFO, "To disable this message please run:\n\n cyconfig --cyphesis:usedatabase=false\n\nto permanently disable database usage.");
|
2004-10-04 00:52:32 +00:00
|
|
|
}
|
2001-10-07 01:08:25 +00:00
|
|
|
|
2005-01-13 00:38:41 +00:00
|
|
|
// If the restricted flag is set in the config file, then we
|
|
|
|
|
// don't allow connecting users to create accounts. Accounts must
|
|
|
|
|
// be created manually by the server administrator.
|
|
|
|
|
if (global_conf->findItem("cyphesis", "restricted")) {
|
|
|
|
|
restricted_flag = global_conf->getItem("cyphesis","restricted");
|
|
|
|
|
if (restricted_flag) {
|
|
|
|
|
log(INFO, "Setting restricted mode.");
|
|
|
|
|
}
|
2001-03-15 11:41:34 +00:00
|
|
|
}
|
|
|
|
|
}
|
2000-12-13 12:10:48 +00:00
|
|
|
|
2001-05-30 14:49:38 +00:00
|
|
|
if (global_conf->findItem("cyphesis", "inittime")) {
|
|
|
|
|
timeoffset = global_conf->getItem("cyphesis","inittime");
|
|
|
|
|
}
|
* tools/cydbload.cpp: Added parameter handling so any file can
be loaded into the database.
* tools/cycmd.cpp: Cleaned up usage and help functions.
* tools/cyisoload.cpp: Cleaned up usage(), and made sure build
completes okay if libraries are missing, and missing
functionality is reported to the user.
* server/server.cpp: Added config options that specifies that
the contents of the db should loaded on server startup. Cleaned
up some debug code.
* server/WorldTime.cpp, server/WorldRouter.cpp,
server/Connection.cpp, rulesets/Structure.h,
rulesets/Python_API.cpp, rulesets/Py_WorldTime.cpp,
rulesets/Movement.cpp, rulesets/Entity.cpp,
physics/Vector3D.h, common/persistance.cpp,
common/database.h, common/database.cpp: Removed output either
to debug mode, or removed altogether.
* common/BaseEntity.h, common/BaseEntity.cpp: Removed redundant header
includes.
* server/ServerRouting.cpp, common/persistance.h,
common/persistance.cpp: Modified admin account function names it
fit convention.
* module/Location.h: Fixed collision detection so that entities
with velocity set to 0 still get checked.
* rulesets/Entity.cpp, rulesets/Thing.cpp, rulesets/Character.cpp,
rulesets/BaseMind.cpp, rulesets/Creator.cpp,
rulesets/ExternalMind.cpp, rulesets/Food.cpp, rulesets/MemMap.cpp,
rulesets/Movement.cpp, rulesets/Pedestrian.cpp, rulesets/Plant.cpp,
rulesets/Py_Location.cpp, rulesets/Py_*.cpp, rulesets/World.cpp:
Removed unnecessary #includes.
Al Riddoch <alriddoch@zepler.org>
2001-06-04 11:22:27 +00:00
|
|
|
|
2002-12-19 20:04:37 +00:00
|
|
|
bool useMetaserver = false;
|
|
|
|
|
if (global_conf->findItem("cyphesis", "usemetaserver")) {
|
|
|
|
|
useMetaserver = global_conf->getItem("cyphesis","usemetaserver");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string mserver("metaserver.worldforge.org");
|
|
|
|
|
if (global_conf->findItem("cyphesis", "metaserver")) {
|
2004-10-05 15:34:18 +00:00
|
|
|
mserver = global_conf->getItem("cyphesis", "metaserver").as_string();
|
2002-12-19 20:04:37 +00:00
|
|
|
}
|
|
|
|
|
|
2005-11-13 Al Riddoch <alriddoch@zepler.org>
* server/Admin.cpp, server/CommPeer.cpp, server/CommPeer.h,
server/CommPeerListener.cpp, server/Peer.cpp, server/Peer.h:
Re-work classes for peer connections to use integer IDs.
* server/Lobby.cpp, server/Lobby.h: Modify interface so its more
obvious that lobby only handles accounts, and adjust to have
integer ID.
* server/Connection.cpp, server/Connection.h,
server/TrustedConnection.cpp, server/TrustedConnection.h: Use
integer IDs, and modify to match new Lobby API changes.
* server/ServerRouting.cpp, server/ServerRouting.h, server/server.cpp:
Modify server to have integer ID, and handle ID for Lobby as well.
* server/CommListener.cpp, server/CommLocalClient.cpp,
server/CommLocalClient.h, server/CommRemoteClient.cpp,
server/CommRemoteClient.h, server/CommUnixListener.cpp:
Modify communication classes for normal clients to handle
integer IDs on the connection classes.
2005-11-13 23:28:02 +00:00
|
|
|
std::string server_name;
|
* server/server.cpp, server/ServerRouting.h, server/ServerRouting.cpp,
server/CommServer.h: Added support for server "name" which
defaults to the hostname of the server machine, but is
customisable in the config. This can be used in preference to
IP address when doing lookups with the metaserver.
* server/Lobby.h, server/ServerRouting.h, server/Account.h,
server/Account.cpp, rulesets/Stackable.h, rulesets/Stackable.cpp,
rulesets/Python_API.cpp, rulesets/Py_Object.cpp, rulesets/Plant.cpp,
rulesets/Pedestrian.cpp, rulesets/Entity.h, rulesets/Entity.cpp,
rulesets/Character.h, rulesets/Character.cpp, common/BaseEntity.h,
common/BaseEntity.cpp: Modied asObect() and addToObject()
methods to make them more efficient.
* modules/Location.h, modules/Location.cpp: Removed old obsolete
Message::Object based addToObject() method.
* rulesets/Thing.cpp: Optimised apperance/disappearance code.
Al Riddoch <alriddoch@zepler.org>
2001-07-16 17:52:23 +00:00
|
|
|
if (global_conf->findItem("cyphesis", "servername")) {
|
2005-11-13 Al Riddoch <alriddoch@zepler.org>
* server/Admin.cpp, server/CommPeer.cpp, server/CommPeer.h,
server/CommPeerListener.cpp, server/Peer.cpp, server/Peer.h:
Re-work classes for peer connections to use integer IDs.
* server/Lobby.cpp, server/Lobby.h: Modify interface so its more
obvious that lobby only handles accounts, and adjust to have
integer ID.
* server/Connection.cpp, server/Connection.h,
server/TrustedConnection.cpp, server/TrustedConnection.h: Use
integer IDs, and modify to match new Lobby API changes.
* server/ServerRouting.cpp, server/ServerRouting.h, server/server.cpp:
Modify server to have integer ID, and handle ID for Lobby as well.
* server/CommListener.cpp, server/CommLocalClient.cpp,
server/CommLocalClient.h, server/CommRemoteClient.cpp,
server/CommRemoteClient.h, server/CommUnixListener.cpp:
Modify communication classes for normal clients to handle
integer IDs on the connection classes.
2005-11-13 23:28:02 +00:00
|
|
|
server_name = global_conf->getItem("cyphesis","servername").as_string();
|
* server/server.cpp, server/ServerRouting.h, server/ServerRouting.cpp,
server/CommServer.h: Added support for server "name" which
defaults to the hostname of the server machine, but is
customisable in the config. This can be used in preference to
IP address when doing lookups with the metaserver.
* server/Lobby.h, server/ServerRouting.h, server/Account.h,
server/Account.cpp, rulesets/Stackable.h, rulesets/Stackable.cpp,
rulesets/Python_API.cpp, rulesets/Py_Object.cpp, rulesets/Plant.cpp,
rulesets/Pedestrian.cpp, rulesets/Entity.h, rulesets/Entity.cpp,
rulesets/Character.h, rulesets/Character.cpp, common/BaseEntity.h,
common/BaseEntity.cpp: Modied asObect() and addToObject()
methods to make them more efficient.
* modules/Location.h, modules/Location.cpp: Removed old obsolete
Message::Object based addToObject() method.
* rulesets/Thing.cpp: Optimised apperance/disappearance code.
Al Riddoch <alriddoch@zepler.org>
2001-07-16 17:52:23 +00:00
|
|
|
} else {
|
2005-11-13 Al Riddoch <alriddoch@zepler.org>
* server/Admin.cpp, server/CommPeer.cpp, server/CommPeer.h,
server/CommPeerListener.cpp, server/Peer.cpp, server/Peer.h:
Re-work classes for peer connections to use integer IDs.
* server/Lobby.cpp, server/Lobby.h: Modify interface so its more
obvious that lobby only handles accounts, and adjust to have
integer ID.
* server/Connection.cpp, server/Connection.h,
server/TrustedConnection.cpp, server/TrustedConnection.h: Use
integer IDs, and modify to match new Lobby API changes.
* server/ServerRouting.cpp, server/ServerRouting.h, server/server.cpp:
Modify server to have integer ID, and handle ID for Lobby as well.
* server/CommListener.cpp, server/CommLocalClient.cpp,
server/CommLocalClient.h, server/CommRemoteClient.cpp,
server/CommRemoteClient.h, server/CommUnixListener.cpp:
Modify communication classes for normal clients to handle
integer IDs on the connection classes.
2005-11-13 23:28:02 +00:00
|
|
|
server_name = get_hostname();
|
* server/server.cpp, server/ServerRouting.h, server/ServerRouting.cpp,
server/CommServer.h: Added support for server "name" which
defaults to the hostname of the server machine, but is
customisable in the config. This can be used in preference to
IP address when doing lookups with the metaserver.
* server/Lobby.h, server/ServerRouting.h, server/Account.h,
server/Account.cpp, rulesets/Stackable.h, rulesets/Stackable.cpp,
rulesets/Python_API.cpp, rulesets/Py_Object.cpp, rulesets/Plant.cpp,
rulesets/Pedestrian.cpp, rulesets/Entity.h, rulesets/Entity.cpp,
rulesets/Character.h, rulesets/Character.cpp, common/BaseEntity.h,
common/BaseEntity.cpp: Modied asObect() and addToObject()
methods to make them more efficient.
* modules/Location.h, modules/Location.cpp: Removed old obsolete
Message::Object based addToObject() method.
* rulesets/Thing.cpp: Optimised apperance/disappearance code.
Al Riddoch <alriddoch@zepler.org>
2001-07-16 17:52:23 +00:00
|
|
|
}
|
2006-05-11 23:33:58 +00:00
|
|
|
|
|
|
|
|
int nice=0;
|
|
|
|
|
if (global_conf->findItem("cyphesis", "nice")) {
|
|
|
|
|
nice = global_conf->getItem("cyphesis", "nice");
|
|
|
|
|
}
|
* server/server.cpp, server/ServerRouting.h, server/ServerRouting.cpp,
server/CommServer.h: Added support for server "name" which
defaults to the hostname of the server machine, but is
customisable in the config. This can be used in preference to
IP address when doing lookups with the metaserver.
* server/Lobby.h, server/ServerRouting.h, server/Account.h,
server/Account.cpp, rulesets/Stackable.h, rulesets/Stackable.cpp,
rulesets/Python_API.cpp, rulesets/Py_Object.cpp, rulesets/Plant.cpp,
rulesets/Pedestrian.cpp, rulesets/Entity.h, rulesets/Entity.cpp,
rulesets/Character.h, rulesets/Character.cpp, common/BaseEntity.h,
common/BaseEntity.cpp: Modied asObect() and addToObject()
methods to make them more efficient.
* modules/Location.h, modules/Location.cpp: Removed old obsolete
Message::Object based addToObject() method.
* rulesets/Thing.cpp: Optimised apperance/disappearance code.
Al Riddoch <alriddoch@zepler.org>
2001-07-16 17:52:23 +00:00
|
|
|
|
2002-03-12 18:08:56 +00:00
|
|
|
// Start up the python subsystem.
|
2000-12-13 12:10:48 +00:00
|
|
|
init_python_api();
|
2000-08-13 20:36:18 +00:00
|
|
|
|
2001-10-10 09:40:24 +00:00
|
|
|
{ // scope for CommServer
|
|
|
|
|
|
2001-05-14 17:25:32 +00:00
|
|
|
// Create commserver instance that will handle connections from clients.
|
|
|
|
|
// The commserver will create the other server related objects, and the
|
|
|
|
|
// world object pair (World + WorldRouter), and initialise the admin
|
|
|
|
|
// account. The primary ruleset name is passed in so it
|
|
|
|
|
// can be stored and queried by clients.
|
2005-09-26 Al Riddoch <alriddoch@zepler.org>
* common/BaseEntity.cpp, common/BaseEntity.h, common/inheritance.cpp,
common/inheritance.h, rulesets/BaseMind.cpp, rulesets/BaseMind.h,
rulesets/Character.cpp, rulesets/Character.h, rulesets/Entity.cpp,
rulesets/Food.cpp, rulesets/Plant.cpp, rulesets/Stackable.cpp,
rulesets/Thing.cpp, rulesets/World.cpp, server/Account.cpp,
server/Admin.cpp, server/Connection.cpp, server/server.cpp:
Remove the subscription mechanism as it is no longer necessary
now that operations have class numbers.
2005-09-26 01:56:21 +00:00
|
|
|
Inheritance::instance();
|
|
|
|
|
|
2003-03-07 00:22:12 +00:00
|
|
|
WorldRouter world;
|
|
|
|
|
|
2005-11-13 Al Riddoch <alriddoch@zepler.org>
* server/Admin.cpp, server/CommPeer.cpp, server/CommPeer.h,
server/CommPeerListener.cpp, server/Peer.cpp, server/Peer.h:
Re-work classes for peer connections to use integer IDs.
* server/Lobby.cpp, server/Lobby.h: Modify interface so its more
obvious that lobby only handles accounts, and adjust to have
integer ID.
* server/Connection.cpp, server/Connection.h,
server/TrustedConnection.cpp, server/TrustedConnection.h: Use
integer IDs, and modify to match new Lobby API changes.
* server/ServerRouting.cpp, server/ServerRouting.h, server/server.cpp:
Modify server to have integer ID, and handle ID for Lobby as well.
* server/CommListener.cpp, server/CommLocalClient.cpp,
server/CommLocalClient.h, server/CommRemoteClient.cpp,
server/CommRemoteClient.h, server/CommUnixListener.cpp:
Modify communication classes for normal clients to handle
integer IDs on the connection classes.
2005-11-13 23:28:02 +00:00
|
|
|
// This ID is currently generated every time, but should perhaps be
|
|
|
|
|
// persistent in future.
|
|
|
|
|
std::string server_id, lobby_id;
|
2006-05-07 00:10:10 +00:00
|
|
|
long int_id, lobby_int_id;
|
|
|
|
|
|
|
|
|
|
if (((int_id = newId(server_id)) < 0) ||
|
|
|
|
|
((lobby_int_id = newId(lobby_id)) < 0)) {
|
|
|
|
|
log(CRITICAL, "Unable to get server IDs from Database");
|
|
|
|
|
return EXIT_DATABASE_ERROR;
|
|
|
|
|
}
|
2005-11-13 Al Riddoch <alriddoch@zepler.org>
* server/Admin.cpp, server/CommPeer.cpp, server/CommPeer.h,
server/CommPeerListener.cpp, server/Peer.cpp, server/Peer.h:
Re-work classes for peer connections to use integer IDs.
* server/Lobby.cpp, server/Lobby.h: Modify interface so its more
obvious that lobby only handles accounts, and adjust to have
integer ID.
* server/Connection.cpp, server/Connection.h,
server/TrustedConnection.cpp, server/TrustedConnection.h: Use
integer IDs, and modify to match new Lobby API changes.
* server/ServerRouting.cpp, server/ServerRouting.h, server/server.cpp:
Modify server to have integer ID, and handle ID for Lobby as well.
* server/CommListener.cpp, server/CommLocalClient.cpp,
server/CommLocalClient.h, server/CommRemoteClient.cpp,
server/CommRemoteClient.h, server/CommUnixListener.cpp:
Modify communication classes for normal clients to handle
integer IDs on the connection classes.
2005-11-13 23:28:02 +00:00
|
|
|
|
2007-06-19 13:19:57 +00:00
|
|
|
ServerRouting server(world, ruleset, server_name,
|
2005-11-13 Al Riddoch <alriddoch@zepler.org>
* server/Admin.cpp, server/CommPeer.cpp, server/CommPeer.h,
server/CommPeerListener.cpp, server/Peer.cpp, server/Peer.h:
Re-work classes for peer connections to use integer IDs.
* server/Lobby.cpp, server/Lobby.h: Modify interface so its more
obvious that lobby only handles accounts, and adjust to have
integer ID.
* server/Connection.cpp, server/Connection.h,
server/TrustedConnection.cpp, server/TrustedConnection.h: Use
integer IDs, and modify to match new Lobby API changes.
* server/ServerRouting.cpp, server/ServerRouting.h, server/server.cpp:
Modify server to have integer ID, and handle ID for Lobby as well.
* server/CommListener.cpp, server/CommLocalClient.cpp,
server/CommLocalClient.h, server/CommRemoteClient.cpp,
server/CommRemoteClient.h, server/CommUnixListener.cpp:
Modify communication classes for normal clients to handle
integer IDs on the connection classes.
2005-11-13 23:28:02 +00:00
|
|
|
server_id, int_id,
|
|
|
|
|
lobby_id, lobby_int_id);
|
2002-11-23 Al Riddoch <alriddoch@zepler.org>
* Increment to devel version 0.3, and start breaking things.
* server/CommClient.cpp, server/CommClient.h, server/CommServer.cpp,
server/CommServer.h, server/server.cpp, server/CommListener.cpp,
server/CommListener.h, server/CommMetaClient.cpp,
server/CommMetaClient.h, server/CommSocket.cpp, server/CommSocket.h:
Refactor network code so metaserver and listen socket are no longer
special cases, opening up the way for a database connection handler.
2002-11-23 17:13:39 +00:00
|
|
|
|
2002-01-02 Al Riddoch <alriddoch@zepler.org>
* common/Database.h: Declaration for register relations.
* server/Account.cpp, server/Account.h, server/Admin.cpp,
server/Admin.h, server/Connection.cpp, server/Player.cpp,
server/Player.h, server/ServerRouting.cpp,
server/ServerRouting.h: Properlly separate username and id from
account, and use the database code to assign numerical ids to
account objects. Eliminate extraneous member variables in account.
* server/CommClient.cpp, server/CommServer.cpp,
server/CommServer.h, server/server.cpp:
Eliminate storing server name string twice.
2003-01-02 08:52:56 +00:00
|
|
|
CommServer commServer(server);
|
2002-12-19 20:04:37 +00:00
|
|
|
|
|
|
|
|
// This is where we should restore the database, before
|
|
|
|
|
// the listen sockets are open. Unlike earlier code, we are
|
|
|
|
|
// attempting to construct the internal state from the database,
|
|
|
|
|
// not creating a new world using the contents of the database as a
|
|
|
|
|
// template
|
|
|
|
|
|
2007-02-20 00:52:41 +00:00
|
|
|
if (database_flag) {
|
2005-01-13 00:38:41 +00:00
|
|
|
log(INFO, _("Restoring world from database..."));
|
2002-12-23 00:01:59 +00:00
|
|
|
|
2005-01-13 00:38:41 +00:00
|
|
|
Restoration restore(server);
|
|
|
|
|
if (restore.read() == 1) {
|
|
|
|
|
debug(std::cout << "Bootstrapping world" << std::endl << std::flush;);
|
|
|
|
|
EntityFactory::instance()->initWorld();
|
2006-08-03 11:18:28 +00:00
|
|
|
assert(!world.m_gameWorld.m_location.m_pos.isValid());
|
|
|
|
|
assert(!world.m_gameWorld.m_location.m_orientation.isValid());
|
|
|
|
|
} else {
|
|
|
|
|
// The world should not have POS or ORIENTATION, but will have
|
|
|
|
|
// picked one up when restored from the database.
|
|
|
|
|
world.m_gameWorld.m_location.m_pos = Point3D(0,0,0);
|
|
|
|
|
world.m_gameWorld.m_location.m_pos.setValid(false);
|
|
|
|
|
world.m_gameWorld.m_location.m_orientation = Quaternion();
|
|
|
|
|
// world.m_gameWorld.m_location.m_orientation.setValid(false);
|
|
|
|
|
|
2005-01-13 00:38:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
log(INFO, _(" world restored"));
|
2002-12-19 21:49:58 +00:00
|
|
|
|
2005-01-13 00:38:41 +00:00
|
|
|
CommPSQLSocket * dbsocket = new CommPSQLSocket(commServer,
|
|
|
|
|
Persistance::instance()->m_connection);
|
|
|
|
|
commServer.addSocket(dbsocket);
|
|
|
|
|
commServer.addIdle(dbsocket);
|
|
|
|
|
} else {
|
|
|
|
|
std::string adminId;
|
2005-11-12 01:40:37 +00:00
|
|
|
long intId = newId(adminId);
|
2006-05-06 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp, common/newid.cpp, server/server.cpp:
Modify new ID checks so that code still runs when database is
unavailable, and events requiring new IDs fail cleanly.
* server/Connection.cpp: Report a failure to create a player
account if no ID available.
* rulesets/BaseMind.cpp: When processing appearance ops, handle
stamp more efficiently, report an error if ID is missing
from argument.
* server/IdlePSQLConnector.cpp, server/IdlePSQLConnector.h:
Implement re-connecting to the Database if connection is lost.
* rulesets/Character.cpp, rulesets/Entity.cpp, rulesets/Thing.cpp:
Ensure STAMP is present on appearance op args.
* server/CommListener.cpp, server/CommListener.h,
server/CommPeerListener.cpp, server/CommPeerListener.h,
server/CommSlaveListener.cpp, server/CommSlaveListener.h,
server/CommUnixListener.cpp, server/CommUnixListener.h:
Add a return value to method for creating new client socket
objects, and use it to return failure if no ID is available
from the database for a new object.
* rulesets/Py_Point3D.cpp, rulesets/Py_Vector3D.cpp,
rulesets/Python_API.cpp: Add "new" method for class wrappers, and
call the in place constructor from new rather than init. Re-write
internal function for creating new instances so it uses the "new"
method.
* rulesets/Py_Statistics.cpp: Remove some obsolete code inadvertedly
copied from another file. Comment out some unused code to get rid
of a warning.
* server/CommPSQLSocket.cpp: Clear the database connection from
destructor.
* tests/python_class.cpp: A new test for experimenting with new
Python wrappers.
2006-05-06 21:36:57 +00:00
|
|
|
assert(intId >= 0);
|
2005-11-11 Al Riddoch <alriddoch@zepler.org>
* common/BaseEntity.h, common/OOGThing.cpp, common/OOGThing.h,
server/Account.cpp, server/Account.h, server/Admin.cpp,
server/Admin.h, server/Connection.cpp, server/ExternalMind.cpp,
server/ExternalMind.h, server/Lobby.cpp, server/Lobby.h,
server/Peer.cpp, server/Persistance.cpp, server/Player.cpp,
server/Player.h, server/ServerRouting.cpp,
server/SlaveClientConnection.cpp, server/server.cpp:
Add integer ID handling to accounts, and some other OOG
objects.
2005-11-11 16:03:14 +00:00
|
|
|
|
|
|
|
|
Admin * admin = new Admin(0, "admin", "BAD_HASH", adminId, intId);
|
2005-01-13 00:38:41 +00:00
|
|
|
server.addAccount(admin);
|
|
|
|
|
}
|
2002-12-23 00:01:59 +00:00
|
|
|
|
2002-12-19 20:04:37 +00:00
|
|
|
CommListener * listener = new CommListener(commServer);
|
2004-12-13 12:22:35 +00:00
|
|
|
if (listener->setup(client_port_num) != 0) {
|
2004-12-15 00:55:54 +00:00
|
|
|
log(ERROR, "Could not create client listen socket. Init failed.");
|
2002-10-03 10:51:59 +00:00
|
|
|
return EXIT_SOCKET_ERROR;
|
2000-08-13 20:36:18 +00:00
|
|
|
}
|
2004-11-20 22:10:04 +00:00
|
|
|
commServer.addSocket(listener);
|
2002-12-19 20:04:37 +00:00
|
|
|
|
2004-12-15 00:55:54 +00:00
|
|
|
CommPeerListener * peerListener = new CommPeerListener(commServer);
|
|
|
|
|
if (peerListener->setup(peer_port_num) != 0) {
|
|
|
|
|
log(ERROR, "Could not create peer listen socket.");
|
|
|
|
|
delete peerListener;
|
|
|
|
|
} else {
|
|
|
|
|
commServer.addSocket(peerListener);
|
|
|
|
|
}
|
|
|
|
|
|
2006-11-03 18:55:40 +00:00
|
|
|
#ifdef HAVE_SYS_UN_H
|
2004-12-15 00:55:54 +00:00
|
|
|
CommUnixListener * localListener = new CommUnixListener(commServer);
|
2004-12-16 00:52:09 +00:00
|
|
|
if (localListener->setup(client_socket_name) != 0) {
|
2004-06-01 17:06:27 +00:00
|
|
|
std::stringstream str;
|
|
|
|
|
str << "Could not create local listen socket with address \"";
|
2004-12-15 00:55:54 +00:00
|
|
|
str << localListener->getPath() << "\".";
|
2004-06-01 17:06:27 +00:00
|
|
|
log(ERROR, str.str().c_str());
|
2004-12-15 00:55:54 +00:00
|
|
|
delete localListener;
|
2003-03-16 Al Riddoch <alriddoch@zepler.org>
* common/globals.cpp, common/globals.h: Add global variable for
the local state directory.
* server/Account.cpp, server/Admin.cpp, server/Admin.h,
server/Player.cpp: Tighten up some operation checking and add Create
handler to Admin in preparation for handling creation of new OOG
things.
* server/CommLocalClient.cpp, server/CommLocalClient.h,
server/CommRemoteClient.cpp, server/CommRemoteClient.h,
server/CommUnixListener.cpp, server/CommUnixListener.h,
server/CommClient.cpp, server/CommClient.h,
server/CommListener.cpp, server/Connection.cpp,
server/Connection.h, server/server.cpp:
Create new listener and connection classes using unix sockets
to allow local trusted connections.
* client/ClientConnection.cpp, client/ClientConnection.h,
client/CommClient.h, client/CreatorClient.cpp,
client/ObserverClient.cpp: Add capability to connect over
unix socket.
2003-03-16 21:26:06 +00:00
|
|
|
} else {
|
2004-12-15 00:55:54 +00:00
|
|
|
commServer.addSocket(localListener);
|
2003-03-16 Al Riddoch <alriddoch@zepler.org>
* common/globals.cpp, common/globals.h: Add global variable for
the local state directory.
* server/Account.cpp, server/Admin.cpp, server/Admin.h,
server/Player.cpp: Tighten up some operation checking and add Create
handler to Admin in preparation for handling creation of new OOG
things.
* server/CommLocalClient.cpp, server/CommLocalClient.h,
server/CommRemoteClient.cpp, server/CommRemoteClient.h,
server/CommUnixListener.cpp, server/CommUnixListener.h,
server/CommClient.cpp, server/CommClient.h,
server/CommListener.cpp, server/Connection.cpp,
server/Connection.h, server/server.cpp:
Create new listener and connection classes using unix sockets
to allow local trusted connections.
* client/ClientConnection.cpp, client/ClientConnection.h,
client/CommClient.h, client/CreatorClient.cpp,
client/ObserverClient.cpp: Add capability to connect over
unix socket.
2003-03-16 21:26:06 +00:00
|
|
|
}
|
2006-11-03 18:55:40 +00:00
|
|
|
#endif
|
2003-03-16 Al Riddoch <alriddoch@zepler.org>
* common/globals.cpp, common/globals.h: Add global variable for
the local state directory.
* server/Account.cpp, server/Admin.cpp, server/Admin.h,
server/Player.cpp: Tighten up some operation checking and add Create
handler to Admin in preparation for handling creation of new OOG
things.
* server/CommLocalClient.cpp, server/CommLocalClient.h,
server/CommRemoteClient.cpp, server/CommRemoteClient.h,
server/CommUnixListener.cpp, server/CommUnixListener.h,
server/CommClient.cpp, server/CommClient.h,
server/CommListener.cpp, server/Connection.cpp,
server/Connection.h, server/server.cpp:
Create new listener and connection classes using unix sockets
to allow local trusted connections.
* client/ClientConnection.cpp, client/ClientConnection.h,
client/CommClient.h, client/CreatorClient.cpp,
client/ObserverClient.cpp: Add capability to connect over
unix socket.
2003-03-16 21:26:06 +00:00
|
|
|
|
2002-12-19 20:04:37 +00:00
|
|
|
if (useMetaserver) {
|
2002-12-28 Al Riddoch <alriddoch@zepler.org>
* common/BaseEntity.cpp, common/BaseEntity.h, rulesets/Character.cpp,
rulesets/Food.cpp, rulesets/Thing.cpp, rulesets/World.cpp:
Add arg to error method specifying where the error should go. Use
this arg to ensure that errors don't get broadcast.
* common/Database.cpp, common/Database.h, common/const.cpp,
server/Persistor.cpp, server/Restoration.cpp,
server/WorldRouter.cpp
Change id and loc column in entity tables to integer for
performance. Add id generator sequence to database
* common/Database.cpp, common/Database.h, server/Persistance.cpp,
server/Persistance.h: Remove old legacy world, mind and server
tables as they are no longer used.
* common/BaseEntity.cpp, common/Load.h, common/Save.h,
common/custom.cpp, common/op_switch.h, common/operations.cpp,
common/operations.h, common/types.h, rulesets/BaseMind.cpp,
rulesets/BaseMind.h, rulesets/Character.cpp, rulesets/Character.h,
server/Admin.cpp, server/Admin.h, server/server.cpp,
tools/cycmd.cpp: Remove Load and Save ops.
* rulesets/Area.cpp, rulesets/Character.cpp, rulesets/Line.cpp,
rulesets/Plant.cpp: Fix != to |= when setting update flags.
* server/CommMetaClient.cpp, server/CommMetaClient.h,
server/CommServer.cpp, server/CommServer.h, server/server.cpp:
Add mechanism for sockets to be called whenever the server
is idle, so that they do period things. Use this mechanis,
to handle sending periodic packets to the metaserver, removing
special case code from CommServer.
2002-12-28 21:52:32 +00:00
|
|
|
CommMetaClient * cmc = new CommMetaClient(commServer);
|
2004-10-02 Al Riddoch <alriddoch@zepler.org>
* client/BaseClient.cpp, client/BaseClient.h,,
client/CharacterClient.cpp, client/CharacterClient.h,
client/ClientConnection.cpp, client/ClientConnection.h,
client/CreatorClient.cpp, client/CreatorClient.h,
client/ObserverClient.cpp, client/ObserverClient.h,
client/Py_CreatorClient.cpp, client/Py_CreatorClient.h,
client/client.cpp, server/CommListener.cpp,
server/CommListener.h, server/CommMetaClient.cpp,
server/CommMetaClient.h, server/CommUnixListener.cpp,
server/CommUnixListener.h, server/server.cpp, tools/cycmd.cpp:
Use int for returning error status.
2004-10-03 00:38:55 +00:00
|
|
|
if (cmc->setup(mserver) == 0) {
|
2004-11-20 22:10:04 +00:00
|
|
|
commServer.addSocket(cmc);
|
2002-12-28 Al Riddoch <alriddoch@zepler.org>
* common/BaseEntity.cpp, common/BaseEntity.h, rulesets/Character.cpp,
rulesets/Food.cpp, rulesets/Thing.cpp, rulesets/World.cpp:
Add arg to error method specifying where the error should go. Use
this arg to ensure that errors don't get broadcast.
* common/Database.cpp, common/Database.h, common/const.cpp,
server/Persistor.cpp, server/Restoration.cpp,
server/WorldRouter.cpp
Change id and loc column in entity tables to integer for
performance. Add id generator sequence to database
* common/Database.cpp, common/Database.h, server/Persistance.cpp,
server/Persistance.h: Remove old legacy world, mind and server
tables as they are no longer used.
* common/BaseEntity.cpp, common/Load.h, common/Save.h,
common/custom.cpp, common/op_switch.h, common/operations.cpp,
common/operations.h, common/types.h, rulesets/BaseMind.cpp,
rulesets/BaseMind.h, rulesets/Character.cpp, rulesets/Character.h,
server/Admin.cpp, server/Admin.h, server/server.cpp,
tools/cycmd.cpp: Remove Load and Save ops.
* rulesets/Area.cpp, rulesets/Character.cpp, rulesets/Line.cpp,
rulesets/Plant.cpp: Fix != to |= when setting update flags.
* server/CommMetaClient.cpp, server/CommMetaClient.h,
server/CommServer.cpp, server/CommServer.h, server/server.cpp:
Add mechanism for sockets to be called whenever the server
is idle, so that they do period things. Use this mechanis,
to handle sending periodic packets to the metaserver, removing
special case code from CommServer.
2002-12-28 21:52:32 +00:00
|
|
|
commServer.addIdle(cmc);
|
2003-08-23 20:40:39 +00:00
|
|
|
} else {
|
|
|
|
|
log(ERROR, "Error creating metaserver comm channel.");
|
|
|
|
|
delete cmc;
|
* tools/cydbload.cpp: Added parameter handling so any file can
be loaded into the database.
* tools/cycmd.cpp: Cleaned up usage and help functions.
* tools/cyisoload.cpp: Cleaned up usage(), and made sure build
completes okay if libraries are missing, and missing
functionality is reported to the user.
* server/server.cpp: Added config options that specifies that
the contents of the db should loaded on server startup. Cleaned
up some debug code.
* server/WorldTime.cpp, server/WorldRouter.cpp,
server/Connection.cpp, rulesets/Structure.h,
rulesets/Python_API.cpp, rulesets/Py_WorldTime.cpp,
rulesets/Movement.cpp, rulesets/Entity.cpp,
physics/Vector3D.h, common/persistance.cpp,
common/database.h, common/database.cpp: Removed output either
to debug mode, or removed altogether.
* common/BaseEntity.h, common/BaseEntity.cpp: Removed redundant header
includes.
* server/ServerRouting.cpp, common/persistance.h,
common/persistance.cpp: Modified admin account function names it
fit convention.
* module/Location.h: Fixed collision detection so that entities
with velocity set to 0 still get checked.
* rulesets/Entity.cpp, rulesets/Thing.cpp, rulesets/Character.cpp,
rulesets/BaseMind.cpp, rulesets/Creator.cpp,
rulesets/ExternalMind.cpp, rulesets/Food.cpp, rulesets/MemMap.cpp,
rulesets/Movement.cpp, rulesets/Pedestrian.cpp, rulesets/Plant.cpp,
rulesets/Py_Location.cpp, rulesets/Py_*.cpp, rulesets/World.cpp:
Removed unnecessary #includes.
Al Riddoch <alriddoch@zepler.org>
2001-06-04 11:22:27 +00:00
|
|
|
}
|
|
|
|
|
}
|
2002-12-28 Al Riddoch <alriddoch@zepler.org>
* common/BaseEntity.cpp, common/BaseEntity.h, rulesets/Character.cpp,
rulesets/Food.cpp, rulesets/Thing.cpp, rulesets/World.cpp:
Add arg to error method specifying where the error should go. Use
this arg to ensure that errors don't get broadcast.
* common/Database.cpp, common/Database.h, common/const.cpp,
server/Persistor.cpp, server/Restoration.cpp,
server/WorldRouter.cpp
Change id and loc column in entity tables to integer for
performance. Add id generator sequence to database
* common/Database.cpp, common/Database.h, server/Persistance.cpp,
server/Persistance.h: Remove old legacy world, mind and server
tables as they are no longer used.
* common/BaseEntity.cpp, common/Load.h, common/Save.h,
common/custom.cpp, common/op_switch.h, common/operations.cpp,
common/operations.h, common/types.h, rulesets/BaseMind.cpp,
rulesets/BaseMind.h, rulesets/Character.cpp, rulesets/Character.h,
server/Admin.cpp, server/Admin.h, server/server.cpp,
tools/cycmd.cpp: Remove Load and Save ops.
* rulesets/Area.cpp, rulesets/Character.cpp, rulesets/Line.cpp,
rulesets/Plant.cpp: Fix != to |= when setting update flags.
* server/CommMetaClient.cpp, server/CommMetaClient.h,
server/CommServer.cpp, server/CommServer.h, server/server.cpp:
Add mechanism for sockets to be called whenever the server
is idle, so that they do period things. Use this mechanis,
to handle sending periodic packets to the metaserver, removing
special case code from CommServer.
2002-12-28 21:52:32 +00:00
|
|
|
|
2005-12-07 02:43:08 +00:00
|
|
|
#if defined(HAVE_LIBHOWL) || defined(HAVE_AVAHI)
|
2004-11-11 14:26:21 +00:00
|
|
|
|
|
|
|
|
CommMDNSPublisher * cmdns = new CommMDNSPublisher(commServer);
|
|
|
|
|
if (cmdns->setup() == 0) {
|
2004-11-20 22:10:04 +00:00
|
|
|
commServer.addSocket(cmdns);
|
2005-12-07 02:43:08 +00:00
|
|
|
commServer.addIdle(cmdns);
|
2004-11-11 14:26:21 +00:00
|
|
|
} else {
|
2005-12-07 02:43:08 +00:00
|
|
|
log(ERROR, "Unable to register service with MDNS daemon.");
|
2004-11-11 14:26:21 +00:00
|
|
|
delete cmdns;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif // defined(HAVE_LIBHOWL)
|
|
|
|
|
|
2002-07-14 21:04:50 +00:00
|
|
|
log(INFO, "Running");
|
2006-01-11 02:36:16 +00:00
|
|
|
logEvent(START, "- - - Standalone server startup");
|
2002-10-03 10:51:59 +00:00
|
|
|
|
2002-12-19 20:04:37 +00:00
|
|
|
// Inform things that want to know that we are running.
|
2002-10-03 10:51:59 +00:00
|
|
|
running();
|
2002-12-19 20:04:37 +00:00
|
|
|
|
2006-05-02 14:06:35 +00:00
|
|
|
// Reduce our system priority to make it easier to debug a runaway
|
|
|
|
|
// server.
|
2006-05-11 23:33:58 +00:00
|
|
|
if (nice != 0) {
|
|
|
|
|
reduce_priority(nice);
|
|
|
|
|
}
|
2006-05-02 14:06:35 +00:00
|
|
|
|
2001-05-14 17:25:32 +00:00
|
|
|
// Loop until the exit flag is set. The exit flag can be set anywhere in
|
|
|
|
|
// the code easily.
|
2000-08-13 20:36:18 +00:00
|
|
|
while (!exit_flag) {
|
2000-12-13 12:10:48 +00:00
|
|
|
try {
|
2004-12-08 16:36:42 +00:00
|
|
|
commServer.poll();
|
2000-12-13 12:10:48 +00:00
|
|
|
}
|
|
|
|
|
catch (...) {
|
2001-05-14 17:25:32 +00:00
|
|
|
// It is hoped that commonly thrown exception, particularly
|
|
|
|
|
// exceptions that can be caused by external influences
|
|
|
|
|
// should be caught close to where they are thrown. If
|
|
|
|
|
// an exception makes it here then it should be debugged.
|
2002-07-14 21:04:50 +00:00
|
|
|
log(ERROR, "Exception caught in main()");
|
2000-12-13 12:10:48 +00:00
|
|
|
}
|
2000-08-13 20:36:18 +00:00
|
|
|
}
|
2001-05-14 17:25:32 +00:00
|
|
|
// exit flag has been set so we close down the databases, and indicate
|
|
|
|
|
// to the metaserver (if we are using one) that this server is going down.
|
|
|
|
|
// It is assumed that any preparation for the shutdown that is required
|
|
|
|
|
// by the game has been done before exit flag was set.
|
2002-07-14 21:04:50 +00:00
|
|
|
log(NOTICE, "Performing clean shutdown...");
|
2001-05-23 19:09:15 +00:00
|
|
|
|
2004-05-15 17:43:14 +00:00
|
|
|
} // close scope of CommServer, WorldRouter, and ServerRouting, which
|
|
|
|
|
// cause the destruction of the server and world objects, and the entire
|
|
|
|
|
// world contents
|
2001-10-10 09:40:24 +00:00
|
|
|
|
2001-03-15 11:41:34 +00:00
|
|
|
Persistance::shutdown();
|
2001-05-23 19:09:15 +00:00
|
|
|
|
|
|
|
|
EntityFactory::instance()->flushFactories();
|
2001-07-12 16:10:41 +00:00
|
|
|
EntityFactory::del();
|
2002-03-05 17:03:13 +00:00
|
|
|
MindFactory::del();
|
2001-05-23 19:09:15 +00:00
|
|
|
|
2001-11-24 13:23:17 +00:00
|
|
|
Inheritance::clear();
|
|
|
|
|
|
2001-11-10 15:20:58 +00:00
|
|
|
// Shutdown the python interpretter. This frees lots of memory, and if
|
|
|
|
|
// the malloc heap is in any way corrupt, a segfault is likely to
|
|
|
|
|
// occur at this point. Previous occassions where pointers have been
|
|
|
|
|
// deleted twice elsewhere in the code, have resulted in a segfault
|
|
|
|
|
// at this point. AlRiddoch 10th November 2001
|
* aiclient/ClientConnection.cpp, aiclient/client.cpp,
client/ClientConnection.cpp, common/database.h, common/globals.cpp,
common/persistance.cpp, common/stringstream.h, server/CommClient.cpp,
server/CommServer.cpp, server/Persistance.cpp, tools/cyctrl.cpp,
tools/cyctrl.cpp, tools/cydbload.cpp, tools/cyisoload.cpp,
tools/cypasswd.cpp: Removed unused config.h.
* client/ObserverClient.cpp, common/const.h, tools/cycmd.cpp:
Use default password if the admin account cannot be fetched from
the database.
* client/Py_CreatorClient.cpp, common/BaseEntity.cpp,
common/BaseEntity.h, rulesets/Character.cpp, rulesets/Creator.cpp,
rulesets/Entity.cpp, rulesets/Entity.h, rulesets/EntityFactory.cpp,
rulesets/MemMap.cpp, rulesets/Py_Mind.cpp, rulesets/Py_Thing.cpp,
rulesets/Py_World.cpp, rulesets/Thing.cpp, server/Account.cpp,
server/Admin.cpp, server/Connection.cpp, tools/cywatchdog.cpp:
Make many of the member variables of Entity protected, and add
the required accessors. Changed the name of the id attribute
to m_id.
* common/BaseWorld.h, common/database.cpp, common/persistance.cpp:
Removed unused includes.
* common/Chop.h, common/Cut.h, common/Eat.h, common/Fire.h,
common/Generic.h, common/Load.h, common/Nourish.h, common/Save.h,
common/Setup.h, common/Tick.h: Moved definition of virtual
functions into cpp file, to reduce wasted code.
* common/Makefile.am: Create cyphesis library, which can be used by
other applications to access cyphesis databases.
* common/config.h, common/database.h, server/Persistance.cpp,
tools/cydbload.cpp, tools/cyisoload.cpp, tools/cypasswd.cpp:
Remove conditional compilation of db code. db3 is now required.
* server/WorldRouter.h: Fixed getNewId() so it take const string.
* server/server.cpp: Removed python shutdown, so it does not
mess up the db if it causes a segfault.
Al Riddoch <alriddoch@zepler.org>
2001-10-17 14:09:42 +00:00
|
|
|
shutdown_python_api();
|
|
|
|
|
|
2001-06-23 14:23:25 +00:00
|
|
|
delete global_conf;
|
|
|
|
|
|
2002-07-14 21:04:50 +00:00
|
|
|
log(INFO, "Clean shutdown complete.");
|
2006-01-11 02:36:16 +00:00
|
|
|
logEvent(STOP, "- - - Standalone server shutdown");
|
2001-03-15 11:41:34 +00:00
|
|
|
return 0;
|
2000-08-13 20:36:18 +00:00
|
|
|
}
|