* 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/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.
* server/EntityFactory.cpp, rulesets/Python_API.h,
rulesets/Python_API.cpp, rulesets/PythonThingScript.h,
rulesets/PythonThingScript.cpp, rulesets/PythonMindScript.cpp,
rulesets/Py_World.cpp, rulesets/Py_Thing.h, rulesets/Py_Thing.cpp,
rulesets/Py_Operation.cpp, rulesets/Py_Map.cpp,
rulesets/Py_Location.cpp, rulesets/Movement.h,
rulesets/MemMap_methods.h, rulesets/MemMap.h, rulesets/MemMap.cpp,
rulesets/Entity.cpp, rulesets/BaseMind.cpp,
client/Py_CreatorClient.cpp:
Rename all references from thing to entity, as thing is
no longer the base class for IG entities.
* rulesets/World.h, rulesets/World.cpp, rulesets/Thing.h,
rulesets/Structure.h, rulesets/Stackable.h, rulesets/Stackable.cpp,
rulesets/Plant.h, rulesets/Plant.cpp, rulesets/Missile.h,
rulesets/Line.h, rulesets/Line.cpp, rulesets/Food.h,
rulesets/Food.cpp, rulesets/Creator.h, rulesets/Character.h,
rulesets/Character.cpp, rulesets/Area.h, rulesets/Area.cpp:
Add a typedef for the parent class of all entity classes.
* rulesets/Plant.h, rulesets/Plant.cpp:
Add in code to fully integrate hardcoded attributes.
* common/Database.h, common/Database.cpp, server/Persistance.cpp:
Finish entity table creation code, and test it.
* rulesets/Entity.cpp, rulesets/Entity.h, rulesets/EntityFactory.h,
rulesets/PythonThingScript.cpp, rulesets/PythonThingScript.h,
rulesets/Python_API.cpp, rulesets/Python_API.h,
rulesets/Thing.cpp, rulesets/Thing.h, server/EntityFactory.cpp,
server/EntityFactory.h, server/WorldRouter.cpp: Sort out
some incorrect use of Thing instead of Entity. Move some code
from Thing into Entity.
tools/cycmd.cpp: Switched to using skstream to completely handle
client socket connections.
* client/ClientConnection.cpp, client/ClientConnection.h,
common/log.cpp, rulesets/EntityFactory.h, rulesets/MemMap.h,
server/server.cpp, tools/cycmd.cpp: Removed unused includes.
* client/Py_CreatorClient.cpp, client/client.cpp,
client/define_world.cpp, rulesets/Py_Location.cpp,
rulesets/Py_Location.h, rulesets/Py_Map.cpp,
rulesets/Py_Map.h, rulesets/Py_Mind.cpp, rulesets/Py_Mind.h,
rulesets/Py_Object.cpp, rulesets/Py_Object.h,
rulesets/Py_Operation.cpp, rulesets/Py_Operation.h,
rulesets/Py_Oplist.cpp, rulesets/Py_Oplist.h,
rulesets/Py_Optime.cpp, rulesets/Py_Optime.h,
rulesets/Py_Thing.cpp, rulesets/Py_Thing.h,
rulesets/Py_Vector3D.cpp, rulesets/Py_Vector3D.h,
rulesets/Py_World.cpp, rulesets/Py_World.h,
rulesets/Py_WorldTime.cpp, rulesets/Py_WorldTime.h,
rulesets/PythonMindScript.cpp, rulesets/PythonThingScript.cpp,
rulesets/PythonThingScript.h, rulesets/Python_API.cpp,
rulesets/Python_API.h, server/server.cpp:
Reorganised python header files so that each header includes
all the code relevant for a particular type. Tidied up
the type implementations. Added prototypes to init_python_api()
to the Python_API.h header, and removed other dependencies from
it.
Al Riddoch <alriddoch@zepler.org>
client/ObserverClient.cpp, client/ObserverClient.h,
client/ClientConnection.cpp, client/ClientConnection.h,
client/define_world.cpp, client define_world.h:
Started re-coding of python client code in C++.
* common/accountbase.h:
Database class used for simply accessing accounts.
* common/OOGThing.cpp, common/OOGThing.h, server/Account.h,
server/Routing.h:
Moved OOGThing class into common as it is not server specific.
* common/BaseWorld.cpp, common/BaseWorld.h,
server/WorldRouter.cpp, server/WorldRouter.h,
rulesets/Entity.h, rulesets/Py_World.cpp,
rulesets/PythonThingScript.cpp, rulesets/Python_API.h,
rulesets/Thing.cpp, rulesets/Thing.h:
Added base class for WorldRouter so that code that previously
used WorldRouter now used the interface defined by this
new class. This means that the code in rulesets no longer
has dependencies on code in server, so can be used in the client.
* server/ExternalMind.cpp, server/ExternalMind.h,
rulesets/Character.h, rulesets/Creator.cpp,
server/Account.cpp:
Moved ExternalMind class into server as it is server specific,
so that there is no dependancy on server in rulesets.
* server/Persistance.cpp. server/Persistance.h,
server/Admin.cpp, server/ServerRouting.cpp, server/server.cpp:
Moved high level server specific persistance class into
server, so there is no dependency on server in common.
* common/database.cpp, common/database.h, server/Admin.cpp,
tools/cydbload.cpp, tools/cyisoload.cpp, tools/cypasswd.cpp:
Increases efficiency of some interfaces by passing Object::MapType
instead of MapType, when the value must be a map.
* modules/WorldTime.cpp, modules/WorldTime.h,
rulesets/Py_WorldTime.cpp, rulesets/Python_API.cpp:
Brought the version of WorldTime in modules up to date, as this is
the version now used.
* rulesets/Character.cpp, server/WorldRouter.cpp, rulesets/Thing.cpp,
server/Admin.cpp:
Made world objects dictionary private.
* rulesets/EntityFactory.cpp, rulesets/EntityFactory.h:
Change newThing parameters so entity factory does not need to
know about WorldRouter.
* server/Lobby.cpp: Added support for people and rooms attributes
of OOG room class.
Al Riddoch <alriddoch@zepler.org>
atlas object inheritance tree.
* server/Connection.cpp: Added code to allow client to query
atlas object inheritance using get ops.
* example/client/InheritanceClient.*: Added example client which
queries the inheritance tree of the server.
* rulesets/MemMap.h, rulesets/Py_Map.cpp: Made hooks lists private,
and added methods to access them.
* server/Account.cpp, server/Lobby.h: Added correct handling of OOG
look ops when looking at own characters, other accounts, or the
lobby.
* server/ServerRouting.h: Added function to generate serial numbers
for operations.
* server/WorldRouter.cpp: Assign genuine serial number to all
in game operations as they are pulled off the queue.
* Cleaned up header file multiple inclusion checks for uniqueness,
and made sure of ISO compliant use of std::string.
Al Riddoch <alriddoch@zepler.org>
* server/WorldRouter.cpp: Switch to using stringstream to
generate ids.
* rulesets/Thing.cpp: Re-write SetupOperation so Sight
operation is not lost and leaked.
* rulesets/Python_API.h, rulesets/Python_API.cpp,
rulesets/Py_WorldTime.cpp, rulesets/Py_World.cpp,
rulesets/Py_Thing.cpp, rulesets/Py_Operation.cpp,
rulesets/Py_Object.cpp: Sort out correct handling of
python references, and ensure C++ objects are
deleted as required.
Al Riddoch <alriddoch@zepler.org>
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>
mind is active or not. Defaults to true.
* rulesets/Py_Object.cpp: Reverted to storing complex attributes
in a python dict.
* rulesets/Python_API.cpp: Get complex attributes from operation
arguments.
* rulesets/Thing.cpp: Added in broadcast of sight(create) operation
to setup when object is created. See Thing::Opertion(Create) for
details.
* rulesets/basic/mind/goals/common/misc_goal.py: Cleaned up comments.
Al Riddoch <alriddoch@zepler.org>
* Substantial re-work of object model. Moved many attributes out
of BaseEntity class. Changed WoldRouter so it now handles
objects in terms of Entity, rather than BaseEntity.
* Code cleanups, including removing reduntant includes, and
getting rid of C style comments.
* Fixed the way attributes are handled in Set operations and
when merging from an Atlas::Message::Object. This fixed
problem with setting gender of characters.
* rulesets/Pedestrian.*, rulesets/Movement.*: Re-named
Movement variables to make them clearer. Added in
separate handling for collisions from moving to
target position. Modified collision handling so
objects can slide next to each other.
* rulesets/Thing.cpp, rulesets/Character.cpp: Cleaned up and
rationalised movement code. Much shorter, faster and
more compact than before.
* Made better use of iterators throughout, eliminating unnecessary
lookups, and copying of data.
* Moved all virtual functions out of header files, making
less work for the linker.
* Made more use of const references to avoid the need to copy
data before being able to inspect it.
Al Riddoch <alriddoch@zepler.org>
script types to be cleanly dropped in.
* Re-work on server and communication related classes to use
references where they are apropriate. Code is now much more
robust.
* Huge cleanup of header files removing redundant includes.
* server/WorldRouter.h: Removed is_object_deleted because it
is broken and not used.
* server/Connection.h: Removed unused disconnect() methods.
* rulesets/Entity.*: Added new in game base class from which
all mind and object classes are derived. This removes
clutter of Thing class from mind classes.
* aiclient/*: Progress with creating AI client for mind handling.
* common/globals.*: Moved some globals out of server specific files.
* rulesets/Makefile.am: Separated rulesets code into 3 almost stand
alone packages; entities, mind and python interface code.
Acorn may well not work now, but I would apreciate it if people could
test the code on their setups. Lots of code has changed, and almost
everything is now cleaner.
Al Riddoch <alriddoch@zepler.org>
* */*: Fixed mistake in copyright statement.
* tools/cypasswd.cpp: Fixed usage message.
* tools/cycmd.cpp: Added tools for sending administrative commands
to server.
* server/server.cpp: Send terminate instruction to metaserver on
server shutdown.
Al Riddoch (alriddoch@zepler.org)
of oplist to take advantage of vector's best performance.
* Modified OP_SWITCH macros to improve speed, and made it inlinable.
* Cleaned up python interface code to improve compile and link time.
* Moved custom operation definitions in one header file per class
to improve modularity and compile time.
* Modified boundingbox handling so it now uses size and median.
* Added collision check and inbox member function to Vector3D class.
* Added collision prediction and checking to Location and Vector3D
classes.
* Added collision prediction into MovementInfo class.
* Modified Thing::operator[] so that static attributes can be handled
and added Thing::set() which must be used to modify attributes.
* Added collision resolution so characters can no longer walk through
each other.
* Moved weight attribute to being static attribute of Thing, so it
can be much more easily handled in movement code.
Al
be accessed, and certain move operations caused an abort.
* Removed attributes from python object which don't have attributes.
* Added Py*_Check() macros, and used them for easier code reading.
* Added snow attribute to weather.
* Commented out code which makes server exit(0) after a certain time.
Al
leak now is copied Location objects in the python interface code.
* Added hook into the time code so the server can be set to exit
after a given number of seconds. This is required for LeakTracer
to generate its report.
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
so that operation manipulations can now work.
* Implemented getting of object name to python/C API, and added
methods for differentiating between op and object.
* Implemented on-the-fly de-coding of operations, from operation
arguuments in python/C API. This will be obsolete once Atlas-C++
does full decode later.
* Implemented get and setattr for Message Object from
python. Attributes are stored both in Object, and in supplementary
python dictionary for non Atlas compatable attributes.
* Implemented copy() method for Python/C Location class.
Al
* Fixed coersion of non-oplist types for addition.
* Implemented getting attributes from Message::Object maps
from python.
It now crashes in the interlinguish code. Closer and closer.
Al
* Added Talk operation throughout operation handling code.
* Added basic WorldTime class together with python wrapper.
Can fill in functionality as required.
* Put debugging back in cos I still need it.
Python mind code now gets talk ops. Some tweaking still to go.
* Implemented getting and setting of to and from in operations
using map to lookup what the mind knows about the entities
in question. This involved adding an extra field to the
RootOperationObject structure to store to and from entities.
* Sorted out base_init() python member so __init__() of all
classes in inheritance tree are called.
* Started work on set_kw() replacement.
* Added python module finding mechanism which is required to deal
with rulesets correctly. I am not convinced this works.
Al
here to start importing real mind code from cyphesis-py.
With a little bit of tweaking, I have now got the NPCMind code to import,
though it will almost certainly crash once you start trying to run
any methods.
for sight operations to be passed onto python code after processing
in C++. Added new type of op switch to deal with operations
in the argument of a sight/sound operation.
* Added features to Opeation python interface for args to be
accessed as if operation is a sequence object.
* Implemented python API for C++ memory map class.
* Added utility function which uses code borrowed from Atlas-C++
to convert a Message::Object into something from the Objects
code.
Al
added the necessary interface code.
* Initial port of MemMap class from python to C++, together with
python interface. Hopefully maintenance of MemMap can be kept
in C++ for speed if possible.
Al
no method as an error.
* Got python interface code to the point that python classes can now
access the C++ attributes of a Thing.
* Split the python interface code into separate files depending
on the type of C++ class the code relates to.
Al