Commit graph

45 commits

Author SHA1 Message Date
Alistair Riddoch
132ee763ea Remove unnecessary conditional 2012-05-15 11:30:23 +01:00
Alistair Riddoch
55cfc1d897 Add inplace add for efficiency 2012-01-04 15:08:15 +00:00
Alistair Riddoch
e8b96b543d Add a few missed rules 2012-01-04 14:45:37 +00:00
Alistair Riddoch
1a2b444608 Add checks so that bad constructor args fail. 2009-11-12 03:20:11 +00:00
Alistair Riddoch
f7549f446a Return a correct valye when an error is detected in seq_length 2009-11-12 03:10:30 +00:00
Alistair Riddoch
eda3935d02 Add a FIXME for some code that needs to be fixed. 2009-11-12 03:01:23 +00:00
Alistair Riddoch
4f734d050d Remove commented out obsolete implementations of new object creation. 2009-07-04 19:03:29 +01:00
Alistair Riddoch
10f414007b Ensure null pointers are not dereferenced. 2009-07-03 20:44:26 +01:00
Alistair Riddoch
1c260a8201 Remove unnecessary tp_new implementations from all bindings that don't need them 2009-06-04 15:29:34 +01:00
Alistair Riddoch
dc02e8d432 Convert tp_dealloc methods to call tp_free as they should in modern types. 2009-06-03 18:23:06 +01:00
Alistair Riddoch
ac62476c11 Remove tp_getattr type method, and use tp_methods instead in Py_Oplist. 2009-06-03 17:43:43 +01:00
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
665993f638 Update IDs 2009-04-09 12:42:44 +01:00
Al Riddoch
8b8d248f06 2007-04-01 Al Riddoch <alriddoch@zepler.org>
* rulesets/Py_Oplist.cpp, rulesets/Py_Operation.cpp: Use the python
	  hex version, as its more reliable for comparison when setting up
	  typedefs for older python versions.

	* common/random.h: Use the C++ version of stdlib.h.
2007-04-01 20:55:26 +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
8dec6dd904 2007-01-09 Al Riddoch <alriddoch@zepler.org>
* rulesets/Py_Oplist.cpp: Correct Python 2.5 fix to the right
	  function.
2007-01-09 17:58:11 +00:00
Al Riddoch
66924fcb64 2007-01-09 Al Riddoch <alriddoch@zepler.org>
* rulesets/Py_Oplist.cpp, rulesets/Py_Operation.cpp:
	  Fix function fingerprints so they are compatible with Python 2.5.
2007-01-09 14:00:19 +00:00
Al Riddoch
69995fa1b9 2007-01-07 Al Riddoch <alriddoch@zepler.org>
* rulesets/Py_Operation.cpp: Fix formatting of comments.

	* rulesets/Py_Oplist.cpp: Adapt sequence methods to be compatible
	  with the new interface typedefs in Python 2.5
2007-01-07 04:16:46 +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
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
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
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
77c19a4395 2005-12-05 Al Riddoch <alriddoch@zepler.org>
* rulesets/Py_BBox.cpp, rulesets/Py_Optime.cpp,
	  rulesets/Py_Statistics.cpp, rulesets/Py_Thing.cpp: Ensure that
	  setattr returns an exception if the attribute is not a valid one.

	* rulesets/Py_Map.cpp, rulesets/Py_Point3D.cpp,
	  rulesets/Py_Quaternion.cpp, rulesets/Py_World.cpp,
	  rulesets/Py_WorldTime.cpp: Remove setattr, as no attributes can
	  be set on this type.

	* rulesets/Py_Mind.cpp, rulesets/Py_Oplist.cpp,
	  rulesets/Py_Vector3D.cpp: Clean up type structure.

	* rulesets/basic/mind/goals/common/move.py: Remove attempt
	  to set "rotation" attribute on location, as its obsolete
	  and pointless.
