* server/EntityFactory.cpp, server/EntityFactory.h, server/Admin.cpp,
server/PersistantThingFactory.cpp, server/WorldRouter.cpp,
server/server.cpp: Rename EntityFactory to EntityBuilder, to make
it's function clearer.
* common/system.h: Add a new exit status code indicating that no
ports were available in the dynamic range.
* server/server.cpp, common/system.cpp: When there are no ports
available, write an appropriate message, and a hint describing
how to allocate more.
* server/Persistance.cpp: Add an information message when attempting
to create a new instance database.
* server/server.cpp: Store a new value for the start of the dynamic
port range, if one is allocated.
* common/globals.cpp: Force the instance name into lower case
alphanumeric, and underscore only. Reject it if it can't easily
be forced.
* 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/globals.h, common/globals.cpp: Provide a separate function
for saving user settings back to the home directory. When
configuring a new instance, store the ruleset in user settings,
and log an informational message rather than a warning.
* server/server.cpp: When dynamically assigning a port to a new
instance, store the port in user settings, and log an informational
message. Save the user configuration once the validity has been
completely verified and applied.
* common/globals.cpp, common/globals.h: Add a new config setting for
the instance short name, and support per-instance configuration.
Add config settings for a dynamic port range.
* server/server.cpp: Support per-instance configuration and use a
dynamic port for non-default instances.
* common/globals.cpp, common/globals.h: Modify the loadConfig
function so it takes usage hints, and checks the options in known
sections against those in the usage help.
* client/client.cpp, server/server.cpp, tools/cyaddrules.cpp,
tools/cycmd.cpp, tools/cydumprules.cpp, tools/cyloadrules.cpp,
tools/cypasswd.cpp: Convert all calls to loadConfig to provide
the right hints.
* common/globals.cpp: Make a missing config file no longer fatal,
as the default are now sane, and do work.
* server/server.cpp: Fix up some error and status messages.
* 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:
* scripts/cyphesis-setup.sh: Complete the database setup script
functionality. Clean up the output, and polish.
* server/PersistantThingFactory.cpp, server/PersistantThingFactory.h,
server/PersistantThingFactory_impl.h: Partially specialise the non
persistent entity factory so we can register the persistor database
tables for the world object when persistence is disabled, so the
state of this entity can be restored.
* server/server.cpp: Tidy up the startup output.
* server/EntityFactory.cpp: Don't try and set up world persistence if
it is turned off.
* 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.