Commit graph

165 commits

Author SHA1 Message Date
Al Riddoch
a511b7a237 2004-09-25 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp: Supress debug output.

	* common/terrain_utils.cpp: Free up database results after processing
	  and supress debug output.
2004-09-25 00:06:39 +00:00
Al Riddoch
1a2045901f 2004-09-17 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp: Implement function for modifying array rows.

	* common/const.cpp: Enable persistence for testing.

	* common/terrain_utils.cpp: Implement function for updating terrain
	  in database after a change.

	* rulesets/World.cpp, rulesets/attributes.h: Add an update flag for
	  terrain, and use it to indicate to the Persistor.

	* rulesets/World.h: Add accessors for variables which track modified
	  terrain, and a function to clear them.

	* server/Persistor.cpp: Implement call to function to update terrain
	  in database.

	* server/Restoration.cpp: Ensure that if world entity is already
	  in database, it gets hooked up appropriatly.
2004-09-17 17:19:55 +00:00
Al Riddoch
392a44ea9e 2004-09-14 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp, common/Database.h: Fix queries on ID relation
	  tables. Add methods to result functions for decoding the contents
	  of fields more directly. Implement selecting from array tables.

	* common/terrain_utils.cpp, common/terrain_utils.h: New functions
	  for handling terrain in array database tables.

	* rulesets/World.cpp, rulesets/World.h: Add functionality to track
	  changes to the terrain for persistence purposes.

	* server/EntityFactory.cpp, server/EntityFactory.h, server/server.cpp:
	  Modify the way world entity persistence is bootstrapped to be
	  more consistent.

	* server/Persistor.cpp: Provide specialisations to handle world so
	  that terrain is persisted. Implement storing terrain at entity
	  creation.

	* server/Restoration.cpp, server/Restoration.h: Remove obsolete
	  restoration code. Return a status more accuratly representing
	  when restoration fails because of error, or if there is nothing
	  to restore.

	* server/Restorer.cpp, server/Restorer.h, server/Restorer_impl.h:
	  Convert to using methods for restoring data in the Database class.
	  Implement restoring terrain from the database.
2004-09-14 16:39:30 +00:00
Al Riddoch
c607ad0186 2004-09-07 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp: Implement inserting into array tables.
	  Modify tables so that key columns are NOT NULL.

	* server/Persistor.cpp: Test creating array rows.
2004-09-07 17:22:35 +00:00
Al Riddoch
be8ea28050 2004-09-07 Al Riddoch <alriddoch@zepler.org>
* common/Database.h, common/Database.cpp: Implement creating tables
	  for storing array data.

	* server/Persistor.cpp: Register a 2D array table for storing terrain
	  height point data.
2004-09-07 10:09:02 +00:00
Al Riddoch
f5231b1ec5 2004-09-06 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp: Add stubs for new methods.
2004-09-06 22:18:32 +00:00
Al Riddoch
96f13800c8 2004-08-07 Al Riddoch <alriddoch@zepler.org>
* common/BaseEntity.cpp, common/BaseEntity.h, common/BaseWorld.h,
	  common/Database.cpp, common/Database.h, common/FormattedXMLWriter.cpp,
	  common/FormattedXMLWriter.h, common/accountbase.cpp,
	  common/accountbase.h, common/custom.cpp, common/inheritance.cpp,
	  common/inheritance.h, common/operations.h, common/type_utils.h,
	  common/utility.cpp, common/utility.h, modules/Location.cpp,
	  modules/Location.h, rulesets/Area.cpp, rulesets/Area.h,
	  rulesets/BaseMind.cpp, rulesets/Character.cpp, rulesets/Character.h,
	  rulesets/Creator.cpp, rulesets/Entity.cpp, rulesets/Entity.h,
	  rulesets/Entity_getLocation.h, rulesets/Food.cpp, rulesets/Line.cpp,
	  rulesets/Line.h, rulesets/MemMap.cpp, rulesets/MemMap.h,
	  rulesets/Pedestrian.cpp, rulesets/Plant.cpp, rulesets/Plant.h,
	  rulesets/Py_Mind.cpp, rulesets/Py_Object.cpp, rulesets/Py_Object.h,
	  rulesets/Py_Operation.cpp, rulesets/Py_Thing.cpp,
	  rulesets/Python_API.cpp, rulesets/Stackable.cpp, rulesets/Stackable.h,
	  rulesets/Thing.cpp, rulesets/World.cpp, rulesets/World.h,
	  server/Account.cpp, server/Account.h, server/Admin.cpp,
	  server/Admin.h, server/CommClient.cpp, server/CommClient.h,
	  server/CommListener.cpp, server/CommListener.h,
	  server/CommLocalClient.cpp, server/CommLocalClient.h,
	  server/CommMetaClient.h, server/CommPSQLSocket.h,
	  server/CommRemoteClient.cpp, server/CommRemoteClient.h,
	  server/CommServer.cpp, server/CommServer.h, server/CommSocket.cpp,
	  server/CommSocket.h, server/CommUnixListener.cpp,
	  server/CommUnixListener.h, server/Connection.cpp,
	  server/Connection.h, server/EntityFactory.cpp,
	  server/EntityFactory.h, server/Lobby.cpp, server/Lobby.h,
	  server/Persistance.cpp, server/Persistance.h,
	  server/PersistantThingFactory.h, server/Persistor.cpp,
	  server/Player.cpp, server/Player.h, server/Restorer.h,
	  server/Restorer_impl.h, server/ServerRouting.cpp,
	  server/ServerRouting.h, server/TrustedConnection.cpp,
	  server/TrustedConnection.h, server/WorldRouter.cpp,
	  server/WorldRouter.h: Convert code to using Atlas Message
	  typedefs as found in Atlas-C++ 0.6 to aid conversion later.