2005-12-05 04:01:11 +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
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
c4a92de9f3 2004-11-06 Al Riddoch <alriddoch@zepler.org>
* aiclient/ClientConnection.cpp, client/BaseClient.cpp,
	  client/CharacterClient.cpp, client/ClientConnection.cpp,
	  common/Database.cpp, common/FormattedXMLWriter.cpp,
	  common/inheritance.cpp, common/refno.h, common/terrain_utils.cpp,
	  common/type_utils.h, common/utility.cpp, modules/WorldTime.cpp,
	  modules/WorldTime.h, physics/Collision.cpp, rulesets/Area.cpp,
	  rulesets/BaseMind.cpp, rulesets/Character.cpp, rulesets/Entity.cpp,
	  rulesets/Line.cpp, rulesets/MemMap.cpp, rulesets/MemMap_methods.h,
	  rulesets/Movement.cpp, rulesets/Plant.cpp, rulesets/Py_Map.cpp,
	  rulesets/Py_Object.cpp, rulesets/Py_Operation.cpp,
	  rulesets/Py_Oplist.cpp, rulesets/PythonMindScript.cpp,
	  rulesets/PythonThingScript.cpp, rulesets/Python_API.cpp,
	  rulesets/Stackable.cpp, rulesets/TerrainProperty.cpp,
	  rulesets/Thing.cpp, rulesets/World.cpp, server/Account.cpp,
	  server/CommClient.cpp, server/CommServer.cpp, server/Connection.cpp,
	  server/EntityFactory.cpp, server/Lobby.cpp, server/Persistance.cpp,
	  server/Player.cpp, server/Restoration.cpp, server/ServerRouting.cpp,
	  server/WorldRouter.cpp, tests/EntityExerciser.h,
	  tests/IGEntityExerciser.h, tests/inheritancetest.cpp,
	  tools/cycmd.cpp, tools/cyconvertrules.cpp, tools/cydbload.cpp,
	  tools/cyloadrules.cpp:
	  Tweak for loops to avoid creating a temporary iterator each
	  iteration.

	* tests/type_utilstest.cpp: New test for function which does
	  list conversions.
2004-11-06 20:36:03 +00:00
Al Riddoch
b584b32964 2003-09-08 Al Riddoch <alriddoch@zepler.org>
* client/Py_CreatorClient.cpp, client/Py_CreatorClient.h,
	  rulesets/Py_BBox.cpp, rulesets/Py_BBox.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_Quaternion.cpp, rulesets/Py_Quaternion.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/PythonMindScript.cpp, rulesets/PythonThingScript.cpp,
	  rulesets/Python_API.cpp:
	  Clean up python API code, with decent names for types,
	  decent error reporting, and making the more paranoid checks
	  only present in debug build.

	* common/BaseEntity.cpp, common/BaseEntity.h, server/Account.cpp:
	  Remove pointless method setRefnoOp, and put it in the body as
	  an inline method.

	* common/BaseEntity.h, common/BaseWorld.cpp, common/Setup.h,
	  common/Tick.h, common/operations.h, common/custom.cpp,
	  common/types.h, common/utility.cpp, common/utility.h,
	  modules/Location.h, physics/Vector3D.h, rulesets/BaseMind.cpp,
	  rulesets/Script.h, server/EntityFactory.h:
	  Clean up the dependency trees using more forward declarations.

	* common/inheritance.cpp, common/inheritance.h:
	  Move most of the implementation into the .cpp file as its
	  not suited to inlining.

	* rulesets/MemMap.cpp, rulesets/MemMap.h, rulesets/MemMap_methods.h:
	  Move contents of MemMap_methods.h into the .cpp file, as it is
	  not suited to inlining, and remove the file from the build.
2003-09-07 23:38:32 +00:00
Al Riddoch
b89504d49c 2002-08-30 Al Riddoch <alriddoch@zepler.org>
* common/globals.cpp: Only persist this sessions command line
	  options if the user is overriding the installation directory.

	* cyphesis.vconf, client/Py_CreatorClient.cpp,
	  client/Py_CreatorClient.h, client/client.cpp:
	  Add client functionality to allow diferent scripts to be run to
	  perform different functions on the server.

	* client/CharacterClient.cpp: Add debug option.

	* rulesets/Character.h: Make mind operation functions virtual,
	  so they can be overridden.

	* common/BaseWorld.h, server/WorldRouter.cpp,
	  server/WorldRouter.h: Add server functions to search for
	  entities by name or type.

	* rulesets/Creator.h, rulesets/Creator.cpp: Allow creator to
	  specify a look without an id to search for entities with
	  a given name or type.

	* client/CreatorClient.cpp, client/CreatorClient.h,
	  client/ObserverClient.cpp, client/ObserverClient.h,
	  client/Py_CreatorClient.cpp, rulesets/basic/editor.py,
	  rulesets/mason/define_world.py:
	  Add support for looking for entities in the world by name or
	  type from client script, so client scripts can modify existing
	  world.

	* rulesets/Entity.cpp, rulesets/Movement.cpp,
	  rulesets/Py_Object.cpp, rulesets/Py_Operation.cpp,
	  rulesets/Py_Oplist.cpp, rulesets/Python_API.cpp,
	  rulesets/Stackable.cpp, rulesets/Thing.cpp,
	  rulesets/World.cpp, server/Account.cpp,
	  server/CommServer.cpp, server/Connection.cpp,
	  server/Player.cpp, server/ServerRouting.cpp,
	  server/server.cpp, tools/cycmd.cpp,
	  tools/cywatchdog.cpp: Code formatting cleanups.

	* rulesets/basic/world/objects/tools/Bow.py: Fix up bow so it now
	  fires correctly.
