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.
Objects using this base class are all long lived, so while they are
often associated with a connection, they most commonly will outlive
that connection, and be unconnected.
This required cleaning up a bunch of other things:
Expose functions to disconnect and flush sockets generally
Make a new base class for objects that link a socket to the server
* common/Identified.cpp, common/Identified.h:
Flatten down the base classes into one called Router.
* client/CharacterClient.cpp, client/CreatorClient.cpp,
rulesets/BaseMind.cpp, rulesets/Character.cpp,
rulesets/Creator.cpp, rulesets/Entity.cpp,
rulesets/LocatedEntity.cpp, rulesets/MemEntity.cpp,
rulesets/Plant.cpp, rulesets/Stackable.cpp,
rulesets/Thing.cpp, rulesets/World.cpp,
server/Account.cpp, server/Admin.cpp,
server/Connection.cpp, server/ExternalMind.cpp,
server/Lobby.cpp, server/Master.cpp,
server/Peer.cpp, server/Player.cpp,
server/ServerRouting.cpp, server/SlaveClientConnection.cpp,
server/TrustedConnection.cpp, tests/LocatedEntitytest.cpp,
tests/ThingupdatePropertiestest.cpp: Update all the operation
routing classes to use the modified base class correctly.
* server/Account.cpp: Don't give names to items in the default
inventory.
* rulesets/mason/world/objects/buildings/House3.py: Don't give
names to the invisible wall objects.
* 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.
* common/BaseEntity.cpp, common/custom.cpp, common/inheritance.cpp,
common/inheritance.h, common/op_switch.h, common/types.h,
rulesets/Character.cpp, rulesets/Creator.cpp,
rulesets/PythonThingScript.cpp, server/Account.cpp,
server/Connection.cpp, server/ExternalMind.cpp,
tests/OOGThingtest.cpp, tests/inheritancetest.cpp:
Remove a set of pointless definitions, and use the originals
throughout the code.
* common/OperationRouter.cpp, common/OperationRouter.h: Interface
class for objects when can handle or route operations.
* common/BaseEntity.h, common/BaseEntity.cpp: Remove standard
implementation of operation handler, forcing class to provide
more specific implementations.
* rulesets/LocatedEntity.h, rulesets/LocatedEntity.cpp: Add an
implementation of the OperationRouter interface, suitable for
IG operations.
* server/ServerRouting.h, server/Peer.cpp, server/Peer.h,
rulesets/MemEntity.h: Add placeholder OperationRouter
implementations.
* server/Connection.cpp: Update OperationRouter implementation to
be better suited.
* server/Account.cpp, server/Account.h: Implement OperationRouter
for accounts.
* 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.