* 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.
* configure.ac: Require Python 2.2 or later. Increment version.
* rulesets/Py_Statistics.cpp: Remove commented out code, and add
initialisation of the entity pointer in this type during
construction.
* rulesets/Py_WorldTime.cpp, rulesets/Py_Statistics.cpp: Use tp_free
in tp_dealloc as instructed by the latest documentation.
* 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/Py_BBox.cpp, rulesets/Py_Optime.cpp,
rulesets/Py_Statistics.cpp, rulesets/Py_Thing.cpp: Ensure that
setattr returns an exception if the attribute is not a valid one.
* rulesets/Py_Map.cpp, rulesets/Py_Point3D.cpp,
rulesets/Py_Quaternion.cpp, rulesets/Py_World.cpp,
rulesets/Py_WorldTime.cpp: Remove setattr, as no attributes can
be set on this type.
* rulesets/Py_Mind.cpp, rulesets/Py_Oplist.cpp,
rulesets/Py_Vector3D.cpp: Clean up type structure.
* rulesets/basic/mind/goals/common/move.py: Remove attempt
to set "rotation" attribute on location, as its obsolete
and pointless.
* modules/WorldTime.h, modules/WorldTime.cpp: Clean up typedef
and member names, and implement querying the season.
* client/CharacterClient.cpp: Remove some obsolete unconverted
Python code.
* physics/Collision.h: Update some comments.
* rulesets/Py_WorldTime.cpp: Implement access to season lookup
from scripts.
* rulesets/Py_WorldTime.cpp, rulesets/Py_World.cpp:
Change the rest of the methods to use METH_NOARGS for simplicity.
* rulesets/Pedestrian.cpp: Experimental fix to stop desination
based movement from bipassing the collision detection.
* client/Py_CreatorClient.cpp, client/Py_CreatorClient.h,
rulesets/Py_BBox.cpp, rulesets/Py_BBox.h, 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_Quaternion.cpp, rulesets/Py_Quaternion.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/Python_API.cpp:
Clean up python API code, with decent names for types,
decent error reporting, and making the more paranoid checks
only present in debug build.
* common/BaseEntity.cpp, common/BaseEntity.h, server/Account.cpp:
Remove pointless method setRefnoOp, and put it in the body as
an inline method.
* common/BaseEntity.h, common/BaseWorld.cpp, common/Setup.h,
common/Tick.h, common/operations.h, common/custom.cpp,
common/types.h, common/utility.cpp, common/utility.h,
modules/Location.h, physics/Vector3D.h, rulesets/BaseMind.cpp,
rulesets/Script.h, server/EntityFactory.h:
Clean up the dependency trees using more forward declarations.
* common/inheritance.cpp, common/inheritance.h:
Move most of the implementation into the .cpp file as its
not suited to inlining.
* rulesets/MemMap.cpp, rulesets/MemMap.h, rulesets/MemMap_methods.h:
Move contents of MemMap_methods.h into the .cpp file, as it is
not suited to inlining, and remove the file from the build.
* Use " instead of < when including application headers.
* Re-work the interface between server and worldrouter objects
so that the are less tied together, and more flexible.
* ALL: Cleaned up headers into correct order.
* common/log.h, common/log.cpp: Write some logging code which
handles message of different types using syslog or standard
error, depending on whether we are running as a daemon.
* ALL: Switched to using log() for all output.
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>
* 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>
be loaded into the database.
* tools/cycmd.cpp: Cleaned up usage and help functions.
* tools/cyisoload.cpp: Cleaned up usage(), and made sure build
completes okay if libraries are missing, and missing
functionality is reported to the user.
* server/server.cpp: Added config options that specifies that
the contents of the db should loaded on server startup. Cleaned
up some debug code.
* server/WorldTime.cpp, server/WorldRouter.cpp,
server/Connection.cpp, rulesets/Structure.h,
rulesets/Python_API.cpp, rulesets/Py_WorldTime.cpp,
rulesets/Movement.cpp, rulesets/Entity.cpp,
physics/Vector3D.h, common/persistance.cpp,
common/database.h, common/database.cpp: Removed output either
to debug mode, or removed altogether.
* common/BaseEntity.h, common/BaseEntity.cpp: Removed redundant header
includes.
* server/ServerRouting.cpp, common/persistance.h,
common/persistance.cpp: Modified admin account function names it
fit convention.
* module/Location.h: Fixed collision detection so that entities
with velocity set to 0 still get checked.
* rulesets/Entity.cpp, rulesets/Thing.cpp, rulesets/Character.cpp,
rulesets/BaseMind.cpp, rulesets/Creator.cpp,
rulesets/ExternalMind.cpp, rulesets/Food.cpp, rulesets/MemMap.cpp,
rulesets/Movement.cpp, rulesets/Pedestrian.cpp, rulesets/Plant.cpp,
rulesets/Py_Location.cpp, rulesets/Py_*.cpp, rulesets/World.cpp:
Removed unnecessary #includes.
Al Riddoch <alriddoch@zepler.org>
server/Account.cpp, rulesets/Entity.h, rulesets/Entity.cpp,
rulesets/Character.h, rulesets/Character.cpp, rulesets/BaseMind.h,
rulesets/BaseMind.cpp, common/types.h, common/operations.h,
common/op_switch.h, common/BaseEntity.h, common/BaseEntity.cpp:
Added support for imaginary operations used in a similar way
to emoting.
* server/WorldTime.h: Added update method so underlying DataTime
can be updated.
* server/ServerRouting.h, server/Lobby.h, server/Lobby.cpp
server/ServerRouting.cpp, server/Connection.h,
server/Connection.cpp, server/Account.h, server/Account.cpp: Added
a lobby object which handles lobby chat. Essentially it stores
a list of accounts and allows operations to be sent or broadcast
to other accounts.
* rulesets/Py_WorldTime.cpp: Added python is_now() method because
using comparison does not appear to work.
* rulesets/BaseMind.cpp: Added updating of minds WorldTime each
time an operation is received.
* modules/DateTime.h: Added operator << so DateTime can be sent
to cout.
* common/types.h: Added types for storing accounts in Lobby.
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>
* */*: 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)
to network classes.
* server/CommServer.h, server/WorldRouter.h, server/ServerRouting.cpp:
Added fields to server entity for number of players and uptime
in seconds.
* Started implementation of WorldTime class for processing of calendric
time.
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
* Throughout entire code base:
Removed all obsolete code and commented out code relating to porting
from python. Removed interim data types bad_type and None. Added
const throughout where apropriate. Change various flags to bool
type. Removed unused members.
* Added TODO list.
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
off using debug flags.
* Added halt_time, which is number of seconds server should run before
it exits.
* Cleaned a bunch if the remaining memory leaks.
* Cleaned up the way time is handled.
* More tweaks to Python code and API to get Acorn working.
* Inlined some methods into the class definitions, for performance.
* Updated movement code to sort out setting mode properlly, and
deal with stuttering NPC movement.
This is quite a big commit, and most of Acorn now works. Performance seems
to be good too.
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