Previously we only allows one delegate per operation. The one that was
installed first was called; all subsequent were ignored. This doesn't
work well with how we're moving to putting more and more functionality
in properties though, so we'll have to allow for multiple delegates per
operation.
I'm not entirely happy of how this currently works. We now just call all
of the delegates, in stochastic order. If any delegate blocks the
operation it doesn't prevent other delegates from getting it too.
But perhaps that's the only way to do it without adding additional
complexity.
The relay mechanism, through the new internal Relay operation, allows
one external client to relay an operation to another external client,
and get the response back.
This can currently only be used by Creator clients. It's main use is for
mind introspection.
All IG code should use the interface of LocatedEntity when dealing
with any entity, rather than sometimes requiring Entity. Add virtual
functions to the interface where required, and modify all other interfaces
to stop them using Entity. This makes the code way cleaner, and much better
de-coupled.
The Link reference provided is the object allowing direct communication
back to the external source of the operation. This allows us to handle
things more cleanly in some cases.
* rulesets/Entity.h: Correct a FIXME about leaking a property
when requiring one of a given type.
* tests/PropertyFlagtest.cpp: Add a note for test coverage that
will be required.
* rulesets/LocatedEntity.cpp, rulesets/LocatedEntity.h: Make all the
property access functions that should never be used to modify a
property const. Remove requirePropertyClass() as it pretty much
can't be const.
* rulesets/Entity.cpp, rulesets/Entity.h: Make overriden
getProperty() const as it is in the base class. Add new
property access functions for code that needs to modify the
properties which ensures class properties never get modified
through the Entity interface.
* rulesets/Character.cpp, rulesets/Plant.cpp, rulesets/Py_Thing.cpp,
rulesets/TerrainModProperty.cpp, server/CorePropertyManager.cpp:
Change all the code that accesses properties to use the right
functions.
* data/basic.xml, data/characters.xml, data/mason.xml: Add tick
properties to a bunch of entity classes so they no longer need
a setup operation to get them going.
* rulesets/mason/world/objects/Weather.py,
rulesets/mason/world/objects/elements/Fire.py,
rulesets/mason/world/objects/plants/seeds/Apple.py: Remove setup
handlers from a bunch of scripts as it is now handled by
properties.
* data/buildings.xml: Add setup property to entity classes which
really need a setup op at startup.
* client/BaseClient.cpp: Send a look when creating the avatar, so
that notifications get back without the need for a special case.
* common/op_switch.h, rulesets/Creator.cpp, rulesets/Entity.cpp,
rulesets/Entity.h, server/WorldRouter.cpp:
Remove the setup operation sent to all entities on startup by
default. Get rid of some special cases that depended on it.
* rulesets/InternalProperties.cpp, rulesets/InternalProperties.h:
Make the tick property schedule the operation on apply(), and
use the property value as the time to schedule it.
* rulesets/Entity.h: Make flags protected, and add convenient methods
to set and clear flags. Add a flag for indicating that the entity
is queued for a storage update.
* rulesets/Entity.cpp: Reset the clean flag correcly when the entity
is made dirty.
* server/StorageManager.cpp: Hook up Entity::updated, and implement
queueing things for update and making sure they only get added once.
* rulesets/Entity.h: Move entity flags to the top of the header.
Replace destroyed and perceptive booleans with flag values,
and re-work check methods accordingly.
* rulesets/Entity.cpp, rulesets/Creator.cpp, rulesets/Character.cpp:
Ensure that destroyed and perceptive flags are used correctly.
* rulesets/attributes.h: Remove old attribute flags used for
persistence from the build.
* rulesets/Entity.h: Replace obsolete update flags with a more
general flags field, and define three needed to track the
cleanness of basic location data.
* rulesets/Plant.cpp, rulesets/World.cpp: Remove now unused update
flags from property initialisation.
* rulesets/Entity.cpp, rulesets/Thing.cpp, server/EntityFactory.cpp:
Replace code which updated update flags with simpler changes to
the new flags field.
* rulesets/LocatedEntity.h: Add onUpdated() virtual method to be
called when the attributes of an Entity are changed.
* rulesets/Entity.cpp, rulesets/Entity.h, rulesets/LocatedEntity.cpp,
rulesets/Thing.cpp, server/WorldRouter.cpp: Implement onUpdated()
to emit the updated signal on Entity, and change all code to
call onUpdated instead of emiting the signal.
* client/BaseClient.cpp, common/BaseEntity.cpp, common/BaseEntity.h,
common/Identified.cpp, common/Identified.h, common/Makefile.am,
common/OOGThing.cpp, common/OOGThing.h, common/OperationRouter.cpp,
common/OperationRouter.h, rulesets/Character.h, rulesets/Entity.h,
rulesets/LocatedEntity.cpp, rulesets/LocatedEntity.h,
server/Account.cpp, server/Account.h, server/Admin.cpp,
server/CommClient.cpp, server/CommClient.h, server/Connection.cpp,
server/Connection.h, server/ExternalMind.cpp, server/ExternalMind.h,
server/ExternalProperty.cpp, server/ExternalProperty.h,
server/Lobby.cpp, server/Lobby.h, server/Master.cpp, server/Master.h,
server/Peer.cpp, server/Peer.h, server/ServerRouting.cpp,
server/ServerRouting.h, server/SlaveClientConnection.cpp,
server/SlaveClientConnection.h: Factor out the more pointless base
classes, in favor of simple interface. Move destroyed signal to
Entity, which is the only place it is needed.
* common/BaseEntity.cpp, common/BaseEntity.h: Remove generic operation
routing code.
* common/op_switch.h: Remove all OOG operations from the standard
op switch.
* rulesets/Entity.cpp, rulesets/Entity.h: Replace generic operation
routing with a more specific IG routing implementation.
* rulesets/BaseMind.cpp: Add a mind specific operation router
implementation.
* server/Account.cpp, server/Account.h: Remove handling of Login,
which should never got to Account. Add base handler for Get,
as it needs to be overriden in Admin.
* rulesets/LocatedEntity.cpp, rulesets/LocatedEntity.h: Add a virtual
function that is called when the location of an entity changes.
* rulesets/Entity.cpp, rulesets/Entity.h: Implement the virtual
function called when location changes and use it to call the
containered signal. Remove the containered_oneshots list, and
make containered inherently one shot only.
* rulesets/OutfitProperty.cpp: Remove the use of containered_oneshots
is this mechanism is obsolete and has been removed.
* rulesets/Entity.cpp, rulesets/Entity.h, rulesets/LocatedEntity.cpp,
rulesets/LocatedEntity.h: Remove raw atlas attributes, and use
properties for everything, cutting down the differences in
interface.
* rulesets/Py_Thing.cpp, rulesets/Thing.cpp: Remove code that accessed
soft attributes directly.
* rulesets/BaseMind.cpp, rulesets/BaseMind.h, rulesets/Entity.cpp
rulesets/Entity.h: Remove the scriptSubscribed methods which
were empty and unused.
* rulesets/Python_API.cpp, rulesets/Python_Script_Utils.h: Remove
Subscribe_Script() as it is useless now.
* server/ScriptFactory.cpp: Remove call to Subscribe_Script().
* data/animals.xml: Give all the animals BIOMASS.
* data/characters.xml: Add mass to some character classes that were
missing it.
* rulesets/Character.cpp, rulesets/Character.h, rulesets/Entity.cpp,
rulesets/Entity.h, rulesets/Plant.cpp, rulesets/Statistics.cpp,
rulesets/World.cpp, server/CorePropertyManager.cpp,
server/Persistor.cpp, server/Persistor_impl.h,
server/Restorer_impl.h: Remove the hard coded mass property from
Entity.
* rulesets/mason/world/statistics/Statistics.py: Fix scripts which
assume entities will have mass.
* rulesets/Character.cpp, rulesets/Character.h, rulesets/Entity.cpp,
rulesets/Entity.h, rulesets/Plant.cpp, rulesets/Py_Thing.cpp,
rulesets/StatusProperty.cpp, rulesets/attributes.h,
server/CorePropertyManager.cpp, server/Persistor.cpp,
server/Persistor_impl.h, server/Restorer.cpp,
server/Restorer_impl.h: Remove the hard coded status property from
Entity, and the hard coded food property from character. Fix
the logic handling digestion and plants to use the new softer
properties.
* client/CreatorClient.cpp, client/CreatorClient.h,
client/Py_CreatorClient.cpp, common/BaseWorld.h, common/types.h,
modules/Location.cpp, modules/Location.h,
rulesets/AtlasProperties.cpp, rulesets/AtlasProperties.h,
rulesets/BaseMind.cpp, rulesets/Character.cpp, rulesets/Character.h,
rulesets/Entity.cpp, rulesets/Entity.h,
rulesets/EntityProperties.cpp, rulesets/LocatedEntity.cpp,
rulesets/LocatedEntity.h, rulesets/MemEntity.cpp,
rulesets/MemEntity.h, rulesets/MemMap.cpp, rulesets/Motion.cpp,
rulesets/Motion.h, rulesets/Py_Location.h, rulesets/Py_Mind.cpp,
rulesets/Py_Thing.cpp, rulesets/Py_Thing.h,
rulesets/PythonMindScript.h, rulesets/PythonScript.h,
rulesets/PythonThingScript.cpp, rulesets/PythonThingScript.h,
rulesets/Python_API.cpp, rulesets/Script.cpp, rulesets/Script.h,
rulesets/Thing.cpp, rulesets/World.cpp, server/WorldRouter.cpp,
server/WorldRouter.h: Refactor all the entity code so there is now
a new base class for entities in the world simulation, and in the
mind which only contains things which are trully common to both.
This moves a lot of functionality which should not have been
present in mind entities away, and makes that code safer and more
efficient.
* tests/TestWorld.h: Update the test world API to match the base
class.
* rulesets/Entity.h: Make the attribute interface virtual.
* rulesets/LocatedEntity.cpp: Add in basic implementatios without
properties of the attribute interface.
* client/BaseClient.cpp, client/CharacterClient.cpp,
client/CharacterClient.h, client/CreatorClient.cpp,
client/CreatorClient.h, rulesets/BaseMind.cpp, rulesets/BaseMind.h,
rulesets/Character.cpp, rulesets/Entity.cpp, rulesets/Entity.h,
rulesets/MindFactory.cpp, rulesets/MindFactory.h, rulesets/Thing.cpp,
rulesets/World.cpp, server/Account.cpp, server/Connection.cpp,
server/EntityFactory.cpp, server/Persistor.cpp,
server/Persistor_impl.h, server/Restorer_impl.h,
server/WorldRouter.cpp: Remove the hard name attribute, now that
most entities don't set it.