Commit graph

109 commits

Author SHA1 Message Date
Al Riddoch
40b8b52252 2007-07-06 Al Riddoch <alriddoch@zepler.org>
* server/EntityFactory.cpp: When processing a new task rule, check
	  that the operation and tool classes referenced have been installed.
	  If not, make the class pending on those classes.
2007-07-06 16:36:12 +00:00
Al Riddoch
ea08205db3 2007-07-04 Al Riddoch <alriddoch@zepler.org>
* rulesets/Area.cpp, rulesets/Area.h, rulesets/Food.cpp,
	  rulesets/Food.h, rulesets/Line.cpp, rulesets/Line.h:
	  Remove these unused core entity classes from the build.

	* rulesets/attributes.h, server/EntityFactory.cpp,
	  server/PersistantThingFactory.cpp, server/Persistor.cpp,
	  server/Persistor.h, server/Persistor_impl.h, server/Restoration.cpp,
	  server/Restorer.cpp: Remove the unused classes above from the
	  persistence code.

	* tests/Makefile.am: Remove tests for the removed classes.
2007-07-05 17:51:40 +00:00
Al Riddoch
3b5e1ef9da 2007-07-02 Al Riddoch <alriddoch@zepler.org>
* rulesets/mason/world/tasks/Reap.py: New task to implement reaping
	  grass with a scythe.

	* server/EntityFactory.cpp: Report an error more clearly.

	* data/mason.xml: Fix a bug in the gravestone rule.

	* date/mason.xml: Add new reap task class.
2007-07-02 21:58:01 +00:00
Al Riddoch
bb1d4fb60d 2007-07-02 Al Riddoch <alriddoch@zepler.org>
* server/EntityFactory.cpp: Remove factory for food core base class,
	  as it is no longer used.
2007-07-02 15:49:07 +00:00
Al Riddoch
f4d4ac8938 2007-06-22 Al Riddoch <alriddoch@zepler.org>
* server/EntityFactory.cpp, tools/cyaddrules.cpp,
	  tools/cyloadrules.cpp: Remove some directory walking debug output.
2007-06-22 12:58:59 +00:00
Al Riddoch
f8a2731576 2007-06-19 Al Riddoch <alriddoch@zepler.org>
* common/globals.cpp, common/globals.h: Change the type and name
	  of the ruleset list to a string.

	* rulesets/Python_API.cpp, server/EntityFactory.cpp,
	  server/server.cpp, tools/cyaddrules.cpp, tools/cydumprules.cpp,
	  tools/cyloadrules.cpp: Switch to using single ruleset config
	  variable.
2007-06-19 13:19:57 +00:00
Al Riddoch
13d0e5e00f 2007-06-16 Al Riddoch <alriddoch@zepler.org>
* data/Makefile.am: Install the xml files for mason into the mason.d
	  subdir, as the rule loading code now prefers.

	* server/EntityFactory.cpp, tools/cyaddrules.cpp,
	  tools/cyloadrules.cpp: Modify the way rule xml files are loaded
	  so files from the ruleset specific subdirectory are loaded first,
	  and the legacy way of doing it is done if this files, with a warning
	  message.
2007-06-16 13:39:54 +00:00
Al Riddoch
8c0ead4568 2007-06-15 Al Riddoch <alriddoch@zepler.org>
* configure.ac: Check for dirent.h.

	* common/AtlasFileLoader.cpp: Report duplicate IDs when loading rule
	  data.

	* data/basic.xml: Remove obsolete old overriden rules, as we will
	  no longer be doing rules that way.

	* server/EntityFactory.cpp: When loading rulesets directly from
	  files, also load all files in ruleset.d.
2007-06-15 15:18:55 +00:00
Al Riddoch
e4fe88005d 2007-06-14 Al Riddoch <alriddoch@zepler.org>
* server/EntityFactory.cpp: Add some warnings when task classes linked
	  to other classes may be suspect.
