Commit graph

36 commits

Author SHA1 Message Date
Erik Hjortsberg
1a99d07383 Fixed a segfault when a type is missing when restoring an entity.
We'll instead log an error and skip that entity, as this is an expected
situation when authoring the world.
2010-03-02 13:07:26 +01:00
Alistair Riddoch
d52550a9e3 Rename Monitor class tree to Variable for clarity. 2009-09-03 00:38:50 +01:00
Alistair Riddoch
958babd997 Add new Variable files to the build, remove copied code, and fix up includes. 2009-09-03 00:27:59 +01:00
Al Riddoch
84c1a94412 Rename files for EntityBuilder from EntityFactory to match the class rename. 2009-03-12 00:50:25 +00:00
Al Riddoch
e5ac2b72db 2008-11-20 Al Riddoch <alriddoch@googlemail.com>
* server/StorageManager.cpp: Hook restored entities to the update
	  functions, or they never get subsequent updates.
2008-11-20 19:59:17 +00:00
Al Riddoch
fef5996466 2008-11-18 Al Riddoch <alriddoch@googlemail.com>
* server/StorageManager.cpp: Remove some debug output, improve
	  error checking and reporting.
2008-11-18 02:40:38 +00:00
Al Riddoch
9b50ab5823 2008-11-17 Al Riddoch <alriddoch@googlemail.com>
* server/StorageManager.cpp: Fill gaps so world is now completely
	  restored from database. Currently incredibly verbose and buggy.
2008-11-17 19:45:53 +00:00
Al Riddoch
91c059a960 2008-11-17 Al Riddoch <alriddoch@googlemail.com>
* server/StorageManager.cpp: Add some improved debug messages, and
	  set the value of restored properties.
2008-11-17 18:14:48 +00:00
Al Riddoch
ffcd25da46 2008-11-17 Al Riddoch <alriddoch@googlemail.com>
* server/StorageManager.cpp: Attempt to recontruct the entities
	  and properties being restored.
2008-11-17 15:55:52 +00:00
Al Riddoch
a976c54552 2008-11-17 Al Riddoch <alriddoch@googlemail.com>
* server/StorageManager.cpp: Dump more debug info about data from
	  the database.
2008-11-17 14:04:39 +00:00
Al Riddoch
d55ef57181 2008-11-17 Al Riddoch <alriddoch@googlemail.com>
* server/StorageManager.cpp: Dump database results to stdout.
2008-11-17 11:07:20 +00:00
Al Riddoch
ecff89aba1 2008-11-17 Al Riddoch <alriddoch@googlemail.com>
* server/StorageManager.cpp, server/StorageManager.h: Sketch out
	  the algorithm for reading entity data from the database.
2008-11-17 02:14:59 +00:00
Al Riddoch
fd3adb5c78 2008-11-03 Al Riddoch <alriddoch@googlemail.com>
* server/StorageManager.cpp, server/StorageManager.h: Add a bunch
	  of metrics about the database performance.
2008-11-03 01:13:36 +00:00
Al Riddoch
9585ec93d7 2008-09-30 Al Riddoch <alriddoch@googlemail.com>
* server/StorageManager.cpp: Return early to avoid scheduling deleted
	  Entities for an update.
2008-09-30 20:31:29 +00:00
Al Riddoch
36124ce0e7 2008-09-11 Al Riddoch <alriddoch@googlemail.com>
* server/StorageManager.cpp: Don't use the enable_persistence
	  flag to see if persistence is enabled. It's always false.
2008-09-11 16:40:47 +00:00
Al Riddoch
e55de645ef 2008-09-10 Al Riddoch <alriddoch@googlemail.com>
* server/StorageManager.cpp: Add a check to see if database
	  is enabled before hooking into the Entity builder, and exporting
	  monitors.
2008-09-11 00:45:51 +00:00
Al Riddoch
dd1e28de7f 2008-09-10 Al Riddoch <alriddoch@googlemail.com>
* server/StorageManager.cpp: Remove debug output.
2008-09-10 16:30:36 +00:00
Al Riddoch
8c8884c11a 2008-09-08 Al Riddoch <alriddoch@googlemail.com>
* server/StorageManager.cpp: Disable debug output.
2008-09-08 00:02:21 +00:00
Al Riddoch
fe60aa4a1f 2008-09-08 Al Riddoch <alriddoch@googlemail.com>
* server/StorageManager.cpp: Only do property inserts if there are
	  some to be inserted. Limit the number of queries per tick. Improve
	  database debug output.
2008-09-07 23:47:04 +00:00
Al Riddoch
60ae81e4a1 2008-09-03 Al Riddoch <alriddoch@googlemail.com>
* server/StorageManager.cpp, server/StorageManager.h: Add a queue
	  of deleted entity IDs, and implement deleting entries from
	  this queue from the database.
2008-09-04 09:39:04 +00:00
Al Riddoch
8863140a37 2008-09-03 Al Riddoch <alriddoch@googlemail.com>
* server/Persistance.cpp: Correct seem seriously wrong error
	  messages.
2008-09-03 22:53:58 +00:00
Al Riddoch
84a8325e1e 2008-09-03 Al Riddoch <alriddoch@googlemail.com>
* server/StorageManager.cpp: Add checks so that ephemeral
	  entities are not written to the database, and ephemeral properties
	  are not inserted or updated. Postpone connecting the updated
	  signal until after the initial insert.
