Since we're targetting the latest LTS release of Ubuntu as a nice
baseline, and that currently only supports 1.46, we need to remove the
nice steady_timer code. For now.
This commit should probably be reverted once a newer version of Ubuntu
LTS is available.
This required cleaning up a bunch of other things:
Expose functions to disconnect and flush sockets generally
Make a new base class for objects that link a socket to the server
* 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.
* server/WorldRouter.cpp: When entity creation cannot get a new ID,
fail cleanly.
* server/Idle.h: Clean up header, and correct copyright date.
* server/CommPSQLSocket.cpp: Implement eof() method to check the
connection is still okay.
* server/CommPSQLSocket.cpp, server/IdlePSQLConnector.cpp,
server/IdlePSQLConnector.h: Add class stub which will try and
re-establish connection to the RDBMS once lost.
* server/CommListener.cpp,
server/CommMetaClient.cpp, server/CommMetaClient.h,
server/CommPSQLSocket.cpp, server/CommPSQLSocket.h
server/CommServer.cpp, server/CommServer.h,
server/CommUnixListener.cpp, server/server.cpp:
Replace CommIdleSocket with pure virtual inferface Idle,
and use multiple inheritance in classes which are both sockets
and idlers. Rename add() in CommServer to make its function cleaner,
and move its implementation into the cpp file in preparation for
a more powerful CommServer implementation.
* server/CommServer.h: Add a method to remove CommIdleSocket
objects.
* server/CommIdleSocket.cpp: Automatically remove this object
from the server when its destroyed.
* server/CommPSQLSocket.cpp: Return an error if we get an error
reading from the RDBMS socket. This seems to indicate that the
connection is lost. Losing connection to database should not now
cause this code to segfault.
* common/BaseWorld.h, server/CommSocket.h, server/CommIdleSocket.h:
Make constructors of some base classes protected.
* server/Account.cpp: Note a possible bug in the character
creation code.
* server/CommIdleSocket.cpp, server/CommIdleSocket.h,
server/CommListener.cpp, server/CommListener.h,
server/CommLocalClient.cpp, server/CommMetaClient.cpp,
server/CommMetaClient.h, server/CommPSQLSocket.cpp,
server/CommPSQLSocket.h, server/CommRemoteClient.cpp,
server/CommSocket.cpp, server/CommSocket.h,
server/CommUnixListener.cpp, server/CommUnixListener.h:
Clean up the Comm classes for consistancy and readability.
* server/CommPSQLSocket.h: Change database vacuum intervals to
more reasonable ammounts.
* server/CommPSQLSocket.cpp: Init m_vacuumFull to false, rather
than 0.
* common/const.cpp, common/const.h, common/random.h,
physics/BBox.h, physics/Collision.cpp, physics/Collision.h,
physics/Quaternion.cpp, physics/Quaternion.h, physics/Vector3D.h,
rulesets/Movement.cpp, rulesets/Plant.cpp, rulesets/Python_API.cpp,
tests/collisiontest.cpp: Update variables relating to geometry
from double to float as this is the type used internall by
WFMath.
* physics/Vector3D.cpp, physics/Quaternion.cpp, physics/Quaternion.h:
Remove legacy code.
* server/CommPSQLSocket.cpp: Reformatting.
* 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.
* server/CommPSQLSocket.h, server/CommPSQLSocket.cpp,
common/Database.h: Work in progress on Comm object to handle
non-blocking database communication.
* physics/Collision.cpp: Remove obsolete FIXME about non-valid
velocity.