* rulesets/Character.cpp, rulesets/Entity.cpp,
rulesets/LocatedEntity.cpp, rulesets/LocatedEntity.h,
rulesets/MemMap.cpp, rulesets/Motion.cpp, rulesets/Py_Mind.cpp,
rulesets/Py_Thing.cpp, rulesets/Thing.cpp, rulesets/World.cpp,
server/WorldRouter.cpp: Change LocatedEntity::m_contains into
a pointer so that the majority of entities that can not contain
anything don't waste the storage.
* 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.
* 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/Thing.cpp: Provide a more verbose error message about
incorrect updates.
* rulesets/mason/define_world.py: Make sure the arguments to
the python builtin range() is always an integer.
* rulesets/StatusProperty.cpp, rulesets/StatusProperty.h:
Add a dynamic property that deletes the entity when it goes
below zero, removing the need for the hard coded property
of the same name.
* rulesets/Makefile.am: Add the new property to the build.
* server/CorePropertyManager.cpp: Add the new property to the system.
* rulesets/mason/define_world.py: Add a test for setting the status
to below zero.
* rulesets/Entity.cpp: Remove the hard property for status.
* rulesets/Thing.cpp: Remove the code that checks the hard
status property to see if the entity needs to be deleted.
* 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.
* rulesets/Entity.cpp: Initialise motion pointer to zero, so
so tests know whether it is there.
* rulesets/Thing.cpp: Don't attempt to do a movement update if
LOC is zero. It is a sign something not quite right is going on.
* tests/IGEntityExerciser.h: Check motion is not null before using
it.
* rulesets/Character.cpp, rulesets/MemMap.cpp, rulesets/Motion.cpp,
rulesets/Python_API.cpp, rulesets/TerrainProperty.cpp,
rulesets/Thing.cpp, rulesets/World.cpp: Don't use camel casing for
local variables or function arguments.
* 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:
* rulesets/Thing.cpp: When moving, check if the entity has
LOC set. If not, print an error, and assert. This may be a
valid way to check for the TLVE, rather than relying on the
world class.
* rulesets/Thing.cpp: When deleting, check if the entity has
LOC set. If not, print an error, and assert. This may be a
valid way to check for the TLVE, rather than relying on the
world class.
* common/BaseEntity.cpp, common/BaseEntity.h, common/custom.cpp,
common/op_switch.h, rulesets/BaseMind.cpp, rulesets/Character.cpp,
rulesets/Character.h, rulesets/Thing.cpp, rulesets/Thing.h,
tests/EntityExerciser.h: Remove the long obsolete Action op from
the core code.
* data/mason.xml: Set default mass on bottle entity.
* tools/cycmd.cpp: Add help for upcoming delete command. Improve
readability by using available typedefs.
* rulesets/Thing.cpp: Hide some debug output.
* rulesets/Character.cpp, rulesets/Creator.cpp, rulesets/Entity.cpp,
rulesets/Entity.h, rulesets/Pedestrian.cpp, rulesets/Py_Thing.cpp,
rulesets/Stackable.cpp, rulesets/Thing.cpp, rulesets/World.cpp:
Remove m_world member variable from all Entity classes, and
access the world manager object as a singleton.
* rulesets/Thing.h, rulesets/Thing.cpp: Make updateProperties
const for the time being. Only treap Update operations as
generic updates if they don't have a refno. Improve the
Update operation handler comments.
* rulesets/Thing.cpp: Add some debug instrumentation to the new
Property update mechanism.
* rulesets/Character.cpp: Re-write the Wield handling code to use
Update ops.
* rulesets/Thing.cpp, rulesets/Thing.h: Add a new method to
generate a Sight(Set) for a designated set of modified attributes.
* ThingupdatePropertiestest.cpp: Add a test for the new method.
* rulesets/BaseMind.cpp, rulesets/Character.cpp, rulesets/Food.cpp,
rulesets/Plant.cpp, rulesets/Stackable.cpp, rulesets/Thing.cpp:
Remove script override calls from the individual C++ operation
methods, as script overrides are now done centrally.
* rulesets/Thing.cpp: Moved increment on m_seq to later in the
function, to make sure its only incremented when the entity
has really been updated. Scripts will be required to update
now.
* rulesets/Entity.cpp, rulesets/Thing.cpp, rulesets/Thing.h:
Move Look and Create handlers into Thing from Entity, so Entity is
a more abstract for all IG entities.
* rulesets/Thing.h, rulesets/Thing.cpp, rulesets/Plant.h,
rulesets/Plant.cpp: Remove SetupOperation from Thing
and implement in Plant, as not all entities need a starting
tick, but plants do.
* rulesets/basic/world/objects/elements/Fire.py,
rulesets/mason/world/objects/Weather.py: Add setup_operation
handlers as these scripts require ticks.
* rulesets/Thing.cpp, server/WorldRouter.cpp: Remove broadcasting
an appearance from Setup handlers, and put it WorldRouter when
the entity is added to the world, to take out the special case
from the Setup operation handler.
* rulesets/Thing.cpp: Use != for logical exclusive or on bools.
* physics/Collision.cpp: Re-write complete excluseive or
implementation and replace with !=.
* common/const.h: Remove obsolete config option to disable
range checks and calculations.
* client/ObserverClient.cpp, rulesets/Movement.cpp,
server/Admin.cpp, tools/AdminClient.h, tools/cycmd.cpp:
Remove const.h from files which no longer require it.
* rulesets/Python_API.cpp: Remove python bindings for obsolete
constants.
* rulesets/Thing.cpp, rulesets/World.cpp, server/WorldRouter.cpp:
Remove obsolete rotten code for handling sight without ranges.
* tests/consttest.cpp: Remove tests for removed constants.
* rulesets/Entity.h, rulesets/Entity.cpp: Add a function to handle
all the changes required when the LOC or container of an entity
changes.
* rulesets/Motion.cpp, rulesets/Thing.cpp: Use changeContainer()
rather than repeating the code in three places.
* rulesets/Thing.cpp: Add some assert checks when altering the
container of an entity.
* rulesets/Motion.cpp: Fix the code in collision resolution that
handler container changes so it does reference counting,
inserting and removing from contains lists, and flagging entity
changes.
* rulesets/Thing.cpp: Re-work the movement code so it never relies
on external serial numbers, but will use internal op serialnos
if they are available, or use its own refnos if not.
* rulesets/Motion.cpp, rulesets/Motion.h: Add method and storage
to note what the reference number of the next update op should
be.
* rulesets/Thing.cpp: Note the current serialno as the refno of the
expected update op, and ignore all others obsolete update ops.
* rulesets/Motion.h: Rename to clearCollision() to adhere to
convention.
* rulesets/Motion.cpp: Implicitly clear a pending collision whenever
one is resolved.
* rulesets/Thing.cpp: Cut in the new collision resolution code.
* rulesets/Motion.h: Add method to clear the collision flag.
* rulesets/Thing.cpp: Clear the collision flag once it has been
handled, and improve code harmonisation between MoveOp and
UpdateOp handlers.
* rulesets/Motion.h, rulesets/Motion.cpp: Add flag and time to sore
info about collisions.
* rulesets/Thing.cpp: Rambling messy code to detect and act on
predicted collisions.
* rulesets/Motion.h, rulesets/Motion.cpp: Add method to check for
collisions.
* rulesets/Thing.cpp: Use Motion::checkCollisions to output debug
data about collisions.
* rulesets/Thing.cpp: Implement basic movement updates.
* rulesets/Pedestrian.cpp: Disable updatePos as it is no longer
required.
* TODO: Add notes on further refactoring of movement code.
* common/const.h: Add new constant for period between movement updates.
* rulesets/Pedestrian.cpp: Don't update entity movement timestamp
here.
* rulesets/Thing.cpp: Add comments about movement code. Update
movement timestamp when move op is handled. Use movement update
interval for update ops.
* rulesets/Thing.h, rulesets/Thing.cpp: Create a function to hold
visibility checking code, and remove it from MoveOperation, calling
the function instead.
* rulesets/Character.cpp: Be more severe about error messages if
client sends an action op. Remove obsolete comments.
Warn if client sends a Set op. Don't accept look ops with
an arg containing no ID - nothing sends this, and nothing should.
* rulesets/Thing.cpp: Add an error report if an explicit Action op
is received by an entity.
* 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.