Commit graph

418 commits

Author SHA1 Message Date
Al Riddoch
d699a4ef8c 2006-08-01 Al Riddoch <alriddoch@zepler.org>
* rulesets/Entity.h, rulesets/Entity.cpp: Add a override of
	  BaseEntities operation() method which handles calling
	  script operation handlers directly, rather than relying
	  on the C++ handlers to check for them later.

	* rulesets/Character.cpp, rulesets/BaseMind.cpp: Check for script
	  operation handlers centrally in Character and BaseMind too.
2006-08-01 11:17:16 +00:00
Al Riddoch
e1fee4628c 2006-07-31 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Add script hooks to Wield and Nourish
	  handlers.
2006-07-31 17:47:59 +00:00
Al Riddoch
d729b606c9 2006-07-31 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Move the script hook for Character
	  to the beginning of the Tick op handler.
2006-07-31 17:41:48 +00:00
Al Riddoch
a6ecac949b 2006-07-31 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Add script override code to the
	  imaginary and talk operation handlers.
2006-07-31 17:34:27 +00:00
Al Riddoch
56f7a816e3 2006-07-19 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Remove Appearance from SetupOperation
	  in Character too.
2006-07-20 23:09:35 +00:00
Al Riddoch
a5549afaaf 2006-07-19 Al Riddoch <alriddoch@zepler.org>
* data/basic.xml: Make coin inherit from stackable.

	* rulesets/Character.cpp, rulesets/Stackable.cpp: Add debug output
	  to new combine op handlers.
2006-07-19 02:44:18 +00:00
Al Riddoch
9ff4f941b8 2006-07-17 Al Riddoch <alriddoch@zepler.org>
* rulesets/Stackable.cpp: Report an error if a divide op has
	  args with the wrong ID.

	* rulesets/Character.h, rulesets/Character.cpp: Add function
	  to check if an entity is in the characters inventory.

	* rulesets/Character.cpp: First pass at implementing filters
	  for combine and divide ops from the client.
2006-07-17 02:09:36 +00:00
Al Riddoch
d9962b3bd0 2006-07-11 Al Riddoch <alriddoch@zepler.org>
* common/BaseEntity.cpp, common/BaseEntity.h: Remove opEnumerate
	  method as its now a trivila call to another method.

	* rulesets/BaseMind.cpp, rulesets/Character.cpp, rulesets/Creator.cpp:
	  Replace calls to opEnumerate with direct calls to getClassNo().
2006-07-11 14:24:26 +00:00
Al Riddoch
640c3d28d7 2006-07-03 Al Riddoch <alriddoch@zepler.org>
* client/Py_CreatorClient.cpp, rulesets/Character.cpp,
	  rulesets/Entity.cpp, rulesets/Entity.h, rulesets/Food.cpp,
	  rulesets/Pedestrian.cpp, rulesets/Plant.cpp, rulesets/Py_Mind.cpp,
	  rulesets/Py_Thing.cpp, rulesets/Thing.cpp, server/WorldRouter.cpp:
	  Rename Entity members get(), set() and has() to getAttr(), setAttr()
	  and hasAttr().
2006-07-03 01:41:29 +00:00
Al Riddoch
afd260bf59 2006-06-20 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Don't forward ops to the mind blindly if
	  we don't know what they are.
2006-06-20 16:39:51 +00:00
Al Riddoch
f725415b57 2006-06-19 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Re-write comments about sending ops from
	  mind to world.
2006-06-19 17:21:46 +00:00
Al Riddoch
07da807b3b 2006-06-06 Al Riddoch <alriddoch@zepler.org>
* common/BaseEntity.cpp, rulesets/Character.cpp, rulesets/Creator.cpp,
	  server/Account.cpp, server/Admin.cpp, server/Connection.cpp,
	  server/Lobby.cpp, server/WorldRouter.cpp: Don't bother with serial
	  numbers on ops generated inside the server. They just leak and upset
	  clients.
2006-06-07 00:13:39 +00:00
Al Riddoch
e757778db6 2006-06-05 Al Riddoch <alriddoch@zepler.org>
* rulesets/Movement.h: Add method to check if a target position has
	  been specified.

	* rulesets/Character.cpp: Don't return a tick for movement if no
	  target is specified, as the old movement object has no further
	  role to play.