2007-06-14 18:07:10 +00:00
Al Riddoch
8c336bc66f 2007-02-20 Al Riddoch <alriddoch@zepler.org>
* common/globals.cpp, common/globals.h: Add a config flag
	  to control whether database code is enabled.

	* server/EntityFactory.cpp, server/EntityFactory.h,
	  server/PersistantThingFactory.cpp, server/PersistantThingFactory.h,
	  server/PersistantThingFactory_impl.h, server/Persistor.cpp:
	  Re-work the persistence code so that persistent or non-persistent
	  versions of entity factories are installed at startup, removing
	  the need to check whether the database is enabled during
	  runtime.

	* common/newid.cpp, server/Connection.cpp, server/server.cpp:
	  Replace the const that used to control whether the database
	  was used with the config flag.
2007-02-20 00:52:41 +00:00
Al Riddoch
9a56dac06c 2006-10-26 Al Riddoch <alriddoch@zepler.org>
* Add RCS Id keywords to every file, for better version tracking.
2006-10-26 00:48:00 +00:00
Al Riddoch
0d79c8300d 2006-07-31 Al Riddoch <alriddoch@zepler.org>
* server/EntityFactory.cpp: Don't call upper_bound in a loop
	  as it is return by value, and expensive to call.
2006-07-31 17:36:18 +00:00
Al Riddoch
0af4ecec9f 2006-07-10 Al Riddoch <alriddoch@zepler.org>
* server/EntityFactory.h, server/EntityFactory.cpp: Improve test
	  for task classes by checking if the class parent has already been
	  installed as a class.
2006-07-10 01:45:28 +00:00
Al Riddoch
57cb4b1a09 2006-07-03 Al Riddoch <alriddoch@zepler.org>
* common/PropertyManager.cpp: When the PropertyManager is deleted,
	  set the instance variable to 0.

	* server/EntityFactory.cpp, server/EntityFactory.h: Add a destructor
	  so the property manager can be deleted at shutdown.
2006-07-03 11:25:28 +00:00
Al Riddoch
1d53fa068f 2006-07-03 Al Riddoch <alriddoch@zepler.org>
* client/ClientPropertyManager.cpp, client/ClientPropertyManager.h:
	  A new class as a dummy property manager for the client side.
	  Never creates property objects.

	* client/client.cpp: Instantiate the client property manager
	  during client initialisation.

	* server/EntityFactory.cpp: Instatiate the server property manager
	  during server intialisation.

	* common/PropertyManager.h: Add the singletons accessor, and
	  make the addProperty member return a pointer to the property.

	* server/CorePropertyManager.h, server/CorePropertyManager.cpp:
	  Implement creating properties for server side entity objects.

	* rulesets/Entity.cpp: Use the property manager singleton to
	  create properties if a new attribute is set which is not already
	  a property, and its also not already a soft attribute.
2006-07-03 01:29:07 +00:00
Al Riddoch
852bb1d643 2006-06-30 Al Riddoch <alriddoch@zepler.org>
* FIXME, Makefile.am: Add new FIXME file which documents FIXMEs in
	  the code.

	* server/EntityFactory.cpp: Remove the terrain feature classes
	  implemented as hard coded classes.

	* data/basic.xml: Add the terrain feature classes as soft data
	  defined classes.
2006-06-30 15:11:57 +00:00
Al Riddoch
ac963eb892 2006-05-09 Al Riddoch <alriddoch@zepler.org>
* rulesets/Py_Task.cpp: Missing missing return when an error is
	  detected.

	* rulesets/Python_API.cpp: Remove obsolete Vector3D and Point3D
	  constructors and method tables, now replaced by init method
	  implementations.

	* server/EntityFactory.cpp: Comment out as yet unused code for
	  updating a task factory from an admin client.
2006-05-09 10:19:33 +00:00
Al Riddoch
124b6746ab 2006-04-30 Al Riddoch <alriddoch@zepler.org>
* server/EntityFactory.cpp: Remove some debug output.
2006-04-30 01:37:59 +00:00
Al Riddoch
55ad954c81 2006-04-28 Al Riddoch <alriddoch@zepler.org>
* server/EntityFactory.cpp: Clear out all the factories on shutdown,
	  not just the entity factories.
