Commit graph

86 commits

Author SHA1 Message Date
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
Al Riddoch
fe4f38265e * server/server.cpp, rulesets/Python_API.cpp: Added function
to shutdown python. Ensure that all references that should be
	  decrefed during initialisation are.

	* tools/cywatchdog.cpp: Moved watchdog pidfile, so it is in
	  cyphesis specific dir.

	* tools/cyctrl.cpp: Moved in watchdog control program, which
	  makes controlling the watchdog easier.

Al Riddoch  <alriddoch@zepler.org>
2001-10-08 23:21:18 +00:00
Al Riddoch
c4baa6914e * configure.in: Switch to using improved checks for Atlas-C++ and
python.

	* common/const.h, common/const.cpp, rulesets/Python_API.cpp:
	  Removed unused consts.

	* common/globals.h, common/globals.cpp, server/server.cpp:
	  Enable running as a daemon in the background by default.
	  This improves usability by removing dependance on users
	  session. Install signal handlers so signals cause clean
	  shutdown.

	* tools/cycmd.cpp: If adminning server on localhost, get admin
	  password directly from database, instead of asking user.
	  Allows cycmd to be used in scripts. Ensure that exit
	  status accuratly reveals whether the command was sent.

	* tools/cypasswd.cpp: Switch to using common/accountbase.h.

Al Riddoch  <alriddoch@zepler.org>
2001-10-06 16:52:02 +00:00
Al Riddoch
dee412c0a0 * client/CharacterClient.cpp: Removed commented out code.
* client/CreatorClient.cpp: Fixed processing the response
	  to a create operation, and cleaned up debugging output.

	* client/ObjserverClient.cpp, client/ObserverClient.h,
	  client/client.cpp: Added setup method, which which handles
	  connecting, negotiation, logging in and creating character.

	* client/Py_CreatorClient.cpp: Added check if make() failed.

	* rulesets/Python_API.cpp: Fixed setting the import hooks
	  list properlly to include the ruleset list in use, instead
	  of hardcoding it.

	* rulesets/acorn/define_world.py: Copied define_world.py script
	  from client directory for Acorn.

	* rulesets/basic/editor.py: Modified to be used from C++ core.

	* rulesets/basic/mind/goals/__init__.py,
	  rulesets/basic/mind/goals/humanoid/werewolf.py:
	  Added in goals file to contain goals related to werewolf.

	* rulesets/basic/mind/panlingua/interlinguish.py:
	  Added in vote and execute verbs for werewolf.

	* rulesets/werewolf: Added in new ruleset for werewolf.

Al Riddoch  <alriddoch@zepler.org>
2001-08-19 18:37:38 +00:00
Al Riddoch
2fd239e63c * tools/cycmd.cpp: Ensure that login op is flushed after it is sent.
* server/Player.cpp: Arg order of std::string.compare() is
	  incompatable between recent libstdc++ versions. Switch
	  back to old version, still in most common use.

	* rulesets/Thing.cpp: Set refno on ops handled in game.

	* rulesets/Python_API.cpp: Modify Entity() python constructor
	  so that commonly used attributes from old atlas are translated
	  to their modern equivalents.

	* rulesets/Py_Thing.cpp, rulesets/Py_Mind.cpp: Differentiate
	  between previously identical error messages in several places.

	* rulesets/Py_Object.cpp: Rework conversion of python dict to
	  Atlas map to be more efficient and clean.

	* rulesets/Py_Location.cpp: Rework setting of vector parts of
	  location so that it can accept vectors from python in more
	  formats, including lists and tuples.

	* rulesets/Creator.h, rulesets/Character.h, common/BaseEntity.h:
	  Re-order virtual methods declarations to fit a convention.

	* common/stringstream.h: Hardcode use of local stringstream class,
	  as the version provided with older libstdc++ seems to be broken.

	* common/database.cpp: Use the common header to pick the right
	  stringstream implementation.

	* common/BaseWorld.cpp, server/Persistance.cpp: Removed unused
	  stringstream include.

	* rulesets/Creator.cpp: Added extra debug output.

	* client/define_world.h, client/define_world.cpp, client/CommClient.h:
	  Use CreatorClient to store Creators mind, instead of BaseMind.

	* client/client.cpp,
	  client/ObserverClient.h, client/ObserverClient.cpp,
	  client/CreatorClient.h, client/CommClient.h, client/CommClient.cpp:
	  Modify method names to fit capitalisation conventions.

	* client/CreatorClient.cpp: Implement creation of in-game entities,
	  using creator entity.

	* client/CommClient.cpp: Added correct client side monitoring of
	  creator entity.

	* client/ClientConnection.h, client/ClientConnection.cpp: Added
	  pending method to establish if ops are in the queue. Switched send()
	  method so we only send ops. Add setting of serialno of sent
	  ops, starting with an offset of 512.

	* client/CharacterClient.h: Removed unused member, opFound.

	* client/CharacterClient.cpp: Debugged sendAndWait() method.

