Commit graph

53 commits

Author SHA1 Message Date
Erik Ogenvik
b0cf29b18d Use SQLite 3 for persistence.
Instead of storing data in Postgres we store it by default in SQLite,
using an in-process database.
This makes setup and handling much easier.
2018-05-19 21:47:24 +02:00
Erik Ogenvik
7aaa9b9ba7 Optimize includes. 2017-03-19 21:36:52 +01:00
Olek Wojnar
7f9ff2246d Remove CVS $Id tags
The legacy tags are causing build issues in Debian.
2013-07-15 20:31:59 +02:00
Alistair Riddoch
c7c920982a Convert remaining Storage functions 2011-10-03 22:03:06 +01:00
Alistair Riddoch
6c8997942f Convert scheduleCommand and related queries 2011-09-29 12:11:15 +01:00
Alistair Riddoch
ee03318f5e Rename class to Storage 2011-04-20 20:10:53 +01:00
Alistair Riddoch
3e3e43ab03 Rename AccountBase.* files to Storage.* 2011-04-20 20:03:30 +01:00
Alistair Riddoch
329ca3d421 Extend cypasswd tool to allow creation and promotion of admin accounts 2010-12-23 13:40:30 +00:00
Manohar Vanga
94459139ce Added creation of server accounts to new cypasswd 2010-08-17 12:24:00 +05:30
Manohar Vanga
997e1f4469 Removed automatic account association from cypasswd 2010-08-17 11:58:15 +05:30
Manohar Vanga
9cecca7322 Modified cypasswd to allow adding of "server" accounts 2010-08-17 11:56:55 +05:30
Manohar Vanga
8bf764b4d8 Added a class for facilitating inter-server communication 2010-08-17 11:56:08 +05:30
Alistair Riddoch
69f92813a1 Re-write option processing so that --instance works. 2010-08-16 20:13:24 +01:00
Alistair Riddoch
7479da8ce4 Rename accountbase file to AccountBase to match class. 2009-03-20 01:39:18 +00:00
Al Riddoch
67a9d94314 2008-11-03 Al Riddoch <alriddoch@googlemail.com>
* common/system.cpp, common/system.h: Add security_init(), a
	  function to initialise any security or crypto related libraries
	  used. This is required by recent version of libgcrypt when
	  using hash functions.

	* server/server.cpp, tests/systemtest.cpp, tools/cypasswd.cpp:
	  Call security_init() in all programs that use security related
	  functions.
2008-11-03 17:12:31 +00:00
Al Riddoch
29415a6a6e 2007-11-14 Al Riddoch <alriddoch@zepler.org>
* common/globals.cpp, common/globals.h: Modify the loadConfig
	  function so it takes usage hints, and checks the options in known
	  sections against those in the usage help.

	* client/client.cpp, server/server.cpp, tools/cyaddrules.cpp,
	  tools/cycmd.cpp, tools/cydumprules.cpp, tools/cyloadrules.cpp,
	  tools/cypasswd.cpp: Convert all calls to loadConfig to provide
	  the right hints.
2007-11-14 22:40:17 +00:00
Al Riddoch
d597378886 2007-04-28 Al Riddoch <alriddoch@zepler.org>
* common/globals.cpp, common/globals.h: Add interfact and mechanism
	  for showing usage data for all the programs given one central
	  location for the data.

	* server/server.cpp: Test out the usage function.

	* tools/cypasswd.cpp: Display usage using the old mechanism.
2007-04-28 16:45:13 +00:00
Al Riddoch
41d00bcab1 2007-04-28 Al Riddoch <alriddoch@zepler.org>
* commong/globals.h, common/globals.cpp: Add definitions for different
	  error codes from reading the config file, in particular codes that
	  indicate that the user has requested version, help or usage
	  information. Add a function for reporting the version of tools.

	* server/server.cpp: Add support for version or usage arguments,
	  including specific reporting of the server build number, which is
	  does not apply when reporting the version of other components.

	* tools/Makefile.am: Fix the globals modules dependency on consts.

	* tools/cypasswd.cpp: Add support for version or usage arguments.
