Commit graph

148 commits

Author SHA1 Message Date
Al Riddoch
e2de50c8ef 2004-06-20 Al Riddoch <alriddoch@zepler.org>
* rulesets/World.cpp, rulesets/World.h: Add accessor to get height
	  at a particular point.

	* server/Account.cpp: Remove redundant check on new character
	  location.

	* common/BaseWorld.h, server/WorldRouter.cpp, server/WorldRouter.h,
	  rulesets/Thing.cpp: Add new function for correcting height
	  of entities to ground level, and use it whenever new entities
	  are created, or whenever an entity moves.
2004-06-20 22:58:18 +00:00
Al Riddoch
70f0f2cdae 2004-06-18 Al Riddoch <alriddoch@zepler.org>
* rulesets/mason/define_world.py, rulesets/World.cpp,
	  mason.xml: New map work.
2004-06-18 01:22:56 +00:00
Al Riddoch
6a5fe8171e 2004-06-11 Al Riddoch <alriddoch@zepler.org>
* modules/Location.h, modules/Location.cpp: Clean up constructors
	  and interface to check whether bbox is solid.

	* rulesets/Area.cpp, rulesets/Movement.cpp, rulesets/Structure.h,
	  rulesets/Structure.cpp: Update to modified Location API.

	* rulesets/World.cpp: Fix misuse of implicit construction.
2004-06-11 11:09:44 +00:00
Al Riddoch
50f17694f1 2004-05-14 Al Riddoch <alriddoch@zepler.org>
* rulesets/Thing.cpp, rulesets/World.cpp, server/WorldRouter.cpp:
	  Delete commented out code for old range checks.

	* modules/Location.h, physics/BBox.h, physics/Collision.cpp,
	  physics/Vector3D.h, rulesets/Entity.h: Remove obsolete math
	  functions for doing silly calculations with boxes.
2004-05-14 00:35:59 +00:00
Al Riddoch
fb8430bb90 2004-05-13 Al Riddoch <alriddoch@zepler.org>
* rulesets/World.cpp: Removed unused variables.
2004-05-13 16:02:58 +00:00
Al Riddoch
b278543da6 2004-05-12 Al Riddoch <alriddoch@zepler.org>
* common/const.cpp, common/const.h: Add constants for handling
	  size based visibility calculations.

	* rulesets/World.cpp, server/WorldRouter.cpp: Convert op broadcast
	  and viewing distance to being handled by a visibility calculation
	  based on size and distance, rather than distance alone. Movement
	  appearance and disappearance is yet to be done.
2004-05-12 09:39:20 +00:00
Al Riddoch
4bd14213b1 2004-04-27 Al Riddoch <alriddoch@zepler.org>
* common/BaseEntity.cpp, common/utility.cpp, rulesets/World.cpp,
	  server/Account.cpp, server/Admin.cpp, server/ServerRouting.cpp,
	  tools/cycmd.cpp: Change objtype from "object" to "obj" in keeping
	  with the new Atlas spec., and tolerate either version from
	  clients for now.
2004-05-01 13:03:36 +00:00
Al Riddoch
30d37c5166 2004-04-19 Al Riddoch <alriddoch@zepler.org>
* Fix some tree related rules

	* rulesets/Plant.cpp, rulesets/Plant.h: Implement touching to release
	  seeds on all plants.

	* rulesets/World.cpp: Get rid of mountains on one side.

	* Add some auto generated forests to world init script.

	* rulesets/mason/world/objects/plants/Fir.py,
	  rulesets/mason/world/objects/plants/Oak.py: Simplify some scripts.

	* server/CommListener.cpp: Set RESUSEADDR on listen sockets.

	* server/Persistor.cpp, server/Persistor.h, server/Persistor_impl.h:
	  Fix persistance of plant's static fruits attribute.
2004-04-19 18:22:22 +00:00
Al Riddoch
cb794d1f50 2004-04-20 Al Riddoch <alriddoch@zepler.org>
* Fix types for boat and jetty.

	* rulesets/World.cpp: New random terrain for Ludex demo.

	* Define new boandary objects, and start work on major map
	  improvements.
2004-04-19 14:29:08 +00:00
Al Riddoch
19d262a52b 2004-03-15 Al Riddoch <alriddoch@zepler.org>
* server/WorldRouter.cpp: Add a FIXME for a very old obsolete test.

	* rulesets/World.cpp: Update setTerrain so it too accepts the
	  data in new format.
2004-03-18 23:19:37 +00:00
Al Riddoch
6421cb6209 2004-03-05 Al Riddoch <alriddoch@zepler.org>
* rulesets/World.cpp: Modify terrain structure to track
	  the new format already implemented in apogee.
