Commit graph

152 commits

Author SHA1 Message Date
Al Riddoch
feb7cb032e 2004-10-23 Al Riddoch <alriddoch@zepler.org>
* server/WorldRouter.cpp: Add a note to check the code.

	* rulesets/basic/mind/goals/humanoid/transaction.py: Remove debug
	  output.

	* rulesets/basic/mind/goals/common/move.py: New goal to accompany
	  another person.

	* rulesets/basic/mind/goals/common/misc_goal.py: Use new accompany
	  goal for hirelings.

	* rulesets/Python_API.cpp: Fix distance_to arg checking error
	  message.

	* rulesets/Py_Vector3D.cpp: Add square magnitude and distance checking
	  methods.
2004-10-24 01:38:59 +00:00
Al Riddoch
ce8f62d539 2004-10-11 Al Riddoch <alriddoch@zepler.org>
* modules/Location.cpp, modules/Location.h: Add new function for
	  usefully calculating the distance vector of another entity.

	* tests/distancetest.cpp: Update test to check new distance
	  function.

	* rulesets/Python_API.cpp: Make the new distance vector function
	  available to python rather than the relative postion function.

	* rulesets/basic/mind/Knowledge.py, rulesets/basic/mind/NPCMind.py:
	  Ensure that Knowledge really does handle arbitrary triples.

	* rulesets/basic/mind/goals/common/misc_goal.py: Add new version
	  of transaction goal for transactions for hirelings.

	* rulesets/basic/mind/goals/humanoid/transaction.py: Complete
	  the implementation of the trigger goal for hirelings.

	* rulesets/mason/define_world.py: Move the mercenaries closer to
	  origin for debugging.
2004-10-11 01:04:27 +00:00
Al Riddoch
5cfdd958c7 2004-10-05 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_API.cpp: Process python output into clean log
	  output.
2004-10-04 23:08:26 +00:00
Al Riddoch
195ac5a2e3 2004-10-02 Al Riddoch <alriddoch@zepler.org>
* rulesets/Py_BBox.cpp, rulesets/Py_Location.cpp,
	  rulesets/Python_API.cpp: Eliminate some raw stderr output,
	  and replace with python errors, and calls to the log subsystem.
2004-10-02 15:36:34 +00:00
Al Riddoch
0b4f56e441 2004-10-02 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_API.cpp: Add new python wrapper for
	  relativePosition().

	* common/Database.cpp: Don't need trailing ; on database queries.
2004-10-02 01:12:02 +00:00
Al Riddoch
68ab5f7fc8 2004-09-20 Al Riddoch <alriddoch@zepler.org>
* physics/Vector3D.h, physics/Vector3D.cpp, modules/Location.h,
	  modules/Location.cpp: Convert to using WFMath::Point instead of
	  WFMath::Vector for position.

	* physics/Collision.h, physics/Collision.cpp: Update collision code
	  to use new pos type.

	* rulesets/Py_Point3D.h, rulesets/Py_Point3D.cpp: New python
	  wrappers for WFMath::Point.

	* rulesets/Py_Location.cpp, rulesets/Py_Vector3D.cpp,
	  rulesets/Python_API.cpp:
	  Update python wrappers to take into account new pos type.
	  Ensure that only apropriate functionality is available for
	  point and vector.

	* rulesets/Character.cpp, rulesets/Entity.cpp, rulesets/Entity.h,
	  rulesets/Line.cpp, rulesets/Movement.cpp, rulesets/Movement.h,
	  rulesets/Pedestrian.cpp, rulesets/Pedestrian.h,
	  rulesets/Plant.cpp, rulesets/Thing.cpp, rulesets/World.cpp,
	  server/EntityFactory.cpp, server/WorldRouter.cpp,
	  server/WorldRouter.h: Update the rest of the code for new pos
	  type, converting all places where entity parenting is changed
	  to use WFMath toParentCoords() and toLocalCoords() methods,
	  so that orientation is handled correctly.

	* tests/transformtest.cpp: New test to ensure that toParentCoords()
	  and toLocalCoords() perform as expected.

	* tests/Creatortest.cpp, tests/Locationtest.cpp, tests/Worldtest.cpp,
	  tests/collisiontest.cpp, tests/emergencetest.cpp:
	  Update the rest of the tests.