2006-04-29 02:27:15 +00:00
Al Riddoch
f8eed4120b 2006-04-25 Al Riddoch <alriddoch@zepler.org>
* server/EntityFactory.cpp: Remove some debug output.
2006-04-25 21:23:56 +00:00
Al Riddoch
6e286ebeca 2006-04-25 Al Riddoch <alriddoch@zepler.org>
* server/Admin.cpp, server/EntityFactory.cpp, server/EntityFactory.h:
	  Change function args to take class descriptions for modification
	  as an Object not a Message. Makes it easier to defermine when
	  op definitions should be processed.
2006-04-25 02:03:36 +00:00
Al Riddoch
0cca233ad5 2006-04-25 Al Riddoch <alriddoch@zepler.org>
* server/Admin.cpp: Allow client to update op definition, passing
	  it to EntityFactory, just like other types.

	* server/EntityFactory.h, server/EntityFactory.cpp: Add method to
	  handle updating op definitions. Catch a bug which might cause
	  a crash if the client updates a core C++ hard coded entity type.
2006-04-25 01:50:17 +00:00
Al Riddoch
11d268bc54 2006-04-25 Al Riddoch <alriddoch@zepler.org>
* server/EntityFactory.h, server/EntityFactory.cpp: Make the
	  activation map a multimap, and search through it to find a match
	  for the target entity.
2006-04-25 00:32:58 +00:00
Al Riddoch
fe4330bedb 2006-04-24 Al Riddoch <alriddoch@zepler.org>
* common/BaseWorld.h, rulesets/Character.cpp,
	  server/EntityFactory.cpp, server/EntityFactory.h,
	  server/TaskFactory.h, server/WorldRouter.cpp,
	  server/WorldRouter.h: Specify the target base type that a given
	  task is valid for, and provide target type when activating a task.

	* data/mason.xml: Add target base types to most task rules.

	* rulesets/mason/world/tasks/Combat.py: Fix the copyright date.

	* rulesets/mason/world/tasks/Sharpen.py: Proof of concept task
	  for turning logs into stakes.
2006-04-24 19:51:54 +00:00
Al Riddoch
6a0a1ac44a 2006-04-24 Al Riddoch <alriddoch@zepler.org>
* common/custom.cpp: Add a "task" base class to the inheritance tree.

	* server/EntityFactory.h, server/EntityFactory.cpp: Add
	  functionality to allow task rules to be installed and updated from
	  an admin client. Improve the error reporting for a number of error
	  conditions.

	* server/Connection.cpp: Correct the copyright dates.

	* server/Admin.cpp: Improve error reporting for a number of error
	  conditions. Remove obsolete commented out code for installing
	  rules using Set ops, and add error notification when the
	  admin client attempts to update an op definition. Allow the
	  admin client to install an op definition.
2006-04-24 12:37:33 +00:00
Al Riddoch
816a2dfc6c 2006-04-05 Al Riddoch <alriddoch@zepler.org>
* common/BaseWorld.h, server/WorldRouter.h, server/WorldRouter.cpp:
	  Add interface to allow world entities to activate tasks based on
	  tool use operations.

	* server/EntityFactory.h, server/EntityFactory.cpp: Add method which
	  createa a new task in response to an activation request.

	* rulesets/Character.cpp: When a character uses a tool, use the
	  tool type and operation to activate a task if one is available.