Al Riddoch  <alriddoch@zepler.org>
2001-08-16 17:39:42 +00:00
Al Riddoch
dcc3dfa85a * server/server.cpp, server/CommClient.h, client/ClientConnection.h,
tools/cycmd.cpp: Switched to using skstream library for socket
	  comms instead of hand rolled fstream based version.

	* ALL FILES: Fixed use of std namespace throughout all code.

This server is now ISO C++ compliand and builds with gcc 3.0.

Al Riddoch  <alriddoch@zepler.org>
2001-08-14 17:52:50 +00:00
Al Riddoch
73b210279c * client/client.cpp,
client/ObserverClient.cpp, client/ObserverClient.h,
	  client/ClientConnection.cpp, client/ClientConnection.h,
	  client/define_world.cpp, client define_world.h:
	  Started re-coding of python client code in C++.

	* common/accountbase.h:
	  Database class used for simply accessing accounts.

	* common/OOGThing.cpp, common/OOGThing.h, server/Account.h,
	  server/Routing.h:
	  Moved OOGThing class into common as it is not server specific.

	* common/BaseWorld.cpp, common/BaseWorld.h,
	  server/WorldRouter.cpp, server/WorldRouter.h,
	  rulesets/Entity.h, rulesets/Py_World.cpp,
	  rulesets/PythonThingScript.cpp, rulesets/Python_API.h,
	  rulesets/Thing.cpp, rulesets/Thing.h:
	  Added base class for WorldRouter so that code that previously
	  used WorldRouter now used the interface defined by this
	  new class. This means that the code in rulesets no longer
	  has dependencies on code in server, so can be used in the client.

	* server/ExternalMind.cpp, server/ExternalMind.h,
	  rulesets/Character.h, rulesets/Creator.cpp,
	  server/Account.cpp:
	  Moved ExternalMind class into server as it is server specific,
	  so that there is no dependancy on server in rulesets.

	* server/Persistance.cpp. server/Persistance.h,
	  server/Admin.cpp, server/ServerRouting.cpp, server/server.cpp:
	  Moved high level server specific persistance class into
	  server, so there is no dependency on server in common.

	* common/database.cpp, common/database.h, server/Admin.cpp,
	  tools/cydbload.cpp, tools/cyisoload.cpp, tools/cypasswd.cpp:
	  Increases efficiency of some interfaces by passing Object::MapType
	  instead of MapType, when the value must be a map.

	* modules/WorldTime.cpp, modules/WorldTime.h,
	  rulesets/Py_WorldTime.cpp, rulesets/Python_API.cpp:
	  Brought the version of WorldTime in modules up to date, as this is
	  the version now used.

	* rulesets/Character.cpp, server/WorldRouter.cpp, rulesets/Thing.cpp,
	  server/Admin.cpp:
	  Made world objects dictionary private.

	* rulesets/EntityFactory.cpp, rulesets/EntityFactory.h:
	  Change newThing parameters so entity factory does not need to
	  know about WorldRouter.

	* server/Lobby.cpp: Added support for people and rooms attributes
	  of OOG room class.

Al Riddoch  <alriddoch@zepler.org>
2001-08-13 17:22:27 +00:00
Al Riddoch
3969bffbfe * common/inheritance.cpp, common/inheritance.h: Added code to store
atlas object inheritance tree.

	* server/Connection.cpp: Added code to allow client to query
	  atlas object inheritance using get ops.

	* example/client/InheritanceClient.*: Added example client which
	  queries the inheritance tree of the server.

	* rulesets/MemMap.h, rulesets/Py_Map.cpp: Made hooks lists private,
	  and added methods to access them.

	* server/Account.cpp, server/Lobby.h: Added correct handling of OOG
	  look ops when looking at own characters, other accounts, or the
	  lobby.

	* server/ServerRouting.h: Added function to generate serial numbers
	  for operations.

	* server/WorldRouter.cpp: Assign genuine serial number to all
	  in game operations as they are pulled off the queue.

	* Cleaned up header file multiple inclusion checks for uniqueness,
	  and made sure of ISO compliant use of std::string.

