Commit graph

160 commits

Author SHA1 Message Date
Al Riddoch
d2bc4fcae9 2007-01-12 Al Riddoch <alriddoch@zepler.org>
* rulesets/Py_BBox.cpp, rulesets/Py_Location.cpp, rulesets/Py_Map.cpp,
	  rulesets/Py_Mind.cpp, rulesets/Py_Object.cpp,
	  rulesets/Py_Operation.cpp, rulesets/Py_Oplist.cpp,
	  rulesets/Py_Optime.cpp, rulesets/Py_Quaternion.cpp,
	  rulesets/Py_RootEntity.cpp, rulesets/Py_Task.cpp,
	  rulesets/Py_Thing.cpp, rulesets/Py_World.cpp,
	  rulesets/Python_API.cpp: Replace calls to PyMem_DEL with calls
	  to PyObject_Free. Thanks to Kai for doing most of the digging
	  on this one.
2007-01-12 12:38:05 +00:00
Al Riddoch
1a59d10ddd 2006-12-22 Al Riddoch <alriddoch@zepler.org>
* server/CommClient.h, server/CommListener.h, server/CommLocalClient.h,
	  server/CommMDNSPublisher.h, server/CommMaster.h,
	  server/CommMetaClient.h, server/CommPSQLSocket.h,
	  server/CommPeer.h, server/CommPeerListener.h,
	  server/CommRemoteClient.h, server/CommServer.h,
	  server/CommSlaveClient.h, server/CommSlaveListener.h,
	  server/CommSocket.cpp, server/CommSocket.h,
	  server/CommUnixListener.h: Add a documentation group for socket
	  classes.

	* rulesets/Py_BBox.h, rulesets/Py_EntityWrapper.h,
	  rulesets/Py_Location.h, rulesets/Py_Map.h, rulesets/Py_Mind.h,
	  rulesets/Py_Object.h, rulesets/Py_Operation.h,
	  rulesets/Py_Oplist.h, rulesets/Py_Optime.h, rulesets/Py_Point3D.h,
	  rulesets/Py_Property.h, rulesets/Py_Quaternion.h,
	  rulesets/Py_RootEntity.h, rulesets/Py_Task.h, rulesets/Py_Thing.h,
	  rulesets/Py_Vector3D.h, rulesets/Py_World.h, rulesets/Py_WorldTime.h,
	  rulesets/Python_API.cpp: Add documentation group for Python wrapper
	  types.

	* rulesets/Container.h, rulesets/PythonScript.cpp,
	  server/ScriptFactory.h, server/ScriptFactory.cpp:
	  Add more inline documentation comments.
2006-12-22 02:14:44 +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
e9e40f04ec 2006-10-20 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_API.cpp: Clean out unused keyword handling in debug
	  functions, fix code to comply with style. Ensure debug calls have
	  minimal cost if debugging is disabled.
2006-10-20 15:09:59 +00:00
Al Riddoch
ae25429787 2006-10-20 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_API.cpp: Add debug hooks for the python API, to
	  help debug scripts.
2006-10-20 14:26:19 +00:00
Al Riddoch
638dc66da0 2006-08-30 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_API.cpp: Change the entity_new constructor used
	  by define world scripts so that it takes an optional "pos" argument
	  rather than the long obsolete "xyz".

	* rulesets/mason/define_world.py, rulesets/werewolf/define_world.py:
	  Modify the most relevant define_world scripts to use the changed API.

	* rulesets/basic/mind/goals/common/move.py: Remove a long obsolete
	  commented out debug line.
2006-08-29 23:54:08 +00:00
Al Riddoch
94de650f41 2006-08-15 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_API.cpp: In Python Entity constructor, tighten
	  up checks so exceptions are thrown for initialisers of the wrong
	  type. Convert xyz sequence more directly to C++ vector for
	  efficiency.
2006-08-15 15:38:29 +00:00
Al Riddoch
b85adc0ddf 2006-08-14 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_API.cpp: Ensure operation_new return value is set
	  to null if an exception is generated in addToArgs().