2006-04-05 01:21:40 +00:00
Al Riddoch
fac57eee73 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
Al Riddoch
a36b7f5db5 2006-01-10 Al Riddoch <alriddoch@zepler.org>
* rulesets/ArithmeticScript.h: Remove redundant constructor.

	* rulesets/ArithmeticScript.cpp: Provide empty virtual destructor
	  implementation.

	* rulesets/Py_Statistics.cpp: Add debugging output, and remove
	  rubbish from __init__.

	* rulesets/PythonArithmeticScript.cpp: Test implementation of
	  attribute.

	* server/ArithmeticFactory.cpp, server/ArithmeticFactory.h: New
	  factory class to create instances of scripts to handle
	  statistics.

	* server/EntityFactory.cpp, server/EntityFactory.h: Add new method
	  and supporting data structures to provide a way to create
	  statistics objects for newly created Character entities.

	* server/PersistantThingFactory.cpp: Add a call to
	  EntityFactory::addStatisticsScript to the Character
	  specialisation of PersistantThingFactory::populate, giving
	  all characters a statistics script now.

	* rulesets/mason/world/statistics/Statistics.py: Test implementation
	  of a class for all character statistics.
2006-01-10 17:51:32 +00:00
Al Riddoch
6863bcaec2 2006-01-08 Al Riddoch <alriddoch@zepler.org>
* rulesets/ArithmeticScript.h: Remove compile time warnings.

	* rulesets/Statistics.h, rulesets/Statistics.cpp: Pass stats request
	  onto script object if one is available.

	* server/PersistantThingFactory.h,
	  server/PersistantThingFactory_impl.h,
	  server/PersistantThingFactory.cpp: Add a populate method to the
	  entity factory, and specialise it for Character so it can be
	  used to add scripted statistics.

	* server/EntityFactory.cpp: Add a call to populate() in the right
	  place.
2006-01-10 15:28:50 +00:00
Al Riddoch
815fd28c78 2005-12-08 Al Riddoch <alriddoch@zepler.org>
* rulesets/TaskScript.cpp, server/TaskFactory.cpp: Add some assert
	  checks.

	* server/EntityFactory.cpp: Remove some debug output.

	* rulesets/mason/world/tasks/Combat.py: Add a simple example
	  of the interface required in a task script.
2005-12-08 03:37:59 +00:00
Al Riddoch
d0713d4183 2005-12-08 Al Riddoch <alriddoch@zepler.org>
* server/TaskFactory.h, server/TaskFactory.cpp,
	  server/EntityFactory.h, server/EntityFactory.cpp,
	  rulesets/TaskScript.h, rulesets/TaskScript.cpp:
	  Implement task script interface.
2005-12-08 03:04:04 +00:00
Al Riddoch
bd153b9f87 2005-12-05 Al Riddoch <alriddoch@zepler.org>
* server/EntityFactory.h, server/EntityFactory.cpp: Add a handler for
	  objects in rules files.

	* rulesets/TaskScript.h, rulesets/TaskScript.cpp: Task class which
	  delegates functionality to a script object. Basically just a
	  stub at this point.

	* server/TaskFactory.h server/TaskFactory.cpp: Factory class for
	  creating instances of Task classes.
2005-12-05 21:23:50 +00:00
Al Riddoch
287a9bc660 2005-11-23 Al Riddoch <alriddoch@zepler.org>
* client/BaseClient.cpp, common/Database.cpp, rulesets/MemMap.cpp,
	  server/Connection.cpp, server/EntityFactory.cpp, server/Peer.cpp,
	  server/Persistance.cpp, server/Restoration.cpp,
	  server/ServerRouting.h: Update integer ID related checks now that
	  integerId() function has changed.
2005-11-23 11:55:08 +00:00
Al Riddoch
63e1fdf76d 2005-11-20 Al Riddoch <alriddoch@zepler.org>
* tests/EntityFactorytest.cpp: Add more tests to ensure adding or
	  removing attributes propagates correctly down the type tree.

	* server/EntityFactory.cpp: Reset class attributes when factory
	  is modified.
2005-11-20 02:03:08 +00:00
Al Riddoch
dc387bdeca 2005-11-19 Al Riddoch <alriddoch@zepler.org>
* common/id.cpp, common/id.h: Add a function to check a string ID
	  can be converted to an integer.

	* server/EntityFactory.cpp: Check IDs are valid integers before
	  looking them up in the world.