2004-09-20 10:16:04 +00:00
Al Riddoch
1cf0a8630b 2004-09-05 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_API.cpp: Use the Generic operation class for ops
	  with no hard coded type.

	* rulesets/Movement.cpp: Make the time periods used when checking
	  collisions dependent on the standard tick time.
2004-09-05 23:03:38 +00:00
Al Riddoch
b256b30d90 2004-08-24 Al Riddoch <alriddoch@zepler.org>
* client/Py_CreatorClient.cpp, common/BaseEntity.cpp,
	  common/BaseEntity.h, modules/Location.cpp, modules/Location.h,
	  rulesets/Area.cpp, rulesets/Area.h, rulesets/Character.cpp,
	  rulesets/Character.h, rulesets/Entity.cpp, rulesets/Entity.h,
	  rulesets/Line.cpp, rulesets/Line.h, rulesets/MemMap.cpp,
	  rulesets/Pedestrian.cpp, rulesets/Plant.cpp, rulesets/Plant.h,
	  rulesets/Py_Mind.cpp, rulesets/Py_Object.cpp, rulesets/Py_Thing.cpp,
	  rulesets/Python_API.cpp, rulesets/Stackable.cpp,
	  rulesets/Stackable.h, rulesets/Thing.cpp, rulesets/World.cpp,
	  rulesets/World.h, server/Account.cpp, server/Account.h,
	  server/Admin.cpp, server/Connection.cpp, server/Lobby.cpp,
	  server/Lobby.h, server/Player.cpp, server/Player.h,
	  server/ServerRouting.cpp, server/ServerRouting.h,
	  tests/Areatest.cpp, tests/Entitytest.cpp, tests/Foodtest.cpp,
	  tests/Linetest.cpp, tests/Planttest.cpp, tests/Stackabletest.cpp,
	  tests/Structuretest.cpp, tests/Thingtest.cpp, tests/Worldtest.cpp:
	  Replace addToObject() with addToMessage() throughout.

	* server/Account.cpp, server/Lobby.cpp: Use BaseEntity::addToMessage().

	* server/Player.cpp: Make adding character types attribute to Message
	  more efficient.
2004-08-24 21:05:06 +00:00
Al Riddoch
96f13800c8 2004-08-07 Al Riddoch <alriddoch@zepler.org>
* common/BaseEntity.cpp, common/BaseEntity.h, common/BaseWorld.h,
	  common/Database.cpp, common/Database.h, common/FormattedXMLWriter.cpp,
	  common/FormattedXMLWriter.h, common/accountbase.cpp,
	  common/accountbase.h, common/custom.cpp, common/inheritance.cpp,
	  common/inheritance.h, common/operations.h, common/type_utils.h,
	  common/utility.cpp, common/utility.h, modules/Location.cpp,
	  modules/Location.h, rulesets/Area.cpp, rulesets/Area.h,
	  rulesets/BaseMind.cpp, rulesets/Character.cpp, rulesets/Character.h,
	  rulesets/Creator.cpp, rulesets/Entity.cpp, rulesets/Entity.h,
	  rulesets/Entity_getLocation.h, rulesets/Food.cpp, rulesets/Line.cpp,
	  rulesets/Line.h, rulesets/MemMap.cpp, rulesets/MemMap.h,
	  rulesets/Pedestrian.cpp, rulesets/Plant.cpp, rulesets/Plant.h,
	  rulesets/Py_Mind.cpp, rulesets/Py_Object.cpp, rulesets/Py_Object.h,
	  rulesets/Py_Operation.cpp, rulesets/Py_Thing.cpp,
	  rulesets/Python_API.cpp, rulesets/Stackable.cpp, rulesets/Stackable.h,
	  rulesets/Thing.cpp, rulesets/World.cpp, rulesets/World.h,
	  server/Account.cpp, server/Account.h, server/Admin.cpp,
	  server/Admin.h, server/CommClient.cpp, server/CommClient.h,
	  server/CommListener.cpp, server/CommListener.h,
	  server/CommLocalClient.cpp, server/CommLocalClient.h,
	  server/CommMetaClient.h, server/CommPSQLSocket.h,
	  server/CommRemoteClient.cpp, server/CommRemoteClient.h,
	  server/CommServer.cpp, server/CommServer.h, server/CommSocket.cpp,
	  server/CommSocket.h, server/CommUnixListener.cpp,
	  server/CommUnixListener.h, server/Connection.cpp,
	  server/Connection.h, server/EntityFactory.cpp,
	  server/EntityFactory.h, server/Lobby.cpp, server/Lobby.h,
	  server/Persistance.cpp, server/Persistance.h,
	  server/PersistantThingFactory.h, server/Persistor.cpp,
	  server/Player.cpp, server/Player.h, server/Restorer.h,
	  server/Restorer_impl.h, server/ServerRouting.cpp,
	  server/ServerRouting.h, server/TrustedConnection.cpp,
	  server/TrustedConnection.h, server/WorldRouter.cpp,
	  server/WorldRouter.h: Convert code to using Atlas Message
	  typedefs as found in Atlas-C++ 0.6 to aid conversion later.