Al Riddoch  <alriddoch@zepler.org>
2001-08-02 14:27:06 +00:00
Al Riddoch
1930946950 * server/server.cpp, server/ServerRouting.h, server/ServerRouting.cpp,
server/CommServer.h: Added support for server "name" which
	  defaults to the hostname of the server machine, but is
	  customisable in the config. This can be used in preference to
	  IP address when doing lookups with the metaserver.

	* server/Lobby.h, server/ServerRouting.h, server/Account.h,
	  server/Account.cpp, rulesets/Stackable.h, rulesets/Stackable.cpp,
	  rulesets/Python_API.cpp, rulesets/Py_Object.cpp, rulesets/Plant.cpp,
	  rulesets/Pedestrian.cpp, rulesets/Entity.h, rulesets/Entity.cpp,
	  rulesets/Character.h, rulesets/Character.cpp, common/BaseEntity.h,
	  common/BaseEntity.cpp: Modied asObect() and addToObject()
	  methods to make them more efficient.

	* modules/Location.h, modules/Location.cpp: Removed old obsolete
	  Message::Object based addToObject() method.

	* rulesets/Thing.cpp: Optimised apperance/disappearance code.

Al Riddoch  <alriddoch@zepler.org>
2001-07-16 17:52:23 +00:00
Al Riddoch
9f0e733adb * server/server.cpp: Handle cleaning up after database load.
* server/WorldRouter.cpp: Switch to using stringstream to
	  generate ids.

	* rulesets/Thing.cpp: Re-write SetupOperation so Sight
	  operation is not lost and leaked.

	* rulesets/Python_API.h, rulesets/Python_API.cpp,
	  rulesets/Py_WorldTime.cpp, rulesets/Py_World.cpp,
	  rulesets/Py_Thing.cpp, rulesets/Py_Operation.cpp,
	  rulesets/Py_Object.cpp: Sort out correct handling of
	  python references, and ensure C++ objects are
	  deleted as required.

Al Riddoch  <alriddoch@zepler.org>
2001-06-22 22:03:59 +00:00
Al Riddoch
8bea85cdfc * Fixed up build files to install in a conformant way.
* acorn.vconf: Added in new building classes which set up
	  wall objects for collision purposes. Building now seem to
	  work.

	* common/database.cpp, common/database.h, common/globals.cpp,
	  common/globals.h, rulesets/Python_API.cpp, server/server.cpp,
	  watchdog/control.c, watchdog/watchdog.c: Implemented
	  correct way of getting installation directories from
	  autoconf.

	* rulesets/Movement.h, rulesets/Movement.cpp, rulesets/Pedestrian.h,
	  rulesets/Pedestrian.cpp: Fixed collisions with the solid
	  wall of a structure.

	* rulesets/Thing.cpp: Modified setup operation so that a sight
	  of create operation is always generated even if setup is
	  overloaded.

	* Many fixes from Anders Petersson to get the build working under
	  debian.

Al Riddoch  <alriddoch@zepler.org>
2001-06-16 14:19:00 +00:00
Al Riddoch
2c4a2036d3 * tools/cydbload.cpp: Added parameter handling so any file can
be loaded into the database.

	* tools/cycmd.cpp: Cleaned up usage and help functions.

	* tools/cyisoload.cpp: Cleaned up usage(), and made sure build
	  completes okay if libraries are missing, and missing
	  functionality is reported to the user.

	* server/server.cpp: Added config options that specifies that
	  the contents of the db should loaded on server startup. Cleaned
	  up some debug code.

	* server/WorldTime.cpp, server/WorldRouter.cpp,
	  server/Connection.cpp, rulesets/Structure.h,
	  rulesets/Python_API.cpp, rulesets/Py_WorldTime.cpp,
	  rulesets/Movement.cpp, rulesets/Entity.cpp,
	  physics/Vector3D.h, common/persistance.cpp,
	  common/database.h, common/database.cpp: Removed output either
	  to debug mode, or removed altogether.

	* common/BaseEntity.h, common/BaseEntity.cpp: Removed redundant header
	  includes.

	* server/ServerRouting.cpp, common/persistance.h,
	  common/persistance.cpp: Modified admin account function names it
	  fit convention.

	* module/Location.h: Fixed collision detection so that entities
	  with velocity set to 0 still get checked.

	* rulesets/Entity.cpp, rulesets/Thing.cpp, rulesets/Character.cpp,
	  rulesets/BaseMind.cpp, rulesets/Creator.cpp,
	  rulesets/ExternalMind.cpp, rulesets/Food.cpp, rulesets/MemMap.cpp,
	  rulesets/Movement.cpp, rulesets/Pedestrian.cpp, rulesets/Plant.cpp,
	  rulesets/Py_Location.cpp, rulesets/Py_*.cpp, rulesets/World.cpp:
	  Removed unnecessary #includes.

