* rulesets/Entity.h, rulesets/Entity.cpp: Add a override of
BaseEntities operation() method which handles calling
script operation handlers directly, rather than relying
on the C++ handlers to check for them later.
* rulesets/Character.cpp, rulesets/BaseMind.cpp: Check for script
operation handlers centrally in Character and BaseMind too.
* rulesets/Stackable.cpp: Report an error if a divide op has
args with the wrong ID.
* rulesets/Character.h, rulesets/Character.cpp: Add function
to check if an entity is in the characters inventory.
* rulesets/Character.cpp: First pass at implementing filters
for combine and divide ops from the client.
* common/BaseEntity.cpp, common/BaseEntity.h: Remove opEnumerate
method as its now a trivila call to another method.
* rulesets/BaseMind.cpp, rulesets/Character.cpp, rulesets/Creator.cpp:
Replace calls to opEnumerate with direct calls to getClassNo().
* common/BaseEntity.cpp, rulesets/Character.cpp, rulesets/Creator.cpp,
server/Account.cpp, server/Admin.cpp, server/Connection.cpp,
server/Lobby.cpp, server/WorldRouter.cpp: Don't bother with serial
numbers on ops generated inside the server. They just leak and upset
clients.
* rulesets/Movement.h: Add method to check if a target position has
been specified.
* rulesets/Character.cpp: Don't return a tick for movement if no
target is specified, as the old movement object has no further
role to play.
* server/Connection.cpp, server/CommClient.cpp, server/Account.cpp:
Only set refnos on ops if the client has set a serial number.
* rulesets/Character.cpp: Simplify handling the transfer of
operations from client to in-game. Don't give new operations
serial numbers at this point.
* 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/Character.cpp, rulesets/Task.cpp: Fix the name of the
TASKS attribute.
* rulesets/mason/world/tasks/Logging.py: Make the logging task
progress in the right direction.
* rulesets/Task.cpp, rulesets/Task.h: Add two members to task,
progress and rate which handle the progress towards completion,
and the rate at which it is changing. Add a member function which
adds an atlas representation of the task as an attribute to an
Atlas entity.
* rulesets/Py_Task.cpp: Expose progress and rate attributes allowing
them to be set.
* server/TaskFactory.cpp: Set the name of a task when it is created
by its factory.
* rulesets/mason/world/tasks/Logging.py: Set the progress and rate
of the logging task as it progresses.
* rulesets/Character.h, rulesets/Character.cpp: Add updateTask()
method to be called when task ticks. Make initTask, updateTask
and clearTask emit Set operations which set the TASK attribute
on the character to reflect the current status of the task.
* rulesets/mason/world/tasks/Ram.py: Use two move ops to give the
entity being hammered a short burst of velocity, so it being
hammered in is visible.
* rulesets/Character.cpp: Don't process task tick ops if they have
no serial number.
* rulesets/mason/world/tasks/Logging.py,
rulesets/mason/world/tasks/Raise.py,
rulesets/mason/world/tasks/Ram.py,
rulesets/mason/world/tasks/Sharpen.py: Add serial numbers to
tick ups.
* rulesets/mason/world/tasks/Combat.py: Fix the attacker initiative
and detect if combat is obsolete if a character has been defeated.
* rulesets/Task.h: Add an accessor to return an incremented serial
number for a new tick op.
* rulesets/Py_Task.cpp: Add python wrapper for new tick accessor.
* rulesets/Character.cpp: Add debug output to code enforcing
old task ticks.
* rulesets/Character.cpp: Re-write the way combat is initialised
so each participant owns its own combat task object.
* rulesets/mason/world/tasks/Combat.py: Re-implement the example
combat system so it works with one instance per character instead
of one per battle.
* rulesets/Character.cpp: When the client sends a Use op with
no args, stop the current task. A mechanism for testing the
task for interruptibility is still required, so characters can't
escape too easily from combat.
* rulesets/Character.cpp: Stop using SUB_TO for tick and setup ops to
subsystems, and use argument.NAME instead to indicate the subsystem
to be compatible with movement ticks.
* rulesets/Character.cpp: Simplify check tick ops for subsystem.
* rulesets/Combat.h, rulesets/Fell.h: Remove obsolete hard coded
tasks from the build.
* tests/Tasktest.cpp, tests/Fell.cpp, tests/Fell.h: Move old Fell
class into tests, and use it to verify tasks operate correctly.
* rulesets/Character.cpp, rulesets/Task.cpp, rulesets/Task.h,
rulesets/TaskScript.cpp: Re-work tick ops to tasks so they use
argument, not sub_to to get routed to the task. Do the groundwork
for having a serial number for each op, which resets to zero when
a new task is started.
* rulesets/mason/world/tasks/Combat.py,
rulesets/mason/world/tasks/Logging.py,
rulesets/mason/world/tasks/Raise.py,
rulesets/mason/world/tasks/Ram.py,
rulesets/mason/world/tasks/Sharpen.py: Modify all current tasks
to set their arg as required.
* 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.
* rulesets/Py_Vector3D.cpp: Fix incorrect METH_VARARGS function type
of the three rotateN methods, as it should have been converted to
METH_O. Add a new rotate method used to rotate a vector using a
quaternion.
* rulesets/Py_Quaternion.cpp: Add a method to check the validity of
the quaternion, and a type method to create a string representation
of the quaternion.
* rulesets/Character.cpp: Remove commented out legacy hard coded
combat task setup. Now all tasks are scripts.
* rulesets/mason/world/tasks/Logging.py: Break logging down into
something that happens over many ticks, using the orientation of
the tree to determine if its felled yet.
* rulesets/Character.cpp: When tick ops are passed to mind, check
that SUB_TO=="mind" so that task ticks don't get treated as mind
ticks.
* rulesets/mason/world/tasks/Combat.py: Clean up logic for checking
attacker stamina on initialisation.
* rulesets/mason/world/tasks/Combat.py: Re-work the way combat works
so all involved entities do their own tick ops, rather than the
whole thing being coordinated by only one entity. This simplifies
removing the task once obsolete.
* rulesets/Py_Thing.cpp: Add get_task() on Character so task is
available to scripts.
* rulesets/Py_Oplist.cpp: Allow an oplist to be appended to an
oplist as well as being added.
* rulesets/Character.h: Add an accessor for task.
* rulesets/Character.cpp: Ensure a task is cleared if it does not
get initialised.
* rulesets/Character.cpp: Improve error logging in task setup.
* rulesets/Task.h, rulesets/Py_Task.cpp: Add an accessor for the
refcount of a task, and expose it to the script interface.
* rulesets/mason/world/tasks/Combat.py: Add a check that there are
still at least two participants in combat, or end the task.
* 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/Character.h, rulesets/Character.cpp: Add stub of Use op
handler on character. Re-write the mind Use op handler to be
cleaner, faster and easier to understand.
* 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.
* rulesets/PythonArithmeticScript.cpp: Implement getting attribute
values from statistics script.
* rulesets/Statistics.cpp, rulesets/Statistics.h,
rulesets/Py_Statistics.cpp, rulesets/Character.cpp,
rulesets/Combat.cpp: Remove hard coded stats for combat
and strength.
* rulesets/mason/world/statistics/Statistics.py: Add test support
for combat and strength stats.
* server/PersistantThingFactory.cpp: Remove debug output.
* rulesets/Character.cpp, rulesets/StatisticsProperty.h,
rulesets/StatisticsProperty.cpp: Add a property handler for
statistics.
* rulesets/Character.cpp: When setting task, check if an existing
task needs to be cleared first. When clearing a task, check
whether a task exists or not.
* rulesets/Character.cpp: When initiating combat task from task
factory, check to see if the task is successfully created before
using it.
* rulesets/Py_Property.cpp, rulesets/Py_Property.h: New python wrapper
class for entity properties.
* rulesets/Py_Mind.cpp: Re-work getattr logic to make it clearer.
* rulesets/Py_Object.cpp: Return Py_None when an Atlas Element cannot
be converted to python. This ensures that this function never returns
null.
* rulesets/Py_Statistics.cpp: Add temporary handlers for hardcoded
statistics for "attack", "defence", and "strength".
* rulesets/Py_Task.cpp: Add wrappers for methods Task.irrelevant and
Task.obsolete, as these are now required in combat scripts.
* rulesets/Py_Task.h: Fix the PyTask_Check macro, which was miscoded.
* rulesets/Py_Thing.cpp: Add wrapper for Entity.send_world so that
scripts can channel ops through entities.
* rulesets/Py_Thing.h, rulesets/Py_Thing.cpp: Add an addition structure
for directlty wrapping Character in a type safe way. Add method
structure pointer to Entity and Character wrappers so that
the same getattr method is used for both. Add new method table for
Character including wrappers for set_task and clear_task, allowing
task scripts to add themselves and remove themselves from
characters. Modify wrapEntity() to ensure that Character entities
get the right wrapper.
* rulesets/Py_Thing.cpp: Re-work getattr code so that properties and
soft attributes are checked individually, rather than in a single
call to Entity.get. Use new python property wrappers to wrap
properties explicitly if required rather than converting to Atlas
then to generic Python data.
* rulesets/TerrainProperty.h: Fix incorrect class description in
documentation.
* rulesets/mason/world/tasks/Combat.py: Complete implementation of
simple example combat.
* server/TaskFactory.cpp: Remove debug output.
* common/BaseWorld.h: Add factory method for new tasks to the world
interface.
* rulesets/Character.cpp: Use world interface to create combat
task, rather than using EntityFactory directly.
* server/WorldRouter.h, server/WorldRouter.cpp: Implement the
new task method in the core world object.
* rulesets/Character.cpp: Switch to using the test combat script.
* rulesets/Py_EntityWrapper.h, rulesets/Py_Statistics.h: Move the
generic entity wrapper structure into its own header.
* client/Py_CreatorClient.cpp, rulesets/Py_Location.cpp,
rulesets/Py_Location.h, rulesets/Py_Mind.cpp, rulesets/Py_Thing.cpp,
rulesets/Python_API.cpp: Modify PyLocation so that rather than
having a flag to indicate whether the script owns the object,
it instead stores a pointer to the entity that owns it in that
eventuality.
* rulesets/Py_Thing.cpp: Allow map and list attributes to be set from
scripts as long as the contents are Atlas compatible.
* rulesets/Python_API.cpp: Fix script output handling so only complete
lines are output.
* rulesets/mason/world/tasks/Combat.py: Add code for identifying
attacker and defender in a combat.
* rulesets/mason/world/tasks/Combat.py: Expand the sample combat
to include tick ops.
* rulesets/Python_API.cpp, rulesets/Py_Operation.cpp: Add necessary
handlers for sub_to attribute on operations.
* rulesets/Character.cpp: Adapt test code for combat scripts to
the latest task API.
* rulesets/Script.cpp: Document the script interface.
* rulesets/Task.h: Modify task interface so tasks now expect
the operation that initiated the task to be passed in
to an init function.
* rulesets/Combat.h, rulesets/Combat.cpp: Modify the combat task
methods to match the interface changes.
* rulesets/Character.cpp: Modify Combat use to take account
of interface changes. Prototype using script based
combat.
* rulesets/TaskScript.h, rulesets/TaskScript.cpp: Implement
passing the initialising op through to the script using the
standard scripp operation handling functions.
* rulesets/mason/world/tasks/Combat.py: Add handler for Attack
operation, which should now be passed in at init time.
* common/id.cpp, common/id.h: Break integer ID conversion into
two versions, one which abort()s and one which returns a known
invalid ID.
* rulesets/Character.cpp: Fix the grammar in an error message.
* server/Player.cpp: Make error message on failed character creation
clearer.
* rulesets/Entity.cpp: Switch to using SignalProperty for BBOX.
* rulesets/Area.cpp, rulesets/Character.cpp, rulesets/Line.cpp,
rulesets/Plant.cpp, rulesets/Py_Location.cpp:
Update bbox on location using setBBox(), so cached values are
updated.
* 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.