2004-08-16 14:26:47 +00:00
Al Riddoch
dff51140d1 2004-06-29 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/mind/NPCMind.py, rulesets/BaseMind.cpp,
	  modules/WorldTime.h: WorldTime now handles time in
	  integer seconds.

	* rulesets/Python_API.cpp: Handle all variations of args with one
	  call to PyArg_ParseTuple as multiple calls are not
	  allowed.
2004-06-29 12:19:02 +00:00
Al Riddoch
d956e574c3 2004-06-23 Al Riddoch <alriddoch@zepler.org>
* rulesets/Py_Location.cpp, rulesets/Py_Map.cpp, rulesets/Py_Mind.cpp,
	  rulesets/Py_Object.cpp, rulesets/Py_Operation.cpp,
	  rulesets/Py_Quaternion.cpp, rulesets/Py_Thing.cpp,
	  rulesets/Py_Vector3D.cpp, rulesets/Python_API.cpp:
	  Change some methods to use METH_NOARGS for simplicity.
2004-06-23 17:19:26 +00:00
Al Riddoch
9f9b0c12a3 2004-06-20 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_API.cpp: Clean up use of standard error to go
	  via the log subsystem.

	* rulesets/basic/editor.py, rulesets/basic/mind/NPCMind.py,
	  rulesets/basic/mind/panlingua/interlinguish.py,
	  rulesets/mason/define_world.py:
	  Expand handling of the verb "know" so that knowledge
	  is a triple, including predicate, so that know can be used
	  to inform a character of any knowledge. Generalise the client
	  code, and tweak the client data to include the right information.

	* mason.xml: Add new rule for mercenaries.

	* rulesets/basic/mind/goals/humanoid/transaction.py: Add new
	  dynamic goal for NPCs offering their services for hire.

	* rulesets/basic/mind/panlingua/interlinguish.py:
	  Add new words related to hirable NPCs

	* rulesets/mason/define_world.py: Start programming up warriors
	  to be hirable.
2004-06-20 19:24:36 +00:00
Al Riddoch
74244d514f 2004-06-15 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp, common/globals.cpp, rulesets/Area.cpp,
	  rulesets/Python_API.cpp, server/Connection.cpp,
	  server/Persistance.cpp: Ensure that all output goes either via
	  the log system, or only in debug macros.
2004-06-15 18:06:59 +00:00
Al Riddoch
db567a85b5 2004-05-16 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_API.cpp: Add to python search path directly, rather
	  than using an environment hack.
2004-05-16 03:51:28 +00:00
Al Riddoch
6c46fee3a1 2004-04-23 Al Riddoch <alriddoch@zepler.org>
* tools/cycmd.cpp: Add new command to enable and disable server
	  monitoring.

	* server/WorldRouter.cpp, common/BaseWorld.h: Add facility to
	  notify using a SigC signal each type an op is dispatched.

	* server/CommClient.h, server/CommClient.cpp: Fix typo in
	  overridden method which meant it didn't work.

	* server/Admin.h, server/Admin.cpp: Add handler for Monitor operation
	  which turns on and off sending all IG ops to the admin client.

	* rulesets/Python_API.cpp, common/types.h, common/Generic.h,
	  common/BaseEntity.h: Fix Generic op so it can be used, and
	  clean up its use. Add an enumeration for monitor ops.
