* rulesets/Py_BBox.cpp, rulesets/Py_Location.cpp, rulesets/Py_Map.cpp,
rulesets/Py_Mind.cpp, rulesets/Py_Object.cpp,
rulesets/Py_Operation.cpp, rulesets/Py_Oplist.cpp,
rulesets/Py_Optime.cpp, rulesets/Py_Quaternion.cpp,
rulesets/Py_RootEntity.cpp, rulesets/Py_Task.cpp,
rulesets/Py_Thing.cpp, rulesets/Py_World.cpp,
rulesets/Python_API.cpp: Replace calls to PyMem_DEL with calls
to PyObject_Free. Thanks to Kai for doing most of the digging
on this one.
* rulesets/Python_API.cpp: Clean out unused keyword handling in debug
functions, fix code to comply with style. Ensure debug calls have
minimal cost if debugging is disabled.
* rulesets/Python_API.cpp: Change the entity_new constructor used
by define world scripts so that it takes an optional "pos" argument
rather than the long obsolete "xyz".
* rulesets/mason/define_world.py, rulesets/werewolf/define_world.py:
Modify the most relevant define_world scripts to use the changed API.
* rulesets/basic/mind/goals/common/move.py: Remove a long obsolete
commented out debug line.
* rulesets/Python_API.cpp: In Python Entity constructor, tighten
up checks so exceptions are thrown for initialisers of the wrong
type. Convert xyz sequence more directly to C++ vector for
efficiency.
* rulesets/Py_BBox.cpp, rulesets/Py_Statistics.cpp,
rulesets/Python_API.cpp: Replace calls to the cyphesis log
system with Python exceptions.
* rulesets/Py_Mind.cpp: Accept map and list atlas attributes on
the mind object.
* rulesets/Py_Property.cpp: Improve the wording of some log messags.
* rulesets/Py_RootEntity.cpp: Assert that attributes work correctly.
* rulesets/Plant.cpp: Add FIXME about an issue with plants eating
people.
* rulesets/Python_API.cpp: Expose wfmath's epsilon as a const value
to python.
* rulesets/Py_Point3D.cpp: Expose isValid() method on WFMath::Point<3>
to python.
* 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/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.
* 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/Py_Point3D.cpp, rulesets/Py_Vector3D.cpp,
rulesets/Python_API.cpp: Extend the type object for python
Vector3D and Point3D to the format used by more recent python
versions, adding init methods as well as flags, and doc string.
* rulesets/Python_API.cpp: Improve the quaternion constructor
so it can build one from an axis and an angle of rotation.
* rulesets/Py_Quaternion.cpp: Add support for multiplying quaternions
together.
* data/mason.xml: Add rules for a pole tool, together with
operations and tasks associated with the pole.
* rulesets/mason/world/tasks/Raise.py: Add a task used with the
pole to lever items into different orientations. When used on an
entity, the entity is oriented away from the users current
position, rotating around a horizontal axis.
* client/Py_CreatorClient.cpp, rulesets/Py_Map.cpp,
rulesets/Py_Operation.cpp, rulesets/Py_Oplist.cpp,
rulesets/Py_Point3D.cpp, rulesets/Py_Vector3D.cpp,
rulesets/Py_WorldTime.cpp, rulesets/Python_API.cpp:
Convert functions that take a single argument to use METH_O
and avoid calling PyArg_ParseTuple.
* rulesets/Py_Point3D.cpp, rulesets/Py_Vector3D.cpp,
rulesets/basic/mind/goals/common/move.py: Rename
unit_vector_to_another_vector to unit_vector_to.
* rulesets/mason/world/tasks/Combat.py: Add method to cause one
entity to turn to face the other, and use it each tick of combat.
* rulesets/Python_API.cpp: Rename "rules" python module to "rulesets"
so it maps more directly onto the classes it wraps.
* rulesets/mason/world/statistics/Statistics.py: Use modified rulesets
module name.
* rulesets/Python_API.cpp: Remove C++ implementation of server.dictlist
as its installation was messy, and it serves no purpose being
implemented in C++.
* rulesets/basic/mind/NPCMind.py, rulesets/basic/mind/dictlist.py:
Use python dictlist implementation from original Python version
of cyphesis.
* rulesets/Py_Statistics.cpp: Extend type structure to comply with
more recent Python API.
* rulesets/Python_API.cpp: Add Statistics to a new module called
rules.
* rulesets/Py_WorldTime.cpp: Extend the type object for python
WorldTime to the format used by more recent python versions,
adding new and init methods as well as flags, and doc string.
* rulesets/Python_API.cpp: Refactor the way the server python
module and its type server.WorldTime are created to be the
preferred way for more recent python versions.
* rulesets/basic/mind/NPCMind.py: Remove explicit WorldTime
member, as there is already one in the C++ base class.
* 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/Python_API.cpp: Re-work the keywords handling in Operation()
to avoid bugs in the mapping protocol by using Dict functions, and
eliminate wasteful double lookup. No longer accept setting FROM
in constructor as its never required.
* rulesets/werewolf/world/objects/characters/Villager.py,
rulesets/basic/editor.py: No longer set FROM on operations at
construction. It was never necessary.
* 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/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.
* rulesets/PythonWrapper.h, rulesets/PythonWrapper.cpp: Add new
class which inherits from Script to store a wrapper pointer
for instances which have no script.
* rulesets/PythonScript.h, rulesets/PythonScript.cpp,
rulesets/PythonThingScript.h, rulesets/PythonThingScript.cpp,
rulesets/PythonMindScript.h, rulesets/PythonMindScript.cpp:
Refactor script classes to inherit from PythonWrapper to make
storing wrappers for mind and world entities easier.
* rulesets/Py_Location.cpp, rulesets/Py_World.cpp: Use PythonWrapper
interface to get wrapper pointers from Script objects.
* rulesets/Python_API.cpp: Improve variable names, and comment out
some unused code.
* rulesets/PythonThingScript.h, rulesets/PythonThingScript.cpp:
Store a pointer to the core object's python wrapper, and modify
constructor to initialise it.
* rulesets/Python_API.cpp, server/ScriptFactory.cpp,
server/TaskFactory.cpp: Modify variable name to make it clearer
what the wrapper object is. Pass wrapper to script management
object constructor, so it can store the pointer.
* rulesets/PythonMindScript.h: Make constructor explicit for
safety.
* server/TaskFactory.cpp, server/TaskFactory.h: Re-write the
script task to handle creating the script directly, rather than
use ScriptFactory which is not suitable.
* rulesets/PythonMindScript.cpp, rulesets/PythonScript.cpp,
rulesets/PythonScript.h, PythonThingScript.cpp,
rulesets/PythonThingScript.h, rulesets/Python_API.cpp,
server/ScriptFactory.cpp: Remove obsolete pointer to entity
from script class, removing its link to Entity, making it more
generally useful.
* rulesets/Py_Operation.h, rulesets/Py_Operation.cpp: Remove reference
ownership flag, and from and to pointers from the python operation
structure.
* rulesets/Py_Map.cpp, rulesets/Py_Oplist.cpp,
rulesets/PythonMindScript.cpp, rulesets/PythonThingScript.cpp,
rulesets/Python_API.cpp: Remove all usage of own, from and to.
* rulesets/basic/mind/NPCMind.py,
rulesets/basic/mind/goals/common/misc_goal.py,
rulesets/basic/mind/goals/humanoid/mason.py,
rulesets/basic/mind/goals/humanoid/transaction.py,
rulesets/mason/world/objects/clothing/Garment.py,
rulesets/mason/world/objects/plants/seeds/Acorn.py,
rulesets/mason/world/objects/plants/seeds/Apple.py,
rulesets/mason/world/objects/plants/seeds/Fircone.py,
rulesets/mason/world/objects/tools/Bucksaw.py,
rulesets/mason/world/objects/tools/Cleaver.py,
rulesets/mason/world/objects/tools/Trowel.py: Modify all scripts
so they expect from and to of ops to be an ID string rather than
an entity.
* rulesets/Python_API.cpp: Modify Python API so Entity() now creates
a RootEntity not a Message Element.
* client/Py_CreatorClient.cpp, client/CreatorClient.h,
client/CreatorClient.cpp: Modify CreatorClient and bindings to
take a RootEntity rather than a Message Element.
* rulesets/Py_Object.h, rulesets/Py_Object.cpp: Remove nasty code
used to handle complex attributes to Message Elements. Now should
either be converted or rejected.
* rulesets/Python_API.cpp: Remove code that merged complex python
attributes to entity arguments.
* rulesets/Py_Mind.cpp: Add note that as_entity() method should
be removed in the long term.
* rulesets/Py_Object.cpp, rulesets/Py_Object.h: Ensure that
Python to Atlas conversions are aborted if they fail at any
point.
* rulesets/Py_RootEntity.cpp: Ensure all static functions still have
unique names. Support setting and retrieving soft attributes.
For attribute values which are non-convertible python objects,
store a pointer to the original Python object.
* rulesets/Python_API.cpp: Adapt setting of operation arguments
modified Python to Atlas conversion functions.
* rulesets/mason/define_world.py: Add a very basic test for
experimenting with interlinguish.
* rulesets/Py_Operation.cpp: Return entity arguments as RootEntity
rather than MessageElement.
* rulesets/Py_RootEntity.cpp: get_name() returns "obj" as it should
rather than "op". Add warnings if unknown attributes are requested
or set.
* rulesets/Python_API.cpp: Accept RootEntity python wrapped
objects as arguments to operations.
* common/custom.cpp: Install an atlas factory for custom op as a test.
* rulesets/Py_Operation.cpp: Improve error reporting.
* rulesets/Python_API.cpp: Fix bug where arguments to ops were
ignored.
* modules/Location.cpp, modules/Location.h, rulesets/Python_API.cpp:
Implement a function for determining the horizontal distance
between two locations neglecting height difference, as for
locations on the terrain it is not relevant.
* rulesets/basic/mind/goals/common/move.py: Improve the coding of
the move_me_to_it goal, so distance determination is more effective.
Make distance independant of height.
Relax distances at which character is concidered to have arrived at
its destination.
* rulesets/basic/mind/Goal.py: Modify goal so that it understands
that a subgoal can be unfulfilled, but still not need to take any
action.
* server/WorldRouter.cpp: Fix a problem where entities contained by
other entities had their height adjusted incorrectly.
* rulesets/basic/world/objects/elements/Fire.py: Allow fires to be
moved.
* rulesets/Python_API.cpp: Add constructor for BBox.
* data/mason.xml: Add a torch. Add burn_speed attributes to a
bunch more entity classes.
* rulesets/mason/world/objects/tools/Torch.py: Script for torch.
* rulesets/Python_Script_Utils.h, rulesets/Python_API.h,
rulesets/Python_API.cpp, rulesets/MindFactory.cpp,
server/EntityFactory.cpp: Move functions related to creating
script objects into a new header, to avoid namespace pollution.
* rulesets/Entity.h, rulesets/BaseMind.h: Make scriptSubscribe
virtual so it can be overriden in BaseMind.
* rulesets/Python_API.cpp: Get rid of template for Subscribe_Script
as its no longer necessary now scriptSubscribe is virtual.
* tools/AdminClient.cpp, tools/AdminClient.h, tools/cyaddrules.cpp:
New tool to load new rules into a running server.
* data/mason.xml, rulesets/mason/world/objects/tools/Rope.py:
Experimental type for a rope.
* man/cyclient.sgml, man/cycmd.sgml, man/cyphesis-tools.sgml,
man/cyphesis.sgml: Add SEE ALSO sections to the man pages.
* rulesets/Python_API.cpp: Clean up variable names.
* server/Admin.cpp: Send an info response when types are
installed from the client.
* tools/cyloadrules.cpp: Correct copyright dates.
* rulesets/Python_API.cpp: Re-write the code for extracting operation
subscriptions from python classes so its now more efficient and
picks up methods from base classes.
* rulesets/basic/mind/BaseMind.py, rulesets/basic/mind/NPCMind.py,
rulesets/basic/world/objects/Thing.py: Rename some methods
which have match the signature of operation handlers.
* rulesets/Character.cpp: Include POS from a Use op argument when
building the arg for the resulting op.
* rulesets/Py_Point3D.cpp: Add a print handler.
* rulesets/Python_API.cpp: When constructing Point3D or Vector3D
accept an Atlas list as well as a standard python list.
* rulesets/Py_Operation.cpp, rulesets/Py_Optime.cpp,
rulesets/Py_Optime.h rulesets/Python_API.cpp:
Remove the Optime class from the API and force scripts to use
setFutureSeconds() to modify operation dispatch time.
* rulesets/acorn/world/objects/Weather.py,
rulesets/acorn/world/objects/plants/Tree.py,
rulesets/acorn/world/objects/plants/seeds/Acorn.py,
rulesets/acorn/world/objects/plants/seeds/Apple.py,
rulesets/acorn/world/objects/plants/seeds/Seed.py,
rulesets/basic/mind/NPCMind.py,
rulesets/basic/mind/goals/common/move.py,
rulesets/basic/world/objects/animals/Animal.py,
rulesets/basic/world/objects/buildings/House.py,
rulesets/basic/world/objects/elements/Fire.py,
rulesets/basic/world/objects/plants/Tree.py,
rulesets/basic/world/objects/tools/Bow.py,
rulesets/mason/world/objects/Weather.py,
rulesets/mason/world/objects/plants/seeds/Acorn.py,
rulesets/mason/world/objects/plants/seeds/Apple.py,
rulesets/mason/world/objects/plants/seeds/Fircone.py,
rulesets/mason/world/objects/plants/seeds/Seed.py:
Fix up all the python scripts to use setFutureSeconds on
ops instead of time.sadd.