* server/EntityFactory.cpp: When processing a new task rule, check
that the operation and tool classes referenced have been installed.
If not, make the class pending on those classes.
* rulesets/mason/world/tasks/Reap.py: New task to implement reaping
grass with a scythe.
* server/EntityFactory.cpp: Report an error more clearly.
* data/mason.xml: Fix a bug in the gravestone rule.
* date/mason.xml: Add new reap task class.
* common/globals.cpp, common/globals.h: Change the type and name
of the ruleset list to a string.
* rulesets/Python_API.cpp, server/EntityFactory.cpp,
server/server.cpp, tools/cyaddrules.cpp, tools/cydumprules.cpp,
tools/cyloadrules.cpp: Switch to using single ruleset config
variable.
* data/Makefile.am: Install the xml files for mason into the mason.d
subdir, as the rule loading code now prefers.
* server/EntityFactory.cpp, tools/cyaddrules.cpp,
tools/cyloadrules.cpp: Modify the way rule xml files are loaded
so files from the ruleset specific subdirectory are loaded first,
and the legacy way of doing it is done if this files, with a warning
message.
* configure.ac: Check for dirent.h.
* common/AtlasFileLoader.cpp: Report duplicate IDs when loading rule
data.
* data/basic.xml: Remove obsolete old overriden rules, as we will
no longer be doing rules that way.
* server/EntityFactory.cpp: When loading rulesets directly from
files, also load all files in ruleset.d.
* common/globals.cpp, common/globals.h: Add a config flag
to control whether database code is enabled.
* server/EntityFactory.cpp, server/EntityFactory.h,
server/PersistantThingFactory.cpp, server/PersistantThingFactory.h,
server/PersistantThingFactory_impl.h, server/Persistor.cpp:
Re-work the persistence code so that persistent or non-persistent
versions of entity factories are installed at startup, removing
the need to check whether the database is enabled during
runtime.
* common/newid.cpp, server/Connection.cpp, server/server.cpp:
Replace the const that used to control whether the database
was used with the config flag.
* server/EntityFactory.h, server/EntityFactory.cpp: Improve test
for task classes by checking if the class parent has already been
installed as a class.
* common/PropertyManager.cpp: When the PropertyManager is deleted,
set the instance variable to 0.
* server/EntityFactory.cpp, server/EntityFactory.h: Add a destructor
so the property manager can be deleted at shutdown.
* client/ClientPropertyManager.cpp, client/ClientPropertyManager.h:
A new class as a dummy property manager for the client side.
Never creates property objects.
* client/client.cpp: Instantiate the client property manager
during client initialisation.
* server/EntityFactory.cpp: Instatiate the server property manager
during server intialisation.
* common/PropertyManager.h: Add the singletons accessor, and
make the addProperty member return a pointer to the property.
* server/CorePropertyManager.h, server/CorePropertyManager.cpp:
Implement creating properties for server side entity objects.
* rulesets/Entity.cpp: Use the property manager singleton to
create properties if a new attribute is set which is not already
a property, and its also not already a soft attribute.
* FIXME, Makefile.am: Add new FIXME file which documents FIXMEs in
the code.
* server/EntityFactory.cpp: Remove the terrain feature classes
implemented as hard coded classes.
* data/basic.xml: Add the terrain feature classes as soft data
defined classes.
* rulesets/Py_Task.cpp: Missing missing return when an error is
detected.
* rulesets/Python_API.cpp: Remove obsolete Vector3D and Point3D
constructors and method tables, now replaced by init method
implementations.
* server/EntityFactory.cpp: Comment out as yet unused code for
updating a task factory from an admin client.
* server/Admin.cpp, server/EntityFactory.cpp, server/EntityFactory.h:
Change function args to take class descriptions for modification
as an Object not a Message. Makes it easier to defermine when
op definitions should be processed.
* server/Admin.cpp: Allow client to update op definition, passing
it to EntityFactory, just like other types.
* server/EntityFactory.h, server/EntityFactory.cpp: Add method to
handle updating op definitions. Catch a bug which might cause
a crash if the client updates a core C++ hard coded entity type.
* common/BaseWorld.h, rulesets/Character.cpp,
server/EntityFactory.cpp, server/EntityFactory.h,
server/TaskFactory.h, server/WorldRouter.cpp,
server/WorldRouter.h: Specify the target base type that a given
task is valid for, and provide target type when activating a task.
* data/mason.xml: Add target base types to most task rules.
* rulesets/mason/world/tasks/Combat.py: Fix the copyright date.
* rulesets/mason/world/tasks/Sharpen.py: Proof of concept task
for turning logs into stakes.
* common/custom.cpp: Add a "task" base class to the inheritance tree.
* server/EntityFactory.h, server/EntityFactory.cpp: Add
functionality to allow task rules to be installed and updated from
an admin client. Improve the error reporting for a number of error
conditions.
* server/Connection.cpp: Correct the copyright dates.
* server/Admin.cpp: Improve error reporting for a number of error
conditions. Remove obsolete commented out code for installing
rules using Set ops, and add error notification when the
admin client attempts to update an op definition. Allow the
admin client to install an op definition.
* common/BaseWorld.h, server/WorldRouter.h, server/WorldRouter.cpp:
Add interface to allow world entities to activate tasks based on
tool use operations.
* server/EntityFactory.h, server/EntityFactory.cpp: Add method which
createa a new task in response to an activation request.
* rulesets/Character.cpp: When a character uses a tool, use the
tool type and operation to activate a task if one is available.
* rulesets/ArithmeticScript.h: Remove redundant constructor.
* rulesets/ArithmeticScript.cpp: Provide empty virtual destructor
implementation.
* rulesets/Py_Statistics.cpp: Add debugging output, and remove
rubbish from __init__.
* rulesets/PythonArithmeticScript.cpp: Test implementation of
attribute.
* server/ArithmeticFactory.cpp, server/ArithmeticFactory.h: New
factory class to create instances of scripts to handle
statistics.
* server/EntityFactory.cpp, server/EntityFactory.h: Add new method
and supporting data structures to provide a way to create
statistics objects for newly created Character entities.
* server/PersistantThingFactory.cpp: Add a call to
EntityFactory::addStatisticsScript to the Character
specialisation of PersistantThingFactory::populate, giving
all characters a statistics script now.
* rulesets/mason/world/statistics/Statistics.py: Test implementation
of a class for all character statistics.
* rulesets/ArithmeticScript.h: Remove compile time warnings.
* rulesets/Statistics.h, rulesets/Statistics.cpp: Pass stats request
onto script object if one is available.
* server/PersistantThingFactory.h,
server/PersistantThingFactory_impl.h,
server/PersistantThingFactory.cpp: Add a populate method to the
entity factory, and specialise it for Character so it can be
used to add scripted statistics.
* server/EntityFactory.cpp: Add a call to populate() in the right
place.
* rulesets/TaskScript.cpp, server/TaskFactory.cpp: Add some assert
checks.
* server/EntityFactory.cpp: Remove some debug output.
* rulesets/mason/world/tasks/Combat.py: Add a simple example
of the interface required in a task script.
* server/EntityFactory.h, server/EntityFactory.cpp: Add a handler for
objects in rules files.
* rulesets/TaskScript.h, rulesets/TaskScript.cpp: Task class which
delegates functionality to a script object. Basically just a
stub at this point.
* server/TaskFactory.h server/TaskFactory.cpp: Factory class for
creating instances of Task classes.
* client/BaseClient.cpp, common/Database.cpp, rulesets/MemMap.cpp,
server/Connection.cpp, server/EntityFactory.cpp, server/Peer.cpp,
server/Persistance.cpp, server/Restoration.cpp,
server/ServerRouting.h: Update integer ID related checks now that
integerId() function has changed.
* tests/EntityFactorytest.cpp: Add more tests to ensure adding or
removing attributes propagates correctly down the type tree.
* server/EntityFactory.cpp: Reset class attributes when factory
is modified.
* common/id.cpp, common/id.h: Add a function to check a string ID
can be converted to an integer.
* server/EntityFactory.cpp: Check IDs are valid integers before
looking them up in the world.
* server/PersistantThingFactory.h,
server/PersistantThingFactory_impl.h: Add separate tracking of
class attributes, and accumulated attributes including those
inherited from the parent class. Add members for storing
parent and child types to a factory.
* server/EntityFactory.h: Ensure instance pointer is zeroed
when instance is deleted. Make internal methods protected so
its easier to test them in a unit test.
* server/EntityFactory.cpp: Add pointers to child factories to parent
when installing new ones. Handle copying inherited attribute
defaults from the parent factory.
* tests/EntityFactorytest.cpp: Add a new class which exposes the
protected parts of EntityFactory for testing.
* 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: Fix face() so that NPC doesn't crash
if it turns to face something that is zero distance away.
* server/EntityFactory.cpp: Improve error reporting when an entity
has velocity set at creation, and ensure that the velocity is
unset before the entity goes into 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/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.
* client/ClientConnection.cpp: Improve error reporting when
unexpected object arrives from server.
* rulesets/Character.cpp: Invert test so that tool use op arguments
are now set correctly.
* rulesets/Entity.cpp: Use proper entities to handle responses to
Create and Look ops.
* server/Connection.cpp, server/EntityFactory.cpp: Improve error
reporting using String::compose.
* server/EntityFactory.cpp: Invert test so that all custom ops
now don't fail to get installed. Ensure that custom ops that
need to wait for their parent a properly inserted into the
waiting queue.
* common/inheritance_impl.h, common/inheritance.h,
common/inheritance.cpp, common/custom.cpp: Get rid of the op
factory feature of inheritance, as its not required.
* server/EntityFactory.cpp: Register op types defined in the
data into the Atlas factory rather than the old inheritance
factory mechanism.
* modules/Location.h, modules/Location.cpp: Remove handling of
LOC attribute from readFromEntity() as every use of this function
has differen requirements.
* rulesets/MemMap.cpp: Implement setting LOC so that the minimum
of lookups in the world dictionary are required.
* server/EntityFactory.cpp: Implement setting LOC in a much simpler
way, as its always uninitialised at this point.
* client/BaseClient.cpp: Add a note that LOC is currently unhandled,
as there is nothing sane to do with it.
* modules/Location.cpp, modules/Location.h: Add a new method to
read location data from an Atlas Entity.
* rulesets/MemMap.cpp, server/EntityFactory.cpp, client/BaseClient.cpp:
Switch to using new function rather than Entity::getLocation.
* rulesets/Entity.h, rulesets/Entity_getLocation.h: Remove obsolete
getLocation method.
* rulesets/Entity.cpp: Update copyright date.
* rulesets/BaseMind.cpp, rulesets/Entity_getLocation.h,
rulesets/Entity.h, rulesets/MemMap.cpp, rulesets/MemMap.h,
rulesets/Py_Map.cpp, server/EntityFactory.cpp,
server/EntityFactory.h, server/WorldRouter.cpp,
client/BaseClient.cpp, client/CreatorClient.cpp:
Change various methods to pass entity information
around as RootEntity rather than MapType.
* 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.
* data/basic.xml, data/mason.xml: Add objtype to all rules.
Add a rule for ignite operation definition.
* common/custom.cpp: Remove hardcoded ignite operation definition.
* server/EntityFactory.cpp, server/EntityFactory.h: Remove some debug
output. Add new code to allow op_definitions to be installed as
rules.
* common/inheritance.cpp, common/inheritance.h: Return an error code
when a type without parents gets installed, rather than throwing an
exception.
* tests/inheritancetest.cpp: Fix test so it no longer expects an
exception.
* rulesets/mason/world/objects/clothing/Garment.py: Remove some
debug output.
* tools/AdminClient.cpp: Remove hardcoded objtype, depending instead
on objtype from the data file. Fix a bug where the full rule
was not getting uploaded when updating an existing rule.
Improve error reporting when update fails.