2004-04-23 17:50:38 +00:00
Al Riddoch
28d9e0e62a 2004-04-20 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_API.cpp: Add comments on new Python type API.
2004-04-19 10:14:17 +00:00
Al Riddoch
9a7a07007f 2004-01-22 Al Riddoch <alriddoch@zepler.org>
* common/custom.cpp, common/inheritance.cpp, common/operations.cpp,
2004-01-22 03:03:07 +00:00
Al Riddoch
ba69f6ec4d 2003-11-22 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp: Additional error reporting for bad update
	  queries.

	* rulesets/Plant.h: Add accessor for number of fruits.

	* rulesets/Python_API.cpp: Remove experimental Python type code.

	* server/Persistor_impl.h: Fix persisting plant fruits, and
	  character attributes.
2003-11-22 15:30:30 +00:00
Al Riddoch
8b764a710d 2003-10-29 Al Riddoch <alriddoch@zepler.org>
* common/const.cpp, common/const.h, common/random.h,
	  physics/BBox.h, physics/Collision.cpp, physics/Collision.h,
	  physics/Quaternion.cpp, physics/Quaternion.h, physics/Vector3D.h,
	  rulesets/Movement.cpp, rulesets/Plant.cpp, rulesets/Python_API.cpp,
	  tests/collisiontest.cpp: Update variables relating to geometry
	  from double to float as this is the type used internall by
	  WFMath.

	* physics/Vector3D.cpp, physics/Quaternion.cpp, physics/Quaternion.h:
	  Remove legacy code.

	* server/CommPSQLSocket.cpp: Reformatting.
2003-10-29 01:39:09 +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
eafee1e683 2003-08-30 Al Riddoch <alriddoch@zepler.org>
* server/Makefile.am: Move cyslave into EXTRAs so that its not
	  built by default.

	* server/CommListener.cpp: Check that listener is open before using
	  it.

	* common/log.h, common/log.cpp: Add log levels for output from
	  scripts.

	* rulesets/Python_API.cpp: Add new python objects which replace
	  sys.stdout and sys.stderr, and redirect output to the
	  cyphesis logging mechanism.
2003-08-30 11:41:58 +00:00
Al Riddoch
0fbfc771ad 2003-08-07 Al Riddoch <alriddoch@zepler.org>
* server/Lobby.cpp: Add some debugging messages.

	* server/CommServer.cpp: Tweak select loop so that closed connections
	  are cleaned up as soon as they are detected.

	* rulesets/World.cpp: Make demo terrain a bit more mountainous.

	* Convert entire codebase over to using Atlas-C++ 0.4.90, as
	  start of transition to 0.6 API.
2003-08-07 23:03:26 +00:00
Al Riddoch
00e9aeb541 2003-07-21 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_API.cpp: Clean up initialisation of python modules to
	  make code readable.
2003-07-22 15:06:31 +00:00
Al Riddoch
cbbcbcc33e 2003-07-21 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_API.cpp: Fix leaked python reference.

	* rulesets/World.cpp: Fix leaked terrain object.
2003-07-21 02:36:58 +00:00
Al Riddoch
184b29b6a6 2003-07-19 Al Riddoch <alriddoch@zepler.org>
* rulesets/Py_BBox.cpp, rulesets/Py_Quaternion.cpp,
	  rulesets/Python_API.cpp, server/Restorer_impl.h:
	  Add some casts and tweaks so that wrappers and
	  database code work with wfmath structures.
2003-07-19 02:11:49 +00:00
Al Riddoch
6921293644 2003-07-18 Al Riddoch <alriddoch@zepler.org>
* rulesets/Py_BBox.cpp, rulesets/Python_API.cpp, server/Restorer_impl.h:
	  Put back the code won't work with WFMath.
2003-07-18 23:05:26 +00:00
Al Riddoch
0468869ee1 2003-07-18 Al Riddoch <alriddoch@zepler.org>
* Migrate maths code to wfmath. Compiles and links, but lots has been
	  commented out.
