Since entries in the database tying entities to accounts only can be
created if the entity already is created in the database we need to make
sure the relation in "accounts_entities" isn't created until the entry in
"entities". This is done by letting the StorageManager handle it.
The way to interface between the Persistance and the StorageManager
classes isn't obvious, so we'll have to do it by signals.
We now first create all of the entities, in order, but without setting
any properties. Once that's done we then go through all entities again,
in order, and set their properties. This is to make sure that
1) We don't set any properties until all child entities are created.
This is crucial for things like outfits to work.
2) We first set the properties of the parent, and then the properties of
the children. This is crucial for things like terrain modifiers to work.
Currently thoughts are only stored when the server is shut down. A more
proper way would probably be to query character and store their thoughts
at regular intervals while the simulation is running.
All IG code should use the interface of LocatedEntity when dealing
with any entity, rather than sometimes requiring Entity. Add virtual
functions to the interface where required, and modify all other interfaces
to stop them using Entity. This makes the code way cleaner, and much better
de-coupled.
* server/StorageManager.cpp, server/StorageManager.h: Add a queue
of deleted entity IDs, and implement deleting entries from
this queue from the database.
* 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.
* 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.