* 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.
* 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.
* common/Database.cpp: Implement updating modified properties.
* server/StorageManager.cpp: Tweak test properties values
so we can tell if one has been updated.
* 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.
* common/Database.cpp, server/Persistance.cpp: Adject code to take
into account changed return value. Add call to create Entity
table, and fix the query string in the implementation.
* common/Database.cpp, common/Database.h: Change the return type
of a method to fit the preferred convention. Add an experimental
API for new Entity persistence.
* common/Database.cpp, common/globals.cpp, common/id.cpp,
common/log.cpp, modules/DateTime.cpp, rulesets/Container.h,
rulesets/Statistics.h, server/CommListener.cpp,
server/CommServer.cpp, tools/cyconfig.cpp, tools/cyconvertrules.cpp:
Add includes required for recent compilers which include less
stuff implicitly in standard headers.
* common/terrain_utils.h, common/Makefile.am: Remove the persistence
code used to save terrain data.
* common/Database.cpp, common/Database.h: Remove the object
relational API for persisting entity data, and put the code
beyond use.
* common/Database.h, common/Database.cpp: Add a new decoder for atlas
objects, and use it when getting the full contents of a table
full of Atlas data.
* server/Persistance.cpp, server/Persistance.h: Modify the API
for getting the rules table to use atlas objects rather than
messages.
* server/EntityFactory.cpp: Re-enable loading rules from the
Database, now that the data is available from the peristence
API in the right format.
* common/Database.cpp, common/Database.h: Add a new API for
attempting to bootstrap an instance database from the master.
* server/Persistance.h, server/Persistance.cpp: Make some of the
functions in the persistence API non-static, so they work
more cleanly and consistently. Use the new return codes
specified in the config header. If an instance can't get a database
connection, use the master database to try and create one.
* server/server.cpp: Use the persistence code the way it is
intended to be used.
* common/Database.cpp, common/Database.h: Remove the flag specifying
that the database should be created at connection time, as we
basically can't do this. Make the default database name depend on
instance name currently in use.
* common/accountbase.cpp, tools/cydumprules.cpp, tools/cyloadrules.cpp:
Fix code for the change to the database API.
* common/log.cpp, common/log.h, common/BaseEntity.cpp,
common/BaseEntity.h: Switch to taking a C++ string reference rather
than a char *, for the rest of the logging and error related
calls.
* common/Database.cpp, common/log.cpp, common/log.h,
rulesets/PythonMindScript.cpp, server/Account.cpp,
server/Admin.cpp, server/Connection.cpp, server/Player.cpp,
tools/cyisoload.cpp: Convert over to using the new API correctly.
* common/log.cpp, common/log.h: Switch to taking a C++ string reference
rather than a char *, as it is not really an optimisation, and it
makes the code simpler to read and write.
* client/BaseClient.cpp, client/ClientConnection.cpp,
common/AtlasFileLoader.cpp, common/BaseEntity.cpp,
common/Database.cpp, common/globals.cpp, common/id.cpp,
common/inheritance.cpp, common/log.cpp, common/log.h,
rulesets/Character.cpp, rulesets/Creator.cpp, rulesets/Entity.cpp,
rulesets/MemMap.cpp, rulesets/Motion.cpp, rulesets/Pedestrian.cpp,
rulesets/Py_Object.cpp, rulesets/Py_RootEntity.cpp,
rulesets/PythonMindScript.cpp, rulesets/PythonThingScript.cpp,
rulesets/Python_API.cpp, rulesets/Thing.cpp, server/Account.cpp,
server/Admin.cpp, server/ArithmeticFactory.cpp,
server/CommClient.cpp, server/CommListener.cpp,
server/CommMDNSPublisher.cpp, server/CommServer.cpp,
server/Connection.cpp, server/EntityFactory.cpp,
server/Persistance.cpp, server/Restoration.cpp,
server/ScriptFactory.cpp, server/TaskFactory.cpp,
server/WorldRouter.cpp, server/server.cpp: Convert over to using
new API correctly.
* data/mason.xml: Add biomass and transient to fircone, making its
script obsolete:
* common/Database.cpp: Improve the presentation of Database error
messages.
* server/server.cpp: If connecting to the database fails, just
disable it, and report plenty of error information.
* common/Database.cpp: Replace asserts with critical error messages,
so tests can run without a Database connection.
* tests/EntityPropertytest.cpp: Re-write test cases to deal with
modified behavoir if the Entity reference is null.
* tests/Databasetest.cpp: Add a unit test for the features of
Database that can be checked without an RDBMS to connect to.
* common/Database.h, common/Database.cpp: Provide a function to
cleanup the Database singleton, for easier testing.
* common/Database.cpp: Assert that the connection to the database
has been created before calling any functions in the database
client lib using that connection.
* common/Database.cpp, common/newid.cpp, server/server.cpp:
Modify new ID checks so that code still runs when database is
unavailable, and events requiring new IDs fail cleanly.
* server/Connection.cpp: Report a failure to create a player
account if no ID available.
* rulesets/BaseMind.cpp: When processing appearance ops, handle
stamp more efficiently, report an error if ID is missing
from argument.
* server/IdlePSQLConnector.cpp, server/IdlePSQLConnector.h:
Implement re-connecting to the Database if connection is lost.
* rulesets/Character.cpp, rulesets/Entity.cpp, rulesets/Thing.cpp:
Ensure STAMP is present on appearance op args.
* server/CommListener.cpp, server/CommListener.h,
server/CommPeerListener.cpp, server/CommPeerListener.h,
server/CommSlaveListener.cpp, server/CommSlaveListener.h,
server/CommUnixListener.cpp, server/CommUnixListener.h:
Add a return value to method for creating new client socket
objects, and use it to return failure if no ID is available
from the database for a new object.
* rulesets/Py_Point3D.cpp, rulesets/Py_Vector3D.cpp,
rulesets/Python_API.cpp: Add "new" method for class wrappers, and
call the in place constructor from new rather than init. Re-write
internal function for creating new instances so it uses the "new"
method.
* rulesets/Py_Statistics.cpp: Remove some obsolete code inadvertedly
copied from another file. Comment out some unused code to get rid
of a warning.
* server/CommPSQLSocket.cpp: Clear the database connection from
destructor.
* tests/python_class.cpp: A new test for experimenting with new
Python wrappers.
* configure.ac: Require latest varconf for its new features.
* common/globals.cpp, tools/cyconfig.cpp: Use new varconf scope for
settings to more suitably handle user overidden config settings.
* aiclient/ClientConnection.cpp, aiclient/client.cpp,
client/client.cpp, common/Database.cpp, server/server.cpp,
server/slave.cpp, tools/AdminClient.h, tools/cyaddrules.cpp,
tools/cycmd.cpp: Use new varconf/config.h header.
* client/BaseClient.cpp, common/Database.cpp, rulesets/MemMap.cpp,
server/Connection.cpp, server/EntityFactory.cpp, server/Peer.cpp,
server/Persistance.cpp, server/Restoration.cpp,
server/ServerRouting.h: Update integer ID related checks now that
integerId() function has changed.
* common/Database.cpp, common/Database.h, common/id.h, common/id.cpp:
Make newId() functions return the integer value.
* common/newid.cpp: Break newId out into its own file, and make
it handle whether or not the database should issue IDs.
* server/Connection.cpp, server/Persistance.cpp,
server/WorldRouter.cpp, server/server.cpp: Simply generating IDs
by just using the newId() function, and use its return value.
* common/AtlasFileLoader.cpp, common/Database.cpp,
common/FormattedXMLWriter.cpp, common/Property.cpp,
common/accountbase.cpp, rulesets/Character.cpp,
rulesets/Entity_getLocation.h, rulesets/MemMap.cpp,
rulesets/Pedestrian.cpp, rulesets/Plant.cpp,
rulesets/Py_Object.cpp, rulesets/Thing.cpp,
server/Admin.cpp, server/Connection.cpp, server/EntityFactory.cpp,
server/WorldRouter.cpp, tools/AdminClient.cpp, tools/cycmd.cpp,
tools/cyconvertrules.cpp: After an Element has been checked
with isFoo(), it is more efficient to get its value using Foo()
rather than asFoo() which repeats the check.
* rulesets/Entity.h: Add a pointer to a Motion object to entities.
* rulesets/Thing.cpp: Add notes about Motion implementation.
Clean up some variable names.
* common/Database.cpp: Fix some lingering missuse of the varconf API.
* common/Database.cpp: Improve error reporting for query errors.
* common/const.cpp, common/const.h: Add full details and comments
for enable_database option.
* common/id.h, common/id.cpp: New ID generator for use when we
are not using the Database.
* common/AtlasFileLoader.cpp, common/AtlasFileLoader.h: Generic
class for loading Atlas data from a file.
* server/Connection.cpp, server/EntityFactory.h,
server/EntityFactory.cpp, server/Persistor.cpp,
server/WorldRouter.cpp, server/server.cpp:
Implement the enable_database option by wrapping all use of database
in if statements. Rules are loaded from files instead.
* common/Database.cpp, common/terrain_utils.cpp: Disable debugging
output.
* server/Persistor.cpp: Don't update the main entity table if we
have no attributes modified other than terrain.
* 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.
* 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.
* common/Database.cpp: Implement inserting into array tables.
Modify tables so that key columns are NOT NULL.
* server/Persistor.cpp: Test creating array rows.