2003-07-18 00:43:53 +00:00
Al Riddoch
693a2109a5 2003-05-05 Al Riddoch <alriddoch@zepler.org>
* server/EntityFactory.cpp, rulesets/Python_API.h,
	  rulesets/Python_API.cpp, rulesets/PythonThingScript.h,
	  rulesets/PythonThingScript.cpp, rulesets/PythonMindScript.cpp,
	  rulesets/Py_World.cpp, rulesets/Py_Thing.h, rulesets/Py_Thing.cpp,
	  rulesets/Py_Operation.cpp, rulesets/Py_Map.cpp,
	  rulesets/Py_Location.cpp, rulesets/Movement.h,
	  rulesets/MemMap_methods.h, rulesets/MemMap.h, rulesets/MemMap.cpp,
	  rulesets/Entity.cpp, rulesets/BaseMind.cpp,
	  client/Py_CreatorClient.cpp:
	  Rename all references from thing to entity, as thing is
	  no longer the base class for IG entities.

	* rulesets/World.h, rulesets/World.cpp, rulesets/Thing.h,
	  rulesets/Structure.h, rulesets/Stackable.h, rulesets/Stackable.cpp,
	  rulesets/Plant.h, rulesets/Plant.cpp, rulesets/Missile.h,
	  rulesets/Line.h, rulesets/Line.cpp, rulesets/Food.h,
	  rulesets/Food.cpp, rulesets/Creator.h, rulesets/Character.h,
	  rulesets/Character.cpp, rulesets/Area.h, rulesets/Area.cpp:
	  Add a typedef for the parent class of all entity classes.

	* rulesets/Plant.h, rulesets/Plant.cpp:
	  Add in code to fully integrate hardcoded attributes.
2003-05-05 21:57:50 +00:00
Al Riddoch
88bb8c6a42 2003-05-04 Al Riddoch <alriddoch@zepler.org>
* Clean up member variable names.
2003-05-04 18:31:38 +00:00
Al Riddoch
b24ad0c18a 2003-03-22 Al Riddoch <alriddoch@zepler.org>
* client/CommClient.cpp, client/CreatorClient.cpp,
	  client/ObserverClient.cpp, client/Py_CreatorClient.cpp,
	  common/BaseEntity.cpp, common/BaseEntity.h,
	  common/types.h, rulesets/Area.cpp, rulesets/BaseMind.cpp,
	  rulesets/Character.cpp, rulesets/Entity.cpp,
	  rulesets/Food.cpp, rulesets/Line.cpp,
	  rulesets/MemMap.cpp, rulesets/Pedestrian.cpp,
	  rulesets/Plant.cpp, rulesets/Py_Mind.cpp,
	  rulesets/Py_Object.cpp, rulesets/Py_Thing.cpp,
	  rulesets/Python_API.cpp, rulesets/Stackable.cpp,
	  rulesets/Thing.cpp, rulesets/World.cpp,
	  server/Account.cpp, server/Admin.cpp, server/CommClient.cpp,
	  server/CommServer.cpp, server/Connection.cpp,
	  server/EntityFactory.cpp, server/Lobby.cpp,
	  server/Persistance.cpp, server/Player.cpp,
	  server/ServerRouting.cpp, server/WorldRouter.cpp:
	  Switch to using Element as name for Atlas::Message::Object,
	  to avoid name clashes on Object, and bring into line with
	  the way Atlas-C++ will be.
2003-03-23 00:55:09 +00:00
Al Riddoch
15ef748518 2003-03-07 Al Riddoch <alriddoch@zepler.org>
* Use " instead of < when including application headers.

	* Re-work the interface between server and worldrouter objects
	  so that the are less tied together, and more flexible.
2003-03-07 00:22:12 +00:00
Al Riddoch
cb24511ec0 2002-11-25 Al Riddoch <alriddoch@zepler.org>
* common/Database.h, common/Database.cpp, server/Persistance.cpp:
	  Finish entity table creation code, and test it.

	* rulesets/Entity.cpp, rulesets/Entity.h, rulesets/EntityFactory.h,
	  rulesets/PythonThingScript.cpp, rulesets/PythonThingScript.h,
	  rulesets/Python_API.cpp, rulesets/Python_API.h,
	  rulesets/Thing.cpp, rulesets/Thing.h, server/EntityFactory.cpp,
	  server/EntityFactory.h, server/WorldRouter.cpp: Sort out
	  some incorrect use of Thing instead of Entity. Move some code
	  from Thing into Entity.