2002-08-30 13:48:39 +00:00
Al Riddoch
49691213c9 2002-03-08 Al Riddoch <alriddoch@zepler.org>
* Changed typedef names to ones which make more sense, and are
	  clearer. There is no change in functionality in this commit.
2002-03-08 14:58:40 +00:00
Al Riddoch
e1669c7947 * client/ClientConnection.cpp, client/ClientConnection.h,
tools/cycmd.cpp: Switched to using skstream to completely handle
	   client socket connections.

	* client/ClientConnection.cpp, client/ClientConnection.h,
	  common/log.cpp, rulesets/EntityFactory.h, rulesets/MemMap.h,
	  server/server.cpp, tools/cycmd.cpp: Removed unused includes.

	* client/Py_CreatorClient.cpp, client/client.cpp,
	  client/define_world.cpp, 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_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/PythonMindScript.cpp, rulesets/PythonThingScript.cpp,
	  rulesets/PythonThingScript.h, rulesets/Python_API.cpp,
	  rulesets/Python_API.h, server/server.cpp:
	  Reorganised python header files so that each header includes
	  all the code relevant for a particular type. Tidied up
	  the type implementations. Added prototypes to init_python_api()
	  to the Python_API.h header, and removed other dependencies from
	  it.

Al Riddoch  <alriddoch@zepler.org>
2001-10-19 11:35:07 +00:00
Al Riddoch
8c0f0358d7 * rulesets/Python_API.cpp, rulesets/PythonMindScript.cpp,
rulesets/Py_Oplist.cpp, rulesets/Py_Operation.cpp,
	  rulesets/Py_Map.cpp: Fixed some points in the code where Python
	  objects are not decreffed, and are thus leaked.

Al Riddoch  <alriddoch@zepler.org>
2001-10-09 14:03:12 +00:00
Al Riddoch
a303326964 * Changed many return statements to match convention.
* rulesets/Thing.cpp: Tweaked ranges code in movement to cut
	  down CPU time used.

	* common/BaseEntity.cpp: Re-ordered opEnumerate so that most
	  frequently used ops are detected soonest.

	* modules/WorldTime.h/.cpp: Moved WorldTime to modules directory.

Al Riddoch  <alriddoch@zepler.org>
2001-04-17 10:14:20 +00:00
Al Riddoch
291621d9e8 * watchdog/*.c: Corrected C++ style comments in c code.
* */*: Fixed mistake in copyright statement.

	* tools/cypasswd.cpp: Fixed usage message.

	* tools/cycmd.cpp: Added tools for sending administrative commands
	  to server.

	* server/server.cpp: Send terminate instruction to metaserver on
	  server shutdown.

Al Riddoch (alriddoch@zepler.org)
2001-03-16 11:38:14 +00:00
Al Riddoch
3a5e4e56c0 * Changed oplist to use std::vector. Recoded and re-optimised use
of oplist to take advantage of vector's best performance.

	* Modified OP_SWITCH macros to improve speed, and made it inlinable.

	* Cleaned up python interface code to improve compile and link time.

	* Moved custom operation definitions in one header file per class
	  to improve modularity and compile time.

	* Modified boundingbox handling so it now uses size and median.

	* Added collision check and inbox member function to Vector3D class.

	* Added collision prediction and checking to Location and Vector3D
	  classes.

	* Added collision prediction into MovementInfo class.

	* Modified Thing::operator[] so that static attributes can be handled
	  and added Thing::set() which must be used to modify attributes.

	* Added collision resolution so characters can no longer walk through
	  each other.

	* Moved weight attribute to being static attribute of Thing, so it
	  can be much more easily handled in movement code.

Al
2001-02-26 14:41:10 +00:00
Al Riddoch
e7eb28366c * all file: Added copyright statement
Al
2001-01-26 16:38:23 +00:00
Al Riddoch
57c737a756 * Fixed error in Thing::operator[] which meant attributes could not
be accessed, and certain move operations caused an abort.

	* Removed attributes from python object which don't have attributes.

	* Added Py*_Check() macros, and used them for easier code reading.

	* Added snow attribute to weather.

	* Commented out code which makes server exit(0) after a certain time.