2008-09-03 20:54:06 +00:00
Al Riddoch
5b44925c4e 2008-09-03 Al Riddoch <alriddoch@googlemail.com>
* server/StorageManager.cpp: Add hooks so that updates to the world
	  get persisted.
2008-09-03 10:19:37 +00:00
Al Riddoch
2083fe0ff4 2008-09-02 Al Riddoch <alriddoch@googlemail.com>
* server/StorageManager.cpp: Disable debug output.
2008-09-02 18:26:52 +00:00
Al Riddoch
977c0ec4d7 2008-09-01 Al Riddoch <alriddoch@googlemail.com>
* server/EntityFactory.cpp, server/PersistantThingFactory.cpp,
	  server/PersistantThingFactory.h,
	  server/PersistantThingFactory_impl.h:
	  Add a count to each factory of the number of entities
	  it has created, and add a monitor watch to each one.

	* server/StorageManager.cpp, server/StorageManager.h: Add counters
	  for the various types of database query, and add monitor watches
	  for them.
2008-09-01 17:45:59 +00:00
Al Riddoch
5e9d6f3e77 2008-08-28 Al Riddoch <alriddoch@googlemail.com>
* common/Database.cpp: Add the location data to the database
	  insert query.

	* server/Persistance.cpp: Modify the entity database table so it
	  has the right columns.

	* server/StorageManager.cpp: Correctly check the orientation
	  valid flag before using it.
2008-08-28 10:32:03 +00:00
Al Riddoch
d3f19deda1 2008-08-27 Al Riddoch <alriddoch@googlemail.com>
* common/Database.cpp, common/Database.h: Modify the Entity database
	  functions to include a chunk of text for location data.

	* server/StorageManager.cpp: Implement naive storage of location
	  data to the database.
2008-08-28 09:43:50 +00:00
Al Riddoch
0285deded5 2008-08-27 Al Riddoch <alriddoch@googlemail.com>
* server/StorageManager.cpp, server/StorageManager.h: Encode
	  properties as rather messy Atlas, and store them in the
	  database.
2008-08-27 15:46:14 +00:00
Al Riddoch
d87a7cd4dc 2008-08-26 Al Riddoch <alriddoch@googlemail.com>
* server/StorageManager.cpp, server/StorageManager.h: Move code
	  that inserts and updates Entities in the database into their own
	  functions.
2008-08-26 14:26:25 +00:00
Al Riddoch
e3aafac169 2008-08-25 Al Riddoch <alriddoch@googlemail.com>
* server/StorageManager.cpp, server/StorageManager.h,
	  server/servery.cpp: Add a stub function to be used to bootstrap
	  world persistence.
2008-08-25 15:47:11 +00:00
Al Riddoch
9e864bb6fe 2008-08-24 Al Riddoch <alriddoch@googlemail.com>
* common/Database.cpp: Implement updating modified properties.

	* server/StorageManager.cpp: Tweak test properties values
	  so we can tell if one has been updated.
2008-08-24 23:01:32 +00:00
Al Riddoch
fb278302b0 2008-08-23 Al Riddoch <alriddoch@googlemail.com>
* common/Property.h: Add helper functions to make it easy and clear
	  to manipulate flags.

	* common/Database.cpp, common/Database.h: Expand the entity database
	  table to include LOC and update sequence number. Implement new
	  functions that insert test entity data into entity and property
	  tables.

	* rulesets/LocatedEntity.h: Add an accessor providing direct access to
	  the properties dictionary for persistence.

	* server/Persistance.cpp: Remove the bounding box chunk from the
	  entity table schema.

	* server/StorageManager.cpp: Implement inserting and updating rows
	  into the Entity and Propertiy tables.
2008-08-23 17:53:43 +00:00
Al Riddoch
1592aebf61 2008-08-22 Al Riddoch <alriddoch@googlemail.com>
* server/StorageManager.cpp: Put in very basic code framework for
	  scheduling update and insert queries to the database.
2008-08-22 19:35:08 +00:00
Al Riddoch
4b7b7c6ccc 2008-08-22 Al Riddoch <alriddoch@googlemail.com>
* server/IdleConnector.cpp, server/IdleConnector.h: A generic sigc++
	  based class for functions which need to be called regularly.

	* server/StorageManager.cpp, server/StorageManager.h: Add a method
	  to be called once a second from the idler.

	* server/server.cpp: Hook the idler up to storage manager.
2008-08-22 18:59:06 +00:00
Al Riddoch
952568e699 2008-08-22 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Entity.h: Make flags protected, and add convenient methods
	  to set and clear flags. Add a flag for indicating that the entity
	  is queued for a storage update.

	* rulesets/Entity.cpp: Reset the clean flag correcly when the entity
	  is made dirty.

	* server/StorageManager.cpp: Hook up Entity::updated, and implement
	  queueing things for update and making sure they only get added once.
2008-08-22 15:44:55 +00:00
Al Riddoch
689092a700 2008-08-17 Al Riddoch <alriddoch@googlemail.com>
* server/StorageManager.cpp, server/StorageManager.h: Add a new
	  class to coordinate storing the world state in a persistent store.
2008-08-17 21:12:50 +00:00