2007-04-28 15:21:17 +00:00
Al Riddoch
e5eb644147 2007-04-24 Al Riddoch <alriddoch@zepler.org>
* tools/cypasswd.cpp: Improve the usage documentation.

	* common/globals.cpp: Add a varconf parameter lookup to allow
	  shorthand arguments to be used to request usage information.
2007-04-24 12:59:26 +00:00
Al Riddoch
e7c7e232ac 2006-12-26 Al Riddoch <alriddoch@zepler.org>
* client/CharacterClient.cpp, client/ClientConnection.h,
	  rulesets/Character.cpp, rulesets/Character.h, tools/cyaddrules.cpp,
	  tools/cyconfig.cpp, tools/cyconvertrules.cpp, tools/cyctrl.cpp,
	  tools/cydumprules.cpp, tools/cyloadrules.cpp, tools/cypasswd.cpp:
	  Add inline documentation.

	* client/CharacterClient.h, client/CharacterClient.cpp: Remove
	  overriden sight operation handlers, as they are no longer
	  present in the base class, and will never be called.

	* client/ClientConnection.h: Remove obsolete unimplemented template
	  declaration.

	* rulesets/Entity.cpp: Remove documentation for an argument that was
	  never there.

	* tools/cyctrl.cpp: Mark as removed from the build.

	* Add a FIXME about removing hard coded gender property
