Commit graph

186 commits

Author SHA1 Message Date
Alistair Riddoch
3b1708c629 Rename atlas.Message to atlas.Oplist in the Python API 2009-05-21 16:34:01 +01:00
Alistair Riddoch
ec67b5e44d Convert the Oplist wrapper to be a modern Pything binding 2009-05-21 04:40:45 +01:00
Alistair Riddoch
ed178ca0b1 Convert the Python Quaternion wrapper to being a modern Python binding 2009-05-20 20:48:54 +01:00
Alistair Riddoch
9bf7fc3eb7 Convert the Python BBox wrapper to being a modern Python binding 2009-05-20 20:01:59 +01:00
Alistair Riddoch
8ff8870a30 Move the vector and point types to the physics internal Python module 2009-05-20 19:33:39 +01:00
Alistair Riddoch
2527348089 Fix a crash which occurs when a BBox is created with no args. 2009-05-18 00:34:27 +01:00
Alistair Riddoch
1286df81a7 Rename PythonThingScript to PythonEntityScript 2009-03-22 15:58:06 +00:00
Alistair Riddoch
cd1f42c3f9 Rename Inheritance class files to match class name. 2009-03-20 15:31:38 +00:00
Al Riddoch
39b1e3b547 2009-01-31 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Python_API.cpp, rulesets/Python_API.h: Remove the
	  now obsolete unused function for running trivial Python
	  command line.
2009-01-31 04:11:21 +00:00
Al Riddoch
0bbbfe7dae 2009-01-30 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Python_API.cpp, rulesets/Python_API.h: Hack in a quick
	  function for executing python commands.

	* server/CommPythonClient.cpp: Pass input from the client straight
	  into the python interpretter and see what happens.
2009-01-30 01:39:06 +00:00
Al Riddoch
233b8bedd2 2008-11-29 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Character.cpp, rulesets/Character.h: Remove all traces
	  of the hard coded statistics property from Character.

	* rulesets/Py_Property.cpp: Don't use Py_StatisticsProperty as the
	  default wrapper for a statistics property because it will no
	  longer work this way.

	* rulesets/Python_API.cpp: Remove the setup for the Statistics
	  wrapper.

	* rulesets/StatisticsProperty.cpp, rulesets/StatisticsProperty.h:
	  Change the footprint of this class so it is no longer hooked
	  into part of the Character class, and instead handles looking
	  up values from the script directly, and owns the script itself.

	* server/ArithmeticFactory.cpp, server/ArithmeticFactory.h,
	  server/EntityFactory.cpp, server/EntityFactory.h,
	  server/PersistantThingFactory.cpp: Remove setup of hard coded
	  statistics property.

	* rulesets/Statistics.h, rulesets/Statistics.cpp,
	  rulesets/Py_Statistics.h, rulesets/Py_Statistics.cpp,
	  rulesets/Makefile.am: Remove clases that are no longer used.
2008-11-29 23:17:38 +00:00
Al Riddoch
5f663cd03f 2008-01-05 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Py_World.h: Remove the pointer to the world router from
	  its wrapper, as all the wrapper code should now use the singleton
	  interface.

	* rulesets/Python_API.cpp, rulesets/Py_World.cpp,
	  rulesets/Py_Thing.cpp: Fix up all the code which uses the world
	  router pointer.
2008-01-05 00:05:29 +00:00
Al Riddoch
d85a0f2a9c 2008-01-04 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Python_API.cpp: Add an instance of the world wrapper to
	  the server module, which should then be used instead of the
	  world attribute on entities.
2008-01-04 23:57:30 +00:00
Al Riddoch
8e9bd398af 2008-01-04 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Python_API.cpp: Remove the server_python flag used to
	  allow scripts to run unmodified on the obsolete python prototype.

	* rulesets/basic/mind/NPCMind.py,
	  rulesets/basic/mind/goals/animal/herd.py,
	  rulesets/basic/mind/goals/common/common.py,
	  rulesets/basic/mind/goals/common/move.py,
	  rulesets/mason/world/objects/buildings/House.py: Remove support
	  for running these scripts on the obsolete python prototype.
2008-01-04 00:45:39 +00:00
Al Riddoch
9f4078b178 2007-12-04 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_API.cpp: Remove commented out call to
	  Subscribe_Script().