2002-11-25 22:48:13 +00:00
Al Riddoch
575bb8e066 2002-10-03 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_API.cpp: Add environment variables using a more
2002-10-03 16:14:10 +00:00
Al Riddoch
7de9d40633 2002-09-14 Al Riddoch <alriddoch@zepler.org>
* server/Admin.cpp: Cleaned up an unimplemented feature, and added it
	  to the TODO.

	* server/Account.h, server/Account.cpp: Removed unused obsolete code for
	  checking character types.

	* rulesets/Python_API.cpp: Add new globals module to python API which exposes
	  core settings to the python scripts.

	* rulesets/basic/hooks/ruleset_import_hooks.py: Abolish autogeneration of
	  this file using new globals module in the python API.

	* configure.in, cyphesis-config.in: Expose conf and data dirs.

	* tools/cyphesis-setup: New script to set the server up.

	* tools/cyconfig.cpp: New tool to make persistant changes to the server config.
2002-09-14 18:46:34 +00:00
Al Riddoch
2c6df5e79d 2002-09-06 Al Riddoch <alriddoch@zepler.org>
* physics/BBox.h: Fixed farPoint() so it now does return the far
	  point, rather than the near point.

	* modules/Location.h, rulesets/Python_API.cpp: Handle NULL parent
	  in location.

	* NPC script bug fixes.
2002-09-06 15:56:08 +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
00199f8aa6 2002-07-27 Al Riddoch <alriddoch@zepler.org>
* tools/cyloadrules.cpp, server/server.cpp,
	  aiclient/ClientConnection.cpp, client/ClientConnection.cpp,
	  common/inheritance.h: Use const iterators and references
	  whenever possible.

	* client/CommClient.cpp, client/CreatorClient.cpp,
	  client/ObserverClient.cpp, client/Py_CreatorClient.cpp,
	  common/BaseEntity.cpp, common/BaseEntity.h,
	  common/types.h, rulesets/Area.cpp, rulesets/BaseMind.cpp,
	  rulesets/Character.cpp, rulesets/Entity.cpp,
	  rulesets/Food.cpp, rulesets/Line.cpp,
	  rulesets/MemMap.cpp, rulesets/Pedestrian.cpp,
	  rulesets/Plant.cpp, rulesets/Py_Mind.cpp,
	  rulesets/Py_Object.cpp, rulesets/Py_Thing.cpp,
	  rulesets/Python_API.cpp, rulesets/Stackable.cpp,
	  rulesets/Thing.cpp, rulesets/World.cpp,
	  server/Account.cpp, server/Admin.cpp, server/CommClient.cpp,
	  server/CommServer.cpp, server/Connection.cpp,
	  server/EntityFactory.cpp, server/Lobby.cpp,
	  server/Persistance.cpp, server/Player.cpp,
	  server/ServerRouting.cpp, server/WorldRouter.cpp:
	  Switch to using Fragment as name for Atlas::Message::Object,
	  to avoid name clashes on Object.

	* common/BaseEntity.h: Make BaseEntity inherit from SigC::Object,
	  so signals and callbacks can be used, and add destroyed
	  signal.

	* common/accountbase.h, physics/BBox.h, physics/Quaternion.h,
	  physics/Vector3D.h, rulesets/MemMap_methods.h,
	  rulesets/Movement.cpp, rulesets/Plant.h,
	  rulesets/Py_Operation.cpp, rulesets/PythonMindScript.cpp,
	  rulesets/PythonThingScript.cpp, rulesets/Script.cpp,
	  common/inheritance.cpp: Cleaned up Atlas::Message::Object
	  use, and excessive use of "using ...".

	* rulesets/Movement.h, rulesets/Pedestrian.h:
	  Use forward declarations rather than including Move.h

	* server/Account.cpp, server/Account.h, server/Connection.cpp,
	  server/Connection.h: Use destroyed signal to ensure references
	  to in game entities are removed when those entities are
	  destroyed. Ensure Connection is only destroyed once.