2006-12-26 18:24:24 +00:00
Al Riddoch
9a56dac06c 2006-10-26 Al Riddoch <alriddoch@zepler.org>
* Add RCS Id keywords to every file, for better version tracking.
2006-10-26 00:48:00 +00:00
Al Riddoch
fac57eee73 2006-01-19 Al Riddoch <alriddoch@zepler.org>
* aiclient/ClientAccount.cpp, aiclient/ClientAccount.h,
	  aiclient/ClientConnection.cpp, aiclient/ClientConnection.h,
	  aiclient/client.cpp, aiclient/client.h, client/BaseClient.cpp,
	  client/BaseClient.h, client/CharacterClient.cpp,
	  client/CharacterClient.h, client/ClientConnection.cpp,
	  client/ClientConnection.h, client/CreatorClient.cpp,
	  client/CreatorClient.h, client/ObserverClient.cpp,
	  client/ObserverClient.h, client/Py_CreatorClient.cpp,
	  client/Py_CreatorClient.h, client/client.cpp,
	  client/define_world.cpp, client/define_world.h, common/Add.h,
	  common/Affect.h, common/AtlasFileLoader.cpp,
	  common/AtlasFileLoader.h, common/Attack.h, common/BaseEntity.cpp,
	  common/BaseEntity.h, common/BaseWorld.cpp, common/BaseWorld.h,
	  common/Burn.h, common/Chop.h, common/Connect.h, common/CustomOp.cpp,
	  common/CustomOp.h, common/CustomOp_impl.h, common/Cut.h,
	  common/Database.cpp, common/Database.h, common/Delve.h, common/Dig.h,
	  common/Eat.h, common/FormattedXMLWriter.cpp,
	  common/FormattedXMLWriter.h, common/Generic.h, common/Load.h,
	  common/Monitor.h, common/Mow.h, common/Nourish.h,
	  common/OOGThing.cpp, common/OOGThing.h, common/Property.cpp,
	  common/Property.h, common/Property_impl.h, common/Save.h,
	  common/Setup.h, common/Tick.h, common/Unseen.h, common/Update.h,
	  common/Use.h, common/Wield.h, common/accountbase.cpp,
	  common/accountbase.h, common/const.cpp, common/const.h,
	  common/custom.cpp, common/debug.h, common/globals.cpp,
	  common/globals.h, common/id.cpp, common/id.h, common/inheritance.cpp,
	  common/inheritance.h, common/inheritance_impl.h, common/log.cpp,
	  common/log.h, common/newid.cpp, common/nls.h, common/op_switch.h,
	  common/operations.cpp, common/operations.h, common/random.h,
	  common/refno.h, common/serialno.cpp, common/serialno.h,
	  common/system.cpp, common/system.h, common/terrain_utils.cpp,
	  common/terrain_utils.h, common/type_utils.h, common/types.h,
	  common/utility.cpp, common/utility.h, modules/DateTime.cpp,
	  modules/DateTime.h, modules/Location.cpp, modules/Location.h,
	  modules/WorldTime.cpp, modules/WorldTime.h, physics/BBox.cpp,
	  physics/BBox.h, physics/Collision.cpp, physics/Collision.h,
	  physics/Quaternion.cpp, physics/Quaternion.h, physics/Vector3D.cpp,
	  physics/Vector3D.h, physics/VectorPol.h, rulesets/Area.cpp,
	  rulesets/Area.h, rulesets/AreaProperty.cpp, rulesets/AreaProperty.h,
	  rulesets/ArithmeticScript.cpp, rulesets/ArithmeticScript.h,
	  rulesets/BaseMind.cpp, rulesets/BaseMind.h,
	  rulesets/CalendarProperty.cpp, rulesets/CalendarProperty.h,
	  rulesets/Character.cpp, rulesets/Character.h, rulesets/Combat.cpp,
	  rulesets/Combat.h, rulesets/Container.cpp, rulesets/Container.h,
	  rulesets/Creator.cpp, rulesets/Creator.h, rulesets/Entity.cpp,
	  rulesets/Entity.h, rulesets/EntityProperties.cpp,
	  rulesets/Entity_getLocation.h, rulesets/Fell.cpp, rulesets/Fell.h,
	  rulesets/Food.cpp, rulesets/Food.h, rulesets/Line.cpp,
	  rulesets/Line.h, rulesets/LineProperty.cpp, rulesets/LineProperty.h,
	  rulesets/MemEntity.cpp, rulesets/MemEntity.h, rulesets/MemMap.cpp,
	  rulesets/MemMap.h, rulesets/MemMap_methods.h,
	  rulesets/MindFactory.cpp, rulesets/MindFactory.h, rulesets/Missile.h,
	  rulesets/Motion.cpp, rulesets/Motion.h, rulesets/Movement.cpp,
	  rulesets/Movement.h, rulesets/Pedestrian.cpp, rulesets/Pedestrian.h,
	  rulesets/Plant.cpp, rulesets/Plant.h, rulesets/Py_BBox.cpp,
	  rulesets/Py_BBox.h, rulesets/Py_EntityWrapper.h,
	  rulesets/Py_Location.cpp, rulesets/Py_Location.h,
	  rulesets/Py_Map.cpp, rulesets/Py_Map.h, rulesets/Py_Mind.cpp,
	  rulesets/Py_Mind.h, rulesets/Py_Object.cpp, rulesets/Py_Object.h,
	  rulesets/Py_Operation.cpp, rulesets/Py_Operation.h,
	  rulesets/Py_Oplist.cpp, rulesets/Py_Oplist.h, rulesets/Py_Optime.cpp,
	  rulesets/Py_Optime.h, rulesets/Py_Point3D.cpp, rulesets/Py_Point3D.h,
	  rulesets/Py_Property.cpp, rulesets/Py_Property.h,
	  rulesets/Py_Quaternion.cpp, rulesets/Py_Quaternion.h,
	  rulesets/Py_RootEntity.cpp, rulesets/Py_RootEntity.h,
	  rulesets/Py_Statistics.cpp, rulesets/Py_Statistics.h,
	  rulesets/Py_Task.cpp, rulesets/Py_Task.h, rulesets/Py_Thing.cpp,
	  rulesets/Py_Thing.h, rulesets/Py_Vector3D.cpp,
	  rulesets/Py_Vector3D.h, rulesets/Py_World.cpp, rulesets/Py_World.h,
	  rulesets/Py_WorldTime.cpp, rulesets/Py_WorldTime.h,
	  rulesets/PythonArithmeticScript.cpp,
	  rulesets/PythonArithmeticScript.h, rulesets/PythonMindScript.cpp,
	  rulesets/PythonMindScript.h, rulesets/PythonScript.cpp,
	  rulesets/PythonScript.h, rulesets/PythonThingScript.cpp,
	  rulesets/PythonThingScript.h, rulesets/PythonWrapper.cpp,
	  rulesets/PythonWrapper.h, rulesets/Python_API.cpp,
	  rulesets/Python_API.h, rulesets/Python_Script_Utils.h,
	  rulesets/Script.cpp, rulesets/Script.h, rulesets/Stackable.cpp,
	  rulesets/Stackable.h, rulesets/Statistics.cpp, rulesets/Statistics.h,
	  rulesets/StatisticsProperty.cpp, rulesets/StatisticsProperty.h,
	  rulesets/Structure.cpp, rulesets/Structure.h, rulesets/Task.cpp,
	  rulesets/Task.h, rulesets/TaskScript.cpp, rulesets/TaskScript.h,
	  rulesets/TerrainProperty.cpp, rulesets/TerrainProperty.h,
	  rulesets/Thing.cpp, rulesets/Thing.h, rulesets/ThingFactory.cpp,
	  rulesets/ThingFactory.h, rulesets/World.cpp, rulesets/World.h,
	  rulesets/attributes.h, server/Account.cpp, server/Account.h,
	  server/Admin.cpp, server/Admin.h, server/ArithmeticFactory.cpp,
	  server/ArithmeticFactory.h, server/CommClient.cpp,
	  server/CommClient.h, server/CommIdleSocket.cpp,
	  server/CommIdleSocket.h, server/CommListener.cpp,
	  server/CommListener.h, server/CommLocalClient.cpp,
	  server/CommLocalClient.h, server/CommMDNSPublisher.cpp,
	  server/CommMDNSPublisher.h, server/CommMaster.cpp,
	  server/CommMaster.h, server/CommMetaClient.cpp,
	  server/CommMetaClient.h, server/CommPSQLSocket.cpp,
	  server/CommPSQLSocket.h, server/CommPeer.cpp,
	  server/CommPeer.h, server/CommPeerListener.cpp,
	  server/CommPeerListener.h, server/CommRemoteClient.cpp,
	  server/CommRemoteClient.h, server/CommServer.cpp,
	  server/CommServer.h, server/CommSlaveClient.cpp,
	  server/CommSlaveClient.h, server/CommSlaveListener.cpp,
	  server/CommSlaveListener.h, server/CommSocket.cpp,
	  server/CommSocket.h, server/CommUnixListener.cpp,
	  server/CommUnixListener.h, server/Connection.cpp,
	  server/Connection.h, server/Connection_methods.h,
	  server/EntityFactory.cpp, server/EntityFactory.h,
	  server/ExternalMind.cpp, server/ExternalMind.h,
	  server/Idle.cpp, server/Idle.h, server/Lobby.cpp, server/Lobby.h,
	  server/Master.cpp, server/Master.h, server/Peer.cpp, server/Peer.h,
	  server/Persistance.cpp, server/Persistance.h,
	  server/PersistantThingFactory.cpp, server/PersistantThingFactory.h,
	  server/PersistantThingFactory_impl.h, server/Persistor.cpp,
	  server/Persistor.h, server/Persistor_impl.h,
	  server/Player.cpp, server/Player.h, server/Restoration.cpp,
	  server/Restoration.h, server/Restorer.cpp, server/Restorer.h,
	  server/Restorer_impl.h, server/ScriptFactory.cpp,
	  server/ScriptFactory.h, server/ServerRouting.cpp,
	  server/ServerRouting.h, server/ServerRouting_methods.h,
	  server/SlaveClientConnection.cpp, server/SlaveClientConnection.h,
	  server/TaskFactory.cpp, server/TaskFactory.h,
	  server/TrustedConnection.cpp, server/TrustedConnection.h,
	  server/WorldRouter.cpp, server/WorldRouter.h,
	  server/server.cpp, server/server.h, server/slave.cpp,
	  tests/Areatest.cpp, tests/BaseEntitytest.cpp,
	  tests/Charactertest.cpp, tests/Containertest.cpp,
	  tests/Creatortest.cpp, tests/EntityExerciser.h,
	  tests/EntityFactorytest.cpp, tests/Entitytest.cpp,
	  tests/Foodtest.cpp, tests/IGEntityExerciser.h,
	  tests/Linetest.cpp, tests/Locationtest.cpp, tests/OOGThingtest.cpp,
	  tests/Planttest.cpp, tests/Propertytest.cpp, tests/Stackabletest.cpp,
	  tests/Structuretest.cpp, tests/Tasktest.cpp, tests/TestWorld.h,
	  tests/Thingtest.cpp, tests/WorldTimetest.cpp, tests/Worldtest.cpp,
	  tests/allOperations.h, tests/collisiontest.cpp, tests/consttest.cpp,
	  tests/distancetest.cpp, tests/emergencetest.cpp,
	  tests/inheritancetest.cpp, tests/logtest.cpp, tests/randomtest.cpp,
	  tests/systemtest.cpp, tests/transformtest.cpp,
	  tests/type_utilstest.cpp, tests/utilitytest.cpp,
	  tools/AdminClient.cpp, tools/AdminClient.h, tools/cyaddrules.cpp,
	  tools/cycmd.cpp, tools/cyconfig.cpp, tools/cyconvertrules.cpp,
	  tools/cyctrl.cpp, tools/cydbload.cpp, tools/cydumprules.cpp,
	  tools/cyisoload.cpp, tools/cyloadrules.cpp, tools/cypasswd.cpp,
	  tools/cywatchdog.cpp: Replace the copyright and license statements
	  with new versions that include disclaimer of warranty, and
	  permit distribution under later versions of the GPL.