2004-08-16 14:26:47 +00:00
Al Riddoch
6ea4c6090a 2004-07-22 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp, common/Database.h: Add function to check
	  whether an Atlas table has a given key.

	* tools/cyloadrules.cpp: Use hasKey() function to make sure we
	  don't get errors when inserting rules.
2004-07-22 11:25:24 +00:00
Al Riddoch
71a1c70fa1 2004-07-20 Al Riddoch <alriddoch@zepler.org>
* client/CreatorClient.cpp, rulesets/BaseMind.cpp,
	  rulesets/MemEntity.cpp, rulesets/MemEntity.h,
	  rulesets/MemMap.cpp, rulesets/MemMap.h, rulesets/Py_Map.cpp:
	  Set time on memory entities when we update them.

	* common/BaseWorld.h: Make object accessor const.

	* common/Database.cpp, common/Database.h, common/accountbase.cpp,
	  server/Connection.cpp, server/Persistance.cpp,
	  server/WorldRouter.cpp: Rename function to get new ID from
	  database to more correctly reflect its role.

	* rulesets/PythonMindScript.cpp: Use get rather than getAdd
	  to sort out to and from of ops send to mind scripts.
2004-07-20 20:27:56 +00:00
Al Riddoch
245308cd24 2004-07-16 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp: Try out creating database tables without an
	  OID column.
2004-07-16 16:15:11 +00:00
Al Riddoch
12c86f9e3b 2004-07-14 Al Riddoch <alriddoch@zepler.org>
* common/Database.h, common/Database.cpp: Modify relation code
	  to allow partial support for foreign key constrains to maintain
	  referential integrity. Full support will work when (if) primary
	  keys are inherited.

	* server/Persistance.h, server/Persistance.cpp: Use updated relation
	  code for the accounts to characters relation.
2004-07-14 18:31:07 +00:00
Al Riddoch
91c9437c81 2004-07-12 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp, common/Database.h: Add capability to specify
	  extra columns in generic Atlas database tables. Query the results
	  columns more robustly. Add a ruleset name column to the rules
	  table.

	* server/EntityFactory.cpp: Re-write rule loader to handle new
	  format rules. Tighten up strictness of rule data. It is no
	  longer possible to specify defaults for location in the rule.

	* tools/cyconvertrules.cpp: Ensure that the playable flag is
	  copied across when converting rules.

	* tools/cyloadrules.cpp: Adapt to load the new format rules,
	  including handling the ruleset name column.
2004-07-12 10:58:20 +00:00
Al Riddoch
74244d514f 2004-06-15 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp, common/globals.cpp, rulesets/Area.cpp,
	  rulesets/Python_API.cpp, server/Connection.cpp,
	  server/Persistance.cpp: Ensure that all output goes either via
	  the log system, or only in debug macros.
2004-06-15 18:06:59 +00:00
Al Riddoch
c3f979b909 2004-06-03 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp: Handle empty strings in config file
	  so they are less likely to cause problems.
2004-06-03 17:34:58 +00:00
Al Riddoch
87809757c0 2004-03-08 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp: Fix bootstrap bug by ensuring that all pending
	  queries are cleared before launching a new query directly.