Al
2000-12-16 20:28:06 +00:00
Al Riddoch
4343c8d383 * Removed lots of extraneous debugging output, and turned the rest
off using debug flags.

	* Added halt_time, which is number of seconds server should run before
	  it exits.

	* Cleaned a bunch if the remaining memory leaks.

	* Cleaned up the way time is handled.

	* More tweaks to Python code and API to get Acorn working.

	* Inlined some methods into the class definitions, for performance.

	* Updated movement code to sort out setting mode properlly, and
	  deal with stuttering NPC movement.

This is quite a big commit, and most of Acorn now works. Performance seems
to be good too.
2000-12-11 13:06:12 +00:00
Al Riddoch
b1a1db69d3 * Major attack on the more fiddly memory leaks. The only noticable
leak now is copied Location objects in the python interface code.

	* Added hook into the time code so the server can be set to exit
	  after a given number of seconds. This is required for LeakTracer
	  to generate its report.

Al
2000-12-08 11:40:32 +00:00
Al Riddoch
1826587f9d * Fixes to worlds object list so it now contains world.
* More python code tweaks to work with modifications to interface.

	* Modified code which gets Thing attributes from Message::Object
	  so it can use any object dictionary to look up parent object.

	* Fixed handling of Thing's static type attribute.

	* Modified creation of operations from python to eliminate
	  some strange segfaults.

	* Re-wrote and fixed Entity creation from python.

	* Implemented dictlist.remove_value for removing things from inventory.

	* Implemented Vector3D arithmetic and methods from python.

	* Implemented as_entity() and get_xyz() methods for Thing from
	  python.

	* Commented out deletion of operations from python OperationObject
	  dealloc() function as it was causing segfaults. There is a problem
	  somewhere with ownership not being cleared, but I can't find it.

	* Implemented conversion of Python Operation and Oplist objects
	  to Message::Object.

	* Fixed MemMap so that attributes of Things are accuratly updated.

	* Fixed it so that look ops from mind are broadcast rather than sent
	  to world. This may have to be reverted.

	* Tweaked autoconf to make it cleaner and work better. Still needs
	  alot of work.

A simple test of some goals now works! The lych goals worked to some
extent and no-longer gives python errors. Only a few more things are
required before Acorn can run, at which point I will release 0.1
for testing.

Al
2000-12-06 18:21:35 +00:00
Al Riddoch
21b18875f6 * Started working on sorting out memory leaks.
* Implemented python function to deal with not being able to check
	  type of python objects implemented in C.

	* Added method to thing for extracting location data from a
	  Message::Object

	* More work on python references to improve leakage.

	* Added flag so that python Operation object can own
	  the operation they point to, and thus delete it in dealloc().

	* Implemented find_by_location() and find_by_type() as required in
	  MemMap, and corresponding python interface.

	* Put in temporary work around to deal with the fact that a mind
	  does not know its name. Currently the mind is not able to
	  discover any of its bodies attributes, and I am not sure how
	  to solve this.

	* Fixed Location and Vector3D so they use operator bool() to detect
	  whether they are set.

	* Fixed bugs in getting parent from Location in python which caused
	  segfaults.

	* Imported all the basic ruleset entity python scripts.


Goals now work to some extent, though nothing moves around still. The main
priority is to work out how minds inherit the attributes of their
bodies, and keep them up to date. aloril?

Al
2000-12-04 20:08:21 +00:00
Al Riddoch
fbdb46ddc8 * Added support for varconf config files.
* Used config file to list enitity types and their python class files.

	* Cleaned up reference counting in Python API related C++ code.
	  References should all now be handled correctly.

	* Added support for adding None to Operation and Oplist.

Reference count changes have solved some segfaults I was getting. New
config files allows easy specification of rulesets, and has allowed
me to test the complete range of python entity classes used in Acorn.

Import hook code does not appear to work for classes imported directly using
python API calls.

Al
2000-12-03 14:23:26 +00:00
Al Riddoch
fda1182f78 * Added dictfunc functionality to Python interface.
* Added creation of Entities for use in Operation arguments.

	* Added initialisation of Vector3D through constructor
	  arguments in python.

	* Added append() method to python interface for Oplist.

	* Added support for coercion of operation into addable form.

Al
2000-12-01 00:13:39 +00:00
Al Riddoch
ece4c15d3d * Added in debug function for python code.
* Fixed coersion of non-oplist types for addition.

	* Implemented getting attributes from Message::Object maps
	  from python.

It now crashes in the interlinguish code. Closer and closer.

Al
2000-11-29 18:02:01 +00:00
Al Riddoch
b295f6f1ec * Added oplist python interface, and implemented returning of
operations from python code.

Al
2000-11-23 14:32:00 +00:00