2007-12-04 00:07:34 +00:00
Al Riddoch
94e6a0505a 2007-12-04 Al Riddoch <alriddoch@zepler.org>
* rulesets/BaseMind.cpp, rulesets/BaseMind.h, rulesets/Entity.cpp
	  rulesets/Entity.h: Remove the scriptSubscribed methods which
	  were empty and unused.

	* rulesets/Python_API.cpp, rulesets/Python_Script_Utils.h: Remove
	  Subscribe_Script() as it is useless now.

	* server/ScriptFactory.cpp: Remove call to Subscribe_Script().
2007-12-04 00:03:59 +00:00
Al Riddoch
8e8df5b482 2007-12-02 Al Riddoch <alriddoch@zepler.org>
* client/CreatorClient.cpp, client/CreatorClient.h,
	  client/Py_CreatorClient.cpp, common/BaseWorld.h, common/types.h,
	  modules/Location.cpp, modules/Location.h,
	  rulesets/AtlasProperties.cpp, rulesets/AtlasProperties.h,
	  rulesets/BaseMind.cpp, rulesets/Character.cpp, rulesets/Character.h,
	  rulesets/Entity.cpp, rulesets/Entity.h,
	  rulesets/EntityProperties.cpp, rulesets/LocatedEntity.cpp,
	  rulesets/LocatedEntity.h, rulesets/MemEntity.cpp,
	  rulesets/MemEntity.h, rulesets/MemMap.cpp, rulesets/Motion.cpp,
	  rulesets/Motion.h, rulesets/Py_Location.h, rulesets/Py_Mind.cpp,
	  rulesets/Py_Thing.cpp, rulesets/Py_Thing.h,
	  rulesets/PythonMindScript.h, rulesets/PythonScript.h,
	  rulesets/PythonThingScript.cpp, rulesets/PythonThingScript.h,
	  rulesets/Python_API.cpp, rulesets/Script.cpp, rulesets/Script.h,
	  rulesets/Thing.cpp, rulesets/World.cpp, server/WorldRouter.cpp,
	  server/WorldRouter.h: Refactor all the entity code so there is now
	  a new base class for entities in the world simulation, and in the
	  mind which only contains things which are trully common to both.
	  This moves a lot of functionality which should not have been
	  present in mind entities away, and makes that code safer and more
	  efficient.

	* tests/TestWorld.h: Update the test world API to match the base
	  class.
2007-12-02 23:49:05 +00:00
Al Riddoch
da3d23f111 2007-11-24 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_API.cpp, rulesets/Makefile.am: Remove now oboleted
	  PythonMindScript from the code, and the build.
2007-11-24 16:54:09 +00:00
Al Riddoch
87ecdcad4b 2007-07-30 Al Riddoch <alriddoch@zepler.org>
* client/Py_CreatorClient.cpp, common/Database.cpp,
	  common/accountbase.cpp, common/system.cpp, rulesets/Character.cpp,
	  rulesets/Motion.cpp, rulesets/Plant.cpp, rulesets/Py_Location.cpp,
	  rulesets/Py_Mind.cpp, rulesets/Py_Operation.cpp,
	  rulesets/Py_Point3D.cpp, rulesets/Py_Statistics.cpp,
	  rulesets/Py_Task.cpp, rulesets/Py_TerrainProperty.cpp,
	  rulesets/Py_Thing.cpp, rulesets/Py_Vector3D.cpp,
	  rulesets/Py_WorldTime.cpp, rulesets/Python_API.cpp,
	  rulesets/TerrainProperty.cpp, server/Admin.cpp,
	  server/CommServer.cpp, server/Connection.cpp,
	  server/EntityFactory.cpp, server/WorldRouter.cpp,
	  tools/cycmd.cpp, tools/cyconvertrules.cpp, tools/cyctrl.cpp:
	  Remove unnecessary () from conditional expressions, where operator
	  binding is clear.
2007-07-30 18:12:50 +00:00
Al Riddoch
7570359f75 2007-07-29 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp, rulesets/MemMap.cpp, rulesets/Motion.cpp,
	  rulesets/Python_API.cpp, rulesets/TerrainProperty.cpp,
	  rulesets/Thing.cpp, rulesets/World.cpp: Don't use camel casing for
	  local variables or function arguments.