2006-08-14 22:51:42 +00:00
Al Riddoch
c4058e429a 2006-08-14 Al Riddoch <alriddoch@zepler.org>
* rulesets/Py_BBox.cpp, rulesets/Py_Statistics.cpp,
	  rulesets/Python_API.cpp: Replace calls to the cyphesis log
	  system with Python exceptions.

	* rulesets/Py_Mind.cpp: Accept map and list atlas attributes on
	  the mind object.

	* rulesets/Py_Property.cpp: Improve the wording of some log messags.

	* rulesets/Py_RootEntity.cpp: Assert that attributes work correctly.

	* rulesets/Plant.cpp: Add FIXME about an issue with plants eating
	  people.
2006-08-14 21:42:50 +00:00
Al Riddoch
7287d25109 2006-08-03 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_API.cpp: Expose wfmath's epsilon as a const value
	  to python.

	* rulesets/Py_Point3D.cpp: Expose isValid() method on WFMath::Point<3>
	  to python.
2006-08-03 20:31:28 +00:00
Al Riddoch
87c135a6af 2006-07-08 Al Riddoch <alriddoch@zepler.org>
* common/const.h: Remove obsolete config option to disable
	  range checks and calculations.

	* client/ObserverClient.cpp, rulesets/Movement.cpp,
	  server/Admin.cpp, tools/AdminClient.h, tools/cycmd.cpp:
	  Remove const.h from files which no longer require it.

	* rulesets/Python_API.cpp: Remove python bindings for obsolete
	  constants.

	* rulesets/Thing.cpp, rulesets/World.cpp, server/WorldRouter.cpp:
	  Remove obsolete rotten code for handling sight without ranges.

	* tests/consttest.cpp: Remove tests for removed constants.
2006-07-08 20:45:10 +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
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
21bbf87ffe 2006-05-02 Al Riddoch <alriddoch@zepler.org>
* rulesets/Py_Point3D.cpp, rulesets/Py_Vector3D.cpp,
	  rulesets/Python_API.cpp: Extend the type object for python
	  Vector3D and Point3D to the format used by more recent python
	  versions, adding init methods as well as flags, and doc string.
2006-05-02 22:45:58 +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
13254d28d3 2006-04-19 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_API.cpp: Improve the quaternion constructor
	  so it can build one from an axis and an angle of rotation.

	* rulesets/Py_Quaternion.cpp: Add support for multiplying quaternions
	  together.

	* data/mason.xml: Add rules for a pole tool, together with
	  operations and tasks associated with the pole.

	* rulesets/mason/world/tasks/Raise.py: Add a task used with the
	  pole to lever items into different orientations. When used on an
	  entity, the entity is oriented away from the users current
	  position, rotating around a horizontal axis.
2006-04-20 15:48:34 +00:00
Al Riddoch
9600aabab5 2006-01-21 Al Riddoch <alriddoch@zepler.org>
* client/Py_CreatorClient.cpp, rulesets/Py_Map.cpp,
	  rulesets/Py_Operation.cpp, rulesets/Py_Oplist.cpp,
	  rulesets/Py_Point3D.cpp, rulesets/Py_Vector3D.cpp,
	  rulesets/Py_WorldTime.cpp, rulesets/Python_API.cpp:
	  Convert functions that take a single argument to use METH_O
	  and avoid calling PyArg_ParseTuple.

	* rulesets/Py_Point3D.cpp, rulesets/Py_Vector3D.cpp,
	  rulesets/basic/mind/goals/common/move.py: Rename
	  unit_vector_to_another_vector to unit_vector_to.
2006-01-22 02:13:52 +00:00
Al Riddoch
61a72ecde4 2006-01-20 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_API.cpp: Allow FROM to be set on operations in
	  the constructor so that attac ops from combat work better.
2006-01-20 15:03:33 +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
a3edf75eb6 2006-01-15 Al Riddoch <alriddoch@zepler.org>
* rulesets/mason/world/tasks/Combat.py: Add method to cause one
	  entity to turn to face the other, and use it each tick of combat.

	* rulesets/Python_API.cpp: Rename "rules" python module to "rulesets"
	  so it maps more directly onto the classes it wraps.

	* rulesets/mason/world/statistics/Statistics.py: Use modified rulesets
	  module name.