2002-07-28 13:34:58 +00:00
Al Riddoch
4c39bc2ecd 2002-07-25 Al Riddoch <alriddoch@zepler.org>
* tools/cycmd.cpp, client/CommClient.h, client/CommClient.cpp: Fixed
	  up client code so it does not rely on username being the same as
	  account id.

	* tools/cycmd.cpp: Added look and logout commands to administrate
	  users logged in.

	* server/server.cpp: Fixed metaserver code so it only sends
	  termination packet if metaserver functionality is enabled.

	* server/Connection.h, server/Connection.cpp, server/CommServer.cpp,
	  server/CommClient.h, server/Account.cpp: Fix logouts so they
	  do cause the client connection to be closed.

	* Finished switch from Fire operation to Burn.
2002-07-26 16:47:39 +00:00
Al Riddoch
5451cbac7f 2002-07-25 Al Riddoch <alriddoch@zepler.org>
* Change fire operation to burn operation, to avoid clash with
2002-07-25 22:18:26 +00:00
Al Riddoch
07a7543461 2002-07-14 Al Riddoch <alriddoch@zepler.org>
* ALL: Cleaned up headers into correct order.

	* common/log.h, common/log.cpp: Write some logging code which
	  handles message of different types using syslog or standard
	  error, depending on whether we are running as a daemon.

	* ALL: Switched to using log() for all output.
2002-07-14 21:04:50 +00:00
Al Riddoch
21dba53944 2002-06-24 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp, rulesets/Python_API.cpp: Remove some
	  debugging output.

	* tools/cydbload.cpp, tools/cyloadrules.cpp: Check atlas files
	  exists.
2002-06-24 10:27:06 +00:00
Al Riddoch
e491d6995a 2002-03-12 Al Riddoch <alriddoch@zepler.org>
* server/server.cpp, rulesets/Python_API.cpp, rulesets/Line.cpp,
	  modules/Location.cpp, client/CreatorClient.cpp:
	  Removed some obsolete comments.

	* server/WorldRouter.h, server/WorldRouter.cpp: Add member to
	  deliver operation to known entity. Make use if it to avoid
	  having to recurse in operation() when broadcasting. Ensure
	  that the container of new entities is managed from here.

	* rulesets/Thing.cpp: Tell world to create new entities at the
	  same position as the creator if no other info is provided.
	  Do not attempt to handle setting up the default containership
	  of entity once created, as this is always handled by the
	  WorldRouter from now on.

	* rulesets/Py_World.cpp: Implement getting time info from world.

	* rulesets/Py_Location.cpp: Implement handling of the orientation
	  attribute from python.

	* rulesets/MemMap.cpp: Update comments about unimplemented code.

	* rulesets/Creator.cpp: Check for string.empty() instead of "".

	* rulesets/BaseMind.cpp: Remove reference python code.
	  Cleanly handle and delete operations returned when savinf mind state.

	* client/CharacterClient.cpp: Move delete to the right place.