2006-06-05 13:10:08 +00:00
Al Riddoch
4bfb14f060 2006-06-05 Al Riddoch <alriddoch@zepler.org>
* server/Connection.cpp, server/CommClient.cpp, server/Account.cpp:
	  Only set refnos on ops if the client has set a serial number.

	* rulesets/Character.cpp: Simplify handling the transfer of
	  operations from client to in-game. Don't give new operations
	  serial numbers at this point.
2006-06-05 12:57:29 +00:00
Al Riddoch
abeb2a55bf 2006-05-14 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Be more severe about error messages if
	  client sends an action op. Remove obsolete comments.
	  Warn if client sends a Set op. Don't accept look ops with
	  an arg containing no ID - nothing sends this, and nothing should.

	* rulesets/Thing.cpp: Add an error report if an explicit Action op
	  is received by an entity.
2006-05-14 02:26:17 +00:00
Al Riddoch
a884fa4866 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
Al Riddoch
b4c3fdf21e 2006-04-29 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp, rulesets/Task.cpp: Fix the name of the
	  TASKS attribute.

	* rulesets/mason/world/tasks/Logging.py: Make the logging task
	  progress in the right direction.
2006-04-30 01:12:10 +00:00
Al Riddoch
21478516e8 2006-04-29 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Set ID on the argument of set ops
	  used to handle tasks. Remove debug output.
2006-04-29 21:41:21 +00:00
Al Riddoch
cda06e34bf 2006-04-29 Al Riddoch <alriddoch@zepler.org>
* rulesets/Task.cpp, rulesets/Task.h: Add two members to task,
	  progress and rate which handle the progress towards completion,
	  and the rate at which it is changing. Add a member function which
	  adds an atlas representation of the task as an attribute to an
	  Atlas entity.

	* rulesets/Py_Task.cpp: Expose progress and rate attributes allowing
	  them to be set.

	* server/TaskFactory.cpp: Set the name of a task when it is created
	  by its factory.

	* rulesets/mason/world/tasks/Logging.py: Set the progress and rate
	  of the logging task as it progresses.

	* rulesets/Character.h, rulesets/Character.cpp: Add updateTask()
	  method to be called when task ticks. Make initTask, updateTask
	  and clearTask emit Set operations which set the TASK attribute
	  on the character to reflect the current status of the task.
2006-04-29 20:41:50 +00:00
Al Riddoch
f2582fecc9 2006-04-27 Al Riddoch <alriddoch@zepler.org>
* rulesets/mason/world/tasks/Ram.py: Use two move ops to give the
	  entity being hammered a short burst of velocity, so it being
	  hammered in is visible.

	* rulesets/Character.cpp: Don't process task tick ops if they have
	  no serial number.
2006-04-27 17:30:08 +00:00
Al Riddoch
1857b859a6 2006-04-27 Al Riddoch <alriddoch@zepler.org>
* rulesets/mason/world/tasks/Logging.py,
	  rulesets/mason/world/tasks/Raise.py,
	  rulesets/mason/world/tasks/Ram.py,
	  rulesets/mason/world/tasks/Sharpen.py: Add serial numbers to
	  tick ups.

	* rulesets/mason/world/tasks/Combat.py: Fix the attacker initiative
	  and detect if combat is obsolete if a character has been defeated.

	* rulesets/Task.h: Add an accessor to return an incremented serial
	  number for a new tick op.

	* rulesets/Py_Task.cpp: Add python wrapper for new tick accessor.

	* rulesets/Character.cpp: Add debug output to code enforcing
	  old task ticks.
2006-04-27 17:04:09 +00:00
Al Riddoch
e8b5625cbb 2006-04-27 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Re-write the way combat is initialised
	  so each participant owns its own combat task object.

	* rulesets/mason/world/tasks/Combat.py: Re-implement the example
	  combat system so it works with one instance per character instead
	  of one per battle.
2006-04-27 00:55:40 +00:00
Al Riddoch
c35bb178a4 2006-04-27 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp, rulesets/Py_Operation.cpp,
	  rulesets/Python_API.cpp: Remove last remaining remnants of
	  code using SUB_TO.