2004-03-05 19:47:26 +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
362d2525f1 2004-01-12 Al Riddoch <alriddoch@zepler.org>
* server/Connection.cpp, server/Admin.cpp: Improve some important
	  error messages to include more context.

	* rulesets/World.cpp: Tweak default landscape so it has some
	  water for testing boats.

	* Add boat type to ruleset, and an instance to the define_world
	  script.
2004-01-12 17:45:14 +00:00
Al Riddoch
34e431fff2 2003-09-10 Al Riddoch <alriddoch@zepler.org>
* rulesets/World.cpp: Assert that world is not NULL.

	* rulesets/Line.cpp: Turn off stray debugging flag.

	* tests/Areatest.cpp, tests/Foodtest.cpp, tests/Linetest.cpp,
	  tests/Planttest.cpp, tests/Stackabletest.cpp,
	  tests/Structuretest.cpp, tests/Thingtest.cpp, tests/Worldtest.cpp:
	  New tests for most C++ base IG classes, derived from the Entity
	  test.
2003-09-10 21:40:27 +00:00
Al Riddoch
4fba881573 2003-08-16 Al Riddoch <alriddoch@zepler.org>
* rulesets/World.cpp: Make server terrain random.
2003-08-17 16:43:42 +00:00
Al Riddoch
f6675c3a75 2003-08-16 Al Riddoch <alriddoch@zepler.org>
* rulesets/World.cpp: Add more terrain for testing.
2003-08-16 00:31:24 +00:00
Al Riddoch
047bfa6625 2003-08-14 Al Riddoch <alriddoch@zepler.org>
* rulesets/World.cpp: Add lots more terrain to stress test clients.
2003-08-14 22:07:05 +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
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
8388d023f5 2003-07-18 Al Riddoch <alriddoch@zepler.org>
* rulesets/World.cpp: Tweak terrain to look a little better.
2003-07-18 11:08:03 +00:00
Al Riddoch
544e8240d9 2003-06-20 Al Riddoch <alriddoch@zepler.org>
* rulesets/World.cpp: Take account of Mercator API changes.
2003-06-20 16:43:21 +00:00
Al Riddoch
04b5afa2e4 2003-05-16 Al Riddoch <alriddoch@zepler.org>
* rulesets/World.cpp: Flatten out terrain a little, for a more
	  realistic test.
2003-05-16 00:17:47 +00:00
Al Riddoch
1eaeba8d12 2003-05-13 Al Riddoch <alriddoch@zepler.org>
* rulesets/World.cpp: Add a bit more terrain.
2003-05-13 18:53:17 +00:00
Al Riddoch
2e0e2c0a27 2003-05-11 Al Riddoch <alriddoch@zepler.org>
* tools/cycmd.cpp: Provide full details of entity attributes.

	* rulesets/World.cpp: Provide terrain basepoints by x,y index rather
	  than x,y position, as it makes more sense.
2003-05-11 22:31:57 +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
f3f73897e3 2003-05-03 Al Riddoch <alriddoch@zepler.org>
* server/Restoration.cpp: Send restored entities a setup op, so the
	  AI gets initialised as if the entity had just been created.

	* Clean up member variable names.

	* rulesets/mason/mind/SkelMind.py: Get skeleton to recognise
	  settlers.
2003-05-03 19:52:41 +00:00
Al Riddoch
13a1aff165 2003-05-01 Al Riddoch <alriddoch@zepler.org>
* rulesets/World.cpp, rulesets/World.h: Rework terrain attribute
	  handling to use new agreed format. Add terrain attribute
	  to the special ranged sight handling.
2003-05-01 00:07:36 +00:00
Al Riddoch
b97b71d593 2003-04-19 Al Riddoch <alriddoch@zepler.org>
* rulesets/World.h, rulesets/World.cpp, rulesets/Stackable.h,
	  rulesets/Stackable.cpp, rulesets/Plant.h,
	  rulesets/Plant.cpp, rulesets/Line.h, rulesets/Line.cpp,
	  rulesets/Entity.h, rulesets/Entity.cpp, rulesets/Character.h,
	  rulesets/Character.cpp, rulesets/Area.h, rulesets/Area.cpp,
	  common/type_utils.h, rulesets/Py_Thing.cpp, rulesets/Py_Mind.cpp,
	  client/Py_CreatorClient.cpp: Modify the way entities are queried
	  to avoid return by value, and use references instead.
2003-04-19 21:34:29 +00:00
Al Riddoch
7db848bbb0 2003-04-19 Al Riddoch <alriddoch@zepler.org>
* Switch to requiring pkg-config versions of libs, and make
	  postgres check more verbose.

	* Disable metaserver by default. This is a devel server.

	* rulesets/World.cpp, rulesets/World.h: Add terrain using
	  Mercator to the world entity, including the required attribute
	  handlers.