2006-01-19 02:17:06 +00:00
Al Riddoch
19d808718a 2005-09-12 Al Riddoch <alriddoch@zepler.org>
* configure.ac: Increment version to development 0.5.x series.

	* aiclient/ClientAccount.cpp, client/BaseClient.cpp,
	  client/ClientConnection.cpp, common/BaseEntity.cpp,
	  common/Database.cpp, common/custom.cpp, common/inheritance.cpp,
	  common/operations.h, rulesets/BaseMind.cpp, rulesets/Creator.cpp,
	  rulesets/Food.cpp, rulesets/MemMap.cpp, rulesets/Pedestrian.cpp,
	  rulesets/Py_Operation.cpp, rulesets/Py_RootEntity.cpp,
	  rulesets/Python_API.cpp, rulesets/Stackable.cpp, rulesets/Thing.cpp,
	  rulesets/World.cpp, server/CommClient.cpp, server/Connection.cpp,
	  server/WorldRouter.cpp, tests/inheritancetest.cpp,
	  tools/AdminClient.h, tools/cyaddrules.cpp,
	  tools/cycmd.cpp, tools/cydumprules.cpp,
	  tools/cyloadrules.cpp, tools/cypasswd.cpp:
	  Remove unnecessary using directives.

	* common/utility.cpp, common/utility.h,
	  rulesets/BaseMind.cpp, rulesets/Py_Operation.cpp,
	  server/CommClient.cpp, tools/AdminClient.h, tools/cycmd.cpp:
	  Remove obsolete utility function from the build.

	* common/operations.h: Remove unused obsolete header from the
	  build.