2006-04-26 23:40:34 +00:00
Al Riddoch
2f1eb7133a 2006-04-26 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: When the client sends a Use op with
	  no args, stop the current task. A mechanism for testing the
	  task for interruptibility is still required, so characters can't
	  escape too easily from combat.
2006-04-26 20:19:51 +00:00
Al Riddoch
d33806e600 2006-04-26 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Stop using SUB_TO for tick and setup ops to
	  subsystems, and use argument.NAME instead to indicate the subsystem
	  to be compatible with movement ticks.
2006-04-26 15:21:15 +00:00
Al Riddoch
f306be60c3 2006-04-26 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Simplify check tick ops for subsystem.

	* rulesets/Combat.h, rulesets/Fell.h: Remove obsolete hard coded
	  tasks from the build.

	* tests/Tasktest.cpp, tests/Fell.cpp, tests/Fell.h: Move old Fell
	  class into tests, and use it to verify tasks operate correctly.
2006-04-26 10:04:04 +00:00
Al Riddoch
53cfab0611 2006-04-26 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp, rulesets/Task.cpp, rulesets/Task.h,
	  rulesets/TaskScript.cpp: Re-work tick ops to tasks so they use
	  argument, not sub_to to get routed to the task. Do the groundwork
	  for having a serial number for each op, which resets to zero when
	  a new task is started.

	* rulesets/mason/world/tasks/Combat.py,
	  rulesets/mason/world/tasks/Logging.py,
	  rulesets/mason/world/tasks/Raise.py,
	  rulesets/mason/world/tasks/Ram.py,
	  rulesets/mason/world/tasks/Sharpen.py: Modify all current tasks
	  to set their arg as required.
2006-04-26 01:20:47 +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
743e11a2f0 2006-04-19 Al Riddoch <alriddoch@zepler.org>
* rulesets/Py_Vector3D.cpp: Fix incorrect METH_VARARGS function type
	  of the three rotateN methods, as it should have been converted to
	  METH_O. Add a new rotate method used to rotate a vector using a
	  quaternion.

	* rulesets/Py_Quaternion.cpp: Add a method to check the validity of
	  the quaternion, and a type method to create a string representation
	  of the quaternion.

	* rulesets/Character.cpp: Remove commented out legacy hard coded
	  combat task setup. Now all tasks are scripts.

	* rulesets/mason/world/tasks/Logging.py: Break logging down into
	  something that happens over many ticks, using the orientation of
	  the tree to determine if its felled yet.
2006-04-19 22:46:00 +00:00
Al Riddoch
b321b0657f 2006-04-18 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: When tick ops are passed to mind, check
	  that SUB_TO=="mind" so that task ticks don't get treated as mind
	  ticks.

	* rulesets/mason/world/tasks/Combat.py: Clean up logic for checking
	  attacker stamina on initialisation.
2006-04-18 13:26:55 +00:00
Al Riddoch
21faff869f 2006-04-18 Al Riddoch <alriddoch@zepler.org>
* rulesets/mason/world/tasks/Combat.py: Re-work the way combat works
	  so all involved entities do their own tick ops, rather than the
	  whole thing being coordinated by only one entity. This simplifies
	  removing the task once obsolete.

	* rulesets/Py_Thing.cpp: Add get_task() on Character so task is
	  available to scripts.

	* rulesets/Py_Oplist.cpp: Allow an oplist to be appended to an
	  oplist as well as being added.

	* rulesets/Character.h: Add an accessor for task.

	* rulesets/Character.cpp: Ensure a task is cleared if it does not
	  get initialised.
2006-04-17 23:58:03 +00:00
Al Riddoch
02bbdc7af5 2006-04-05 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Improve error logging in task setup.

	* rulesets/Task.h, rulesets/Py_Task.cpp: Add an accessor for the
	  refcount of a task, and expose it to the script interface.

	* rulesets/mason/world/tasks/Combat.py: Add a check that there are
	  still at least two participants in combat, or end the task.