2005-11-19 13:15:04 +00:00
Al Riddoch
9d10ba6510 2005-11-18 Al Riddoch <alriddoch@zepler.org>
* server/PersistantThingFactory.h,
	  server/PersistantThingFactory_impl.h: Add separate tracking of
	  class attributes, and accumulated attributes including those
	  inherited from the parent class. Add members for storing
	  parent and child types to a factory.

	* server/EntityFactory.h: Ensure instance pointer is zeroed
	  when instance is deleted. Make internal methods protected so
	  its easier to test them in a unit test.

	* server/EntityFactory.cpp: Add pointers to child factories to parent
	  when installing new ones. Handle copying inherited attribute
	  defaults from the parent factory.

	* tests/EntityFactorytest.cpp: Add a new class which exposes the
	  protected parts of EntityFactory for testing.
2005-11-18 01:52:10 +00:00
Al Riddoch
162f57955e 2005-11-11 Al Riddoch <alriddoch@zepler.org>
* common/types.h, server/Persistance.h, common/BaseWorld.h,
	  common/BaseWorld.cpp, server/WorldRouter.cpp:
	  Switch core world map to reference by integer ID rather than string.
	  Add version of getEntity() which converts from string to integer
	  automatically.

	* rulesets/Character.cpp, rulesets/Thing.cpp, rulesets/World.cpp,
	  server/EntityFactory.cpp,
	  Use getEntity() when looking up an entity, so that conversion of
	  ID from string to integer is automatic.

	* rulesets/BaseMind.cpp, rulesets/MemMap.cpp, rulesets/MemMap.h:
	  Switch to using integer IDs in MemMap's core mapping.

	* server/Account.cpp, server/Account.h: Switch a few function
	  parameters to use integer ID values, making the code cleaner.

	* server/Account.cpp, server/Admin.cpp, server/Persistance.cpp:
	  Handle string ID to integer conversions as required.
2005-11-11 02:04:56 +00:00
Al Riddoch
75e9d3a546 2005-11-10 Al Riddoch <alriddoch@zepler.org>
* common/BaseEntity.h, common/BaseEntity.cpp: Add an integer ID
	  member variable, and accessor, and require it to be initialised
	  along with string ID in constructor.

	* common/const.cpp, common/const.h: Add a const for the integer value
	  of the world ID.

	* rulesets/Area.cpp, rulesets/Area.h, rulesets/BaseMind.cpp,
	  rulesets/BaseMind.h, rulesets/Character.cpp, rulesets/Character.h,
	  rulesets/Creator.cpp, rulesets/Creator.h, rulesets/Entity.cpp,
	  rulesets/Entity.h, rulesets/Food.cpp, rulesets/Food.h,
	  rulesets/Line.cpp, rulesets/Line.h, rulesets/MemEntity.cpp,
	  rulesets/MemEntity.h, rulesets/Plant.cpp, rulesets/Plant.h,
	  rulesets/Stackable.cpp, rulesets/Stackable.h, rulesets/Structure.cpp,
	  rulesets/Structure.h, rulesets/Thing.cpp, rulesets/Thing.h,
	  rulesets/World.cpp, rulesets/World.h: Add integer ID handling to
	  constructors of all in-game entity classes.

	* rulesets/MemMap.cpp: Initialise integer ID of entities in the mind
	  map.

	* rulesets/MindFactory.cpp, rulesets/MindFactory.h: Handle integer
	  ID when constructing mind objects.

	* server/EntityFactory.cpp, server/EntityFactory.h,
	  server/PersistantThingFactory_impl.h: Handle integer
	  ID when contructing entity objects.

	* server/Restoration.cpp, server/Restoration.h, server/Restorer.h,
	  server/Restorer_impl.h: Handle integer ID when restoring from
	  database.

	* server/WorldRouter.cpp: Assign integer ID when constructing the
	  world.
