* 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.
* rulesets/Entity.h, rulesets/Entity.cpp: Set argument names on
some methods. Add a new method allowing a property to be set
externally.
* server/ExternalProperty.cpp, server/ExternalProperty.h: Add a new
property which reflects whether an entity is connected to the
outside world via an external mind.
* server/Connection.cpp, server/Connection.h: Add a new method which
hooks up an avatar to the connection, installing an ExternalProperty
if necessary.
* server/Account.cpp: Use the new Connection method to hook up
existing avatars.
* server/Connection.h, server/Connection.cpp: Change disconnectObject
to removePlayer to make it clearer what the return value means,
and return a pointer to the removed object if it is a player account.
* server/Connection.cpp: When removing an account which has been
logged out, remove all its characters which are not currently in
use from the connections list.
* server/Connection.h, server/Connection.cpp: Move the code that
decouples an object from the subscribed connection into its
own function, so the same code is invoked from two different
places.
* rulesets/Entity.cpp, server/Account.cpp, server/Admin.cpp,
server/Connection.cpp, server/EntityFactory.h,
server/Persistor_impl.h, tools/cycmd.cpp:
Switch from using deprecated sigc++ 1.2 headers to the right
sigc++ 2.0 equivalents.
* common/BaseEntity.cpp, rulesets/Character.cpp, rulesets/Creator.cpp,
server/Account.cpp, server/Admin.cpp, server/Connection.cpp,
server/Lobby.cpp, server/WorldRouter.cpp: Don't bother with serial
numbers on ops generated inside the server. They just leak and upset
clients.
* server/Connection.cpp, server/CommClient.cpp, server/Account.cpp:
Only set refnos on ops if the client has set a serial number.
* rulesets/Character.cpp: Simplify handling the transfer of
operations from client to in-game. Don't give new operations
serial numbers at this point.
* common/system.cpp: Return 0 on security check fail, as -1 is
signed.
* server/Connection.cpp: Re-order logging messages so that messages
reflect the fact the a broken connection occurs before the
subscriptions associated with that connection can be dropped.
Implement logging out just specific objects without closing the
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.
* common/custom.cpp: Add a "task" base class to the inheritance tree.
* server/EntityFactory.h, server/EntityFactory.cpp: Add
functionality to allow task rules to be installed and updated from
an admin client. Improve the error reporting for a number of error
conditions.
* server/Connection.cpp: Correct the copyright dates.
* server/Admin.cpp: Improve error reporting for a number of error
conditions. Remove obsolete commented out code for installing
rules using Set ops, and add error notification when the
admin client attempts to update an op definition. Allow the
admin client to install an op definition.
* common/BaseEntity.h, common/BaseWorld.h, common/Property.h,
modules/Location.h, rulesets/Entity.cpp, rulesets/Entity.h,
server/Account.cpp, server/Account.h, server/Admin.cpp,
server/Admin.h, server/Connection.cpp, server/Connection.h,
server/Persistor.cpp, server/Persistor.h, server/Persistor_impl.h,
tools/cycmd.cpp: Update usage of sigc++ to the native 2.0 API
rather than the deprecated compatability API. Eleminate the
manual disconnection code for deleted objects, as this is now
handled automatically by sigc::trackable.
* 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.
* data/mason.xml: Make skeleton playable.
* server/Connection.cpp: Differentiate in the event logs between
account creation and login to an existing account.
* server/Account.cpp: Move character creation logging to a place
where the information is easier to get to.
* server/Connection.cpp: Add logging of taking existing character.
* 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.
* 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/types.h: Switch the core object index for the server, and
the subscription index for connections to use integer IDs.
* server/Admin.cpp, server/Connection.cpp, server/Connection.h,
server/ExternalMind.cpp, server/ServerRouting.h:
Modify code to use integer object indices.
* server/Lobby.cpp: Remove debug output.
* 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: Add a new method which
generates an error operation without creating an log entry.
* server/Connection.cpp: Report routine client errors, like
login failure using the new error method, so they no longer
create high priority log messages.
* rulesets/basic/mind/NPCMind.py: Don't respond to knowledge
queries if the character has no knowledge.
* server/Connection.cpp, rulesets/Creator.cpp, rulesets/Character.cpp:
Use flag check to see if operations have FROM set, rather than
checking for an empty string.
* rulesets/Thing.cpp: When handling move ops, avoid lookup of LOC
in world unless it has changed.
* 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/system.cpp, common/system.h: Add new functions for handling
encrypted password hashes with a salt, based on gcrypt rather
than openssl. Include legacy support for hashes without a salt.
* common/const.cpp: Add a salt to the default admin password.
* tests/systemtest.cpp: Modify the password tests to use the new
functions.
* server/Connection.cpp, server/Connection.h,
server/TrustedConnection.cpp, server/TrustedConnection.h:
Update the login code to use the new password functions.
* client/ClientConnection.cpp: Improve error reporting when
unexpected object arrives from server.
* rulesets/Character.cpp: Invert test so that tool use op arguments
are now set correctly.
* rulesets/Entity.cpp: Use proper entities to handle responses to
Create and Look ops.
* server/Connection.cpp, server/EntityFactory.cpp: Improve error
reporting using String::compose.
* server/EntityFactory.cpp: Invert test so that all custom ops
now don't fail to get installed. Ensure that custom ops that
need to wait for their parent a properly inserted into the
waiting queue.
* common/inheritance.h: Set the correct objtype on the Root meta class.
* rulesets/Character.cpp, rulesets/Food.cpp, rulesets/Plant.cpp,
rulesets/Stackable.cpp, rulesets/Thing.cpp, server/Account.cpp,
server/Admin.cpp, server/Connection.cpp, tools/AdminClient.cpp,
tools/cycmd.cpp: Switch to renamed copyAttr() method from
Atlas-C++.
* 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.
* server/Account.cpp, server/Admin.cpp, server/CommClient.cpp,
server/Connection.cpp: Don't set refno on unicast OOG ops,
instead set them at the interface with the client in one
place.
* server/WorldRouter.cpp: Modify setting refno on IG ops so its
now only set on unicast responses.
* rulesets/Creator.cpp: Set refno on responses direct ops from creator
clients more manually.
* common/BaseEntity.cpp: Only set refno on unicast error ops.
* common/refno.h: Disable as this file is no longer used.
* rulesets/Thing.cpp: Remove obsolete commented out code.
* server/Account.cpp, server/Connection.cpp:
Add a note about serialno/refno handling when code sends ops
directly to the client.
* server/CommClient.cpp, server/CommClient.h: Clean up some debug
code, and method names.
* server/Lobby.cpp: Fix a case where a private message would fail
silently if account had logged on recenlty but was no longer.
* common/BaseWorld.h, rulesets/Character.cpp, rulesets/Py_World.cpp,
rulesets/PythonThingScript.cpp, rulesets/Stackable.cpp,
rulesets/Thing.cpp, rulesets/World.cpp, server/Account.cpp,
server/Admin.cpp, server/Connection.cpp, server/EntityFactory.cpp,
server/Restoration.cpp, server/WorldRouter.cpp, server/WorldRouter.h:
Rename some functions in the World interface so they make more
sense.
* rulesets/Entity.cpp, rulesets/Entity.h: Add destroyed flag to
Entity so we can tell if its no longer in the world.
* server/WorldRouter.cpp: Cut down the special case handling of
delete ops as we can now broadcast ops from entities that
have been removed from the world.
* 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/Admin.cpp: Make sure setup is called on peer connection.
* server/CommClient.h, server/CommClient.cpp: Adapt code so it
can be used for both establishing and accepting connections.
* server/Connection.cpp: Re-order initialisations in constructor
to eliminate warnings.
* 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.
* common/BaseEntity.cpp, common/BaseWorld.h, common/refno.h,
common/serialno.h, rulesets/Character.cpp, rulesets/Creator.cpp,
rulesets/World.h, server/Account.cpp, server/Admin.cpp,
server/Connection.cpp, server/Lobby.cpp, server/ServerRouting.h,
server/WorldRouter.cpp, server/WorldRouter.h, tests/Creatortest.cpp,
tests/Worldtest.cpp: Simplify the way operation refnos and serialnos
are handled, getting rid of some unnecessary virtual methods and
functions.