2006-01-15 20:58:52 +00:00
Al Riddoch
f8b54007ac 2006-01-06 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_API.cpp: Remove C++ implementation of server.dictlist
	  as its installation was messy, and it serves no purpose being
	  implemented in C++.

	* rulesets/basic/mind/NPCMind.py, rulesets/basic/mind/dictlist.py:
	  Use python dictlist implementation from original Python version
	  of cyphesis.
2006-01-06 21:39:00 +00:00
Al Riddoch
3e984dd1d3 2006-01-06 Al Riddoch <alriddoch@zepler.org>
* rulesets/Py_Statistics.cpp: Extend type structure to comply with
	  more recent Python API.

	* rulesets/Python_API.cpp: Add Statistics to a new module called
	  rules.
2006-01-06 21:14:33 +00:00
Al Riddoch
027b481aee 2006-01-05 Al Riddoch <alriddoch@zepler.org>
* rulesets/Py_WorldTime.cpp: Extend the type object for python
	  WorldTime to the format used by more recent python versions,
	  adding new and init methods as well as flags, and doc string.

	* rulesets/Python_API.cpp: Refactor the way the server python
	  module and its type server.WorldTime are created to be the
	  preferred way for more recent python versions.

	* rulesets/basic/mind/NPCMind.py: Remove explicit WorldTime
	  member, as there is already one in the C++ base class.
2006-01-05 16:52:52 +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
a2914a39e3 2005-12-24 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_API.cpp: Re-work the keywords handling in Operation()
	  to avoid bugs in the mapping protocol by using Dict functions, and
	  eliminate wasteful double lookup. No longer accept setting FROM
	  in constructor as its never required.

	* rulesets/werewolf/world/objects/characters/Villager.py,
	  rulesets/basic/editor.py: No longer set FROM on operations at
	  construction. It was never necessary.
2005-12-24 02:23:31 +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
560887fccd 2005-12-14 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_API.cpp: Remove an obsolete commented out function.

	* rulesets/CalendarProperty.cpp, rulesets/CalendarProperty.h,
	  rulesets/World.cpp: Add a new property to handle revealing
	  astronomical calendar information on the world object, so clients
	  can get day/night cycle right.

	* tools/cycmd.cpp: Improve formatting of output Atlas data, to make
	  it readable.
2005-12-14 17:16:21 +00:00
Al Riddoch
ad8e5989cf 2005-12-11 Al Riddoch <alriddoch@zepler.org>
* rulesets/PythonWrapper.h, rulesets/PythonWrapper.cpp: Add new
	  class which inherits from Script to store a wrapper pointer
	  for instances which have no script.

	* rulesets/PythonScript.h, rulesets/PythonScript.cpp,
	  rulesets/PythonThingScript.h, rulesets/PythonThingScript.cpp,
	  rulesets/PythonMindScript.h, rulesets/PythonMindScript.cpp:
	  Refactor script classes to inherit from PythonWrapper to make
	  storing wrappers for mind and world entities easier.

	* rulesets/Py_Location.cpp, rulesets/Py_World.cpp: Use PythonWrapper
	  interface to get wrapper pointers from Script objects.

	* rulesets/Python_API.cpp: Improve variable names, and comment out
	  some unused code.
2005-12-11 20:33:43 +00:00
Al Riddoch
1ed6e05234 2005-12-11 Al Riddoch <alriddoch@zepler.org>
* rulesets/PythonThingScript.h, rulesets/PythonThingScript.cpp:
	  Store a pointer to the core object's python wrapper, and modify
	  constructor to initialise it.

	* rulesets/Python_API.cpp, server/ScriptFactory.cpp,
	  server/TaskFactory.cpp: Modify variable name to make it clearer
	  what the wrapper object is. Pass wrapper to script management
	  object constructor, so it can store the pointer.

	* rulesets/PythonMindScript.h: Make constructor explicit for
	  safety.