2003-04-19 00:34:24 +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
26633cf574 2003-03-21 Al Riddoch <alriddoch@zepler.org>
* client/Py_CreatorClient.cpp, common/BaseEntity.cpp,
	  common/BaseEntity.h, rulesets/MemMap.cpp, rulesets/Py_Mind.cpp,
	  rulesets/Py_Thing.cpp, rulesets/Thing.cpp, rulesets/Thing.h,
	  server/Account.cpp, server/Admin.cpp, server/Connection.cpp,
	  server/Lobby.cpp, server/ServerRouting.cpp:
	  Use a more efficient technique to set the attributes on
	  operation arguments without a copy.

	* common/BaseEntity.cpp, rulesets/Entity.cpp, rulesets/Thing.h,
	  rulesets/World.cpp, server/WorldRouter.cpp:
	  Move handling IG Look ops into the IG code in rulesets.
2003-03-21 00:04:53 +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
ba2c5485da 2003-01-12 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp, common/Database.h: Add functions for removing
	  relation rows. Modify entity select method to handle an empty loc
	  correctly.

	* rulesets/Thing.cpp: Correct indenting.

	* rulesets/World.cpp: Trigger update in SetOperation() correctly.

	* server/Account.cpp, server/Persistance.cpp, server/Persistance.h:
	  Inform Persistance modules when the account loses a character, so
	  this change is reflected in the database.

	* server/Persistor.cpp: Move comments into the correct place.

	* server/Restoration.cpp, server/Restorer.cpp, server/Restorer.h,
	  server/Restorer_impl.h: Persist and restore the world entity
	  attributes. Remove redundant argument from Restorer::populate().
2003-01-12 15:06:09 +00:00
Al Riddoch
8d7eb1b6e1 2002-12-28 Al Riddoch <alriddoch@zepler.org>
* common/BaseEntity.cpp, common/BaseEntity.h, rulesets/Character.cpp,
	  rulesets/Food.cpp, rulesets/Thing.cpp, rulesets/World.cpp:
	  Add arg to error method specifying where the error should go. Use
	  this arg to ensure that errors don't get broadcast.

	* common/Database.cpp, common/Database.h, common/const.cpp,
	  server/Persistor.cpp, server/Restoration.cpp,
	  server/WorldRouter.cpp
	  Change id and loc column in entity tables to integer for
	  performance. Add id generator sequence to database

	* common/Database.cpp, common/Database.h, server/Persistance.cpp,
	  server/Persistance.h: Remove old legacy world, mind and server
	  tables as they are no longer used.

	* common/BaseEntity.cpp, common/Load.h, common/Save.h,
	  common/custom.cpp, common/op_switch.h, common/operations.cpp,
	  common/operations.h, common/types.h, rulesets/BaseMind.cpp,
	  rulesets/BaseMind.h, rulesets/Character.cpp, rulesets/Character.h,
	  server/Admin.cpp, server/Admin.h, server/server.cpp,
	  tools/cycmd.cpp: Remove Load and Save ops.

	* rulesets/Area.cpp, rulesets/Character.cpp, rulesets/Line.cpp,
	  rulesets/Plant.cpp: Fix != to |= when setting update flags.

	* server/CommMetaClient.cpp, server/CommMetaClient.h,
	  server/CommServer.cpp, server/CommServer.h, server/server.cpp:
	  Add mechanism for sockets to be called whenever the server
	  is idle, so that they do period things. Use this mechanis,
	  to handle sending periodic packets to the metaserver, removing
	  special case code from CommServer.
2002-12-28 21:52:32 +00:00
Al Riddoch
8915b80e5d 2002-12-23 Al Riddoch <alriddoch@zepler.org>
* common/BaseEntity.h, common/BaseWorld.cpp, common/BaseWorld.h,
	  common/OOGThing.h, rulesets/Area.cpp, rulesets/Area.h,
	  rulesets/BaseMind.cpp, rulesets/Character.cpp,
	  rulesets/Character.h, rulesets/Creator.cpp, rulesets/Creator.h,
	  rulesets/Entity.cpp, rulesets/Entity.h, rulesets/Food.cpp,
	  rulesets/Food.h, rulesets/Line.cpp, rulesets/Line.h,
	  rulesets/MemMap.cpp, rulesets/Plant.cpp, rulesets/Plant.h,
	  rulesets/Stackable.cpp, rulesets/Stackable.h,
	  rulesets/Structure.h, rulesets/Thing.cpp, rulesets/Thing.h,
	  rulesets/World.cpp, rulesets/World.h, server/Account.cpp,
	  server/CommClient.cpp, server/CommClient.h,
	  server/Connection.cpp, server/Connection.h,
	  server/EntityFactory.cpp, server/Lobby.cpp, server/Lobby.h,
	  server/PersistantThingFactory.h,
	  server/PersistantThingFactory_impl.h,
	  server/Restorer.cpp, server/Restorer_impl.h, server/ServerRouting.cpp,
	  server/WorldRouter.cpp: Assign ID at entity construction time,
	  and make it constant, and thus unmodifiable.
