* 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.
* server/Restoration.cpp: Send restored entities a setup op, so the
AI gets initialised as if the entity had just been created.
* Clean up member variable names.
* rulesets/mason/mind/SkelMind.py: Get skeleton to recognise
settlers.
* client/CommClient.cpp, client/CreatorClient.cpp,
client/ObserverClient.cpp, client/Py_CreatorClient.cpp,
common/BaseEntity.cpp, common/BaseEntity.h,
common/types.h, rulesets/Area.cpp, rulesets/BaseMind.cpp,
rulesets/Character.cpp, rulesets/Entity.cpp,
rulesets/Food.cpp, rulesets/Line.cpp,
rulesets/MemMap.cpp, rulesets/Pedestrian.cpp,
rulesets/Plant.cpp, rulesets/Py_Mind.cpp,
rulesets/Py_Object.cpp, rulesets/Py_Thing.cpp,
rulesets/Python_API.cpp, rulesets/Stackable.cpp,
rulesets/Thing.cpp, rulesets/World.cpp,
server/Account.cpp, server/Admin.cpp, server/CommClient.cpp,
server/CommServer.cpp, server/Connection.cpp,
server/EntityFactory.cpp, server/Lobby.cpp,
server/Persistance.cpp, server/Player.cpp,
server/ServerRouting.cpp, server/WorldRouter.cpp:
Switch to using Element as name for Atlas::Message::Object,
to avoid name clashes on Object, and bring into line with
the way Atlas-C++ will be.
* common/system.h, common/system.cpp: Add code to md5 hash
strings, like passwords.
* server/Connection.cpp: Use md5 hash code for storing and
verifying passwords.
* client/Py_CreatorClient.cpp, common/BaseEntity.cpp,
common/BaseEntity.h, rulesets/MemMap.cpp, rulesets/Py_Mind.cpp,
rulesets/Py_Thing.cpp, rulesets/Thing.cpp, rulesets/Thing.h,
server/Account.cpp, server/Admin.cpp, server/Connection.cpp,
server/Lobby.cpp, server/ServerRouting.cpp:
Use a more efficient technique to set the attributes on
operation arguments without a copy.
* common/BaseEntity.cpp, rulesets/Entity.cpp, rulesets/Thing.h,
rulesets/World.cpp, server/WorldRouter.cpp:
Move handling IG Look ops into the IG code in rulesets.
* 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.
* Use " instead of < when including application headers.
* Re-work the interface between server and worldrouter objects
so that the are less tied together, and more flexible.
* 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.
* server/Connection.cpp, server/ServerRouting.h:
Rename function for querying account by its name.
* server/Persistance.cpp, server/Persistance.h: Remove obsolete
function for loading Admin account.
* common/globals.cpp, common/globals.h, server/Connection.cpp,
server/Persistance.cpp, server/Persistance.h, server/ServerRouting.cpp,
server/server.cpp: Move restricted flag out of persistance into
globals.
* server/Account.h, server/Admin.cpp, server/Connection_methods.h,
server/WorldRouter.cpp: Remove unnecessary includes.
* server/ServerRouting.cpp: No longer necessary to load the admin
account at startup. Can be loaded on demand.
* common/Database.h: Declaration for register relations.
* server/Account.cpp, server/Account.h, server/Admin.cpp,
server/Admin.h, server/Connection.cpp, server/Player.cpp,
server/Player.h, server/ServerRouting.cpp,
server/ServerRouting.h: Properlly separate username and id from
account, and use the database code to assign numerical ids to
account objects. Eliminate extraneous member variables in account.
* server/CommClient.cpp, server/CommServer.cpp,
server/CommServer.h, server/server.cpp:
Eliminate storing server name string twice.
* server/Connection.cpp: Remove redundant includes
* tools/cycmd.cpp: Re-factor code to work non-blocking, allow
non-admin logins, and generally be more useful.
* tools/cycmd.cpp, server/Admin.cpp: Clean up admin interface so its
a bit more Atlas compliant.
* server/Connection.cpp, server/Player.cpp: Improve some checking.
* server/EntityFactory.cpp: Remove dead commented out code.
* client/CreatorClient.cpp, rulesets/BaseMind.cpp,
rulesets/Character.cpp, rulesets/Food.cpp,
rulesets/Thing.cpp, server/Connection.cpp:
Tighten up some atlas type checks, to reduce the chances of
bugs caused by malicious or buggy clients.
* init script fixes.
* common/system.cpp: Ensure that parent of daemon exit status indicates
whether the daemon has started properlly.
* server/Connection.cpp: Clarify error reporting.
* common/globals.cpp: Only persist this sessions command line
options if the user is overriding the installation directory.
* cyphesis.vconf, client/Py_CreatorClient.cpp,
client/Py_CreatorClient.h, client/client.cpp:
Add client functionality to allow diferent scripts to be run to
perform different functions on the server.
* client/CharacterClient.cpp: Add debug option.
* rulesets/Character.h: Make mind operation functions virtual,
so they can be overridden.
* common/BaseWorld.h, server/WorldRouter.cpp,
server/WorldRouter.h: Add server functions to search for
entities by name or type.
* rulesets/Creator.h, rulesets/Creator.cpp: Allow creator to
specify a look without an id to search for entities with
a given name or type.
* client/CreatorClient.cpp, client/CreatorClient.h,
client/ObserverClient.cpp, client/ObserverClient.h,
client/Py_CreatorClient.cpp, rulesets/basic/editor.py,
rulesets/mason/define_world.py:
Add support for looking for entities in the world by name or
type from client script, so client scripts can modify existing
world.
* rulesets/Entity.cpp, rulesets/Movement.cpp,
rulesets/Py_Object.cpp, rulesets/Py_Operation.cpp,
rulesets/Py_Oplist.cpp, rulesets/Python_API.cpp,
rulesets/Stackable.cpp, rulesets/Thing.cpp,
rulesets/World.cpp, server/Account.cpp,
server/CommServer.cpp, server/Connection.cpp,
server/Player.cpp, server/ServerRouting.cpp,
server/server.cpp, tools/cycmd.cpp,
tools/cywatchdog.cpp: Code formatting cleanups.
* rulesets/basic/world/objects/tools/Bow.py: Fix up bow so it now
fires correctly.
* Added pkgconfig and sigc++ autotools macros into acinclude.m4
as only one or the other should be required, not both.
* server/Connection.h, server/Connection.cpp: Move large methods
into .cpp file to avoid bloat. Add in non ref method
for removing deleted objects, as references are a problem.
* Account.h, Account.cpp: characterDestroyed method now
takes value rather than reference because of sigc++. Add
necessary headers.
* server/Account.cpp, server/Connection.cpp: Get rid of
character existance check on login, as dead ones are now handled
using SigC signals.
* rulesets/Entity.h, rulesets/Entity.cpp, rulesets/Py_World.cpp:
Remove pointless deleted flag, as the only time its true is when
the object has been deleted, and accessing would cause a segfault.
* tools/cyloadrules.cpp, server/server.cpp,
aiclient/ClientConnection.cpp, client/ClientConnection.cpp,
common/inheritance.h: Use const iterators and references
whenever possible.
* client/CommClient.cpp, client/CreatorClient.cpp,
client/ObserverClient.cpp, client/Py_CreatorClient.cpp,
common/BaseEntity.cpp, common/BaseEntity.h,
common/types.h, rulesets/Area.cpp, rulesets/BaseMind.cpp,
rulesets/Character.cpp, rulesets/Entity.cpp,
rulesets/Food.cpp, rulesets/Line.cpp,
rulesets/MemMap.cpp, rulesets/Pedestrian.cpp,
rulesets/Plant.cpp, rulesets/Py_Mind.cpp,
rulesets/Py_Object.cpp, rulesets/Py_Thing.cpp,
rulesets/Python_API.cpp, rulesets/Stackable.cpp,
rulesets/Thing.cpp, rulesets/World.cpp,
server/Account.cpp, server/Admin.cpp, server/CommClient.cpp,
server/CommServer.cpp, server/Connection.cpp,
server/EntityFactory.cpp, server/Lobby.cpp,
server/Persistance.cpp, server/Player.cpp,
server/ServerRouting.cpp, server/WorldRouter.cpp:
Switch to using Fragment as name for Atlas::Message::Object,
to avoid name clashes on Object.
* common/BaseEntity.h: Make BaseEntity inherit from SigC::Object,
so signals and callbacks can be used, and add destroyed
signal.
* common/accountbase.h, physics/BBox.h, physics/Quaternion.h,
physics/Vector3D.h, rulesets/MemMap_methods.h,
rulesets/Movement.cpp, rulesets/Plant.h,
rulesets/Py_Operation.cpp, rulesets/PythonMindScript.cpp,
rulesets/PythonThingScript.cpp, rulesets/Script.cpp,
common/inheritance.cpp: Cleaned up Atlas::Message::Object
use, and excessive use of "using ...".
* rulesets/Movement.h, rulesets/Pedestrian.h:
Use forward declarations rather than including Move.h
* server/Account.cpp, server/Account.h, server/Connection.cpp,
server/Connection.h: Use destroyed signal to ensure references
to in game entities are removed when those entities are
destroyed. Ensure Connection is only destroyed once.
* tools/cycmd.cpp, client/CommClient.h, client/CommClient.cpp: Fixed
up client code so it does not rely on username being the same as
account id.
* tools/cycmd.cpp: Added look and logout commands to administrate
users logged in.
* server/server.cpp: Fixed metaserver code so it only sends
termination packet if metaserver functionality is enabled.
* server/Connection.h, server/Connection.cpp, server/CommServer.cpp,
server/CommClient.h, server/Account.cpp: Fix logouts so they
do cause the client connection to be closed.
* Finished switch from Fire operation to Burn.
* common/const.cpp, common/const.h: Make consts modifiable in
the debug build.
* common/op_switch.h, rulesets/Character.cpp, rulesets/Character.h:
Fix missing logout op in op switchers.
* server/Account.cpp, server/Connection.cpp: Handle logouts
a bit differently, and return the info response process
expects.
* server/CommClient.cpp: Set connection id to client ip and port.
* server/CommServer.cpp: Tighten up the way eof is handled.
* server/ServerRouting.cpp: Set lobby id.
* ALL: Cleaned up headers into correct order.
* common/log.h, common/log.cpp: Write some logging code which
handles message of different types using syslog or standard
error, depending on whether we are running as a daemon.
* ALL: Switched to using log() for all output.
* client/ObserverClient.cpp, server/Account.cpp, server/Connection.h,
server/Routing.h: Formatting cleanup
* client/Py_CreatorClient.cpp, rulesets/Area.cpp, rulesets/Area.h,
rulesets/Character.cpp, rulesets/Character.h, rulesets/Entity.cpp,
rulesets/Entity.h, rulesets/Line.cpp, rulesets/Line.h,
rulesets/Plant.cpp, rulesets/Plant.h, rulesets/Py_Mind.cpp,
rulesets/Py_Thing.cpp, rulesets/Stackable.cpp, rulesets/Stackable.h:
Replace operator[] with get() method for querying attributes.
Make this get() method const, and re-write the internals so
that it more cleanly handles attributes.
* common/BaseWorld.h: Re-write world.getObject() so that it
no longer uses std::map::operator[], as the old method was
inserting NULLs into the world dictionary when non-existant
entities were queried.
* rulesets/Character.cpp: Clean up outstanding issues when movement
position is supplied, and is very close to being correct, and
clarify comments about movement when neither destination nor
source are provided.
* rulesets/Character.cpp: Modify mind2body interface so that setting
the TO of ops is done in the individual handlers, and copying
the operation globally is avoided.
* rulesets/MemMap_methods.h: Remove dodgy debug code.
* rulesets/Pedestrian.cpp: Clarify movement fixme.
* rulesets/Py_Operation.cpp: Clarify operation time handler fixme.
* rulesets/Stackable.cpp: Clarify fixme's in combine and divide
handlers.
* server/CommServer.cpp: Remove redundant fixme.
* server/Connection.cpp, server/ServerRouting.cpp,
server/ServerRouting.h, server/ServerRouting_methods.h,
server/server.cpp:
Move inline ServerRouting::getObject into class header.
* server/WorldRouter.cpp, server/WorldRouter.h:
Clean up includes, and move updateTime into the main body of the
file. Clean up code formatting when handling maps and dictionaries.
Clarify error output and comments about NULL objects in the world
dictionary.
* client/CommClient.cpp, client/ClientConnection.cpp, tools/cycmd.cpp:
Ensure clients use username in login ops.
* common/BaseEntity.cpp, common/op_switch.h, rulesets/BaseMind.cpp:
Modify the way op switchers work so they can be used for functions
that return any type.
* rulesets/Character.cpp, rulesets/Character.h: Re-write world2mind
layer so that rather than copying ops that are to be sent to
the mind, the w2m functions returning a flag indicating whether
the op should be passed to the mind. Made w2m and mind op handlers
final, as they are never overridden.
* rulesets/Creator.cpp: Correct comments.
* rulesets/MemMap.cpp: Add comments clarifying behavoir, and remove
old pseudo-code.
* server/Account.cpp, server/Account.h: Ensure that an accounts
character dictionary only ever contains characters. Other entities
that the account chooses to create will no be stored here. Add
function to be called at login time to make sure that characters
stored here are still around.
* server/Connection.cpp, server/Connection.h, server/ExternalMind.cpp,
server/ExternalMind.h: When external mind of a character is
destroyed, ensure that the character is removed from the
connection's object reference store.
* server/Account.cpp, server/Connection.cpp: Switched to using
USERNAME of accounts rather that ID for login and account creation.
Toughened up the connection code, so invalid login/create ops
are handled.
* server/Connection.h: Removed unused getObject method.
* rulesets/Character.cpp, rulesets/Character.h: Get rid of
inefficiency handling ops from internal and external mind. Fix
leak of some ops.
* common/BaseWorld.h, server/WorldRouter.cpp, server/WorldRouter.h:
Add method for getting a new serialno.
* rulesets/Thing.cpp, rulesets/Thing.h, server/WorldRouter.cpp:
Set refno on ops as they come back from entities. Set serialnos
on same ops at the same time, but do not set serialnos
on ops that come in from elsewhere, as those are now handled at
source.
* rulesets/Creator.cpp, rulesets/Character.cpp:
Ensure that ops from external client preserve their serialno,
and assign new serialnos to other ops created at the same time.
* server/WorldRouter.cpp: Eliminate unnecessary call to opEnumerate()
and enhance debugging output.
* server/Player.cpp: Correct the use of string.compare() in older
versions of libstdc++.
* common/types.h: Added enumeration for other operations, not
handled by the core, but considered valid. Added new type
for storing mapping between operation parents and their
enumerated type.
* common/op_switch.h: Separate handling of operations known to
be invalid from operations which are valid, but not explicitly
added to the core.
* common/inheritance.h, common/inheritance.cpp, common/custom.cpp:
Provide global operation mapping where enumeration of operations
can be looked up. Install all types handled by the core, and
types known to be used in scripts.
* common/BaseEntity.h, common/BaseEntity.cpp: Add object specific
operation mapping where operation types each object is subscribed
to can be enumerated, and others are rejected. Add mechanism
so that objects can add to the mapping, this subscribing to
operations. This makes enumerating operations much cheaper, and
eliminates the overhead of handling ops an object has no interest
in.
* rulesets/Thing.h, rulesets/Thing.cpp: Add mechanism so scripts
can subscribe to operations.
* rulesets/Character.h, rulesets/Character.cpp:
Add subscription mechanism for ops going to and from
the mind.
* rulesets/BaseMind.h, rulesets/BaseMind.cpp:
Add subscription mechanism for sight and sound perception
operations sub operations, and provide an interface to it
for scripts.
* server/Connection.cpp, server/Admin.cpp, server/Account.cpp,
rulesets/World.cpp, rulesets/World.h, rulesets/Thing.cpp,
rulesets/Stackable.cpp, rulesets/Plant.cpp, rulesets/Food.cpp,
rulesets/Character.cpp, rulesets/BaseMind.cpp:
Add subscriptions to operations for all core base classes.
* rulesets/Python_API.cpp: When script is created, go through
methods, and subscribe to the operations which are handled by
them.
* rulesets/Character.cpp: When calculating orientation of a walking
character, assume it is standing upright.
* physics/Vector3D.h: Add versions of mag() and distance() which
omit the square root calculations, so that when their values
are only used for comparison, the expensive square root
calculations can be ommited. Add new version of collision
and range checking functions which provide the optimal
interface to the application. Add versions of methods which
modify this rather than creating a new operation to eliminate
wasted copies.
* physics/Quaternion.cpp: Make use of faster interface provided
by Vector3D.
* physics/BBox.h: Add new version of collision checking function
which provides optimal interface to the application.
* modules/Location.h, modules/Location.cpp: Add new functions
to optimally calculate the distance between any two entities.
* modules/Location.h: Re-write collision and range functions to
make much more optimal use of Vector3D, BBox and distance
functionality.
* rulesets/Py_Vector3D.cpp, rulesets/Pedestrian.cpp,
rulesets/Movement.cpp, rulesets/Entity.cpp, rulesets/Character.cpp:
Eliminate implicit copies from vector arithmetic.
* rulesets/Pedestrian.cpp, rulesets/MemMap.cpp, common/const.h:
Re-write code which uses magnitude of vectors to use the square
of the magnitude instead, as it is much cheaper to calculate.
* common/BaseEntity.cpp, common/BaseEntity.h, rulesets/Entity.h,
server/Connection.cpp: Remove destroy from the base class, and
make it non-virtual, as it is not used this way.
* rulesets/Entity.cpp: Clean up destroy, ensuring that contains
is managed correctly.
* server/WorldRouter.cpp: Eliminate duplicate contains management.
* server/Persistance.cpp, server/Connection.cpp, server/Admin.cpp,
server/Account.cpp, rulesets/Thing.h, rulesets/Thing.cpp,
rulesets/Stackable.cpp, rulesets/Py_Location.cpp,
rulesets/Entity.h, rulesets/Entity.cpp, rulesets/Creator.cpp,
rulesets/Character.cpp, common/BaseEntity.h, common/BaseEntity.cpp:
Get rid of flags used to determine object type, and get rid
of use of C style casts to cast between object pointers.
Replace both with dynamic casts. Clean up some stray casts
left behind from older versions of object structure.
* physics/Vector3D.cpp: Added note explaining when to use
Vector3D::relMag() instead of mag().
* rulesets/Line.h, rulesets/Line.cpp, rulesets/Area.h,
rulesets/Area.cpp, server/EntityFactory.cpp: Added stub
base classes for new geometric entities.
* server/ServerRouting.cpp, server/Lobby.h, server/Lobby.cpp,
server/Connection.cpp: Fleshed out lobby functionality,
so that accounts/connections are no longer responsible
for managing their own appearance and disappearance.
* server/Account.cpp: Send info of logout.
* tools/cycmd.cpp, server/WorldRouter.cpp, server/EntityFactory.cpp,
server/Connection.cpp, server/Admin.cpp, server/Account.cpp,
rulesets/World.cpp, rulesets/Thing.cpp, rulesets/Py_Operation.cpp,
rulesets/MemMap_methods.h, rulesets/MemMap.cpp, rulesets/Entity.cpp,
rulesets/Character.cpp, rulesets/BaseMind.cpp:
Use empty() instead of size() == 0 for STL sequence types.
* rulesets/ThingFactory.h, server/EntityFactory.cpp: Modified the
way adding classes to the inheritance tree is handled, so types
no longer have to inherit directly from a C++ class.
* server/WorldRouter.cpp: Modified the way broadcast operations are
handled to make them more efficient, and catch NULL pointers in
the world dictionary.
* client/CreatorClient.cpp: Fix operation semantics for admin
puppetting to new convention.
* common/Database.cpp: Add optional support for database password.
* physics/Quaternion.h: Add extra way of setting up a Quaternion.
* rulesets/MindFactory.cpp, server/Connection.cpp:
Move some output into debugging.
* rulesets/Python_API.cpp, rulesets/Py_Quaternion.h,
rulesets/Py_Quaternion.h: Add support for quaternions into the
scripting API.
* rulesets/mason/define_world.py: Switch to using quaternions to
send orientation data to the server.
type info Get handling more robust.
* server/Admin.cpp, server/Admin.h: Added capability for admin to
forcefully logout users.
* server/Account.cpp: Made handling of OOG Look ops more inline with
Atlas conventions, made args handling more robust.
Al Riddoch <alriddoch@zepler.org>