2004-03-08 14:36:44 +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
6c278ce33c 2003-10-30 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp: Add <cassert> for gcc 3.3
2003-10-30 00:03:54 +00:00
Al Riddoch
9c04705d93 2003-10-28 Al Riddoch <alriddoch@zepler.org>
* common/Database.h: Add a registry for all tables.

	* common/Database.cpp: Add names of all database tables to the
	  registry. Clean up, fix and fully implement running maintainance
	  commands on all tables on request.

	* server/CommPSQLSocket.h, server/CommPSQLSocket.cpp: Implement
	  timing variables for handling regular running of database
	  maintainance commands. Add code to schedule the commands to
	  idle method, alternating between VACUUM FULL and VACUUM ANALYZE.
2003-10-28 00:18:18 +00:00
Al Riddoch
a42087b520 2003-10-27 Al Riddoch <alriddoch@zepler.org>
* common/Database.h, common/Database.cpp: Add function which
	  schedules queries required for routine database maintainance.
2003-10-27 18:01:03 +00:00
Al Riddoch
ba566381af 2003-10-27 Al Riddoch <alriddoch@zepler.org>
* server/server.cpp: Add database socket to the idle set, so it
	  gets called for regular database maintainance.

	* server/CommPSQLSocket.cpp, common/Database.cpp: Clean up and
	  disable the debugging output.
2003-10-27 12:04:53 +00:00
Al Riddoch
94a62bc477 2003-10-27 Al Riddoch <alriddoch@zepler.org>
* server/server.cpp: Add communications object to handle getting
	  the response to database queries without blocking.

	* server/Persistance.h: Make database connection exposed so
	  that CommPSQLSocket can access it.

	* server/CommPSQLSocket.cpp: Add debugging output, and implement
	  dispatching new queries once we have response to previous.

	* common/Database.h, common/Database.cpp: Switch code to submit
	  all command queries via the async que, so we don't block
	  waiting for them to complete. Currently very noisy.
2003-10-27 01:59:53 +00:00
Al Riddoch
a6fc58508b 2003-10-25 Al Riddoch <alriddoch@zepler.org>
* server/CommPSQLSocket.cpp: Implement processing the response to
	  async queries.

	* common/Database.h, common/Database.cpp: Add new data and interface
	  for managing a queue of queries so they can be processed
	  asyncronously.
2003-10-24 23:50:12 +00:00
Al Riddoch
077212e598 2003-08-23 Al Riddoch <alriddoch@zepler.org>
* common/accountbase.h, common/accountbase.cpp: Add init
	  method required to make the database connection.
	  Clear up bugs in putAccount, and get putAccount to return
	  true/false correctly.

	* common/Database.h, common/Database.cpp: Add extra arg to
	  updateSimpleRow so it can use any column as the key.
2003-08-25 15:20:01 +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
98c7fc5f62 2003-08-13 Al Riddoch <alriddoch@zepler.org>
* common/const.cpp, common/const.h: Add a const for the default
	  admin password hash, with a view to removing the plain text
	  default admin password.

	* server/Persistance.cpp: Ensure that the database contains an
	  admin account on startup.

	* common/Database.cpp: Move the call to register the ID generating
	  sequence out of the code for creating IG entity tables, as it is
	  also required by OOG entities, in particular the admin account
	  bootstrap.

	* client/ObserverClient.cpp, client/ObserverClient.h,
	  client/client.cpp: Modify client so that it no longer attempts to
	  get account details from the database, or from a hard coded default.
	  It will now attempt a trusted login, or rely on password provided
	  by config option.
2003-08-12 23:45:40 +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
661e208f6d 2003-07-21 Al Riddoch <alriddoch@zepler.org>
* common/Database.h, server/Account.cpp, server/Account.h,
	  server/Admin.h, server/Connection.cpp, server/Player.h,
	  server/WorldRouter.cpp: Change the form of the getEntityId()
	  method in the database code and re-work the code that uses it.

	* common/Database.cpp, common/Database.h: Use PQClear() to free
	  up database result objects, and provide a method to
	  free the contents of a DatabaseResult instance.
2003-07-21 09:37:58 +00:00
Al Riddoch
4c32169c52 2003-07-19 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp: Add support for boolean columns.

	* server/Persistor.cpp, server/Persistor_impl.h, server/Restorer.h,
	  server/Restorer_impl.h: Use a bool column to store whether or
	  not an entity has a bounding box, and use it apropriatly.
2003-07-19 18:29:57 +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
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
980f22cca5 2003-01-12 Al Riddoch <alriddoch@zepler.org>
* server/Restorer.h, server/Restorer_impl.h: Add method to allow
	  decoding of a complete atlas map from a database record.

	* common/Database.cpp: Ensure failure is only returned if string
	  is not empty.
