* rulesets/World.cpp, rulesets/World.h, rulesets/mason/define_world.py:
Remove the special handling of Set ops in world which prevented
setting status below zero from generating a Delete op. Add a test
function to define_world which attempts to destroy the world by
setting its status to -1.
* 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.
* common/BaseWorld.h, rulesets/Creator.cpp, rulesets/World.cpp,
server/WorldRouter.cpp, server/WorldRouter.h, tests/TestWorld.h:
Pass perceptive entities to the world by pointer rather than
by ID, avoiding a lookup in the dictionary.
* rulesets/World.cpp: Remove commented out code. Make use of the
fact that CONTAINS is directly supported by RootEntity to
make handling it much more efficient.
* rulesets/World.cpp: Re-write look handling to use existing
addToEntity() to create an atlas representation of the entity
rather than doing most by hand. This ensures that properties
and attributes now work on the world.
* rulesets/Entity.cpp: Ensure that the best use is made of static
attributes on RootEntity.
* rulesets/Python_API.cpp: Remove an obsolete commented out function.
* rulesets/CalendarProperty.cpp, rulesets/CalendarProperty.h,
rulesets/World.cpp: Add a new property to handle revealing
astronomical calendar information on the world object, so clients
can get day/night cycle right.
* tools/cycmd.cpp: Improve formatting of output Atlas data, to make
it readable.
* 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.
* 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.
* rulesets/World.cpp: Implement sending nourish ops to plants.
Ammount of nutrition is logarithmically proportional to their
mass which seems to give a nice growth curve for now.
* rulesets/Thing.cpp: Fix leak of Motion object.
* rulesets/World.cpp, rulesets/World.h: Make tileShader a member
variable, and delete it in the destructor to avoid a leak.
* server/PersistantThingFactory.cpp: Fix leak of ScriptFactorys.
* server/PersistantThingFactory_impl.h: Fix leak of Persistor
in ForbiddenThingFactory.
* data/mason.xml: Type for bundles of grass.
* rulesets/World.cpp: Implement resource gathering for all the
currently supported resource types.
* rulesets/basic/world/objects/Pile.py: Fix so Pile inherits from
Thing correctly.
* rulesets/Entity.cpp, rulesets/Thing.cpp: Move Create op subscription
into Entity, as that is where the method is.
* rulesets/World.cpp: Create a boulder entity when the pickaxe
is used on rocky terain.
* client/CharacterClient.cpp: Don't process ops from the server in
* common/Dig.h, common/Mow.h, common/custom.cpp, common/operations.cpp:
Add new Dig and Mow operations, for handling resource gathering.
* rulesets/basic/world/objects/tools/Shovel.py,
rulesets/basic/world/objects/tools/Scythe.py,
data/basic.xml: Add new scythe and shovel for gathering resources
from the terrain.
* rulesets/basic/world/objects/tools/Pickaxe.py,
common/Delve.h: Fix the comments.
* rulesets/World.cpp, rulesets/World.h: Move code for determining
terrain surface type into a method of its own. Implement handlers
for Dig and Mow ops.
* rulesets/World.cpp: Use a TileShader to handle data about the
material the makes up the terrain surface. When a Delve operation
determine what material the world is at that point.
* rulesets/Character.cpp: Add some debug stuff.
* rulesets/World.cpp, rulesets/World.h: Add handler for delve
operations. Just for testing for now, no functionality.
* common/custom.cpp, common/Delve.h,
common/operations.cpp, common/operations.h:
Add new delve operation for digging with a pickaxe.
* data/basic.xml, rulesets/basic/world/objects/tools/Pickaxe.py:
Add new pickaxe entity which emits a Delve operation when
used.
* rulesets/Character.cpp: Fix a bug where a segfault occured
if an operation was requested by a tool that was unknown to
to the core server code. Instead an error message is emitted.
* rulesets/World.cpp: Subscribe world terrain to delve ops.
* common/BaseWorld.h, rulesets/Character.cpp, rulesets/Py_World.cpp,
rulesets/PythonThingScript.cpp, rulesets/Stackable.cpp,
rulesets/Thing.cpp, rulesets/World.cpp, server/Account.cpp,
server/Admin.cpp, server/Connection.cpp, server/EntityFactory.cpp,
server/Restoration.cpp, server/WorldRouter.cpp, server/WorldRouter.h:
Rename some functions in the World interface so they make more
sense.
* rulesets/Entity.cpp, rulesets/Entity.h: Add destroyed flag to
Entity so we can tell if its no longer in the world.
* server/WorldRouter.cpp: Cut down the special case handling of
delete ops as we can now broadcast ops from entities that
have been removed from the world.
* common/OOGThing.cpp, common/Property.cpp, common/Property.h,
common/Property_impl.h, common/inheritance.h, common/operations.cpp,
rulesets/World.cpp: Update some comments.
* rulesets/Task.h, rulesets/Task.cpp, tests/Tasktest.cpp,
rulesets/Fell.h, rulesets/Fell.cpp: New Task interface for
tasks which take a while to complete. Sample implentation provided
in the form of a Fell task for felling trees.
* rulesets/Character.cpp, rulesets/Character.h: Try out Task
implementation with Fell.
* rulesets/Entity.cpp, rulesets/Entity.h: Make get(), set(), and
addToMessage() non-virtual, and convert them to using new property
mechanism. Add the necessary properties in the constructor.
* rulesets/Area.cpp, rulesets/Area.h, rulesets/Character.cpp,
rulesets/Character.h, rulesets/Line.cpp, rulesets/Line.h,
rulesets/Plant.cpp, rulesets/Plant.h, rulesets/Stackable.cpp,
rulesets/Stackable.h, rulesets/World.cpp, rulesets/World.h:
Remove virtual get() set() and addToMessage() methods. These
are now entirely in Entity.
* rulesets/World.cpp, rulesets/World.h: Remove some functions
for handling terrain data now handled by properties.
Clean up Set code to get rid of nasty unnecessary exception
try / catch block.
* physics/Vector3D.h, physics/Vector3D.cpp, modules/Location.h,
modules/Location.cpp: Convert to using WFMath::Point instead of
WFMath::Vector for position.
* physics/Collision.h, physics/Collision.cpp: Update collision code
to use new pos type.
* rulesets/Py_Point3D.h, rulesets/Py_Point3D.cpp: New python
wrappers for WFMath::Point.
* rulesets/Py_Location.cpp, rulesets/Py_Vector3D.cpp,
rulesets/Python_API.cpp:
Update python wrappers to take into account new pos type.
Ensure that only apropriate functionality is available for
point and vector.
* rulesets/Character.cpp, rulesets/Entity.cpp, rulesets/Entity.h,
rulesets/Line.cpp, rulesets/Movement.cpp, rulesets/Movement.h,
rulesets/Pedestrian.cpp, rulesets/Pedestrian.h,
rulesets/Plant.cpp, rulesets/Thing.cpp, rulesets/World.cpp,
server/EntityFactory.cpp, server/WorldRouter.cpp,
server/WorldRouter.h: Update the rest of the code for new pos
type, converting all places where entity parenting is changed
to use WFMath toParentCoords() and toLocalCoords() methods,
so that orientation is handled correctly.
* tests/transformtest.cpp: New test to ensure that toParentCoords()
and toLocalCoords() perform as expected.
* tests/Creatortest.cpp, tests/Locationtest.cpp, tests/Worldtest.cpp,
tests/collisiontest.cpp, tests/emergencetest.cpp:
Update the rest of the tests.
* common/Database.cpp: Implement function for modifying array rows.
* common/const.cpp: Enable persistence for testing.
* common/terrain_utils.cpp: Implement function for updating terrain
in database after a change.
* rulesets/World.cpp, rulesets/attributes.h: Add an update flag for
terrain, and use it to indicate to the Persistor.
* rulesets/World.h: Add accessors for variables which track modified
terrain, and a function to clear them.
* server/Persistor.cpp: Implement call to function to update terrain
in database.
* server/Restoration.cpp: Ensure that if world entity is already
in database, it gets hooked up appropriatly.
* common/Database.cpp, common/Database.h: Fix queries on ID relation
tables. Add methods to result functions for decoding the contents
of fields more directly. Implement selecting from array tables.
* common/terrain_utils.cpp, common/terrain_utils.h: New functions
for handling terrain in array database tables.
* rulesets/World.cpp, rulesets/World.h: Add functionality to track
changes to the terrain for persistence purposes.
* server/EntityFactory.cpp, server/EntityFactory.h, server/server.cpp:
Modify the way world entity persistence is bootstrapped to be
more consistent.
* server/Persistor.cpp: Provide specialisations to handle world so
that terrain is persisted. Implement storing terrain at entity
creation.
* server/Restoration.cpp, server/Restoration.h: Remove obsolete
restoration code. Return a status more accuratly representing
when restoration fails because of error, or if there is nothing
to restore.
* server/Restorer.cpp, server/Restorer.h, server/Restorer_impl.h:
Convert to using methods for restoring data in the Database class.
Implement restoring terrain from the database.
* rulesets/World.cpp: Correct a debug message, and clean up some
code.
* rulesets/Entity.cpp: Re-write handling for contains attribute
to be more efficient in addToObject().
* common/BaseWorld.h, rulesets/Creator.cpp, rulesets/Thing.h,
rulesets/World.cpp, server/WorldRouter.cpp, server/WorldRouter.h:
Modify the world interface to get rid of some pointless
infeffiencies.
* server/Account.cpp, server/Admin.cpp, server/Connection.cpp,
server/Lobby.cpp, server/ServerRouting.h, server/WorldRouter.cpp,
server/WorldRouter.h: Change getSerialNo to newSerialNo to make it
clear what it does.