2007-07-29 21:23:40 +00:00
Al Riddoch
2069f3dd4c 2007-07-29 Al Riddoch <alriddoch@zepler.org>
* common/log.cpp, common/log.h: Switch to taking a C++ string reference
	  rather than a char *, as it is not really an optimisation, and it
	  makes the code simpler to read and write.

	* client/BaseClient.cpp, client/ClientConnection.cpp,
	  common/AtlasFileLoader.cpp, common/BaseEntity.cpp,
	  common/Database.cpp, common/globals.cpp, common/id.cpp,
	  common/inheritance.cpp, common/log.cpp, common/log.h,
	  rulesets/Character.cpp, rulesets/Creator.cpp, rulesets/Entity.cpp,
	  rulesets/MemMap.cpp, rulesets/Motion.cpp, rulesets/Pedestrian.cpp,
	  rulesets/Py_Object.cpp, rulesets/Py_RootEntity.cpp,
	  rulesets/PythonMindScript.cpp, rulesets/PythonThingScript.cpp,
	  rulesets/Python_API.cpp, rulesets/Thing.cpp, server/Account.cpp,
	  server/Admin.cpp, server/ArithmeticFactory.cpp,
	  server/CommClient.cpp, server/CommListener.cpp,
	  server/CommMDNSPublisher.cpp, server/CommServer.cpp,
	  server/Connection.cpp, server/EntityFactory.cpp,
	  server/Persistance.cpp, server/Restoration.cpp,
	  server/ScriptFactory.cpp, server/TaskFactory.cpp,
	  server/WorldRouter.cpp, server/server.cpp: Convert over to using
	  new API correctly.

	* data/mason.xml: Add biomass and transient to fircone, making its
	  script obsolete:
2007-07-29 03:33:33 +00:00
Al Riddoch
73330b762f 2007-07-04 Al Riddoch <alriddoch@zepler.org>
* rulesets/Py_Property.h, rulesets/Py_Property.cpp,
	  rulesets/Py_TerrainProperty.cpp, rulesets/Makefile.am,
	  rulesets/Python_API.cpp: Complete implementation of terrain
	  property wrapper.

	* rulesets/mason/world/tasks/Reap.py: Check the surface to make sure
	  it is grass. Remove deubg output.
2007-07-04 16:42:10 +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
6f8c07fe76 2007-06-19 Al Riddoch <alriddoch@zepler.org>
* common/globals.cpp: Remove loading config data for inherited
	  rulesets.

	* rulesets/Python_API.cpp: Add the python path for mind code
	  manually, and only add one path for the ruleset.