2005-12-11 03:28:18 +00:00
Al Riddoch
563b6c4714 2005-12-05 Al Riddoch <alriddoch@zepler.org>
* server/TaskFactory.cpp, server/TaskFactory.h: Re-write the
	  script task to handle creating the script directly, rather than
	  use ScriptFactory which is not suitable.

	* rulesets/PythonMindScript.cpp, rulesets/PythonScript.cpp,
	  rulesets/PythonScript.h, PythonThingScript.cpp,
	  rulesets/PythonThingScript.h, rulesets/Python_API.cpp,
	  server/ScriptFactory.cpp: Remove obsolete pointer to entity
	  from script class, removing its link to Entity, making it more
	  generally useful.
2005-12-05 23:47:17 +00:00
Al Riddoch
b60512e186 2005-11-30 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_API.cpp: Remove obsolete C++ set_kw() implementation.
2005-11-30 22:40:20 +00:00
Al Riddoch
19d808718a 2005-09-12 Al Riddoch <alriddoch@zepler.org>
* configure.ac: Increment version to development 0.5.x series.

	* aiclient/ClientAccount.cpp, client/BaseClient.cpp,
	  client/ClientConnection.cpp, common/BaseEntity.cpp,
	  common/Database.cpp, common/custom.cpp, common/inheritance.cpp,
	  common/operations.h, rulesets/BaseMind.cpp, rulesets/Creator.cpp,
	  rulesets/Food.cpp, rulesets/MemMap.cpp, rulesets/Pedestrian.cpp,
	  rulesets/Py_Operation.cpp, rulesets/Py_RootEntity.cpp,
	  rulesets/Python_API.cpp, rulesets/Stackable.cpp, rulesets/Thing.cpp,
	  rulesets/World.cpp, server/CommClient.cpp, server/Connection.cpp,
	  server/WorldRouter.cpp, tests/inheritancetest.cpp,
	  tools/AdminClient.h, tools/cyaddrules.cpp,
	  tools/cycmd.cpp, tools/cydumprules.cpp,
	  tools/cyloadrules.cpp, tools/cypasswd.cpp:
	  Remove unnecessary using directives.

	* common/utility.cpp, common/utility.h,
	  rulesets/BaseMind.cpp, rulesets/Py_Operation.cpp,
	  server/CommClient.cpp, tools/AdminClient.h, tools/cycmd.cpp:
	  Remove obsolete utility function from the build.

	* common/operations.h: Remove unused obsolete header from the
	  build.
2005-09-12 16:21:18 +00:00
Al Riddoch
d5637bacef 2005-09-11 Al Riddoch <alriddoch@zepler.org>
* rulesets/Py_Operation.h, rulesets/Py_Operation.cpp: Remove reference
	  ownership flag, and from and to pointers from the python operation
	  structure.

	* rulesets/Py_Map.cpp, rulesets/Py_Oplist.cpp,
	  rulesets/PythonMindScript.cpp, rulesets/PythonThingScript.cpp,
	  rulesets/Python_API.cpp: Remove all usage of own, from and to.

	* rulesets/basic/mind/NPCMind.py,
	  rulesets/basic/mind/goals/common/misc_goal.py,
	  rulesets/basic/mind/goals/humanoid/mason.py,
	  rulesets/basic/mind/goals/humanoid/transaction.py,
	  rulesets/mason/world/objects/clothing/Garment.py,
	  rulesets/mason/world/objects/plants/seeds/Acorn.py,
	  rulesets/mason/world/objects/plants/seeds/Apple.py,
	  rulesets/mason/world/objects/plants/seeds/Fircone.py,
	  rulesets/mason/world/objects/tools/Bucksaw.py,
	  rulesets/mason/world/objects/tools/Cleaver.py,
	  rulesets/mason/world/objects/tools/Trowel.py: Modify all scripts
	  so they expect from and to of ops to be an ID string rather than
	  an entity.
2005-09-11 18:51:55 +00:00
Al Riddoch
41fd29502f 2005-09-11 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_API.cpp: Modify Python API so Entity() now creates
	  a RootEntity not a Message Element.

	* client/Py_CreatorClient.cpp, client/CreatorClient.h,
	  client/CreatorClient.cpp: Modify CreatorClient and bindings to
	  take a RootEntity rather than a Message Element.
