* common/Database.cpp, common/globals.cpp, common/id.cpp,
common/log.cpp, modules/DateTime.cpp, rulesets/Container.h,
rulesets/Statistics.h, server/CommListener.cpp,
server/CommServer.cpp, tools/cyconfig.cpp, tools/cyconvertrules.cpp:
Add includes required for recent compilers which include less
stuff implicitly in standard headers.
* 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:
* server/CommListener.cpp, server/CommPeerListener.cpp,
server/CommUnixListener.cpp:
Use closesocket to close sockets, so that it works on systems
which do not use the same namespace for files and sockets.
Use typedefs provided by skstream to ensure platform neutral
handling of socket related types. Disable code that stores
presentation version of client address on systems which don't
have inet_ntop.
* server/CommServer.cpp: Use skstream to get the right header
for select system call, and use skstream typedefs.
* server/WorldRouter.cpp: Use common/system.h to get getimeofday
on systems which don't provide it.
* server/CommServer.cpp: Remove FIXME and replace with comments
explaining the choice of value for epoll_create(). Check if
epoll_wait is returning the maximum events possible, so we know
if we should enlarge the array.
* physics/BBox.cpp: Re-core squareBoxSize() to be much more efficient.
* server/CommServer.cpp: Don't report "Interrupted System Call" as
an error from epoll_wait, as its always happening.
* tools/Makefile.am: Add pthread library to static link libs for
database using tools.
* server/Idle.h, server/Idle.cpp: Rename reference to CommServer
so there is no ambiguity in classes which inherit from Idle
and CommSocket.
* server/CommServer.h, server/CommServer.cpp: Store the current
time, and a flag indicating if the server is currently handling
client traffic. Modify idle handlers so they are only
called if the server is not busy with internal traffic, or traffic
from clients. Check for errors returned by epoll().
* server/CommUnixListener.cpp, server/CommListener.cpp,
server/CommClient.h, server/CommClient.cpp: Make CommClient an
idler, and use it to track clients which connect but don't
negotiate, disconnecting them after a timeout.
* common/BaseWorld.h, server/CommServer.cpp, server/ServerRouting.cpp,
server/ServerRouting.h, server/ServerRouting_methods.h,
server/WorldRouter.cpp, server/WorldRouter.h: Clean up the way the
idle functions work, reducing the number of calls to time related
system calls.
* common/log.cpp, common/log.h: Add a new logging function to log
errors from libc.
* server/CommListener.cpp, server/CommServer.cpp: Use new function
rather than perror for logging libc errors.
* common/utility.cpp: Add a FIXME note about more correctly
converting a message to an op.
* server/CommClient.h, server/CommClient.cpp: Call new shutdown()
method in skstream instead of close when disconnecting or
timing out, so that the socket is still valid. Otherwise
there is no reliable way to detect that the socket is no longer
connected.
* server/CommClient.h, server/CommClient.cpp, server/Account.cpp,
server/Connection.h, server/Connection.cpp: Rename close() to
disconect() to more accuratly reflect its function.
* server/CommServer.h, server/CommServer.cpp: Add an implementation
based on epoll which is used if available. Much more efficient
and scalable.
* tools/cycmd.cpp: Fix a couple of memory leaks.
* server/CommListener.cpp,
server/CommMetaClient.cpp, server/CommMetaClient.h,
server/CommPSQLSocket.cpp, server/CommPSQLSocket.h
server/CommServer.cpp, server/CommServer.h,
server/CommUnixListener.cpp, server/server.cpp:
Replace CommIdleSocket with pure virtual inferface Idle,
and use multiple inheritance in classes which are both sockets
and idlers. Rename add() in CommServer to make its function cleaner,
and move its implementation into the cpp file in preparation for
a more powerful CommServer implementation.
* rulesets/Entity.cpp, rulesets/MemMap.cpp: Modify FIXME text so
its clearer which ones are part of the same problem.
* rulesets/Thing.cpp: Use a Delete pointer for a Delete operation.
* server/CommServer.cpp, server/CommServer.h: Change references
to clients into sockets. Remove unused version of removeSocket()
which takes an error message.
* common/FormattedXMLWriter.h: Add some notes about converting this
class for use with any Atlas codec.
* server/CommClient.h, server/CommIdleSocket.h, server/CommServer.cpp,
server/CommServer.h, server/CommSocket.h, server/ServerRouting.h,
server/WorldRouter.cpp:
Improve the names of some typedefs and clean up some comments.
* server/WorldRouter.h: Remove declaration of obsolete unimplemented
setSerialno() member function.
* common/BaseWorld.h, server/CommServer.cpp, server/CommServer.h,
server/ServerRouting.cpp, server/ServerRouting.h,
server/ServerRouting_methods.h, server/WorldRouter.cpp,
server/WorldRouter.h: Modify idle to return if there are ops due
so that select can be called with zero timeout. Server now processes
op as quickly as possible and hopefully is still responsive.
* server/CommSocket.h, server/CommUnixListener.cpp,
server/CommUnixListener.h, server/CommServer.cpp,
server/CommMetaClient.cpp, server/CommMetaClient.h,
server/CommListener.cpp, server/CommListener.h,
server/CommClient.cpp, server/CommClient.h:
Add a new dispatch method to the socket interface, delaying
dispatch of incoming data until after it has been read, so that
a write timeout cannot occur during reading.
* server/Lobby.cpp: Add some debugging messages.
* server/CommServer.cpp: Tweak select loop so that closed connections
are cleaned up as soon as they are detected.
* rulesets/World.cpp: Make demo terrain a bit more mountainous.
* Convert entire codebase over to using Atlas-C++ 0.4.90, as
start of transition to 0.6 API.
* 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.
* common/Database.h: Declaration for register relations.
* server/Account.cpp, server/Account.h, server/Admin.cpp,
server/Admin.h, server/Connection.cpp, server/Player.cpp,
server/Player.h, server/ServerRouting.cpp,
server/ServerRouting.h: Properlly separate username and id from
account, and use the database code to assign numerical ids to
account objects. Eliminate extraneous member variables in account.
* server/CommClient.cpp, server/CommServer.cpp,
server/CommServer.h, server/server.cpp:
Eliminate storing server name string twice.
* common/BaseEntity.cpp, common/BaseEntity.h, rulesets/Character.cpp,
rulesets/Food.cpp, rulesets/Thing.cpp, rulesets/World.cpp:
Add arg to error method specifying where the error should go. Use
this arg to ensure that errors don't get broadcast.
* common/Database.cpp, common/Database.h, common/const.cpp,
server/Persistor.cpp, server/Restoration.cpp,
server/WorldRouter.cpp
Change id and loc column in entity tables to integer for
performance. Add id generator sequence to database
* common/Database.cpp, common/Database.h, server/Persistance.cpp,
server/Persistance.h: Remove old legacy world, mind and server
tables as they are no longer used.
* common/BaseEntity.cpp, common/Load.h, common/Save.h,
common/custom.cpp, common/op_switch.h, common/operations.cpp,
common/operations.h, common/types.h, rulesets/BaseMind.cpp,
rulesets/BaseMind.h, rulesets/Character.cpp, rulesets/Character.h,
server/Admin.cpp, server/Admin.h, server/server.cpp,
tools/cycmd.cpp: Remove Load and Save ops.
* rulesets/Area.cpp, rulesets/Character.cpp, rulesets/Line.cpp,
rulesets/Plant.cpp: Fix != to |= when setting update flags.
* server/CommMetaClient.cpp, server/CommMetaClient.h,
server/CommServer.cpp, server/CommServer.h, server/server.cpp:
Add mechanism for sockets to be called whenever the server
is idle, so that they do period things. Use this mechanis,
to handle sending periodic packets to the metaserver, removing
special case code from CommServer.
* server/CommClient.cpp, server/CommServer.cpp, server/CommServer.h,
server/ServerRouting.cpp, server/ServerRouting.h,
server/server.cpp: Change the way main server object are created
to be more logical.
* Increment to devel version 0.3, and start breaking things.
* server/CommClient.cpp, server/CommClient.h, server/CommServer.cpp,
server/CommServer.h, server/server.cpp, server/CommListener.cpp,
server/CommListener.h, server/CommMetaClient.cpp,
server/CommMetaClient.h, server/CommSocket.cpp, server/CommSocket.h:
Refactor network code so metaserver and listen socket are no longer
special cases, opening up the way for a database connection handler.
* 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.
* server/CommClient.cpp, server/CommServer.cpp: Move exception
handling into the read method, and ensure correct handling
of the reading flag.
* server/CommClient.h: Fix exception constructor to be
ISO compliant.
* server/CommServer.cpp, server/CommClient.h, server/CommClient.cpp:
Experimental version of a more comprehensive way to handle
client write timeouts, and a possible way to handle traffic
shaping in future.
* tools/cyloadrules.cpp, server/server.cpp,
aiclient/ClientConnection.cpp, client/ClientConnection.cpp,
common/inheritance.h: Use const iterators and references
whenever possible.
* client/CommClient.cpp, client/CreatorClient.cpp,
client/ObserverClient.cpp, client/Py_CreatorClient.cpp,
common/BaseEntity.cpp, common/BaseEntity.h,
common/types.h, rulesets/Area.cpp, rulesets/BaseMind.cpp,
rulesets/Character.cpp, rulesets/Entity.cpp,
rulesets/Food.cpp, rulesets/Line.cpp,
rulesets/MemMap.cpp, rulesets/Pedestrian.cpp,
rulesets/Plant.cpp, rulesets/Py_Mind.cpp,
rulesets/Py_Object.cpp, rulesets/Py_Thing.cpp,
rulesets/Python_API.cpp, rulesets/Stackable.cpp,
rulesets/Thing.cpp, rulesets/World.cpp,
server/Account.cpp, server/Admin.cpp, server/CommClient.cpp,
server/CommServer.cpp, server/Connection.cpp,
server/EntityFactory.cpp, server/Lobby.cpp,
server/Persistance.cpp, server/Player.cpp,
server/ServerRouting.cpp, server/WorldRouter.cpp:
Switch to using Fragment as name for Atlas::Message::Object,
to avoid name clashes on Object.
* common/BaseEntity.h: Make BaseEntity inherit from SigC::Object,
so signals and callbacks can be used, and add destroyed
signal.
* common/accountbase.h, physics/BBox.h, physics/Quaternion.h,
physics/Vector3D.h, rulesets/MemMap_methods.h,
rulesets/Movement.cpp, rulesets/Plant.h,
rulesets/Py_Operation.cpp, rulesets/PythonMindScript.cpp,
rulesets/PythonThingScript.cpp, rulesets/Script.cpp,
common/inheritance.cpp: Cleaned up Atlas::Message::Object
use, and excessive use of "using ...".
* rulesets/Movement.h, rulesets/Pedestrian.h:
Use forward declarations rather than including Move.h
* server/Account.cpp, server/Account.h, server/Connection.cpp,
server/Connection.h: Use destroyed signal to ensure references
to in game entities are removed when those entities are
destroyed. Ensure Connection is only destroyed once.