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
|
2005-05-13 23:25:32 +00:00
|
|
|
// Copyright (C) 2001-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
|
2002-01-27 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp, common/Database.h,
server/Persistance.cpp, server/Persistance.h:
Add a new table to store rulesets, so they can be persisted, and
edited online. The new ruleset format integrates information
about the class hierarchy, scripting and default attributes.
Added low level method to fetch an entire database table as an
Atlas map.
* tools/cyloadrules.cpp: New tool to load rulesets in new xml
format into database table.
* server/EntityFactory.cpp, server/EntityFactory.h:
New re-written Entity Factory, to support new rules database
table, and better class definition capabilities.
* rulesets/EntityFactory.cpp, rulesets/EntityFactory.h:
Removed from build.
* client/CommClient.cpp: Redundant include removed.
* rulesets/ThingFactory.h: Add storage to factory for script
info and default attributes.
* server/WorldRouter.cpp: Switch to using new EntityFactory.
* server/server.cpp: Removed old ruleset loading code, and now
simply load the ruleset names from the config file.
* tools/cycmd.cpp: Exit correctly if connection fails.
2002-01-27 00:38:27 +00:00
|
|
|
|
2006-12-26 Al Riddoch <alriddoch@zepler.org>
* client/CharacterClient.cpp, client/ClientConnection.h,
rulesets/Character.cpp, rulesets/Character.h, tools/cyaddrules.cpp,
tools/cyconfig.cpp, tools/cyconvertrules.cpp, tools/cyctrl.cpp,
tools/cydumprules.cpp, tools/cyloadrules.cpp, tools/cypasswd.cpp:
Add inline documentation.
* client/CharacterClient.h, client/CharacterClient.cpp: Remove
overriden sight operation handlers, as they are no longer
present in the base class, and will never be called.
* client/ClientConnection.h: Remove obsolete unimplemented template
declaration.
* rulesets/Entity.cpp: Remove documentation for an argument that was
never there.
* tools/cyctrl.cpp: Mark as removed from the build.
* Add a FIXME about removing hard coded gender property
2006-12-26 18:24:24 +00:00
|
|
|
|
|
|
|
|
/// \page cyloadrules_index
|
|
|
|
|
///
|
|
|
|
|
/// \section Introduction
|
|
|
|
|
///
|
|
|
|
|
/// cyloadrules is a non-interactive commandline tool to copy rule data to
|
|
|
|
|
/// the database from a file. For information on the usage, please see the unix
|
|
|
|
|
/// manual page. The manual page is generated from docbook sources, so can
|
|
|
|
|
/// also be converted into other formats.
|
2006-10-26 00:48:00 +00:00
|
|
|
|
2007-06-16 13:39:54 +00:00
|
|
|
|
2011-04-21 19:25:10 +01:00
|
|
|
#include "common/Storage.h"
|
2003-03-07 00:22:12 +00:00
|
|
|
#include "common/globals.h"
|
2007-04-29 13:32:27 +00:00
|
|
|
#include "common/log.h"
|
2002-01-27 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp, common/Database.h,
server/Persistance.cpp, server/Persistance.h:
Add a new table to store rulesets, so they can be persisted, and
edited online. The new ruleset format integrates information
about the class hierarchy, scripting and default attributes.
Added low level method to fetch an entire database table as an
Atlas map.
* tools/cyloadrules.cpp: New tool to load rulesets in new xml
format into database table.
* server/EntityFactory.cpp, server/EntityFactory.h:
New re-written Entity Factory, to support new rules database
table, and better class definition capabilities.
* rulesets/EntityFactory.cpp, rulesets/EntityFactory.h:
Removed from build.
* client/CommClient.cpp: Redundant include removed.
* rulesets/ThingFactory.h: Add storage to factory for script
info and default attributes.
* server/WorldRouter.cpp: Switch to using new EntityFactory.
* server/server.cpp: Removed old ruleset loading code, and now
simply load the ruleset names from the config file.
* tools/cycmd.cpp: Exit correctly if connection fails.
2002-01-27 00:38:27 +00:00
|
|
|
|
2005-08-27 23:18:48 +00:00
|
|
|
#include <Atlas/Message/DecoderBase.h>
|
2002-07-14 21:04:50 +00:00
|
|
|
#include <Atlas/Codecs/XML.h>
|
|
|
|
|
|
2002-01-27 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp, common/Database.h,
server/Persistance.cpp, server/Persistance.h:
Add a new table to store rulesets, so they can be persisted, and
edited online. The new ruleset format integrates information
about the class hierarchy, scripting and default attributes.
Added low level method to fetch an entire database table as an
Atlas map.
* tools/cyloadrules.cpp: New tool to load rulesets in new xml
format into database table.
* server/EntityFactory.cpp, server/EntityFactory.h:
New re-written Entity Factory, to support new rules database
table, and better class definition capabilities.
* rulesets/EntityFactory.cpp, rulesets/EntityFactory.h:
Removed from build.
* client/CommClient.cpp: Redundant include removed.
* rulesets/ThingFactory.h: Add storage to factory for script
info and default attributes.
* server/WorldRouter.cpp: Switch to using new EntityFactory.
* server/server.cpp: Removed old ruleset loading code, and now
simply load the ruleset names from the config file.
* tools/cycmd.cpp: Exit correctly if connection fails.
2002-01-27 00:38:27 +00:00
|
|
|
#include <string>
|
|
|
|
|
#include <fstream>
|
2005-08-27 23:18:48 +00:00
|
|
|
#include <iostream>
|
2002-01-27 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp, common/Database.h,
server/Persistance.cpp, server/Persistance.h:
Add a new table to store rulesets, so they can be persisted, and
edited online. The new ruleset format integrates information
about the class hierarchy, scripting and default attributes.
Added low level method to fetch an entire database table as an
Atlas map.
* tools/cyloadrules.cpp: New tool to load rulesets in new xml
format into database table.
* server/EntityFactory.cpp, server/EntityFactory.h:
New re-written Entity Factory, to support new rules database
table, and better class definition capabilities.
* rulesets/EntityFactory.cpp, rulesets/EntityFactory.h:
Removed from build.
* client/CommClient.cpp: Redundant include removed.
* rulesets/ThingFactory.h: Add storage to factory for script
info and default attributes.
* server/WorldRouter.cpp: Switch to using new EntityFactory.
* server/server.cpp: Removed old ruleset loading code, and now
simply load the ruleset names from the config file.
* tools/cycmd.cpp: Exit correctly if connection fails.
2002-01-27 00:38:27 +00:00
|
|
|
|
2007-06-16 13:39:54 +00:00
|
|
|
#include <sys/types.h>
|
|
|
|
|
// #ifdef HAVE_DIRENT_H
|
|
|
|
|
#include <dirent.h>
|
|
|
|
|
// #endif // HAS_DIRENT_H
|
|
|
|
|
|
2003-08-07 23:03:26 +00:00
|
|
|
using Atlas::Message::Element;
|
2004-08-17 Al Riddoch <alriddoch@zepler.org>
* tests/Areatest.cpp, tests/Entitytest.cpp, tests/Foodtest.cpp,
tests/Linetest.cpp, tests/Planttest.cpp, tests/Stackabletest.cpp,
tests/Structuretest.cpp, tests/Thingtest.cpp, tests/Worldtest.cpp,
tests/inheritancetest.cpp, tests/utilitytest.cpp, tools/cycmd.cpp,
tools/cyconvertrules.cpp, tools/cydbload.cpp, tools/cyisoload.cpp,
tools/cyloadrules.cpp, tools/cypasswd.cpp: Convert code to using
Atlas Message typedefs as found in Atlas-C++ 0.6 to aid
conversion later.
2004-08-17 13:23:28 +00:00
|
|
|
using Atlas::Message::MapType;
|
2002-01-27 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp, common/Database.h,
server/Persistance.cpp, server/Persistance.h:
Add a new table to store rulesets, so they can be persisted, and
edited online. The new ruleset format integrates information
about the class hierarchy, scripting and default attributes.
Added low level method to fetch an entire database table as an
Atlas map.
* tools/cyloadrules.cpp: New tool to load rulesets in new xml
format into database table.
* server/EntityFactory.cpp, server/EntityFactory.h:
New re-written Entity Factory, to support new rules database
table, and better class definition capabilities.
* rulesets/EntityFactory.cpp, rulesets/EntityFactory.h:
Removed from build.
* client/CommClient.cpp: Redundant include removed.
* rulesets/ThingFactory.h: Add storage to factory for script
info and default attributes.
* server/WorldRouter.cpp: Switch to using new EntityFactory.
* server/server.cpp: Removed old ruleset loading code, and now
simply load the ruleset names from the config file.
* tools/cycmd.cpp: Exit correctly if connection fails.
2002-01-27 00:38:27 +00:00
|
|
|
|
2006-12-24 Al Riddoch <alriddoch@zepler.org>
* index.dox, common/BaseWorld.cpp, common/BaseWorld.h,
common/PropertyFactory.h, common/PropertyManager.h, common/const.h,
rulesets/ActivePropertyFactory.h, rulesets/Entity.h,
rulesets/Py_Vector3D.h, rulesets/Py_World.h, rulesets/Py_WorldTime.h,
rulesets/PythonMindScript.cpp, rulesets/PythonMindScript.h,
rulesets/PythonScript.h,
rulesets/PythonThingScript.h, rulesets/PythonWrapper.cpp,
rulesets/PythonWrapper.h, rulesets/Script.cpp, rulesets/Script.h,
server/ArithmeticFactory.h, server/CommServer.h, server/CommSocket.h,
server/ScriptFactory.cpp, server/TaskFactory.cpp,
server/TaskFactory.h, server/WorldRouter.cpp, tools/AdminClient.h,
tools/cyaddrules.cpp, tools/cycmd.cpp, tools/cyconfig.cpp,
tools/cydumprules.cpp, tools/cyloadrules.cpp:
Add a truck load of inline docs.
* tools/cywatchdog.cpp: Mark obsolete file as removed from the build.
* tools/cyloadrules.cpp, tools/cyconfig.cpp, tools/cyaddrules.cpp:
Rename some overly generic types so they have more indicative
and unique names.
* FIXME, server/ScriptFactory.cpp, server/TaskFactory.h: Add a couple
of formal FIXMEs to sort out the code for loading modules and
classes.
* rulesets/PythonThingScript.h: Remove some commented out code.
2006-12-24 14:42:05 +00:00
|
|
|
/// \brief Class that handles reading in an Atlas file, and loading the
|
|
|
|
|
/// contents into the rules database.
|
|
|
|
|
class DatabaseFileLoader : public Atlas::Message::DecoderBase {
|
2002-05-02 16:40:22 +00:00
|
|
|
std::fstream m_file;
|
2011-04-21 19:25:10 +01:00
|
|
|
Storage & m_db;
|
2002-01-27 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp, common/Database.h,
server/Persistance.cpp, server/Persistance.h:
Add a new table to store rulesets, so they can be persisted, and
edited online. The new ruleset format integrates information
about the class hierarchy, scripting and default attributes.
Added low level method to fetch an entire database table as an
Atlas map.
* tools/cyloadrules.cpp: New tool to load rulesets in new xml
format into database table.
* server/EntityFactory.cpp, server/EntityFactory.h:
New re-written Entity Factory, to support new rules database
table, and better class definition capabilities.
* rulesets/EntityFactory.cpp, rulesets/EntityFactory.h:
Removed from build.
* client/CommClient.cpp: Redundant include removed.
* rulesets/ThingFactory.h: Add storage to factory for script
info and default attributes.
* server/WorldRouter.cpp: Switch to using new EntityFactory.
* server/server.cpp: Removed old ruleset loading code, and now
simply load the ruleset names from the config file.
* tools/cycmd.cpp: Exit correctly if connection fails.
2002-01-27 00:38:27 +00:00
|
|
|
Atlas::Codecs::XML m_codec;
|
|
|
|
|
int m_count;
|
|
|
|
|
|
2005-08-27 23:18:48 +00:00
|
|
|
virtual void messageArrived(const MapType & omap) {
|
2004-08-17 Al Riddoch <alriddoch@zepler.org>
* tests/Areatest.cpp, tests/Entitytest.cpp, tests/Foodtest.cpp,
tests/Linetest.cpp, tests/Planttest.cpp, tests/Stackabletest.cpp,
tests/Structuretest.cpp, tests/Thingtest.cpp, tests/Worldtest.cpp,
tests/inheritancetest.cpp, tests/utilitytest.cpp, tools/cycmd.cpp,
tools/cyconvertrules.cpp, tools/cydbload.cpp, tools/cyisoload.cpp,
tools/cyloadrules.cpp, tools/cypasswd.cpp: Convert code to using
Atlas Message typedefs as found in Atlas-C++ 0.6 to aid
conversion later.
2004-08-17 13:23:28 +00:00
|
|
|
MapType::const_iterator I = omap.find("id");
|
2004-07-12 10:58:20 +00:00
|
|
|
if (I == omap.end()) {
|
|
|
|
|
std::cerr << "Found rule with no id" << std::endl << std::flush;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (!I->second.isString()) {
|
|
|
|
|
std::cerr << "Found rule with non string id" << std::endl << std::flush;
|
|
|
|
|
return;
|
2002-01-27 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp, common/Database.h,
server/Persistance.cpp, server/Persistance.h:
Add a new table to store rulesets, so they can be persisted, and
edited online. The new ruleset format integrates information
about the class hierarchy, scripting and default attributes.
Added low level method to fetch an entire database table as an
Atlas map.
* tools/cyloadrules.cpp: New tool to load rulesets in new xml
format into database table.
* server/EntityFactory.cpp, server/EntityFactory.h:
New re-written Entity Factory, to support new rules database
table, and better class definition capabilities.
* rulesets/EntityFactory.cpp, rulesets/EntityFactory.h:
Removed from build.
* client/CommClient.cpp: Redundant include removed.
* rulesets/ThingFactory.h: Add storage to factory for script
info and default attributes.
* server/WorldRouter.cpp: Switch to using new EntityFactory.
* server/server.cpp: Removed old ruleset loading code, and now
simply load the ruleset names from the config file.
* tools/cycmd.cpp: Exit correctly if connection fails.
2002-01-27 00:38:27 +00:00
|
|
|
}
|
2004-07-12 10:58:20 +00:00
|
|
|
m_count++;
|
2005-08-27 23:18:48 +00:00
|
|
|
m_db.storeInRules(omap, I->second.asString());
|
2002-01-27 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp, common/Database.h,
server/Persistance.cpp, server/Persistance.h:
Add a new table to store rulesets, so they can be persisted, and
edited online. The new ruleset format integrates information
about the class hierarchy, scripting and default attributes.
Added low level method to fetch an entire database table as an
Atlas map.
* tools/cyloadrules.cpp: New tool to load rulesets in new xml
format into database table.
* server/EntityFactory.cpp, server/EntityFactory.h:
New re-written Entity Factory, to support new rules database
table, and better class definition capabilities.
* rulesets/EntityFactory.cpp, rulesets/EntityFactory.h:
Removed from build.
* client/CommClient.cpp: Redundant include removed.
* rulesets/ThingFactory.h: Add storage to factory for script
info and default attributes.
* server/WorldRouter.cpp: Switch to using new EntityFactory.
* server/server.cpp: Removed old ruleset loading code, and now
simply load the ruleset names from the config file.
* tools/cycmd.cpp: Exit correctly if connection fails.
2002-01-27 00:38:27 +00:00
|
|
|
}
|
|
|
|
|
public:
|
2011-04-21 19:25:10 +01:00
|
|
|
DatabaseFileLoader(const std::string & filename, Storage & db) :
|
2002-05-02 16:40:22 +00:00
|
|
|
m_file(filename.c_str(), std::ios::in), m_db(db),
|
2005-08-27 23:18:48 +00:00
|
|
|
m_codec(m_file, *this), m_count(0)
|
2002-01-27 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp, common/Database.h,
server/Persistance.cpp, server/Persistance.h:
Add a new table to store rulesets, so they can be persisted, and
edited online. The new ruleset format integrates information
about the class hierarchy, scripting and default attributes.
Added low level method to fetch an entire database table as an
Atlas map.
* tools/cyloadrules.cpp: New tool to load rulesets in new xml
format into database table.
* server/EntityFactory.cpp, server/EntityFactory.h:
New re-written Entity Factory, to support new rules database
table, and better class definition capabilities.
* rulesets/EntityFactory.cpp, rulesets/EntityFactory.h:
Removed from build.
* client/CommClient.cpp: Redundant include removed.
* rulesets/ThingFactory.h: Add storage to factory for script
info and default attributes.
* server/WorldRouter.cpp: Switch to using new EntityFactory.
* server/server.cpp: Removed old ruleset loading code, and now
simply load the ruleset names from the config file.
* tools/cycmd.cpp: Exit correctly if connection fails.
2002-01-27 00:38:27 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void read() {
|
|
|
|
|
while (!m_file.eof()) {
|
2003-08-07 23:03:26 +00:00
|
|
|
m_codec.poll();
|
2002-01-27 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp, common/Database.h,
server/Persistance.cpp, server/Persistance.h:
Add a new table to store rulesets, so they can be persisted, and
edited online. The new ruleset format integrates information
about the class hierarchy, scripting and default attributes.
Added low level method to fetch an entire database table as an
Atlas map.
* tools/cyloadrules.cpp: New tool to load rulesets in new xml
format into database table.
* server/EntityFactory.cpp, server/EntityFactory.h:
New re-written Entity Factory, to support new rules database
table, and better class definition capabilities.
* rulesets/EntityFactory.cpp, rulesets/EntityFactory.h:
Removed from build.
* client/CommClient.cpp: Redundant include removed.
* rulesets/ThingFactory.h: Add storage to factory for script
info and default attributes.
* server/WorldRouter.cpp: Switch to using new EntityFactory.
* server/server.cpp: Removed old ruleset loading code, and now
simply load the ruleset names from the config file.
* tools/cycmd.cpp: Exit correctly if connection fails.
2002-01-27 00:38:27 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2009-11-02 02:21:25 +00:00
|
|
|
void report(const std::string & set) {
|
|
|
|
|
std::cout << m_count << " classes stored in rule database from "
|
|
|
|
|
<< set << "."
|
2002-01-27 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp, common/Database.h,
server/Persistance.cpp, server/Persistance.h:
Add a new table to store rulesets, so they can be persisted, and
edited online. The new ruleset format integrates information
about the class hierarchy, scripting and default attributes.
Added low level method to fetch an entire database table as an
Atlas map.
* tools/cyloadrules.cpp: New tool to load rulesets in new xml
format into database table.
* server/EntityFactory.cpp, server/EntityFactory.h:
New re-written Entity Factory, to support new rules database
table, and better class definition capabilities.
* rulesets/EntityFactory.cpp, rulesets/EntityFactory.h:
Removed from build.
* client/CommClient.cpp: Redundant include removed.
* rulesets/ThingFactory.h: Add storage to factory for script
info and default attributes.
* server/WorldRouter.cpp: Switch to using new EntityFactory.
* server/server.cpp: Removed old ruleset loading code, and now
simply load the ruleset names from the config file.
* tools/cycmd.cpp: Exit correctly if connection fails.
2002-01-27 00:38:27 +00:00
|
|
|
<< std::endl << std::flush;
|
|
|
|
|
}
|
2002-06-24 10:27:06 +00:00
|
|
|
|
|
|
|
|
bool isOpen() {
|
|
|
|
|
return m_file.is_open();
|
|
|
|
|
}
|
2002-01-27 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp, common/Database.h,
server/Persistance.cpp, server/Persistance.h:
Add a new table to store rulesets, so they can be persisted, and
edited online. The new ruleset format integrates information
about the class hierarchy, scripting and default attributes.
Added low level method to fetch an entire database table as an
Atlas map.
* tools/cyloadrules.cpp: New tool to load rulesets in new xml
format into database table.
* server/EntityFactory.cpp, server/EntityFactory.h:
New re-written Entity Factory, to support new rules database
table, and better class definition capabilities.
* rulesets/EntityFactory.cpp, rulesets/EntityFactory.h:
Removed from build.
* client/CommClient.cpp: Redundant include removed.
* rulesets/ThingFactory.h: Add storage to factory for script
info and default attributes.
* server/WorldRouter.cpp: Switch to using new EntityFactory.
* server/server.cpp: Removed old ruleset loading code, and now
simply load the ruleset names from the config file.
* tools/cycmd.cpp: Exit correctly if connection fails.
2002-01-27 00:38:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static void usage(char * prgname)
|
|
|
|
|
{
|
2004-09-28 19:24:15 +00:00
|
|
|
std::cerr << "usage: " << prgname << " [<rulesetname> <atlas-xml-file>]" << std::endl << std::flush;
|
2002-01-27 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp, common/Database.h,
server/Persistance.cpp, server/Persistance.h:
Add a new table to store rulesets, so they can be persisted, and
edited online. The new ruleset format integrates information
about the class hierarchy, scripting and default attributes.
Added low level method to fetch an entire database table as an
Atlas map.
* tools/cyloadrules.cpp: New tool to load rulesets in new xml
format into database table.
* server/EntityFactory.cpp, server/EntityFactory.h:
New re-written Entity Factory, to support new rules database
table, and better class definition capabilities.
* rulesets/EntityFactory.cpp, rulesets/EntityFactory.h:
Removed from build.
* client/CommClient.cpp: Redundant include removed.
* rulesets/ThingFactory.h: Add storage to factory for script
info and default attributes.
* server/WorldRouter.cpp: Switch to using new EntityFactory.
* server/server.cpp: Removed old ruleset loading code, and now
simply load the ruleset names from the config file.
* tools/cycmd.cpp: Exit correctly if connection fails.
2002-01-27 00:38:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int main(int argc, char ** argv)
|
|
|
|
|
{
|
2007-11-14 22:40:17 +00:00
|
|
|
int config_status = loadConfig(argc, argv, USAGE_DBASE);
|
2007-04-29 13:32:27 +00:00
|
|
|
if (config_status < 0) {
|
|
|
|
|
if (config_status == CONFIG_VERSION) {
|
|
|
|
|
reportVersion(argv[0]);
|
|
|
|
|
return 0;
|
|
|
|
|
} else if (config_status == CONFIG_HELP) {
|
|
|
|
|
showUsage(argv[0], USAGE_DBASE, "[<rulesetname> <atlas-xml-file>]");
|
|
|
|
|
return 0;
|
|
|
|
|
} else if (config_status != CONFIG_ERROR) {
|
|
|
|
|
log(ERROR, "Unknown error reading configuration.");
|
|
|
|
|
}
|
2002-01-27 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp, common/Database.h,
server/Persistance.cpp, server/Persistance.h:
Add a new table to store rulesets, so they can be persisted, and
edited online. The new ruleset format integrates information
about the class hierarchy, scripting and default attributes.
Added low level method to fetch an entire database table as an
Atlas map.
* tools/cyloadrules.cpp: New tool to load rulesets in new xml
format into database table.
* server/EntityFactory.cpp, server/EntityFactory.h:
New re-written Entity Factory, to support new rules database
table, and better class definition capabilities.
* rulesets/EntityFactory.cpp, rulesets/EntityFactory.h:
Removed from build.
* client/CommClient.cpp: Redundant include removed.
* rulesets/ThingFactory.h: Add storage to factory for script
info and default attributes.
* server/WorldRouter.cpp: Switch to using new EntityFactory.
* server/server.cpp: Removed old ruleset loading code, and now
simply load the ruleset names from the config file.
* tools/cycmd.cpp: Exit correctly if connection fails.
2002-01-27 00:38:27 +00:00
|
|
|
// Fatal error loading config file
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2007-04-29 13:32:27 +00:00
|
|
|
int optind = config_status;
|
|
|
|
|
|
2011-04-21 19:25:10 +01:00
|
|
|
Storage * storage = new Storage;
|
2003-09-15 20:55:15 +00:00
|
|
|
|
2011-04-21 19:25:10 +01:00
|
|
|
if (storage->init() != 0) {
|
2003-09-15 20:55:15 +00:00
|
|
|
std::cerr << argv[0] << ": Could not make database connection."
|
|
|
|
|
<< std::endl << std::flush;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
2002-01-27 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp, common/Database.h,
server/Persistance.cpp, server/Persistance.h:
Add a new table to store rulesets, so they can be persisted, and
edited online. The new ruleset format integrates information
about the class hierarchy, scripting and default attributes.
Added low level method to fetch an entire database table as an
Atlas map.
* tools/cyloadrules.cpp: New tool to load rulesets in new xml
format into database table.
* server/EntityFactory.cpp, server/EntityFactory.h:
New re-written Entity Factory, to support new rules database
table, and better class definition capabilities.
* rulesets/EntityFactory.cpp, rulesets/EntityFactory.h:
Removed from build.
* client/CommClient.cpp: Redundant include removed.
* rulesets/ThingFactory.h: Add storage to factory for script
info and default attributes.
* server/WorldRouter.cpp: Switch to using new EntityFactory.
* server/server.cpp: Removed old ruleset loading code, and now
simply load the ruleset names from the config file.
* tools/cycmd.cpp: Exit correctly if connection fails.
2002-01-27 00:38:27 +00:00
|
|
|
|
2004-10-05 14:57:11 +00:00
|
|
|
if (optind == (argc - 2)) {
|
2011-04-21 19:25:10 +01:00
|
|
|
DatabaseFileLoader f(argv[optind + 1], *storage);
|
2002-06-24 10:27:06 +00:00
|
|
|
if (!f.isOpen()) {
|
2004-10-05 14:57:11 +00:00
|
|
|
std::cerr << "ERROR: Unable to open file " << argv[optind + 1]
|
2002-06-24 10:27:06 +00:00
|
|
|
<< std::endl << std::flush;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
2011-04-21 19:25:10 +01:00
|
|
|
storage->setRuleset(argv[optind]);
|
2002-01-28 Al Riddoch <alriddoch@zepler.org>
* client/ClientConnection.cpp, client/CommClient.h,
common/globals.cpp, common/globals.h, server/server.cpp,
tools/cycmd.cpp:
Make the TCP port number a global config setting, and
ensure it is used everwhere, so it can be overriden, and all
clients and tools will use it. Modify behavoir so that any
settings overridden on the command line are made semi-permanent
in the users home directory, making it easier for users to run
two versions on one machine at the same time.
* common/Database.cpp, common/Database.h: Remove obsolete iterator
code. Add a method to clear a given database table.
* server/Persistance.h, tools/cyloadrules.cpp:
Automate loading of the ruleset given in the config file, and
the rulesets it depends on, ensuring that the rules table
is cleared first.
2002-01-28 11:40:10 +00:00
|
|
|
f.read();
|
2009-11-02 02:21:25 +00:00
|
|
|
f.report(argv[optind]);
|
2004-10-05 14:57:11 +00:00
|
|
|
} else if (optind == argc) {
|
2011-04-21 19:25:10 +01:00
|
|
|
storage->clearRules();
|
2012-01-19 19:34:20 +00:00
|
|
|
std::cout << "Reading rules from " << ruleset_name << std::endl << std::flush;
|
2007-06-19 13:19:57 +00:00
|
|
|
std::string filename;
|
|
|
|
|
|
2012-01-19 19:34:20 +00:00
|
|
|
std::string dirname = etc_directory + "/cyphesis/" + ruleset_name + ".d";
|
2007-06-19 13:19:57 +00:00
|
|
|
DIR * rules_dir = ::opendir(dirname.c_str());
|
|
|
|
|
if (rules_dir == 0) {
|
2012-01-19 19:34:20 +00:00
|
|
|
filename = etc_directory + "/cyphesis/" + ruleset_name + ".xml";
|
2011-04-21 19:25:10 +01:00
|
|
|
DatabaseFileLoader f(filename, *storage);
|
2007-06-19 13:19:57 +00:00
|
|
|
if (f.isOpen()) {
|
|
|
|
|
std::cerr << "WARNING: Reading legacy rule data from \""
|
|
|
|
|
<< filename << "\""
|
|
|
|
|
<< std::endl << std::flush;
|
2012-01-19 19:34:20 +00:00
|
|
|
storage->setRuleset(ruleset_name);
|
2007-06-19 13:19:57 +00:00
|
|
|
f.read();
|
2012-01-19 19:34:20 +00:00
|
|
|
f.report(ruleset_name);
|
2007-06-16 13:39:54 +00:00
|
|
|
}
|
2007-06-19 13:19:57 +00:00
|
|
|
} else {
|
2007-06-16 13:39:54 +00:00
|
|
|
while (struct dirent * rules_entry = ::readdir(rules_dir)) {
|
|
|
|
|
if (rules_entry->d_name[0] == '.') {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
2007-06-19 13:19:57 +00:00
|
|
|
filename = dirname + "/" + rules_entry->d_name;
|
2007-06-16 13:39:54 +00:00
|
|
|
|
2011-04-21 19:25:10 +01:00
|
|
|
DatabaseFileLoader f(filename, *storage);
|
2007-06-16 13:39:54 +00:00
|
|
|
if (!f.isOpen()) {
|
|
|
|
|
std::cerr << "ERROR: Unable to open file " << filename
|
|
|
|
|
<< std::endl << std::flush;
|
|
|
|
|
} else {
|
2011-04-21 19:25:10 +01:00
|
|
|
storage->setRuleset(rules_entry->d_name);
|
2007-06-16 13:39:54 +00:00
|
|
|
f.read();
|
2009-11-02 02:21:25 +00:00
|
|
|
f.report(rules_entry->d_name);
|
2007-06-16 13:39:54 +00:00
|
|
|
}
|
2002-06-24 10:27:06 +00:00
|
|
|
}
|
2002-01-28 Al Riddoch <alriddoch@zepler.org>
* client/ClientConnection.cpp, client/CommClient.h,
common/globals.cpp, common/globals.h, server/server.cpp,
tools/cycmd.cpp:
Make the TCP port number a global config setting, and
ensure it is used everwhere, so it can be overriden, and all
clients and tools will use it. Modify behavoir so that any
settings overridden on the command line are made semi-permanent
in the users home directory, making it easier for users to run
two versions on one machine at the same time.
* common/Database.cpp, common/Database.h: Remove obsolete iterator
code. Add a method to clear a given database table.
* server/Persistance.h, tools/cyloadrules.cpp:
Automate loading of the ruleset given in the config file, and
the rulesets it depends on, ensuring that the rules table
is cleared first.
2002-01-28 11:40:10 +00:00
|
|
|
}
|
2004-07-12 10:58:20 +00:00
|
|
|
} else {
|
|
|
|
|
usage(argv[0]);
|
|
|
|
|
return 1;
|
2002-01-28 Al Riddoch <alriddoch@zepler.org>
* client/ClientConnection.cpp, client/CommClient.h,
common/globals.cpp, common/globals.h, server/server.cpp,
tools/cycmd.cpp:
Make the TCP port number a global config setting, and
ensure it is used everwhere, so it can be overriden, and all
clients and tools will use it. Modify behavoir so that any
settings overridden on the command line are made semi-permanent
in the users home directory, making it easier for users to run
two versions on one machine at the same time.
* common/Database.cpp, common/Database.h: Remove obsolete iterator
code. Add a method to clear a given database table.
* server/Persistance.h, tools/cyloadrules.cpp:
Automate loading of the ruleset given in the config file, and
the rulesets it depends on, ensuring that the rules table
is cleared first.
2002-01-28 11:40:10 +00:00
|
|
|
}
|
|
|
|
|
|
2011-04-21 19:25:10 +01:00
|
|
|
delete storage;
|
2002-01-27 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp, common/Database.h,
server/Persistance.cpp, server/Persistance.h:
Add a new table to store rulesets, so they can be persisted, and
edited online. The new ruleset format integrates information
about the class hierarchy, scripting and default attributes.
Added low level method to fetch an entire database table as an
Atlas map.
* tools/cyloadrules.cpp: New tool to load rulesets in new xml
format into database table.
* server/EntityFactory.cpp, server/EntityFactory.h:
New re-written Entity Factory, to support new rules database
table, and better class definition capabilities.
* rulesets/EntityFactory.cpp, rulesets/EntityFactory.h:
Removed from build.
* client/CommClient.cpp: Redundant include removed.
* rulesets/ThingFactory.h: Add storage to factory for script
info and default attributes.
* server/WorldRouter.cpp: Switch to using new EntityFactory.
* server/server.cpp: Removed old ruleset loading code, and now
simply load the ruleset names from the config file.
* tools/cycmd.cpp: Exit correctly if connection fails.
2002-01-27 00:38:27 +00:00
|
|
|
}
|