2005-09-11 17:48:26 +00:00
Al Riddoch
1a3157ffb3 2005-09-11 Al Riddoch <alriddoch@zepler.org>
* rulesets/Py_Object.h, rulesets/Py_Object.cpp: Remove nasty code
	  used to handle complex attributes to Message Elements. Now should
	  either be converted or rejected.

	* rulesets/Python_API.cpp: Remove code that merged complex python
	  attributes to entity arguments.

	* rulesets/Py_Mind.cpp: Add note that as_entity() method should
	  be removed in the long term.
2005-09-11 17:04:32 +00:00
Al Riddoch
4b41bdb212 2005-09-11 Al Riddoch <alriddoch@zepler.org>
* rulesets/Py_Object.cpp, rulesets/Py_Object.h: Ensure that
	  Python to Atlas conversions are aborted if they fail at any
	  point.

	* rulesets/Py_RootEntity.cpp: Ensure all static functions still have
	  unique names. Support setting and retrieving soft attributes.
	  For attribute values which are non-convertible python objects,
	  store a pointer to the original Python object.

	* rulesets/Python_API.cpp: Adapt setting of operation arguments
	  modified Python to Atlas conversion functions.

	* rulesets/mason/define_world.py: Add a very basic test for
	  experimenting with interlinguish.
2005-09-11 13:50:14 +00:00
Al Riddoch
d375a679bc 2005-09-11 Al Riddoch <alriddoch@zepler.org>
* rulesets/Py_Operation.cpp: Return entity arguments as RootEntity
	  rather than MessageElement.

	* rulesets/Py_RootEntity.cpp: get_name() returns "obj" as it should
	  rather than "op". Add warnings if unknown attributes are requested
	  or set.

	* rulesets/Python_API.cpp: Accept RootEntity python wrapped
	  objects as arguments to operations.
2005-09-10 23:47:25 +00:00
Al Riddoch
925401e492 2005-08-28 Al Riddoch <alriddoch@zepler.org>
* common/custom.cpp: Install an atlas factory for custom op as a test.

	* rulesets/Py_Operation.cpp: Improve error reporting.

	* rulesets/Python_API.cpp: Fix bug where arguments to ops were
	  ignored.
2005-08-28 15:01:25 +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
a2b95197d1 2005-06-23 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_API.cpp: Move declaration of clist_size so its
	  initialisation is no longer bipassed by jumps.
2005-06-23 13:09:02 +00:00
Al Riddoch
04a1310ed6 2005-06-23 Al Riddoch <alriddoch@zepler.org>
* modules/Location.cpp, modules/Location.h, rulesets/Python_API.cpp:
	  Implement a function for determining the horizontal distance
	  between two locations neglecting height difference, as for
	  locations on the terrain it is not relevant.

	* rulesets/basic/mind/goals/common/move.py: Improve the coding of
	  the move_me_to_it goal, so distance determination is more effective.
	  Make distance independant of height.
	  Relax distances at which character is concidered to have arrived at
	  its destination.

	* rulesets/basic/mind/Goal.py: Modify goal so that it understands
	  that a subgoal can be unfulfilled, but still not need to take any
	  action.
2005-06-23 12:46:28 +00:00
Al Riddoch
ff6227f0e7 2005-06-22 Al Riddoch <alriddoch@zepler.org>
* server/WorldRouter.cpp: Fix a problem where entities contained by
	  other entities had their height adjusted incorrectly.

	* rulesets/basic/world/objects/elements/Fire.py: Allow fires to be
	  moved.

	* rulesets/Python_API.cpp: Add constructor for BBox.

	* data/mason.xml: Add a torch. Add burn_speed attributes to a
	  bunch more entity classes.

	* rulesets/mason/world/objects/tools/Torch.py: Script for torch.
2005-06-22 14:56:14 +00:00
Al Riddoch
1f283e4f50 2005-05-14 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_Script_Utils.h, rulesets/Python_API.h,
	  rulesets/Python_API.cpp, rulesets/MindFactory.cpp,
	  server/EntityFactory.cpp: Move functions related to creating
	  script objects into a new header, to avoid namespace pollution.