2005-11-11 00:06:48 +00:00
Al Riddoch
dc50c8c7f2 2005-10-19 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/mind/NPCMind.py: Fix face() so that NPC doesn't crash
	  if it turns to face something that is zero distance away.

	* server/EntityFactory.cpp: Improve error reporting when an entity
	  has velocity set at creation, and ensure that the velocity is
	  unset before the entity goes into the world.
2005-10-19 20:44:41 +00:00
Al Riddoch
a0836a6818 2005-09-28 Al Riddoch <alriddoch@zepler.org>
* modules/Location.cpp, modules/Location.h:
	  Add const accessors for location data, in preparation for
	  adding cached collision data which must be updated every
	  time data is modified.

	* physics/Collision.cpp, rulesets/Character.cpp, rulesets/Entity.cpp,
	  rulesets/Entity.h, rulesets/MemMap.cpp, rulesets/Movement.cpp,
	  rulesets/Pedestrian.cpp, rulesets/Plant.cpp,
	  rulesets/Py_Location.cpp, rulesets/Thing.cpp, rulesets/World.cpp,
	  server/Account.cpp, server/EntityFactory.cpp, server/Persistor.cpp,
	  server/Persistor_impl.h, server/Restorer_impl.h,
	  server/WorldRouter.cpp, tests/Locationtest.cpp:
	  Use the const accessors whenver reading data from Location.
2005-09-28 23:02:50 +00:00
Al Riddoch
f3a20714ec 2005-09-26 Al Riddoch <alriddoch@zepler.org>
* common/BaseEntity.cpp, common/custom.cpp, common/op_switch.h,
	  common/types.h, rulesets/BaseMind.cpp, rulesets/Character.cpp,
	  rulesets/Creator.cpp, rulesets/Food.cpp, rulesets/Plant.cpp,
	  rulesets/Thing.cpp, rulesets/World.cpp, server/Admin.cpp,
	  server/Admin.cpp: Replace OpNo enumeration with defines for the
	  integer class numbers.  Expand the switch statements used for op
	  dispatch because runtime extended op definitions don't have a const
	  number.

	* server/EntityFactory.cpp: Re-order installation of ops to ensure
	  the number registered in enumeration maps is the one returned by
	  the Atlas factories.

	* rulesets/Character.cpp: Improve debug output for op handling when
	  debug is enabled for this file.
2005-09-26 00:06:19 +00:00
Al Riddoch
5360789b4d 2005-09-19 Al Riddoch <alriddoch@zepler.org>
* server/EntityFactory.cpp: Report if entities have velocity on
	  creation.
2005-09-19 20:07:30 +00:00
Al Riddoch
f2a739734a 2005-09-14 Al Riddoch <alriddoch@zepler.org>
* client/ClientConnection.cpp: Improve error reporting when
	  unexpected object arrives from server.

	* rulesets/Character.cpp: Invert test so that tool use op arguments
	  are now set correctly.

	* rulesets/Entity.cpp: Use proper entities to handle responses to
	  Create and Look ops.

	* server/Connection.cpp, server/EntityFactory.cpp: Improve error
	  reporting using String::compose.

	* server/EntityFactory.cpp: Invert test so that all custom ops
	  now don't fail to get installed. Ensure that custom ops that
	  need to wait for their parent a properly inserted into the
	  waiting queue.
2005-09-13 23:29:42 +00:00
Al Riddoch
5fd6bc0abd 2005-09-12 Al Riddoch <alriddoch@zepler.org>
* common/inheritance_impl.h, common/inheritance.h,
	  common/inheritance.cpp, common/custom.cpp: Get rid of the op
	  factory feature of inheritance, as its not required.

	* server/EntityFactory.cpp: Register op types defined in the
	  data into the Atlas factory rather than the old inheritance
	  factory mechanism.