Al Riddoch  <alriddoch@zepler.org>
2001-06-04 11:22:27 +00:00
Al Riddoch
0572ab631b * Renamed Operataion method names throughout so they no longer
all have the name Operation but are now called MoveOperation,
	  according to the type of operation they handle.

	* modules/DateTime.cpp, modules/DataTime.h: Filled in functionality,
	  allowing initialisation and updating from a time values in seconds.

	* modules/Location.h: Modified collision detection code so no
	  checking is done between two moving objects.

	* rulesets/BaseMind.h, rulesets/BaseMind.cpp, rulesets/Entity.h,
	  rulesets/Entity.cpp: Removed virtual getMap() method and replaced
	  with a fixed method in BaseMind only. Added time member veriable
	  to BaseMind so each mind keeps track of time by itself.

	* rulesets/Python_API.h, rulesets/Py_Mind.cpp, rulesets/Py_Mind.h:
	  Added specific python interface for mind objects, because if
	  increasing differences in the way this must be handled.

	* rulesets/Character.h, rulesets/Character.cpp: Added isAlive flag
	  which is cleared if the character is dead. If this flag is cleared,
	  operations are no longer sent to the mind.

	* rulesets/Movement.h, rulesets/Movement.cpp, rulesets/Pedestrian.h,
	  rulesets/Pedestrian.cpp: Cleaned up the code, made members more
	  distinctive, and make interface more general.

	* rulesets/Py_Thing.cpp: Removed features used to support mind.

	* rulesets/Py_WorldTime.cpp: Added support for comparison of
	  time with strings, to establish whether it matches descriptions
	  of time.

	* rulesets/Python_API.cpp: Modified creating of scripts so mind
	  scripts use a slightly different interface from entity scripts,
	  to support the fact that a mind handles its own timekeeping,
	  has a memory map, and has no access to the world.

	* server/WorldTime.cpp, server/WorldTime.h: Brought WorldTime into
	  the build. Used to track details of the time. Added support for
	  checking time descriptions such as "midday", "summer" against
	  DateTime.

Al Riddoch  <alriddoch@zepler.org>
2001-05-28 14:58:24 +00:00
Al Riddoch
b6a7e1302a 2001-05-22 Al Riddoch <alriddoch@zepler.org>
* client/define_world.py: Added archers who can hunt deer.

	* rulesets/basic/mind/goals/common/misc_goal.py:
	  Added the hunting goal.

	* rulesets/basic/mind/goals/common/move.py: Modified hunt_for()
	  goal so it has variable attack proximity.

	* common/op_switch.h, common/operations.h, common/Generic.h,
	  rulesets/Character.cpp, rulesets/Entity.h, rulesets/Entity.cpp,
	  rulesets/Python_API.cpp: Added handling of operation types not
	  directly supported by C++ classes in the scripting engine. In
	  order for these to be used they must be created in a script, and
	  received in a script.

	* rulesets/Character.cpp: Avoid using RootOperation pointers unless
	  that is really what we mean.

	* rulesets/Character.cpp: Added code to delete operations from
	  internal mind when external mind is active.

	* rulesets/Entity.cpp: Handled leaking of null script objects,
	  and python script objects.

	* rulesets/Connection.cpp: Delete characters external mind when
	  connection goes down.

Al Riddoch  <alriddoch@zepler.org>
2001-05-22 17:59:43 +00:00
Al Riddoch
d339cbe5e4 * rulesets/BaseMind.h/cpp: Added isAwake flag to indicate whether the
mind is active or not. Defaults to true.

	* rulesets/Py_Object.cpp: Reverted to storing complex attributes
	  in a python dict.

	* rulesets/Python_API.cpp: Get complex attributes from operation
	  arguments.

	* rulesets/Thing.cpp: Added in broadcast of sight(create) operation
	  to setup when object is created. See Thing::Opertion(Create) for
	  details.

	* rulesets/basic/mind/goals/common/misc_goal.py: Cleaned up comments.

Al Riddoch  <alriddoch@zepler.org>
2001-05-20 19:02:41 +00:00
Al Riddoch
e091bfd8f8 * server/Admin.cpp: Modified database loading code so it picks up
the object parent correctly instead of looking for a type attribute.

	* server/server.cpp: Made metaserver address a config file option.

	* common/database.h: Put in compiler error if code is built without
	  database support.

	* common/BaseEntity.cpp: Switched over to using stamp instead of seq
	  as the attribute used to check whether entity needs to be
	  updated.

	* Used action operation throughout python code to denote performing
	  an action, as differentiated from setting mode.

	* rulesets/skills: Added the beginnings of a skill system.

	* example/client: Fixed Atlas-C++ 0.5 example client so it
	  compiles again.

	* README: Wrote a README file

Al Riddoch  <alriddoch@zepler.org>
2001-05-06 23:51:37 +00:00
Al Riddoch
a481668f13 * rulesets/Py_Object.cpp: Added support for complex attributes
for Entities used as argument for operations.

Al Riddoch  <alriddoch@zepler.org>
2001-05-03 22:04:43 +00:00