Since we're targetting the latest LTS release of Ubuntu as a nice
baseline, and that currently only supports 1.46, we need to remove the
nice steady_timer code. For now.
This commit should probably be reverted once a newer version of Ubuntu
LTS is available.
This required cleaning up a bunch of other things:
Expose functions to disconnect and flush sockets generally
Make a new base class for objects that link a socket to the server
* configure.ac: Add a check for res_init().
* server/CommMetaClient.cpp, server/CommMetaClient.h: Refactor
the metaserver related code so it retries resolving the address
of the metaserver, and then uses the address established later
than init time. This provisionally fixes bug #283763 which was
that cyphesis would never talk to the metaserver if the name
resolution at startup failed.
* server/server.cpp: Modify the way MetaClient is set up as it
is now not an open socket after initial setup.
* server/CommMetaClient.cpp: Get rid of the header file for metaserver
protocol constants, as it is not consistently licensed with the rest
of the code.
* server/protocol_instructions.h, server/Makefile.am: Remove the
obsolete metaserver protocol header from the build.
* server/CommMetaClient.cpp: Fix eof() to check for the correct
condition on the socket stream, and ensure that decoding message
from the metaserver is aborted if the message is shorter than
expected. This should fix a tight loop bug which occurs when
there is a problem with metaserver communication.
* 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.
* common/BaseWorld.h, server/CommSocket.h, server/CommIdleSocket.h:
Make constructors of some base classes protected.
* server/Account.cpp: Note a possible bug in the character
creation code.
* server/CommIdleSocket.cpp, server/CommIdleSocket.h,
server/CommListener.cpp, server/CommListener.h,
server/CommLocalClient.cpp, server/CommMetaClient.cpp,
server/CommMetaClient.h, server/CommPSQLSocket.cpp,
server/CommPSQLSocket.h, server/CommRemoteClient.cpp,
server/CommSocket.cpp, server/CommSocket.h,
server/CommUnixListener.cpp, server/CommUnixListener.h:
Clean up the Comm classes for consistancy and readability.
* 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/server.cpp: Handle the case correctly if the metaserver
socket setup does not work.
* server/CommMetaClient.h, server/CommMetaClient.cpp: Re-write
CommMetaClient to use skstreams udp_socket_stream.
* server/Persistance.cpp, server/Restoration.cpp: Use DatabaseResult
clear() method to free result objects.
* server/CommMetaClient.cpp: Free address info in the event of a socket
failure.
* 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/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/CommMetaClient.cpp: Correctly initialise the size of
the from address structure.
* server/EntityFactory.cpp: Delete persistor connection once
its been used.
* server/EntityFactory.h: Ensure constructor is explicit.
* 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.