Commit graph

17 commits

Author SHA1 Message Date
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
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
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
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
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
13922d54da 2002-05-17 Al Riddoch <alriddoch@zepler.org>
* rulesets/Py_Operation.cpp, rulesets/Py_Operation.h: Add a variant
	  of the python Operation wrapper which handles const operations.

	* rulesets/PythonMindScript.cpp, rulesets/PythonThingScript.cpp:
	  Pass const versions of operations to the python scripts, rather
	  than having to copy them.

	* server/ServerRouting.cpp: Add build date, time and version to
	  server info.
2002-05-17 17:18:40 +00:00
Al Riddoch
49691213c9 2002-03-08 Al Riddoch <alriddoch@zepler.org>
* Changed typedef names to ones which make more sense, and are
	  clearer. There is no change in functionality in this commit.
2002-03-08 14:58:40 +00:00
Al Riddoch
e1669c7947 * client/ClientConnection.cpp, client/ClientConnection.h,
tools/cycmd.cpp: Switched to using skstream to completely handle
	   client socket connections.

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

	* client/Py_CreatorClient.cpp, client/client.cpp,
	  client/define_world.cpp, rulesets/Py_Location.cpp,
	  rulesets/Py_Location.h, rulesets/Py_Map.cpp,
	  rulesets/Py_Map.h, rulesets/Py_Mind.cpp, rulesets/Py_Mind.h,
	  rulesets/Py_Object.cpp, rulesets/Py_Object.h,
	  rulesets/Py_Operation.cpp, rulesets/Py_Operation.h,
	  rulesets/Py_Oplist.cpp, rulesets/Py_Oplist.h,
	  rulesets/Py_Optime.cpp, rulesets/Py_Optime.h,
	  rulesets/Py_Thing.cpp, rulesets/Py_Thing.h,
	  rulesets/Py_Vector3D.cpp, rulesets/Py_Vector3D.h,
	  rulesets/Py_World.cpp, rulesets/Py_World.h,
	  rulesets/Py_WorldTime.cpp, rulesets/Py_WorldTime.h,
	  rulesets/PythonMindScript.cpp, rulesets/PythonThingScript.cpp,
	  rulesets/PythonThingScript.h, rulesets/Python_API.cpp,
	  rulesets/Python_API.h, server/server.cpp:
	  Reorganised python header files so that each header includes
	  all the code relevant for a particular type. Tidied up
	  the type implementations. Added prototypes to init_python_api()
	  to the Python_API.h header, and removed other dependencies from
	  it.

Al Riddoch  <alriddoch@zepler.org>
2001-10-19 11:35:07 +00:00
Al Riddoch
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
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
2ccfaadef3 2001-04-14 Al Riddoch <alriddoch@zepler.org>
* Substantial re-work of object model. Moved many attributes out
	  of BaseEntity class. Changed WoldRouter so it now handles
	  objects in terms of Entity, rather than BaseEntity.

	* Code cleanups, including removing reduntant includes, and
	  getting rid of C style comments.

	* Fixed the way attributes are handled in Set operations and
	  when merging from an Atlas::Message::Object. This fixed
	  problem with setting gender of characters.

	* rulesets/Pedestrian.*, rulesets/Movement.*: Re-named
	  Movement variables to make them clearer. Added in
	  separate handling for collisions from moving to
	  target position. Modified collision handling so
	  objects can slide next to each other.

	* rulesets/Thing.cpp, rulesets/Character.cpp: Cleaned up and
	  rationalised movement code. Much shorter, faster and
	  more compact than before.

	* Made better use of iterators throughout, eliminating unnecessary
	  lookups, and copying of data.

	* Moved all virtual functions out of header files, making
	  less work for the linker.

	* Made more use of const references to avoid the need to copy
	  data before being able to inspect it.

Al Riddoch <alriddoch@zepler.org>
2001-04-16 16:26:44 +00:00
Al Riddoch
43211cf9d1 * Re-wrote class headers files so that all class members now
begin with a lower case letter and do not contain _.

	* Fixed retrieval of Account from database so that the Account
	  is now correctly referenced in the server object.

	* common/types.h: Changed type name to make them clearer.

	* rulesets/Character.h: Moved MovementInfo into its own class
	  file, and made it a base class, with a Pedestrian super class.
	  This allows different types of movement handling classes
	  to be used to handle things that move differently.

Al Riddoch  <alriddoch@zepler.org>
2001-04-11 14:34:15 +00:00
Al Riddoch
488f35b52f * Complete re-write of python script interface to allow other
script types to be cleanly dropped in.

	* Re-work on server and communication related classes to use
	  references where they are apropriate. Code is now much more
	  robust.

	* Huge cleanup of header files removing redundant includes.

	* server/WorldRouter.h: Removed is_object_deleted because it
	  is broken and not used.

	* server/Connection.h: Removed unused disconnect() methods.

	* rulesets/Entity.*: Added new in game base class from which
	  all mind and object classes are derived. This removes
	  clutter of Thing class from mind classes.

	* aiclient/*: Progress with creating AI client for mind handling.

	* common/globals.*: Moved some globals out of server specific files.

	* rulesets/Makefile.am: Separated rulesets code into 3 almost stand
	  alone packages; entities, mind and python interface code.


Acorn may well not work now, but I would apreciate it if people could
test the code on their setups. Lots of code has changed, and almost
everything is now cleaner.

Al Riddoch  <alriddoch@zepler.org>
2001-04-10 19:05:14 +00:00