* rulesets/mason/world/tasks/Logging.py: Implement logging entirely
in the task, instead of relying on functionality in the plant
class.
* rulesets/Py_Quaternion.cpp: Implement rotation method as in the
the wfmath class, as required for Logging.
* rulesets/Plant.cpp: Add an error message if the old plant
functionality gets called.
* rulesets/basic/world/objects/tools/Axe.py: Add an error message
noting that this method should not be called.
* rulesets/basic/world/objects/Thing.py: Remove self.attributes
from the base class for all python scripts.
* rulesets/mason/world/objects/Weather.py,
rulesets/basic/world/objects/plants/Tree.py,
rulesets/basic/world/objects/animals/Animal.py,
data/basic.xml, data/mason.xml: Don't use set_kw to handle default
attributes, and add the to the .xml rules files.
* rulesets/basic/world/objects/buildings/House.py,
rulesets/basic/world/objects/buildings/StoneHouse.py,
rulesets/basic/world/objects/tools/Bow.py,
rulesets/basic/world/objects/tools/Sword.py,
rulesets/mason/world/objects/animals/Deer.py,
rulesets/mason/world/objects/animals/Pig.py,
rulesets/mason/world/objects/outdoor/Campfire.py,
rulesets/mason/world/objects/outdoor/Gravestone.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,
rulesets/mason/world/objects/tools/Cleaver.py,
rulesets/mason/world/objects/undead/Skeleton.py,
rulesets/werewolf/world/objects/characters/Villager.py,
rulesets/werewolf/world/objects/tools/Gallows.py:
Don't import set_kw from misc, as its now obsolete and unused.
* 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.
* 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/mason/world/objects/tools/Tinderbox.py: Change strength
of initial fire spark to 0.05.
* common/operations.cpp: Fix nourish op, which got broken when mow
was added.
* data/basic.xml: Add a default bbox for lumber, giving it a more
apropriate size.
* rulesets/Py_World.cpp: Add a compare implementation so that
` scripts can check entities to see if they are the world.
* rulesets/basic/world/objects/elements/Fire.py: Tune the
changes which occur in fire as it burns.
* data/mason.xml, rulesets/mason/world/objects/tools/Bucksaw.py:
New bucksaw for cutting up logs.
* rulesets/mason/world/objects/tools/Trowel.py: Correct the comments.
* rulesets/mason/world/objects/tools/Rope.py: Correct the syntax
of stub functions.
* rulesets/basic/world/objects/buildings/StoneHouse.py: Fix the import
statements.
* rulesets/basic/world/objects/buildings/House.py: Fix import for
physics module.
* rulesets/basic/mind/goals/common/misc_goal.py: Fix typo in
cut_something.
* server/ScriptFactory.cpp, server/ScriptFactory.h: New factory
class for handling python scripts for entities much more
efficiently, and provide a means where they can be re-imorted
at an apropriate time.
* server/PersistantThingFactory.h,
server/PersistantThingFactory.cpp: Make PersistantThingFactory
copy constructor protected, to ensure its not used accidentally.
Replace strings for storing python script data with a pointer
to a factory for creating scripts.
* server/EntityFactory.cpp: Use the new ScriptFactory mechnism
for creating scripts attached to entities. Improve variable
names a little.
* 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/mason/world/objects/tools/Trowel.py, data/mason.xml:
Add a rule for a trowel for planting seeds. Add a rule for spider
model.
* common/custom.cpp: Add custom ops for "sow" and "germinate" for
handling seeds.
* common/Dig.h, common/Mow.h, common/custom.cpp, common/operations.cpp:
Add new Dig and Mow operations, for handling resource gathering.
* rulesets/basic/world/objects/tools/Shovel.py,
rulesets/basic/world/objects/tools/Scythe.py,
data/basic.xml: Add new scythe and shovel for gathering resources
from the terrain.
* rulesets/basic/world/objects/tools/Pickaxe.py,
common/Delve.h: Fix the comments.
* rulesets/World.cpp, rulesets/World.h: Move code for determining
terrain surface type into a method of its own. Implement handlers
for Dig and Mow ops.
* common/custom.cpp, common/Delve.h,
common/operations.cpp, common/operations.h:
Add new delve operation for digging with a pickaxe.
* data/basic.xml, rulesets/basic/world/objects/tools/Pickaxe.py:
Add new pickaxe entity which emits a Delve operation when
used.
* rulesets/Character.cpp: Fix a bug where a segfault occured
if an operation was requested by a tool that was unknown to
to the core server code. Instead an error message is emitted.
* rulesets/World.cpp: Subscribe world terrain to delve ops.
* 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.
* data/basic.xml: Clean out a load of obsolete classes and scripts.
* rulesets/basic/world/objects/buildings/House.py,
rulesets/basic/world/objects/buildings/StoneHouse.py,
rulesets/basic/world/objects/tools/Bow.py,
rulesets/basic/world/objects/tools/Sword.py,
rulesets/mason/world/objects/plants/seeds/Seed.py,
rulesets/mason/world/objects/undead/Skeleton.py:
Remove obsolete constructors, and don't inherit from
obsolete scripts.
* rulesets/mason/world/objects/tools/Cleaver.py,
rulesets/mason/world/objects/animals/Deer.py,
rulesets/basic/world/objects/tools/Axe.py:
Remove obsolete commented out code, and useless constructors
from some scripts.
* data/mason.xml: Remove obsolete scripts for some entities
which don't do anything.
* rulesets/Plant.h, rulesets/Plant.cpp: Add handler for chop so
we can chop down vegetation.
* rulesets/basic/world/objects/tools/Axe.py: Modify Axe to comply
with new tool use mechanism.
* rulesets/basic/mind/goals/humanoid/transaction.py,
rulesets/basic/mind/goals/common/misc_goal.py,
rulesets/mason/define_world.py: Update butcher goals to use tool
use mechanism.
* rulesets/Python_API.cpp: Ensure entities created from Python
have an objtype.
* rulesets/Entity.cpp, rulesets/Entity.h: Add has() method
to query if an entity has an attribute with a given name.
* rulesets/Character.cpp, rulesets/Character.h: Implement tool
wield and use operations.
* data/mason.xml: Add operations list to the cleaver.
* rulesets/mason/world/objects/tools/Cleaver.py: Simplify the chop
operation the cleaver expects to get from its user.
* tools/cyloadrules.cpp: Remove some commented out cruft and
debugging output.
* rulesets/werewolf/world/objects/tools/Gallows.py,
rulesets/basic/world/objects/tools/Bow.py,
rulesets/basic/world/objects/plants/Tree.py,
rulesets/basic/world/objects/buildings/House.py,
rulesets/basic/mind/goals/humanoid/transaction.py,
rulesets/basic/mind/goals/common/misc_goal.py:
Fix bugs initialising Location ensuring the second
arg is a Point3D, not a Vector3D for position.
Fixes pig purchasing.
* rulesets/basic/mind/goals/humanoid/mason.py:
Fix the velocity check for escaping pigs.
* rulesets/Py_Point3D.cpp: Fix Point3D subtraction operator to
allow subtraction of both Point and Vector. Fixes pig merchant
goal for keeping pigs.
* common/globals.cpp: Only persist this sessions command line
options if the user is overriding the installation directory.
* cyphesis.vconf, client/Py_CreatorClient.cpp,
client/Py_CreatorClient.h, client/client.cpp:
Add client functionality to allow diferent scripts to be run to
perform different functions on the server.
* client/CharacterClient.cpp: Add debug option.
* rulesets/Character.h: Make mind operation functions virtual,
so they can be overridden.
* common/BaseWorld.h, server/WorldRouter.cpp,
server/WorldRouter.h: Add server functions to search for
entities by name or type.
* rulesets/Creator.h, rulesets/Creator.cpp: Allow creator to
specify a look without an id to search for entities with
a given name or type.
* client/CreatorClient.cpp, client/CreatorClient.h,
client/ObserverClient.cpp, client/ObserverClient.h,
client/Py_CreatorClient.cpp, rulesets/basic/editor.py,
rulesets/mason/define_world.py:
Add support for looking for entities in the world by name or
type from client script, so client scripts can modify existing
world.
* rulesets/Entity.cpp, rulesets/Movement.cpp,
rulesets/Py_Object.cpp, rulesets/Py_Operation.cpp,
rulesets/Py_Oplist.cpp, rulesets/Python_API.cpp,
rulesets/Stackable.cpp, rulesets/Thing.cpp,
rulesets/World.cpp, server/Account.cpp,
server/CommServer.cpp, server/Connection.cpp,
server/Player.cpp, server/ServerRouting.cpp,
server/server.cpp, tools/cycmd.cpp,
tools/cywatchdog.cpp: Code formatting cleanups.
* rulesets/basic/world/objects/tools/Bow.py: Fix up bow so it now
fires correctly.
* common/const.h: Increase the sight range.
* server/WorldRouter.cpp: Put in some warnings, as I want to
know when ops are getting broadcast.
* server/server.cpp: Ensure stdout is not used when in daemon mode.
* tools/cydbload.cpp: Rename the daftly named class WorldBase
to WorldAccessor.
* mason.xml, cyphesis.vconf: Stop using the Acorn ruleset in Mason,
as it contains strange stuff, and remove the playable farmer
class from basic. Now games themselves define the only
playable types, and mason contains its own copies of classes
it has in common with acorn.
* rulesets/Entity.cpp, rulesets/Entity.h, rulesets/Character.cpp,
rulesets/Character.h, rulesets/Thing.cpp, rulesets/Food.cpp:
Renamed weight member as mass, and use this name in Atlas,
as this is a better convention, and has already been adopted in
stage.
* Switched python code to using mass instead of weight, as it is
a more accurate term.
* common/globals.cpp, common/globals.h, tools/cyloadrules.cpp:
Put admin modifiable config in etc instead of share directory.
* Don't build cycmd if readline is not available. Untested, and
probably nasty.
all have the name Operation but are now called MoveOperation,
according to the type of operation they handle.
* modules/DateTime.cpp, modules/DataTime.h: Filled in functionality,
allowing initialisation and updating from a time values in seconds.
* modules/Location.h: Modified collision detection code so no
checking is done between two moving objects.
* rulesets/BaseMind.h, rulesets/BaseMind.cpp, rulesets/Entity.h,
rulesets/Entity.cpp: Removed virtual getMap() method and replaced
with a fixed method in BaseMind only. Added time member veriable
to BaseMind so each mind keeps track of time by itself.
* rulesets/Python_API.h, rulesets/Py_Mind.cpp, rulesets/Py_Mind.h:
Added specific python interface for mind objects, because if
increasing differences in the way this must be handled.
* rulesets/Character.h, rulesets/Character.cpp: Added isAlive flag
which is cleared if the character is dead. If this flag is cleared,
operations are no longer sent to the mind.
* rulesets/Movement.h, rulesets/Movement.cpp, rulesets/Pedestrian.h,
rulesets/Pedestrian.cpp: Cleaned up the code, made members more
distinctive, and make interface more general.
* rulesets/Py_Thing.cpp: Removed features used to support mind.
* rulesets/Py_WorldTime.cpp: Added support for comparison of
time with strings, to establish whether it matches descriptions
of time.
* rulesets/Python_API.cpp: Modified creating of scripts so mind
scripts use a slightly different interface from entity scripts,
to support the fact that a mind handles its own timekeeping,
has a memory map, and has no access to the world.
* server/WorldTime.cpp, server/WorldTime.h: Brought WorldTime into
the build. Used to track details of the time. Added support for
checking time descriptions such as "midday", "summer" against
DateTime.
Al Riddoch <alriddoch@zepler.org>
* modules/Location.h: Added inRange() method which can be used
to check whether location, including bounding box, is within
given range of a given location. Changed parent member
variable to ref to fit with Atlas spec. Changed all code
related to using the term ref instead of parent so
that there is no confusion between ref for coordinates
and parent in the Atlas hierarchy.
* rulesets/Thing.cpp: Added code to move operation to check
what entities come into and out of range when entity moves.
Appearance and Disappearance operations are sent to the
moving entity with a list of the relevant entities as their
argument.
* server/WorldRouter.h/cpp: Added overloaded Look operation
handler which applies range constraints to the contains
attribute before returning.
* common/BaseEntity.h, rulesets/Thing.h, rulesets/Character.h:
Added handling of Appearance and Disappearance operations.
* server/WorldRouter.cpp: Added primitive check to broadcast
operations to avoid delivering broadcast operation to
entities out of range.
* Removed world.get_object() use from server python code, as
its use is not required.
* server/WorldRouter.h: Implemented fetching of floating point time
from the OS so movement is much smoother.
Al
* Tweaked the way Look operations are handled when sent from mind, so
an argument is not required if to is set.
* Made some performance enhancements.
* Implemented nourish operation.
* Modifed move_me() goal so it sets face direction.
* Fixed memory leak in MemMap.
* Implemented fully deleting of entities.
* Cleaned up and tweaked python scripts so eating acorns now works.
* Implemented hooks in MemMap for python scripts.
This is the work I got done over the Christmas break. Acorn now works
with a couple of minor glitches.
Al
from config files. Global ruleset should indicate top level ruleset
which can depend on a list of other rulesets.
* Sorted out installation directories. Cyphesis will now need to be
installed before it can be run.
* Cleaned up a load more python scripts for more Acorn stuff.
* Added getting x y and z from Vector3D.
* Made acorn the default ruleset.
Al
clag the server up and are not correct behavoir.
* Minor fixes/python tweaks.
* Slight change to ordering of ops in the queue, so more recently
created ops with the same time stamp come of the queue after
older ops.
* Implemented contains attribute so newly created objects are added
to their parents contains list, and when objects are move, they are
transfered from old parents to new parents contains list.
Lots more stuff is now happening in the world, though I can't see what it is
because things don't show up in uclient now that broadcast Look doesn't
work. It is also clear that I need to seriously attack the memory leak situation
now.
Al
* Removed some unused code.
* Tweaked some python scripts so they import correctly.
* Added in_game flag to BaseEntity so it is possible to tell
if an object is in game.
* Increased the number of operations handled by Message()
* Added handling for initialisation of location.parent using me
in mind code.
* Added is_object_delete() functionality to python interface to world
object.
* Added handling for converting Tuple into Message::Object, and then
ensured that non-basic python types don't get stored as attributes
of a Message::Object.
Many more improvements to goal behavoir. Guard now patrols correctly,
and butcher tries to by a cleaver, because he fails to notice he already
has one.
Al
log.
* Added in lots of deletes to sort memory leaks.
* More python tweaks.
* Implemented status attributes of thing.
* Re-wrote some code which needlessly creates objects in the
free store.
Very nearly all works now.
TODO:
Tidy some of the rest of the leak handling, including all of the stuff
to deal with connections going down.
Sort out how mind gets its attributes set and updated.
Sort out iritating python error in init of Vector3D
delete oplists in OplistObjects. The pointers are never passed back.
Al
* Implemented python function to deal with not being able to check
type of python objects implemented in C.
* Added method to thing for extracting location data from a
Message::Object
* More work on python references to improve leakage.
* Added flag so that python Operation object can own
the operation they point to, and thus delete it in dealloc().
* Implemented find_by_location() and find_by_type() as required in
MemMap, and corresponding python interface.
* Put in temporary work around to deal with the fact that a mind
does not know its name. Currently the mind is not able to
discover any of its bodies attributes, and I am not sure how
to solve this.
* Fixed Location and Vector3D so they use operator bool() to detect
whether they are set.
* Fixed bugs in getting parent from Location in python which caused
segfaults.
* Imported all the basic ruleset entity python scripts.
Goals now work to some extent, though nothing moves around still. The main
priority is to work out how minds inherit the attributes of their
bodies, and keep them up to date. aloril?
Al