* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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().
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.