2006-04-15 09:55:22 +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
7dc0d82303 2006-04-03 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Further cleanups of mind Use op handler,
	  and improvements to error messages.
2006-04-03 13:46:02 +00:00
Al Riddoch
39fbb91462 2006-04-03 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.h, rulesets/Character.cpp: Add stub of Use op
	  handler on character. Re-write the mind Use op handler to be
	  cleaner, faster and easier to understand.
2006-04-03 00:52:53 +00:00
Al Riddoch
410312f866 2006-02-20 Al Riddoch <alriddoch@zepler.org>
* rulesets/Entity.h, rulesets/Thing.cpp: Add a signal to be emitted
	  when an entities container changes, and emit it during
	  MoveOperation processing.

	* rulesets/Character.h, rulesets/Character.cpp: Hook up to the
	  containered signal of a wielded entity, and unwield it when its
	  container changes.
2006-02-21 01:41:59 +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
8963785b31 2006-01-17 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Remove error reports when client sends
	  move ops which refer to a non-existant entity.
2006-01-17 16:37:44 +00:00
Al Riddoch
c51eb98c01 2006-01-11 Al Riddoch <alriddoch@zepler.org>
* rulesets/PythonArithmeticScript.cpp: Implement getting attribute
	  values from statistics script.

	* rulesets/Statistics.cpp, rulesets/Statistics.h,
	  rulesets/Py_Statistics.cpp, rulesets/Character.cpp,
	  rulesets/Combat.cpp: Remove hard coded stats for combat
	  and strength.

	* rulesets/mason/world/statistics/Statistics.py: Add test support
	  for combat and strength stats.

	* server/PersistantThingFactory.cpp: Remove debug output.
2006-01-11 16:55:55 +00:00
Al Riddoch
223a8cc309 2005-12-31 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Reduce the rate at which animal mass is
	  consumed when they are starving.
2005-12-31 00:55:14 +00:00
Al Riddoch
d3f2f1a351 2005-12-30 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp, rulesets/StatisticsProperty.h,
	  rulesets/StatisticsProperty.cpp: Add a property handler for
	  statistics.

	* rulesets/Character.cpp: When setting task, check if an existing
	  task needs to be cleared first. When clearing a task, check
	  whether a task exists or not.

	* rulesets/Character.cpp: When initiating combat task from task
	  factory, check to see if the task is successfully created before
	  using it.

	* rulesets/Py_Property.cpp, rulesets/Py_Property.h: New python wrapper
	  class for entity properties.

	* rulesets/Py_Mind.cpp: Re-work getattr logic to make it clearer.

	* rulesets/Py_Object.cpp: Return Py_None when an Atlas Element cannot
	  be converted to python. This ensures that this function never returns
	  null.

	* rulesets/Py_Statistics.cpp: Add temporary handlers for hardcoded
	  statistics for "attack", "defence", and "strength".

	* rulesets/Py_Task.cpp: Add wrappers for methods Task.irrelevant and
	  Task.obsolete, as these are now required in combat scripts.

	* rulesets/Py_Task.h: Fix the PyTask_Check macro, which was miscoded.

	* rulesets/Py_Thing.cpp: Add wrapper for Entity.send_world so that
	  scripts can channel ops through entities.

	* rulesets/Py_Thing.h, rulesets/Py_Thing.cpp: Add an addition structure
	  for directlty wrapping Character in a type safe way. Add method
	  structure pointer to Entity and Character wrappers so that
	  the same getattr method is used for both. Add new method table for
	  Character including wrappers for set_task and clear_task, allowing
	  task scripts to add themselves and remove themselves from
	  characters. Modify wrapEntity() to ensure that Character entities
	  get the right wrapper.

	* rulesets/Py_Thing.cpp: Re-work getattr code so that properties and
	  soft attributes are checked individually, rather than in a single
	  call to Entity.get. Use new python property wrappers to wrap
	  properties explicitly if required rather than converting to Atlas
	  then to generic Python data.

	* rulesets/TerrainProperty.h: Fix incorrect class description in
	  documentation.

	* rulesets/mason/world/tasks/Combat.py: Complete implementation of
	  simple example combat.

	* server/TaskFactory.cpp: Remove debug output.
