* 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.
* rulesets/Entity.h, rulesets/Thing.cpp: Add a signal to be emitted
when an entities container changes, and emit it during
MoveOperation processing.
* rulesets/Character.h, rulesets/Character.cpp: Hook up to the
containered signal of a wielded entity, and unwield it when its
container changes.
* common/Pickup.h, common/Drop.h, common/custom.cpp,
common/operations.cpp, common/types.h: Add and install two new
op types for Pickup and Drop.
* rulesets/Thing.cpp: Send sights of Pickup and Drop when characters
perform this actions implicitly with move ops.
* common/types.h, server/Persistance.h, common/BaseWorld.h,
common/BaseWorld.cpp, server/WorldRouter.cpp:
Switch core world map to reference by integer ID rather than string.
Add version of getEntity() which converts from string to integer
automatically.
* rulesets/Character.cpp, rulesets/Thing.cpp, rulesets/World.cpp,
server/EntityFactory.cpp,
Use getEntity() when looking up an entity, so that conversion of
ID from string to integer is automatic.
* rulesets/BaseMind.cpp, rulesets/MemMap.cpp, rulesets/MemMap.h:
Switch to using integer IDs in MemMap's core mapping.
* server/Account.cpp, server/Account.h: Switch a few function
parameters to use integer ID values, making the code cleaner.
* server/Account.cpp, server/Admin.cpp, server/Persistance.cpp:
Handle string ID to integer conversions as required.
* common/BaseEntity.h, common/BaseEntity.cpp: Add an integer ID
member variable, and accessor, and require it to be initialised
along with string ID in constructor.
* common/const.cpp, common/const.h: Add a const for the integer value
of the world ID.
* rulesets/Area.cpp, rulesets/Area.h, rulesets/BaseMind.cpp,
rulesets/BaseMind.h, rulesets/Character.cpp, rulesets/Character.h,
rulesets/Creator.cpp, rulesets/Creator.h, rulesets/Entity.cpp,
rulesets/Entity.h, rulesets/Food.cpp, rulesets/Food.h,
rulesets/Line.cpp, rulesets/Line.h, rulesets/MemEntity.cpp,
rulesets/MemEntity.h, rulesets/Plant.cpp, rulesets/Plant.h,
rulesets/Stackable.cpp, rulesets/Stackable.h, rulesets/Structure.cpp,
rulesets/Structure.h, rulesets/Thing.cpp, rulesets/Thing.h,
rulesets/World.cpp, rulesets/World.h: Add integer ID handling to
constructors of all in-game entity classes.
* rulesets/MemMap.cpp: Initialise integer ID of entities in the mind
map.
* rulesets/MindFactory.cpp, rulesets/MindFactory.h: Handle integer
ID when constructing mind objects.
* server/EntityFactory.cpp, server/EntityFactory.h,
server/PersistantThingFactory_impl.h: Handle integer
ID when contructing entity objects.
* server/Restoration.cpp, server/Restoration.h, server/Restorer.h,
server/Restorer_impl.h: Handle integer ID when restoring from
database.
* server/WorldRouter.cpp: Assign integer ID when constructing the
world.
* 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.
* modules/Location.cpp, modules/Location.h:
Add const accessors for location data, in preparation for
adding cached collision data which must be updated every
time data is modified.
* physics/Collision.cpp, rulesets/Character.cpp, rulesets/Entity.cpp,
rulesets/Entity.h, rulesets/MemMap.cpp, rulesets/Movement.cpp,
rulesets/Pedestrian.cpp, rulesets/Plant.cpp,
rulesets/Py_Location.cpp, rulesets/Thing.cpp, rulesets/World.cpp,
server/Account.cpp, server/EntityFactory.cpp, server/Persistor.cpp,
server/Persistor_impl.h, server/Restorer_impl.h,
server/WorldRouter.cpp, tests/Locationtest.cpp:
Use the const accessors whenver reading data from Location.
* 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/BaseEntity.cpp, common/custom.cpp, common/op_switch.h,
common/types.h, rulesets/BaseMind.cpp, rulesets/Character.cpp,
rulesets/Creator.cpp, rulesets/Food.cpp, rulesets/Plant.cpp,
rulesets/Thing.cpp, rulesets/World.cpp, server/Admin.cpp,
server/Admin.cpp: Replace OpNo enumeration with defines for the
integer class numbers. Expand the switch statements used for op
dispatch because runtime extended op definitions don't have a const
number.
* server/EntityFactory.cpp: Re-order installation of ops to ensure
the number registered in enumeration maps is the one returned by
the Atlas factories.
* rulesets/Character.cpp: Improve debug output for op handling when
debug is enabled for this file.
* common/const.cpp, common/const.h: Git rid of bizare scheme
where each constant appears twice, debug and non-debug versions.
* rulesets/Pedestrian.cpp, rulesets/Thing.cpp,
server/WorldRouter.cpp: Fix problem where an essential call
was inside an assert, so did not happen when built in non-debug
mode.
* 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, rulesets/Thing.cpp, rulesets/Character.cpp:
Replace asserts with proper checks that arguments are of the
expected type.
* common/custom.cpp: Put ignite op installation back in.
* rulesets/basic/mind/goals/common/misc_goal.py: Don't return
non-existant ops.
* rulesets/Thing.cpp: Fix some places where root_operations
were being returned.
* common/inheritance.cpp: Add "affect" operation base class,
and fix parents on use and wield.
* common/custom.cpp: Install atlas factories for custom op
types.
* rulesets/Entity.cpp, rulesets/Thing.cpp: Use static LOC and POS
members in RootEntity.
* rulesets/Entity_getLocation.h: Add some slightly more thorough
checking for location data.