* rulesets/Python_API.cpp, rulesets/Python_API.h: Hack in a quick
function for executing python commands.
* server/CommPythonClient.cpp: Pass input from the client straight
into the python interpretter and see what happens.
* rulesets/Character.cpp, rulesets/Character.h: Remove all traces
of the hard coded statistics property from Character.
* rulesets/Py_Property.cpp: Don't use Py_StatisticsProperty as the
default wrapper for a statistics property because it will no
longer work this way.
* rulesets/Python_API.cpp: Remove the setup for the Statistics
wrapper.
* rulesets/StatisticsProperty.cpp, rulesets/StatisticsProperty.h:
Change the footprint of this class so it is no longer hooked
into part of the Character class, and instead handles looking
up values from the script directly, and owns the script itself.
* server/ArithmeticFactory.cpp, server/ArithmeticFactory.h,
server/EntityFactory.cpp, server/EntityFactory.h,
server/PersistantThingFactory.cpp: Remove setup of hard coded
statistics property.
* rulesets/Statistics.h, rulesets/Statistics.cpp,
rulesets/Py_Statistics.h, rulesets/Py_Statistics.cpp,
rulesets/Makefile.am: Remove clases that are no longer used.
* rulesets/Py_World.h: Remove the pointer to the world router from
its wrapper, as all the wrapper code should now use the singleton
interface.
* rulesets/Python_API.cpp, rulesets/Py_World.cpp,
rulesets/Py_Thing.cpp: Fix up all the code which uses the world
router pointer.
* rulesets/Python_API.cpp: Add an instance of the world wrapper to
the server module, which should then be used instead of the
world attribute on entities.
* rulesets/Python_API.cpp: Remove the server_python flag used to
allow scripts to run unmodified on the obsolete python prototype.
* rulesets/basic/mind/NPCMind.py,
rulesets/basic/mind/goals/animal/herd.py,
rulesets/basic/mind/goals/common/common.py,
rulesets/basic/mind/goals/common/move.py,
rulesets/mason/world/objects/buildings/House.py: Remove support
for running these scripts on the obsolete python prototype.
* rulesets/BaseMind.cpp, rulesets/BaseMind.h, rulesets/Entity.cpp
rulesets/Entity.h: Remove the scriptSubscribed methods which
were empty and unused.
* rulesets/Python_API.cpp, rulesets/Python_Script_Utils.h: Remove
Subscribe_Script() as it is useless now.
* server/ScriptFactory.cpp: Remove call to Subscribe_Script().
* client/CreatorClient.cpp, client/CreatorClient.h,
client/Py_CreatorClient.cpp, common/BaseWorld.h, common/types.h,
modules/Location.cpp, modules/Location.h,
rulesets/AtlasProperties.cpp, rulesets/AtlasProperties.h,
rulesets/BaseMind.cpp, rulesets/Character.cpp, rulesets/Character.h,
rulesets/Entity.cpp, rulesets/Entity.h,
rulesets/EntityProperties.cpp, rulesets/LocatedEntity.cpp,
rulesets/LocatedEntity.h, rulesets/MemEntity.cpp,
rulesets/MemEntity.h, rulesets/MemMap.cpp, rulesets/Motion.cpp,
rulesets/Motion.h, rulesets/Py_Location.h, rulesets/Py_Mind.cpp,
rulesets/Py_Thing.cpp, rulesets/Py_Thing.h,
rulesets/PythonMindScript.h, rulesets/PythonScript.h,
rulesets/PythonThingScript.cpp, rulesets/PythonThingScript.h,
rulesets/Python_API.cpp, rulesets/Script.cpp, rulesets/Script.h,
rulesets/Thing.cpp, rulesets/World.cpp, server/WorldRouter.cpp,
server/WorldRouter.h: Refactor all the entity code so there is now
a new base class for entities in the world simulation, and in the
mind which only contains things which are trully common to both.
This moves a lot of functionality which should not have been
present in mind entities away, and makes that code safer and more
efficient.
* tests/TestWorld.h: Update the test world API to match the base
class.
* rulesets/Character.cpp, rulesets/MemMap.cpp, rulesets/Motion.cpp,
rulesets/Python_API.cpp, rulesets/TerrainProperty.cpp,
rulesets/Thing.cpp, rulesets/World.cpp: Don't use camel casing for
local variables or function arguments.
* 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:
* rulesets/Py_Property.h, rulesets/Py_Property.cpp,
rulesets/Py_TerrainProperty.cpp, rulesets/Makefile.am,
rulesets/Python_API.cpp: Complete implementation of terrain
property wrapper.
* rulesets/mason/world/tasks/Reap.py: Check the surface to make sure
it is grass. Remove deubg output.
* 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.
* common/globals.cpp: Remove loading config data for inherited
rulesets.
* rulesets/Python_API.cpp: Add the python path for mind code
manually, and only add one path for the ruleset.
* rulesets/Python_API.cpp: Add a new directory to the python path
containing non ruleset specific code that is required by any
normal python scripts.
* rulesets/Makefile.am: Install non ruleset specific python code
that was historically in common into a separate place.
* irulesets/mason/define_world.py: Import the editor functionality
from the new location.
* 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.