2005-09-12 01:33:53 +00:00
Al Riddoch
9ef58988e3 2005-09-11 Al Riddoch <alriddoch@zepler.org>
* modules/Location.h, modules/Location.cpp: Remove handling of
	  LOC attribute from readFromEntity() as every use of this function
	  has differen requirements.

	* rulesets/MemMap.cpp: Implement setting LOC so that the minimum
	  of lookups in the world dictionary are required.

	* server/EntityFactory.cpp: Implement setting LOC in a much simpler
	  way, as its always uninitialised at this point.

	* client/BaseClient.cpp: Add a note that LOC is currently unhandled,
	  as there is nothing sane to do with it.
2005-09-11 01:43:29 +00:00
Al Riddoch
372ddf5271 2005-09-10 Al Riddoch <alriddoch@zepler.org>
* modules/Location.cpp, modules/Location.h: Add a new method to
	  read location data from an Atlas Entity.

	* rulesets/MemMap.cpp, server/EntityFactory.cpp, client/BaseClient.cpp:
	  Switch to using new function rather than Entity::getLocation.

	* rulesets/Entity.h, rulesets/Entity_getLocation.h: Remove obsolete
	  getLocation method.
2005-09-10 10:28:45 +00:00
Al Riddoch
84b04428eb 2005-09-08 Al Riddoch <alriddoch@zepler.org>
* rulesets/Entity.cpp: Update copyright date.

	* rulesets/BaseMind.cpp, rulesets/Entity_getLocation.h,
	  rulesets/Entity.h, rulesets/MemMap.cpp, rulesets/MemMap.h,
	  rulesets/Py_Map.cpp, server/EntityFactory.cpp,
	  server/EntityFactory.h, server/WorldRouter.cpp,
	  client/BaseClient.cpp, client/CreatorClient.cpp:
	  Change various methods to pass entity information
	  around as RootEntity rather than MapType.
2005-09-08 15:03:31 +00:00
Al Riddoch
42e1c99565 2005-08-30 Al Riddoch <alriddoch@zepler.org>
* common/AtlasFileLoader.cpp, common/Database.cpp,
	  common/FormattedXMLWriter.cpp, common/Property.cpp,
	  common/accountbase.cpp, rulesets/Character.cpp,
	  rulesets/Entity_getLocation.h, rulesets/MemMap.cpp,
	  rulesets/Pedestrian.cpp, rulesets/Plant.cpp,
	  rulesets/Py_Object.cpp, rulesets/Thing.cpp,
	  server/Admin.cpp, server/Connection.cpp, server/EntityFactory.cpp,
	  server/WorldRouter.cpp, tools/AdminClient.cpp, tools/cycmd.cpp,
	  tools/cyconvertrules.cpp: After an Element has been checked
	  with isFoo(), it is more efficient to get its value using Foo()
	  rather than asFoo() which repeats the check.
2005-08-30 20:43:19 +00:00
Al Riddoch
fdd316b628 2005-08-27 Al Riddoch <alriddoch@zepler.org>
* Port whole code base to Atlas-C++ 0.6 series. Main server binary
	  now links.
2005-08-27 14:52:12 +00:00
Al Riddoch
9b76a9c3a7 2005-05-18 Al Riddoch <alriddoch@zepler.org>
* data/basic.xml, data/mason.xml: Add objtype to all rules.
	  Add a rule for ignite operation definition.

	* common/custom.cpp: Remove hardcoded ignite operation definition.

	* server/EntityFactory.cpp, server/EntityFactory.h: Remove some debug
	  output. Add new code to allow op_definitions to be installed as
	  rules.

	* common/inheritance.cpp, common/inheritance.h: Return an error code
	  when a type without parents gets installed, rather than throwing an
	  exception.

	* tests/inheritancetest.cpp: Fix test so it no longer expects an
	  exception.

	* rulesets/mason/world/objects/clothing/Garment.py: Remove some
	  debug output.

	* tools/AdminClient.cpp: Remove hardcoded objtype, depending instead
	  on objtype from the data file. Fix a bug where the full rule
	  was not getting uploaded when updating an existing rule.
	  Improve error reporting when update fails.
2005-05-17 23:51:26 +00:00