* server/EntityFactory.cpp, server/EntityFactory.h: Major overhaul of
error reporting when installing rules, covering many new cases, and
reporting errors more clearly.
* 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:
* server/EntityFactory.cpp: Complete the code that populates
operations on a tool based on the task activations in the
ruleset, removing the need for world builders to synchronise
this data manually.
* data/basic.xml, data/mason.xml: Remove operations from all tools
that only use them for activating tasks, now that this is handled
automatically.
* scripts/cyphesis-setup.sh: Complete the database setup script
functionality. Clean up the output, and polish.
* server/PersistantThingFactory.cpp, server/PersistantThingFactory.h,
server/PersistantThingFactory_impl.h: Partially specialise the non
persistent entity factory so we can register the persistor database
tables for the world object when persistence is disabled, so the
state of this entity can be restored.
* server/server.cpp: Tidy up the startup output.
* server/EntityFactory.cpp: Don't try and set up world persistence if
it is turned off.
* 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.