2005-09-12 16:21:18 +00:00
Al Riddoch
70bda04c90 2004-10-03 Al Riddoch <alriddoch@zepler.org>
* Require varconf 0.6.2 for its superior command line handling.

	* client/client.cpp, common/globals.cpp, server/server.cpp,
	  server/slave.cpp, tools/cycmd.cpp, tools/cyloadrules.cpp,
	  tools/cypasswd.cpp: loadConfig() now returns the index of
	  the first non-option commandline arg.

	* client/client.cpp: Use new config feature to allow user to
	  specify the client function to use on the command line far
	  more easily.
2004-10-03 13:55:54 +00:00
Al Riddoch
adc1d1b7c0 2004-10-03 Al Riddoch <alriddoch@zepler.org>
* client/client.cpp, common/globals.cpp, common/globals.h,
	  common/inheritance.cpp, common/inheritance.h, server/server.cpp,
	  server/slave.cpp, tools/cycmd.cpp, tools/cyloadrules.cpp,
	  tools/cypasswd.cpp:
	  Use int for returning error status.
2004-10-03 02:06:45 +00:00
Al Riddoch
3dc25b698f 2004-10-03 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp, common/Database.h, common/accountbase.cpp,
	  common/accountbase.h, server/Persistance.cpp, server/Persistance.h,
	  server/server.cpp, tools/cyloadrules.cpp, tools/cypasswd.cpp:
	  Use int for returning error status.