2005-05-14 23:02:02 +00:00
Al Riddoch
143bad1a28 2005-05-14 Al Riddoch <alriddoch@zepler.org>
* rulesets/Entity.h, rulesets/BaseMind.h: Make scriptSubscribe
	  virtual so it can be overriden in BaseMind.

	* rulesets/Python_API.cpp: Get rid of template for Subscribe_Script
	  as its no longer necessary now scriptSubscribe is virtual.
2005-05-14 22:36:48 +00:00
Al Riddoch
aabb8239c9 2005-05-14 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_API.cpp: Clean up variable names to make code more
	  readable.
2005-05-14 20:46:48 +00:00
Al Riddoch
da5b9c4551 2005-05-14 Al Riddoch <alriddoch@zepler.org>
* tools/AdminClient.cpp, tools/AdminClient.h, tools/cyaddrules.cpp:
	  New tool to load new rules into a running server.

	* data/mason.xml, rulesets/mason/world/objects/tools/Rope.py:
	  Experimental type for a rope.

	* man/cyclient.sgml, man/cycmd.sgml, man/cyphesis-tools.sgml,
	  man/cyphesis.sgml: Add SEE ALSO sections to the man pages.

	* rulesets/Python_API.cpp: Clean up variable names.

	* server/Admin.cpp: Send an info response when types are
	  installed from the client.

	* tools/cyloadrules.cpp: Correct copyright dates.
2005-05-13 23:25:32 +00:00
Al Riddoch
354dc0a1b9 2005-05-12 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_API.cpp: Re-write the code for extracting operation
	  subscriptions from python classes so its now more efficient and
	  picks up methods from base classes.

	* rulesets/basic/mind/BaseMind.py, rulesets/basic/mind/NPCMind.py,
	  rulesets/basic/world/objects/Thing.py: Rename some methods
	  which have match the signature of operation handlers.
2005-05-12 00:28:01 +00:00
Al Riddoch
7f1ee732b7 2005-05-01 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Include POS from a Use op argument when
	  building the arg for the resulting op.

	* rulesets/Py_Point3D.cpp: Add a print handler.

	* rulesets/Python_API.cpp: When constructing Point3D or Vector3D
	  accept an Atlas list as well as a standard python list.
2005-05-01 18:05:52 +00:00
Al Riddoch
a8c3b3bec0 2005-04-24 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_API.cpp: Don't set objtype on entities from python
	  scripts unless they have parents.
2005-04-24 21:58:00 +00:00
Al Riddoch
edc9d66023 2005-04-10 Al Riddoch <alriddoch@zepler.org>
* rulesets/Py_Operation.cpp, rulesets/Py_Optime.cpp,
	  rulesets/Py_Optime.h rulesets/Python_API.cpp:
	  Remove the Optime class from the API and force scripts to use
	  setFutureSeconds() to modify operation dispatch time.

	* rulesets/acorn/world/objects/Weather.py,
	  rulesets/acorn/world/objects/plants/Tree.py,
	  rulesets/acorn/world/objects/plants/seeds/Acorn.py,
	  rulesets/acorn/world/objects/plants/seeds/Apple.py,
	  rulesets/acorn/world/objects/plants/seeds/Seed.py,
	  rulesets/basic/mind/NPCMind.py,
	  rulesets/basic/mind/goals/common/move.py,
	  rulesets/basic/world/objects/animals/Animal.py,
	  rulesets/basic/world/objects/buildings/House.py,
	  rulesets/basic/world/objects/elements/Fire.py,
	  rulesets/basic/world/objects/plants/Tree.py,
	  rulesets/basic/world/objects/tools/Bow.py,
	  rulesets/mason/world/objects/Weather.py,
	  rulesets/mason/world/objects/plants/seeds/Acorn.py,
	  rulesets/mason/world/objects/plants/seeds/Apple.py,
	  rulesets/mason/world/objects/plants/seeds/Fircone.py,
	  rulesets/mason/world/objects/plants/seeds/Seed.py:
	  Fix up all the python scripts to use setFutureSeconds on
	  ops instead of time.sadd.
2005-04-11 00:54:15 +00:00