2003-01-12 03:21:54 +00:00
Al Riddoch
0ce4f91307 2003-01-11 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp, common/Database.h: Add method to generalise
	  encoding atlas maps to string. Make the codec used by the database
	  code into a typedef, so production systems can use a more efficient
	  one.

	* server/Persistor.cpp, server/Persistor_impl.h: Persist
	  Entity::attributes as an atlas encoded string column. Not yet
	  restored.
2003-01-11 18:21:31 +00:00
Al Riddoch
f6dc20a9d2 2003-01-05 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp: Fix some errors in the entity table
	  creation code.

	* server/Persistor.cpp, server/Persistor.h, server/Persistor_impl.h:
	  Switch to using pointers instead of references with signals
 	  to comply with sigc++ 1.2.

	* tools/cycmd.cpp: Add a missing header, require for sigc++ 1.2.

	* server/Persistance.cpp: Fixed error message.
2003-01-05 21:44:56 +00:00
Al Riddoch
d30400de55 2003-01-05 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp, common/Database.h: Modify relation
	  table create query to allow different types of relation,
	  with constraints to be added. Implement function to
	  add rows to a relation. Modify result iterator constrcter
	  so it returns end() if the result is empty.

	* server/Persistance.cpp, server/Persistance.h: New methods
	  to handle populating a newly restored account object
	  with characters, and syncing newly created characters to
	  the relation that links them with their account.

	* server/Account.cpp, server/Account.h: New method to
	  add existing characters to this account. Inform persistance
	  system when we get a newly created character.

	* server/Connection.cpp: Ask persistance system to populate
	  newly restored account with its characters.
2003-01-05 19:55:52 +00:00
Al Riddoch
0c78cf0b43 2003-01-03 Al Riddoch <alriddoch@zepler.org>
* common/BaseEntity.h, server/Persistor.h: Make inheritance of
	  SigC::Object virtual, although multiple inheritance is not planned.

	* common/Database.cpp, common/Database.h: Remove legacy account
	  table, and add support for generic non-inherited tables for OOG
	  data.

	* common/Database.cpp, common/Database.h: Add general methods for
	  running queries and reporting errors, and cut down duplicated
	  code elsewhere by using them.

	* common/accountbase.cpp, common/accountbase.h: Remove code
	  that used old account table, and replace with stubs. New
	  account yet to be written.

	* server/Account.cpp, server/Account.h, server/Admin.cpp,
	  server/Admin.h, server/Player.cpp, server/Player.h:
	  Allow an id to be specified when creating an account.

	* server/Persistance.cpp: Re-write account persistance methods
	  to use new table.

	* server/Restoration.cpp: Clarify debug output.
2003-01-03 17:14:28 +00:00
Al Riddoch
babd1472a8 2002-12-30 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp: Don't make update requests if no columns
	  are given to be updated.

	* common/Database.cpp, common/Database.h: Add new method to select
	  all rows in a given class table with a given location.

	* rulesets/Entity.cpp, rulesets/Entity.h: Make update_flags
	  public.

	* rulesets/Entity.cpp, rulesets/Thing.cpp, rulesets/attributes.h,
	  server/Persistor.cpp, server/Persistor_impl.h,
	  server/WorldRouter.cpp: Add new cont column to entity tables which
	  is zero if the entity has no contained entities.

	* server/Restoration.cpp, server/Restoration.h, server/Restorer.cpp,
	  server/Restorer.h, server/Restorer_impl.h:
	  Modify restorers so they now use a database result iterator to
	  indicate the row they should restore from.

	* server/Restoration.cpp: Implement new way of restoring world from
	  database using new function to fetch multiple complete entities
	  from database at the same time. Massive speedup.
2002-12-31 12:41:19 +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
23f1040e22 2002-12-23 Al Riddoch <alriddoch@zepler.org>
* common/BaseEntity.cpp, common/BaseEntity.h, common/OOGThing.h:
	  Add a protected constructor for initialising id at construction
	  time.

	* common/Database.cpp, common/Database.h, server/Restorer_impl.h:
	  Switch argument order so default row can be first row.

	* server/Persistor.cpp: Don't persist Creator objects.

	* server/Restoration.cpp: Clean up debugging output, and report
	  serious errors.

	* server/Restorer.cpp, server/Restorer.h: Add restorers for Character.

	* server/server.cpp: Add log calls for restoring from database.