2004-10-03 01:50:49 +00:00
Al Riddoch
da8ad23bbd 2004-08-17 Al Riddoch <alriddoch@zepler.org>
* 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,
	  tests/inheritancetest.cpp, tests/utilitytest.cpp, tools/cycmd.cpp,
	  tools/cyconvertrules.cpp, tools/cydbload.cpp, tools/cyisoload.cpp,
	  tools/cyloadrules.cpp, tools/cypasswd.cpp: Convert code to using
	  Atlas Message typedefs as found in Atlas-C++ 0.6 to aid
	  conversion later.
2004-08-17 13:23:28 +00:00
Al Riddoch
a2487f5f0e 2004-06-09 Al Riddoch <alriddoch@zepler.org>
* tools/cypasswd.cpp, tools/cyloadrules.cpp, tools/cycmd.cpp: Fix
	  usage functions to output to standard error.

	* server/Admin.cpp: Add quick code to install new types.

	* tools/cyconvertrules.cpp: Add placeholder for tool to convert
	  old format rules files into a new format to be common with
	  indri.
2004-06-09 21:19:41 +00:00
Al Riddoch
0aadfb8b3a 2003-08-25 Al Riddoch <alriddoch@zepler.org>
* tools/cypasswd.cpp: Fix up cypasswd to work with updated accountbase.
	  Needs more work on options, and admin account feature.
2003-08-25 16:54:58 +00:00
Al Riddoch
a832c2ce1b 2003-08-23 Al Riddoch <alriddoch@zepler.org>
* tools/cypasswd.cpp: Remove an obsolete comment.

	* common/Database.h, common/Database.cpp: Add the method required
	  to update a row of a simle database table.

	* common/accountbase.h, common/accountbase.cpp: Re-implement
	  accountbase to use the new style accounts table.
2003-08-24 23:56:15 +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
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
c5fda9c31f 2002-07-01 Al Riddoch <alriddoch@zepler.org>
* tools/cypasswd.cpp, tools/cyloadrules.cpp: Cleaned up tool source.
2002-07-01 10:21:14 +00:00
Al Riddoch
15fd19c073 gcc 3 fix 2002-05-05 14:36:55 +00:00
Al Riddoch
e54fa9816f 2002-05-02 Al Riddoch <alriddoch@zepler.org>
* tools/cydbload.cpp, tools/cyisoload.cpp, tools/cyloadrules.cpp:
	  Clean up unused headers, and incorrect use of fstream in
	  some tools.
2002-05-02 16:40:22 +00:00
Al Riddoch
32d93aed79 2002-03-03 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp, common/Database.h, common/accountbase.h,
	  server/Persistance.cpp, server/Persistance.h,
	  tools/cydbload.cpp, tools/cyloadrules.cpp, tools/cypasswd.cpp:
	  Modified class structure of database related classes to get
	  rid on nasty inheritance based idea. Add functionality
	  to handle updating a row as distinct from inserting. Made
	  id column the primary key. Updated tools to make propper use
	  of update functionality.