2007-06-19 12:54:54 +00:00
Al Riddoch
ddfed59ec8 2007-06-19 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_API.cpp: Remove the messy import hooks that make
	  inherited rulesets work, but screw up module reloading.

	* rulesets/acorn/mind/SkelMind.py,
	  rulesets/acorn/world/objects/Weather.py,
	  rulesets/acorn/world/objects/animals/Crab.py,
	  rulesets/acorn/world/objects/animals/Deer.py,
	  rulesets/acorn/world/objects/animals/Pig.py,
	  rulesets/acorn/world/objects/animals/Squirrel.py,
	  rulesets/acorn/world/objects/animals/Wolf.py,
	  rulesets/acorn/world/objects/buildings/FarmHouse1.py,
	  rulesets/acorn/world/objects/buildings/FarmHouse2.py,
	  rulesets/acorn/world/objects/buildings/FarmHouse3.py,
	  rulesets/acorn/world/objects/buildings/FarmStand.py,
	  rulesets/acorn/world/objects/buildings/FishShop.py,
	  rulesets/acorn/world/objects/buildings/House1.py,
	  rulesets/acorn/world/objects/buildings/House2.py,
	  rulesets/acorn/world/objects/buildings/House3.py,
	  rulesets/acorn/world/objects/buildings/House4.py,
	  rulesets/acorn/world/objects/buildings/House5.py,
	  rulesets/acorn/world/objects/buildings/Inn1.py,
	  rulesets/acorn/world/objects/buildings/Inn2.py,
	  rulesets/acorn/world/objects/buildings/ItemShop.py,
	  rulesets/acorn/world/objects/buildings/Mansion.py,
	  rulesets/acorn/world/objects/buildings/MetalShop.py,
	  rulesets/acorn/world/objects/buildings/Ruin.py,
	  rulesets/acorn/world/objects/buildings/Shack.py,
	  rulesets/acorn/world/objects/buildings/Stall.py,
	  rulesets/acorn/world/objects/buildings/Sty.py,
	  rulesets/acorn/world/objects/buildings/VacantShop1e.py,
	  rulesets/acorn/world/objects/buildings/VacantShop1w.py,
	  rulesets/acorn/world/objects/buildings/VacantShop2.py,
	  rulesets/acorn/world/objects/outdoor/Campfire.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/acorn/world/objects/tools/Cleaver.py,
	  rulesets/acorn/world/objects/undead/Arm.py,
	  rulesets/acorn/world/objects/undead/Pelvis.py,
	  rulesets/acorn/world/objects/undead/Ribcage.py,
	  rulesets/acorn/world/objects/undead/Shin.py,
	  rulesets/acorn/world/objects/undead/Skull.py,
	  rulesets/acorn/world/objects/undead/Thigh.py,
	  rulesets/basic/mind/NPCMind.py,
	  rulesets/basic/world/objects/Pile.py,
	  rulesets/basic/world/objects/animals/Animal.py,
	  rulesets/basic/world/objects/buildings/House.py,
	  rulesets/basic/world/objects/buildings/StoneHouse.py,
	  rulesets/basic/world/objects/elements/Fire.py,
	  rulesets/basic/world/objects/plants/Tree.py,
	  rulesets/basic/world/objects/tools/Axe.py,
	  rulesets/basic/world/objects/tools/Bow.py,
	  rulesets/basic/world/objects/tools/Pickaxe.py,
	  rulesets/basic/world/objects/tools/Scythe.py,
	  rulesets/basic/world/objects/tools/Shovel.py,
	  rulesets/basic/world/objects/tools/Sword.py,
	  rulesets/mason/world/objects/Pile.py,
	  rulesets/mason/world/objects/Weather.py,
	  rulesets/mason/world/objects/animals/Deer.py,
	  rulesets/mason/world/objects/animals/Pig.py,
	  rulesets/mason/world/objects/buildings/House.py,
	  rulesets/mason/world/objects/buildings/House3.py,
	  rulesets/mason/world/objects/buildings/StoneHouse.py,
	  rulesets/mason/world/objects/clothing/Garment.py,
	  rulesets/mason/world/objects/elements/Fire.py,
	  rulesets/mason/world/objects/outdoor/Campfire.py,
	  rulesets/mason/world/objects/outdoor/Gravestone.py,
	  rulesets/mason/world/objects/plants/Fir.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,
	  rulesets/mason/world/objects/tools/Axe.py,
	  rulesets/mason/world/objects/tools/Bow.py,
	  rulesets/mason/world/objects/tools/Bucksaw.py,
	  rulesets/mason/world/objects/tools/Cleaver.py,
	  rulesets/mason/world/objects/tools/Pickaxe.py,
	  rulesets/mason/world/objects/tools/Rope.py,
	  rulesets/mason/world/objects/tools/Scythe.py,
	  rulesets/mason/world/objects/tools/Shovel.py,
	  rulesets/mason/world/objects/tools/Sword.py,
	  rulesets/mason/world/objects/tools/Tinderbox.py,
	  rulesets/mason/world/objects/tools/Torch.py,
	  rulesets/mason/world/objects/tools/Trowel.py,
	  rulesets/mason/world/objects/undead/Skeleton.py,
	  rulesets/mason/world/tasks/Bisect.py,
	  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,
	  rulesets/mason/world/tasks/Slice.py,
	  rulesets/mason/define_world.py:
	  Convert rulesets over to inheriting from the Thing class in
	  the new non ruleset specific location.

	* rulesets/basic/mind/goals/animal/domestic.py: Add file missing from
	  previous commit.
2007-06-19 12:36:42 +00:00
Al Riddoch
45160f016c 2007-06-18 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_API.cpp: Add a new directory to the python path
	  containing non ruleset specific code that is required by any
	  normal python scripts.

	* rulesets/Makefile.am: Install non ruleset specific python code
	  that was historically in common into a separate place.

	* irulesets/mason/define_world.py: Import the editor functionality
	  from the new location.
2007-06-18 13:19:52 +00:00
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