2002-03-12 18:08:56 +00:00
Al Riddoch
83c53f06c6 2002-03-11 Al Riddoch <alriddoch@zepler.org>
* server/WorldRouter.cpp: Eliminate unnecessary call to opEnumerate()
	  and enhance debugging output.

	* server/Player.cpp: Correct the use of string.compare() in older
	  versions of libstdc++.

	* common/types.h: Added enumeration for other operations, not
	  handled by the core, but considered valid. Added new type
	  for storing mapping between operation parents and their
	  enumerated type.

	* common/op_switch.h: Separate handling of operations known to
	  be invalid from operations which are valid, but not explicitly
	  added to the core.

	* common/inheritance.h, common/inheritance.cpp, common/custom.cpp:
	  Provide global operation mapping where enumeration of operations
	  can be looked up. Install all types handled by the core, and
	  types known to be used in scripts.

	* common/BaseEntity.h, common/BaseEntity.cpp: Add object specific
	  operation mapping where operation types each object is subscribed
	  to can be enumerated, and others are rejected. Add mechanism
	  so that objects can add to the mapping, this subscribing to
	  operations. This makes enumerating operations much cheaper, and
	  eliminates the overhead of handling ops an object has no interest
	  in.

	* rulesets/Thing.h, rulesets/Thing.cpp: Add mechanism so scripts
	  can subscribe to operations.

	* rulesets/Character.h, rulesets/Character.cpp:
	  Add subscription mechanism for ops going to and from
	  the mind.

	* rulesets/BaseMind.h, rulesets/BaseMind.cpp:
	  Add subscription mechanism for sight and sound perception
	  operations sub operations, and provide an interface to it
	  for scripts.

	* server/Connection.cpp, server/Admin.cpp, server/Account.cpp,
	  rulesets/World.cpp, rulesets/World.h, rulesets/Thing.cpp,
	  rulesets/Stackable.cpp, rulesets/Plant.cpp, rulesets/Food.cpp,
	  rulesets/Character.cpp, rulesets/BaseMind.cpp:
	  Add subscriptions to operations for all core base classes.

	* rulesets/Python_API.cpp: When script is created, go through
	  methods, and subscribe to the operations which are handled by
	  them.

	* rulesets/Character.cpp: When calculating orientation of a walking
	  character, assume it is standing upright.

	* physics/Vector3D.h: Add versions of mag() and distance() which
	  omit the square root calculations, so that when their values
	  are only used for comparison, the expensive square root
	  calculations can be ommited. Add new version of collision
	  and range checking functions which provide the optimal
	  interface to the application. Add versions of methods which
	  modify this rather than creating a new operation to eliminate
	  wasted copies.

	* physics/Quaternion.cpp: Make use of faster interface provided
	  by Vector3D.

	* physics/BBox.h: Add new version of collision checking function
	  which provides optimal interface to the application.

	* modules/Location.h, modules/Location.cpp: Add new functions
	  to optimally calculate the distance between any two entities.

	* modules/Location.h: Re-write collision and range functions to
	  make much more optimal use of Vector3D, BBox and distance
	  functionality.

	* rulesets/Py_Vector3D.cpp, rulesets/Pedestrian.cpp,
	  rulesets/Movement.cpp, rulesets/Entity.cpp, rulesets/Character.cpp:
	  Eliminate implicit copies from vector arithmetic.

	* rulesets/Pedestrian.cpp, rulesets/MemMap.cpp, common/const.h:
	  Re-write code which uses magnitude of vectors to use the square
	  of the magnitude instead, as it is much cheaper to calculate.
2002-03-11 18:24:19 +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
70ba5263af 2002-03-08 Al Riddoch <alriddoch@zepler.org>
* common/globals.cpp, common/globals.h, rulesets/Python_API.cpp,
	  tools/cyloadrules.cpp: Make rulesets list a vector for
	  efficiency.

	* common/utility.cpp, common/utility.h: New function to create
	  an operation from a message Object.

	* rulesets/BaseMind.cpp, rulesets/MemMap.cpp, rulesets/MemMap.h,
	  rulesets/MemMap_methods.h, rulesets/Py_Map.cpp: Clean up
	  mind/memory interface, eliminating copies, unecessary allocations,
	  and passing more apropriate types around.

	* server/CommClient.cpp, rulesets/Py_Operation.cpp: Make use of
	  operation converter where it is apropriate.
2002-03-08 11:52:27 +00:00
Al Riddoch
cb99bb996f 2002-03-03 Al Riddoch <alriddoch@zepler.org>
* client/CreatorClient.cpp: Fix operation semantics for admin
	  puppetting to new convention.

	* common/Database.cpp: Add optional support for database password.

	* physics/Quaternion.h: Add extra way of setting up a Quaternion.

	* rulesets/MindFactory.cpp, server/Connection.cpp:
	  Move some output into debugging.

	* rulesets/Python_API.cpp, rulesets/Py_Quaternion.h,
	  rulesets/Py_Quaternion.h: Add support for quaternions into the
	  scripting API.

	* rulesets/mason/define_world.py: Switch to using quaternions to
	  send orientation data to the server.
2002-03-03 00:48:28 +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
1aa2021f6c * rulesets/Python_API.cpp: Made variable names clearer.
* server/Connection.cpp: Fixed adding accounts to lobby on login.

	* server/server.cpp: Limited the scope of the CommServer object
	  so that it is destructed before the rest of shutdown can
	  take place.

Al Riddoch  <alriddoch@zepler.org>
2001-10-10 09:40:24 +00:00
Al Riddoch
7ec46f4fe1 * rulesets/Python_API.cpp: Fixed another leak in the python code.
Al Riddoch  <alriddoch@zepler.org>
2001-10-09 15:39:55 +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