2002-03-03 02:37:35 +00:00
Michael Koch
d196ce291d check for termios.h and use it to turn off echo during input of
password in cypasswd when available
2002-01-17 18:44:21 +00:00
Al Riddoch
f7b9471b2c 2002-01-14 Al Riddoch <alriddoch@zepler.org>
* C++ compliance fixes for gcc 3.
2002-01-14 19:10:16 +00:00
Al Riddoch
e70aed6400 2002-01-13 Al Riddoch <alriddoch@zepler.org>
* client/client.cpp, server/server.cpp, common/globals.cpp,
	  common/globals.h, tools/cycmd.cpp, tools/cydbload.cpp,
	  tools/cypasswd.cpp: Move code for handling loading of config
	  from the command line, user config and global config, into
	  globals.cpp, and make use of it in all tools.

	* tools/cycmd.cpp: Fix objtype on server set commands.

	* common/Database.cpp, common/Database.h: Implemented new database
	  interface to PostgreSQL to replace inadequate db3 code.

	* common/database.cpp, common/database.h: Old code removed from the
	  build.

	* common/accountbase.h, server/Admin.cpp, server/Persistance.cpp,
	  server/server.cpp, tools/cydbload.cpp: Fixed for minor changes
	  in the low level database API.

	* common/globals.h, common/globals.cpp, rulesets/EntityFactory.cpp,
	  server/Admin.cpp, server/CommServer.cpp,
	  Remove varconf header from globals.h, and put in .cpp files
	  where it belongs.
2002-01-13 17:24:53 +00:00
Al Riddoch
c0af3c3c63 * aiclient/ClientConnection.cpp, aiclient/client.cpp,
client/ClientConnection.cpp, common/database.h, common/globals.cpp,
	  common/persistance.cpp, common/stringstream.h, server/CommClient.cpp,
	  server/CommServer.cpp, server/Persistance.cpp, tools/cyctrl.cpp,
	  tools/cyctrl.cpp, tools/cydbload.cpp, tools/cyisoload.cpp,
	  tools/cypasswd.cpp: Removed unused config.h.

	* client/ObserverClient.cpp, common/const.h, tools/cycmd.cpp:
	  Use default password if the admin account cannot be fetched from
	  the database.

	* client/Py_CreatorClient.cpp, common/BaseEntity.cpp,
	  common/BaseEntity.h, rulesets/Character.cpp, rulesets/Creator.cpp,
	  rulesets/Entity.cpp, rulesets/Entity.h, rulesets/EntityFactory.cpp,
	  rulesets/MemMap.cpp, rulesets/Py_Mind.cpp, rulesets/Py_Thing.cpp,
	  rulesets/Py_World.cpp, rulesets/Thing.cpp, server/Account.cpp,
	  server/Admin.cpp, server/Connection.cpp, tools/cywatchdog.cpp:
	  Make many of the member variables of Entity protected, and add
	  the required accessors. Changed the name of the id attribute
	  to m_id.

	* common/BaseWorld.h, common/database.cpp, common/persistance.cpp:
	  Removed unused includes.

	* common/Chop.h, common/Cut.h, common/Eat.h, common/Fire.h,
	  common/Generic.h, common/Load.h, common/Nourish.h, common/Save.h,
	  common/Setup.h, common/Tick.h: Moved definition of virtual
	  functions into cpp file, to reduce wasted code.

	* common/Makefile.am: Create cyphesis library, which can be used by
	  other applications to access cyphesis databases.

	* common/config.h, common/database.h, server/Persistance.cpp,
	  tools/cydbload.cpp, tools/cyisoload.cpp, tools/cypasswd.cpp:
	  Remove conditional compilation of db code. db3 is now required.

	* server/WorldRouter.h: Fixed getNewId() so it take const string.

	* server/server.cpp: Removed python shutdown, so it does not
	  mess up the db if it causes a segfault.

Al Riddoch  <alriddoch@zepler.org>
2001-10-17 14:09:42 +00:00
Al Riddoch
c92c420e0c * watchdog/watchdog.c: Deprecated non-working watchdog program.
* tools/cypasswd.cpp, tools/cycmd.cpp, client/ObserverClient.cpp,
	  common/accountbase.h Added database delete method, which closes
	  the database, and make sure it is used.

	* server/server.cpp: Moved the point where the server drops to
	  a daemon, as doing this after the db was open seems to corrupt
	  the db.

	* common/database.cpp: If a db is opened but not created, then it
	  is read only.