2002-12-23 00:01:59 +00:00
Al Riddoch
201c6d683a 2002-12-21 Al Riddoch <alriddoch@zepler.org>
* server/WorldRouter.cpp, server/Admin.cpp:
	  Use consts::rootWorldId correctly.

	* server/Persistor.cpp, server/PersistantThingFactory.cpp,
	  server/PersistantThingFactory.h, server/EntityFactory.h,
	  server/EntityFactory.cpp: Add World specialisation of Persistor
	  so that row in entity database is maintained, but not created.

	* common/Database.h: Ensure iterator has != as well as ==.

	* common/Database.cpp: Check that tuples have been returned
	  in response to a select.

	* server/Restoration.cpp, server/Restoration.h,
	  server/Restorer.cpp: Restoration code now iterates over the
	  contents of the database, but does not attempt to actually
	  restore it yet.
2002-12-21 21:28:20 +00:00
Al Riddoch
14aaea2756 2002-12-21 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp, common/Database.h: Implement methods
	  to query database results.

	* common/const.cpp, common/const.h: Add a const for the root
	  id.

	* server/Restoration.cpp, server/Restoration.h: Start implementing
	  code to restore world from database.
2002-12-21 17:11:05 +00:00
Al Riddoch
ad8bc68969 2002-12-21 Al Riddoch <alriddoch@zepler.org>
* common/Database.h, common/Database.cpp: Add base to get rows
	  from entity tables. Flesh out the result iterator - untested.
	  Tweak various bits of query generating code to be a little
	  more efficient.
2002-12-21 01:15:19 +00:00
Al Riddoch
35dbb779c2 2002-12-19 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp: Make id column of entity tables a unique
	  primary key.
2002-12-19 17:41:20 +00:00
Al Riddoch
d9d9330508 2002-12-19 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp, server/Persistor.cpp, server/Persistor_impl.h:
	  Clean up debugging output.
2002-12-19 16:23:28 +00:00
Al Riddoch
7dbe14ddbc 2002-12-19 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp: Add in code to send the entity requests
	  to the database.

	* server/Persistor.cpp, server/Persistor_impl.h: Add type and
	  class columns, correct the name of the drunkness column,
	  and remove a bad test from the update query generator.
2002-12-19 00:50:47 +00:00
Al Riddoch
bd9fdb374a 2002-12-18 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp, common/Database.h: Handle the way SQL INSERT
	  requires column headers and values to be separated.

	* server/Persistor.cpp, server/Persistor.h, server/Persistor_impl.h:
	  Add functions to generate INSERT queries for new entities.
2002-12-18 18:27:06 +00:00
Al Riddoch
6509955895 2002-12-18 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp: Fix badly generated insert query.

	* rulesets/Character.h: Add accessors for some hard attributes.

	* rulesets/Entity.h, server/EntityFactory.cpp: Add a way of clearing
	  all the update flags, and clear them after creating the database
	  row.

	* server/Persistor.h, server/Persistor_impl.h, server/Persistor.cpp:
	  Progress on the SQL update query generating code. Now generates
	  what looks like good update queries.
2002-12-18 15:44:37 +00:00
Al Riddoch
1db722f079 2002-12-15 Al Riddoch <alriddoch@zepler.org>
* server/server.cpp, server/WorldRouter.cpp,
	  server/EntityFactory.h, server/EntityFactory.cpp:
	  Change the way the EnitityFactory is created so it has a
	  reference to the world.

	* rulesets/Entity.h, rulesets/Entity.cpp: getLocation returns
	  whether an error occured setting location data.

	* common/Database.h, common/Database.cpp: Add stub functions
	  for generating queries to new format entity tables.

	* server/Persistor_impl.h, server/Persistor.h,
	  server/Persistor.cpp: Add hooks for syncing update to
	  database using new database functions.
2002-12-15 02:52:54 +00:00
Al Riddoch
638ba8c5a2 2002-12-11 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp: Fix error creating tables.
2002-12-11 01:30:05 +00:00
Al Riddoch
27381dd63a 2002-12-10 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp: Clean up errors in new entity table
	  code.

	* server/EntityFactory.cpp: Switch to using new persistant
	  factories.

	* server/Persistance.cpp: Don't create test tables.

	* server/PersistantThingFactory.h:
	  Clean up the way templates are used here, and simplify.

	* Persistor.h, Persistor.cpp, Persistor_impl.h:
	  Implement object handles the persistance of the rulesets
	  classes. Currently does not implement any of the actual
	  persistance.
2002-12-10 23:38:15 +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