2005-12-30 18:02:40 +00:00
Al Riddoch
8dc08013dd 2005-12-26 Al Riddoch <alriddoch@zepler.org>
* common/BaseWorld.h: Add factory method for new tasks to the world
	  interface.

	* rulesets/Character.cpp: Use world interface to create combat
	  task, rather than using EntityFactory directly.

	* server/WorldRouter.h, server/WorldRouter.cpp: Implement the
	  new task method in the core world object.
2005-12-26 23:05:16 +00:00
Al Riddoch
d68e894f5a 2005-12-26 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Switch to using the test combat script.

	* rulesets/Py_EntityWrapper.h, rulesets/Py_Statistics.h: Move the
	  generic entity wrapper structure into its own header.

	* client/Py_CreatorClient.cpp, rulesets/Py_Location.cpp,
	  rulesets/Py_Location.h, rulesets/Py_Mind.cpp, rulesets/Py_Thing.cpp,
	  rulesets/Python_API.cpp: Modify PyLocation so that rather than
	  having a flag to indicate whether the script owns the object,
	  it instead stores a pointer to the entity that owns it in that
	  eventuality.

	* rulesets/Py_Thing.cpp: Allow map and list attributes to be set from
	  scripts as long as the contents are Atlas compatible.

	* rulesets/Python_API.cpp: Fix script output handling so only complete
	  lines are output.

	* rulesets/mason/world/tasks/Combat.py: Add code for identifying
	  attacker and defender in a combat.
2005-12-26 18:49:14 +00:00
Al Riddoch
c2e1e78271 2005-12-23 Al Riddoch <alriddoch@zepler.org>
* rulesets/mason/world/tasks/Combat.py: Expand the sample combat
	  to include tick ops.

	* rulesets/Python_API.cpp, rulesets/Py_Operation.cpp: Add necessary
	  handlers for sub_to attribute on operations.

	* rulesets/Character.cpp: Adapt test code for combat scripts to
	  the latest task API.
2005-12-23 23:34:19 +00:00
Al Riddoch
c6ddb48ac8 2005-12-09 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.h, rulesets/Character.cpp: Add a function to
	  assign a task to a character.

	* tests/Tasktest.cpp: Test the combat task.
2005-12-09 22:43:40 +00:00
Al Riddoch
c111c29826 2005-12-09 Al Riddoch <alriddoch@zepler.org>
* rulesets/Script.cpp: Document the script interface.

	* rulesets/Task.h: Modify task interface so tasks now expect
	  the operation that initiated the task to be passed in
	  to an init function.

	* rulesets/Combat.h, rulesets/Combat.cpp: Modify the combat task
	  methods to match the interface changes.

	* rulesets/Character.cpp: Modify Combat use to take account
	  of interface changes. Prototype using script based
	  combat.

	* rulesets/TaskScript.h, rulesets/TaskScript.cpp: Implement
	  passing the initialising op through to the script using the
	  standard scripp operation handling functions.

	* rulesets/mason/world/tasks/Combat.py: Add handler for Attack
	  operation, which should now be passed in at init time.
2005-12-09 09:33:17 +00:00
Al Riddoch
c2ab5ff120 2005-11-23 Al Riddoch <alriddoch@zepler.org>
* common/id.cpp, common/id.h: Break integer ID conversion into
	  two versions, one which abort()s and one which returns a known
	  invalid ID.

	* rulesets/Character.cpp: Fix the grammar in an error message.

	* server/Player.cpp: Make error message on failed character creation
	  clearer.
2005-11-23 11:13:11 +00:00
Al Riddoch
895e7e6797 2005-11-23 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Prevent characters from attacking themselves.
2005-11-23 10:52:20 +00:00
Al Riddoch
7da6d9838c 2005-11-21 Al Riddoch <alriddoch@zepler.org>
* rulesets/Entity.cpp: Switch to using SignalProperty for BBOX.

	* rulesets/Area.cpp, rulesets/Character.cpp, rulesets/Line.cpp,
	  rulesets/Plant.cpp, rulesets/Py_Location.cpp:
	  Update bbox on location using setBBox(), so cached values are
	  updated.
2005-11-21 14:34:03 +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