Al Riddoch  <alriddoch@zepler.org>
2001-10-07 01:08:25 +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
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
2b4c12d65d * client/define_world.py: Fixed and refined the market traders.
Sorted out random face direction.

	* tools/cypasswd.c: Re-wrote tool to use database class, and thus
	  ensure it is trying to access the right database.

	* common/database.cpp, common/database.h: Added function to remove
	  accounts from the account database.

Al Riddoch  <alriddoch@zepler.org>
2001-07-04 02:00:11 +00:00
Al Riddoch
403cb8d391 * configure.in, common/config.h, common/database.h, tools/cypasswd.cpp:
Added config check that looks for DB3's db_cxx.h on default
	  include path if it cannot be found in db3/. This fixes building
	  on Debian.

	* server/server.cpp, server/WorldRouter.cpp, acorn.vconf,
	  globals.h, globals.cpp: Added inittime config option used to
	  influence the game time used at server startup.

	* server/WorldTime.cpp: Added in new time of day descriptions for
	  more flexible goals.

	* server/ServerRouting.cpp: Removed output used to debug memory
	  cleanup code.

	* rulesets/basic/mind/goals/common/misc_goal.py: Added time
	  parameters to trading goals.

	* rulesets/Thing.cpp: Fixed appearance/disappearance operations
	  which were not getting sent most of the time.

	* client/define_world.py: Added in more NPC and modified behavoir.
	  Everyone now goes to the inn for lunch and in the evening, and
	  market traders only work during the day.

Al Riddoch  <alriddoch@zepler.org>
2001-05-30 14:49:38 +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
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
563107b595 * physics/Vector3D.h: Changed boundary condition of inBox() from
when part of entity leaves box to when the whole entity leaves the
	  box.

	* basic.vconf: Make tent use the structure base class.

	* client/define_world.py: Add bounding box to tent.

	* tools/cycmd.cpp: Added password entry.

	* server/Admin.cpp: Added "stat" admin command, to get server
	  details.

	* server/CommClient.h: Fixed include dependencies.

	* common/persistance.cpp: Added findAccount() method for systems
	  without db3.

	* rulesets/Thing.cpp: Added sending Apperance and Disappearance
	  operations to static entities when another entity moves out
	  of sight.

	* rulesets/Character.cpp: Added check to make sure an entity does
	  not collide with itself.

	* rulesets/Thing.cpp: Added check to make sure entity does not move
	  inside itself.

	* rulesets/Py_Location.cpp: Modified python location.copy() method
	  so that only the position and velocity is copied. This should
	  bounding boxes getting set on things which should not have them.

	* rulesets/Character.cpp: Added return statement to movement
	  handling, so move ops without arguments are not handled.

Al Riddoch (alriddoch@zepler.org)
2001-03-22 11:12:38 +00:00
Al Riddoch
8db1550177 * Modified database code so that entries have the correct begin
and end encodings, which is <atlas>..</atlas> in the case of
	  XML-like codec.

	* modules/Location.h: Added a flag which indicates whether the
	  bounding box of an entity is solid. If it is not solid, then
	  the entities contents much be checked for collisions rather
	  than the entity itself.

	* rulesets/Character.h: Added target_ref attribute to MovementInfo
	  as a means to track character movement between entities.

	* rulsets/Character.cpp: Modified collision code to handle
	  detecting of collisions with non-solid objects, and handling
	  movement when characters moves into a non-solid object but
	  does not collide with it.

	* rulesets/Structure.h, StructFactory.*: Added base class for
	  buildings and other structure, which are not solid, and the
	  character can move in and out of freely.

	* server/server.cpp: Made metaserver functionality optional, and
	  added a config option to the config file.

Al Riddoch (alriddoch@zepler.org)
2001-03-18 21:35:49 +00:00