* common/globals.cpp, common/globals.h: Change the type and name
of the ruleset list to a string.
* rulesets/Python_API.cpp, server/EntityFactory.cpp,
server/server.cpp, tools/cyaddrules.cpp, tools/cydumprules.cpp,
tools/cyloadrules.cpp: Switch to using single ruleset config
variable.
* common/globals.cpp, common/globals.h: Add interfact and mechanism
for showing usage data for all the programs given one central
location for the data.
* server/server.cpp: Test out the usage function.
* tools/cypasswd.cpp: Display usage using the old mechanism.
* commong/globals.h, common/globals.cpp: Add definitions for different
error codes from reading the config file, in particular codes that
indicate that the user has requested version, help or usage
information. Add a function for reporting the version of tools.
* server/server.cpp: Add support for version or usage arguments,
including specific reporting of the server build number, which is
does not apply when reporting the version of other components.
* tools/Makefile.am: Fix the globals modules dependency on consts.
* tools/cypasswd.cpp: Add support for version or usage arguments.
* 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/globals.cpp, common/globals.h: Add a config flag
to control whether database code is enabled.
* server/EntityFactory.cpp, server/EntityFactory.h,
server/PersistantThingFactory.cpp, server/PersistantThingFactory.h,
server/PersistantThingFactory_impl.h, server/Persistor.cpp:
Re-work the persistence code so that persistent or non-persistent
versions of entity factories are installed at startup, removing
the need to check whether the database is enabled during
runtime.
* common/newid.cpp, server/Connection.cpp, server/server.cpp:
Replace the const that used to control whether the database
was used with the config flag.
* configure.ac: Add tests for more optional functions and headers.
* client/ObserverClient.cpp: Use alternative on systems which don't
have usleep().
* common/system.cpp: Implement gettimeofday for systems which don't
have it.
* server/CommListener.cpp: Add a note about supporting alternatives
to inet_ntop.
* server/CommUnixListener.cpp, server/server.cpp: Disable the unix
listen socket on systems which don't have it.
* tests/systemtest.cpp: Fix the test to work on systems without fork()
or kill(), and add a test for the substitute gettimeofday
implementation.
* common/accountbase.cpp, server/Admin.cpp, server/Persistance.cpp,
server/server.cpp, server/slave.cpp: Add more checks to ensure
that not getting an ID from the database always fails cleanly.
* 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.
* common/system.cpp, common/system.h: Add a function to increment nice
value for the server. Change security check to return unsigned, as
the magic number is in fact unsigned.
* server/server.cpp: Call system function to increment nice, thus
reducing priority once setup is complete.
* common/system.h, common/system.cpp: Add security check function
which for now just ensures cyphesis is not run as root.
* server/server.cpp: Use security check function when starting
the server.
* common/log.cpp, server/Account.cpp, server/Connection.cpp,
server/server.cpp: Make server logs much more machine readable
by removing stray colons, standardising field semantics, and
cleaning up messages.
* 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.
* common/log.h, common/log.cpp: Add logging function for logging
regular server activity, for statistics purposes, to a file.
* server/Account.cpp, server/Connection.cpp, server/server.cpp:
Add log calls to recall typical events.
* tools/cycmd.cpp: Set a name on the admin agent avatar.
* server/ServerRouting.h: Add accessor for client count.
* server/CommMDNSPublisher.h, server/CommMDNSPublisher.cpp:
Add alternative MDNS-SD handler using Avahi, which is preferred
over howl.
* server/server.cpp: CommMDNSPublisher is now an idler as well
as a socket.
* server/Admin.cpp, server/CommPeer.cpp, server/CommPeer.h,
server/CommPeerListener.cpp, server/Peer.cpp, server/Peer.h:
Re-work classes for peer connections to use integer IDs.
* server/Lobby.cpp, server/Lobby.h: Modify interface so its more
obvious that lobby only handles accounts, and adjust to have
integer ID.
* server/Connection.cpp, server/Connection.h,
server/TrustedConnection.cpp, server/TrustedConnection.h: Use
integer IDs, and modify to match new Lobby API changes.
* server/ServerRouting.cpp, server/ServerRouting.h, server/server.cpp:
Modify server to have integer ID, and handle ID for Lobby as well.
* server/CommListener.cpp, server/CommLocalClient.cpp,
server/CommLocalClient.h, server/CommRemoteClient.cpp,
server/CommRemoteClient.h, server/CommUnixListener.cpp:
Modify communication classes for normal clients to handle
integer IDs on the connection classes.
* 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.
* client/BaseClient.cpp, common/BaseWorld.cpp, common/id.cpp,
common/id.h, rulesets/MemMap.cpp, server/Account.cpp,
server/Admin.cpp, server/Connection.cpp, server/Persistance.cpp,
server/Restoration.cpp, server/WorldRouter.cpp, server/server.cpp:
Add intgerId() function to convert ID strings to integers, and
check the conversion went okay.
* common/BaseEntity.cpp, common/BaseEntity.h, common/inheritance.cpp,
common/inheritance.h, rulesets/BaseMind.cpp, rulesets/BaseMind.h,
rulesets/Character.cpp, rulesets/Character.h, rulesets/Entity.cpp,
rulesets/Food.cpp, rulesets/Plant.cpp, rulesets/Stackable.cpp,
rulesets/Thing.cpp, rulesets/World.cpp, server/Account.cpp,
server/Admin.cpp, server/Connection.cpp, server/server.cpp:
Remove the subscription mechanism as it is no longer necessary
now that operations have class numbers.
* 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.
* server/CommMaster.cpp, server/CommMaster.h, server/Master.cpp,
server/Master.h: Handlers for a connection to a master server.
* server/CommPeer.cpp: Fix comments.
* server/slave.cpp: Implement connecting to master server on startup.
* tools/cycmd.cpp: Fix bug handling option to connect to slave instead
of server.
* common/globals.cpp, common/globals.h: Separate globals for server
and slave sockets. Add code for reading slave settings.
* client/ClientConnection.cpp, server/server.cpp: Use modified
global socket_name setting.
* server/slave.cpp: Update for changed return values from bool to
int. Remove metaserver functionality. Switch to using
CommSlaveListener.
* tools/cycmd.cpp: Add config option to connect to slave rather
than core server.
* server/CommListener.cpp, server/CommListener.h: Add a virtual
create method, so it can be overriden to make different kinds
of listener.
* server/Peer.cpp, server/Peer.h: New class representing connections
to peer servers.
* server/CommPeer.cpp, server/CommPeer.h: New socket class handling
sockets used to connect to peer servers.
* server/CommPeerListener.cpp, server/CommPeerListener.h: New
listener using new virtual interface in CommListener to accept
peer connections.
* server/CommClient.cpp, server/CommClient.h: Add a new constructor
for creating Atlas socket objects which are not yet open. Makes
this class suitable for establishing as well as accepting
connections. Take out call to Connection::destroy.
* server/CommRemoteClient.h: Fix error in header guards.
* server/Connection.cpp, server/Connection.h: Remove
obsolete destroy() method. Make CommClient member public.
* server/server.cpp: Add new listener for peer connections.
* common/types.h: Add enumeration for new connect operation.
* server/Admin.cpp, server/Admin.h: Add new handler for connect
operations, used by admin client to build peer connections.
* tools/cycmd.cpp: Add new command "connect" for sending
connect ops to server.
* client/ClientConnection.cpp, common/globals.cpp, common/globals.h,
server/CommMDNSPublisher.cpp, server/server.cpp, server/slave.cpp,
tools/cycmd.cpp: Add new port number settings for things like
peer connections, and listen sockets for an AI slave.
* server/CommUnixListener.cpp, server/CommUnixListener.h:
Parameterise socket name for listen socket.
* 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/CommMDNSPublisher.cpp, server/CommMDNSPublisher.h: New
class to publish service using zeroconf.
* server/server.cpp: Use new CommMDNSPublisher class.
* configure.ac: Detect howl libraries, optionally. Clean up a bunch
of unused variables.
* server/Connection.cpp: Move the code to handle destruction of
a connection into the destructor. The destroy method can go
once this is well tested.
* server/CommListener.cpp: Return -1 on error.
* server/Persistance.cpp: Return a different error code depending
on why database init failed.
* server/server.cpp: Try and provide more helpfull error messages
depending on why database init failed.
* Require varconf 0.6.2 for its superior command line handling.
* client/client.cpp, common/globals.cpp, server/server.cpp,
server/slave.cpp, tools/cycmd.cpp, tools/cyloadrules.cpp,
tools/cypasswd.cpp: loadConfig() now returns the index of
the first non-option commandline arg.
* client/client.cpp: Use new config feature to allow user to
specify the client function to use on the command line far
more easily.
* 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.
* server/CommUnixListener.cpp, server/CommUnixListener.h:
Clean up member variable names in CommUnixListener, store
the socket path to avoid regenerating it, and provide
an accessor for the path.
* server/server.cpp: Report the pathname of failed listen socket
if we can't open it.
* server/server.cpp, common/globals.cpp, client/client.cpp:
Workaround C++s nasty implicit conversion behavoir.
* common/system.cpp: Be smarted about POSIX signal handling for
segfaults and aborts.
* Update TODO.
* 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/server.cpp: Handle the case correctly if the metaserver
socket setup does not work.
* server/CommMetaClient.h, server/CommMetaClient.cpp: Re-write
CommMetaClient to use skstreams udp_socket_stream.
* common/globals.cpp, common/globals.h: Add global variable for
the local state directory.
* server/Account.cpp, server/Admin.cpp, server/Admin.h,
server/Player.cpp: Tighten up some operation checking and add Create
handler to Admin in preparation for handling creation of new OOG
things.
* server/CommLocalClient.cpp, server/CommLocalClient.h,
server/CommRemoteClient.cpp, server/CommRemoteClient.h,
server/CommUnixListener.cpp, server/CommUnixListener.h,
server/CommClient.cpp, server/CommClient.h,
server/CommListener.cpp, server/Connection.cpp,
server/Connection.h, server/server.cpp:
Create new listener and connection classes using unix sockets
to allow local trusted connections.
* client/ClientConnection.cpp, client/ClientConnection.h,
client/CommClient.h, client/CreatorClient.cpp,
client/ObserverClient.cpp: Add capability to connect over
unix socket.