2002-12-23 23:22:25 +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
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
79e06ff18d 2002-05-15 Al Riddoch <alriddoch@zepler.org>
* server/WorldRouter.h, server/WorldRouter.cpp, common/BaseWorld.h,
	  rulesets/Creator.cpp, rulesets/World.cpp: Removed unused and
	  unnecessary code from BaseWorld class, and move some stuff into
	  the WorldRouter where it belongs.

	* rulesets/Character.cpp: Fixed a bug in the way ops from the
	  mind are handled which caused a segfault.

	* rulesets/Character.h, rulesets/Creator.h: Made some functions
	  which are never overridden non-virtual for speed.

	* rulesets/MemMap.cpp, rulesets/MemMap.h, rulesets/MemMap_methods.h:
	  Cleaned up the memmap code to get rid of inefficiency, and badly
	  written code.

	* rulesets/Movement.cpp: Code formatting cleanup.

	* server/Routing.h: Remove old commented out code.
2002-05-15 08:15:55 +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
ec3e9fe029 2002-03-06 Al Riddoch <alriddoch@zepler.org>
* tools/cycmd.cpp, server/WorldRouter.cpp, server/EntityFactory.cpp,
	  server/Connection.cpp, server/Admin.cpp, server/Account.cpp,
	  rulesets/World.cpp, rulesets/Thing.cpp, rulesets/Py_Operation.cpp,
	  rulesets/MemMap_methods.h, rulesets/MemMap.cpp, rulesets/Entity.cpp,
	  rulesets/Character.cpp, rulesets/BaseMind.cpp:
	  Use empty() instead of size() == 0 for STL sequence types.

	* rulesets/ThingFactory.h, server/EntityFactory.cpp: Modified the
	  way adding classes to the inheritance tree is handled, so types
	  no longer have to inherit directly from a C++ class.

	* server/WorldRouter.cpp: Modified the way broadcast operations are
	  handled to make them more efficient, and catch NULL pointers in
	  the world dictionary.
2002-03-06 00:23:28 +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
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
1d0f77d4b5 * server/server.cpp: Added several options to the config file to
make server operation customisable. Added comments.

	* server/server.cpp, server/CommServer.h: Changed methods which
	  return int to returning bool if they are success/faul results.

	* server/WorldRouter.cpp: Removed some unused debugging code.
	  Optimised heavily used code. Changed error message on
	  sending to a non-existant entity so that it is no longer
	  reported as a critical error.

	* server/ServerRouting.h, server/Connection.h,
	  server/Connection_methods.h: inlined simple methods.

	* server/Connection.cpp: Optimised frequently used code.

	* server/CommClient.h: Simplified read method so it no
	  longer checks status redundantly.

	* common/BaseEntity.h, rulesets/Thing.h, rulesets/Entity.h: Added
	  comments explaing purpose of classes.

	* rulesets/Thing.cpp: Added detailed comments, and removed unnecessary
	  initialisation of some attributes.

	* rulesets/PythonMindScript.cpp: Removed redundant NULL check.

	* rulesets/MemMap.h: Added inlines for inlined methods.

	* rulesets/Entity.h, common/BaseEntity.h: Moved seq from BaseEntity
	  to Entity as it does not apply to Out Of Game objects.

	* rulesets/Entity.cpp: Added in stamp/seq attribute. Nade name
	  attribute optional.

	* rulesets/Character.cpp: Simplified some op handling code
	  to make it more readable and hopefully faster. Added comments
	  explaining movement, removed unused commented out code, and
	  removed some unnecessary debugging code.

	* common/operations.h: Explanatory comments.

	* common/*.h: Re-wrote extended operations to fit in
	  with Atlas-C++ 0.4.2 conventions.

	* common/log.*: Commented out unused logging code.

Al Riddoch  <alriddoch@zepler.org>

This code will no longer build against the last release of Atlas-C++ 0.4
Please use cvs Atlas-C++ stable branch.
2001-05-14 17:25:32 +00:00
Al Riddoch
11eaed5865 *** empty log message *** 2001-04-18 10:37:09 +00:00