Commit graph

198 commits

Author SHA1 Message Date
Alistair Riddoch
693012e188 No need to specialize this template explicitly 2012-03-05 14:15:34 +00:00
Alistair Riddoch
6213337fd3 Clear up the dependencies 2012-03-05 09:31:33 +00:00
Alistair Riddoch
3959902f9f Use ConnectedRouter base to disconnect all OOG objects, including Junctures 2010-12-13 17:41:16 +00:00
Alistair Riddoch
b066d282ba Remove a bunch of verbose logging that looked to be for debugging purposes 2010-11-30 21:51:20 +00:00
Alistair Riddoch
83aac508c5 Add account type to logins and account creation 2010-11-30 21:46:13 +00:00
Alistair Riddoch
217459c9ef Always pass in integer ID when creating objects. 2010-11-26 16:07:29 +00:00
Manohar Vanga
8518c55e47 Added some logging info to detect successful login's 2010-08-17 11:58:16 +05:30
Alistair Riddoch
cff38a9866 Add a null pointer check. 2009-12-05 23:03:23 +00:00
Alistair Riddoch
566fe35d73 Remove some debug output. 2009-12-03 19:12:19 +00:00
Alistair Riddoch
cf404ba5eb Restructure the vtable of Connection to make it easier to override accounts. 2009-12-01 17:31:11 +00:00
Alistair Riddoch
db0835d895 Use Account pointers, as accounts may be no Players. 2009-12-01 17:18:00 +00:00
Alistair Riddoch
31f25ff48c Modify the account creation interface so it is more flexible. 2009-11-24 13:18:33 +00:00
Alistair Riddoch
2b9eeaacca Make username and password protected, and use accessors. 2009-11-24 13:13:54 +00:00
Alistair Riddoch
a86eca9964 Add some code to allow the type of account to be specified. 2009-11-24 13:09:54 +00:00
Alistair Riddoch
edf8e42e37 Remove long obsolete support for very old client implementations. 2009-11-24 13:00:45 +00:00
Alistair Riddoch
8ba22660c1 Move storing new accounts into the server code too. 2009-11-24 11:46:16 +00:00
Alistair Riddoch
f9315cf8c1 Move querying the database for accounts into ServerRouting. 2009-11-24 11:19:50 +00:00
Alistair Riddoch
ffd019a744 Correct the spelling of persistence. 2009-03-24 03:08:45 +00:00
Alistair Riddoch
cd1f42c3f9 Rename Inheritance class files to match class name. 2009-03-20 15:31:38 +00:00
Al Riddoch
ab54d0fea2 2009-02-02 Al Riddoch <alriddoch@googlemail.com>
* common/Identified.cpp, common/Identified.h:
	  Flatten down the base classes into one called Router.

	* client/CharacterClient.cpp, client/CreatorClient.cpp,
	  rulesets/BaseMind.cpp, rulesets/Character.cpp,
	  rulesets/Creator.cpp, rulesets/Entity.cpp,
	  rulesets/LocatedEntity.cpp, rulesets/MemEntity.cpp,
	  rulesets/Plant.cpp, rulesets/Stackable.cpp,
	  rulesets/Thing.cpp, rulesets/World.cpp,
	  server/Account.cpp, server/Admin.cpp,
	  server/Connection.cpp, server/ExternalMind.cpp,
	  server/Lobby.cpp, server/Master.cpp,
	  server/Peer.cpp, server/Player.cpp,
	  server/ServerRouting.cpp, server/SlaveClientConnection.cpp,
	  server/TrustedConnection.cpp, tests/LocatedEntitytest.cpp,
	  tests/ThingupdatePropertiestest.cpp: Update all the operation
	  routing classes to use the modified base class correctly.
2009-02-02 02:28:45 +00:00
Al Riddoch
43693a25e3 2008-12-10 Al Riddoch <alriddoch@googlemail.com>
* server/ExternalMind.h, server/ExternalMind.cpp: Improve the
	  interface to make it cleaner, and add a way to track the time
	  at which the character lost it's connection to the client.

	* server/Connection.cpp: Change to use the cleaner ExternalMind
	  interface.
2008-12-10 22:07:12 +00:00
Al Riddoch
bf598b933d 2008-12-10 Al Riddoch <alriddoch@googlemail.com>
* server/ExternalMind.h: Make all the member variables protected,
	  and create an API to expose as needed.

	* server/Connection.cpp: Update the code to use the interface to
	  interact with ExternalMind.
2008-12-10 20:08:49 +00:00
Al Riddoch
00d3a44fab 2008-12-10 Al Riddoch <alriddoch@googlemail.com>
* server/Connection.cpp: Remove some of the debug output.
2008-12-10 03:12:42 +00:00
Al Riddoch
40a3bd1018 2008-12-10 Al Riddoch <alriddoch@googlemail.com>
* common/Identified.cpp, common/Identified.h, rulesets/Character.h,
	  rulesets/LocatedEntity.h, server/Account.h, server/Admin.cpp,
	  server/CommClient.cpp, server/CommClient.h, server/Connection.cpp,
	  server/Connection.h, server/ExternalMind.h,
	  server/ExternalProperty.cpp, server/ExternalProperty.h,
	  server/Lobby.h, server/Master.h, server/Peer.h,
	  server/ServerRouting.h, server/SlaveClientConnection.h:
	  Rename IdentifiedRouter to Router as it's the base class
	  for pretty much all routers.
2008-12-10 01:16:37 +00:00
Al Riddoch
d40fcb0bd0 2008-12-09 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Creator.cpp: Remove code for removing Creators once
	  they've been disconnected, and simply mark them as ephemeral.

	* server/ExternalMind.h, server/ExternalMind.cpp: Change
	  the external mind so it stores a reference to the character it
	  is the mind for, and stores a pointer to the connection rather
	  than a reference so it can be nulled when the connection is
	  removed on unsubscribed. Implement removing an ephemeral avatar
	  character on disconnection.

	* server/Connection.cpp: Re-work the connection code to deal with
	  a character still having an external mind on connection, and not
	  removing the external mind at disconnection.
2008-12-09 04:07:14 +00:00
Al Riddoch
adc64c3ced 2008-01-28 Al Riddoch <alriddoch@googlemail.com>
* client/BaseClient.cpp, common/BaseEntity.cpp, common/BaseEntity.h,
	  common/Identified.cpp, common/Identified.h, common/Makefile.am,
	  common/OOGThing.cpp, common/OOGThing.h, common/OperationRouter.cpp,
	  common/OperationRouter.h, rulesets/Character.h, rulesets/Entity.h,
	  rulesets/LocatedEntity.cpp, rulesets/LocatedEntity.h,
	  server/Account.cpp, server/Account.h, server/Admin.cpp,
	  server/CommClient.cpp, server/CommClient.h, server/Connection.cpp,
	  server/Connection.h, server/ExternalMind.cpp, server/ExternalMind.h,
	  server/ExternalProperty.cpp, server/ExternalProperty.h,
	  server/Lobby.cpp, server/Lobby.h, server/Master.cpp, server/Master.h,
	  server/Peer.cpp, server/Peer.h, server/ServerRouting.cpp,
	  server/ServerRouting.h, server/SlaveClientConnection.cpp,
	  server/SlaveClientConnection.h: Factor out the more pointless base
	  classes, in favor of simple interface. Move destroyed signal to
	  Entity, which is the only place it is needed.
2008-01-28 23:48:30 +00:00
Al Riddoch
03a8bf7d4f 2008-01-17 Al Riddoch <alriddoch@googlemail.com>
* common/Identified.cpp, common/Identified.h: Add a new base class
	  which combines Identified with OperationRouter.

	* server/CommClient.cpp, server/CommClient.h: Modify CommClient to
	  refer to it's operation routing object purely by the OperationRouter
	  interface.

	* server/Connection.cpp, server/Connection.h,
	  server/TrustedConnection.cpp: Re-factor connection routers so
	  they no longer inherit from BaseEntity, and instead inherit
	  cleanly from the minimum required interfaces.
2008-01-18 15:26:44 +00:00
Al Riddoch
8169e158d2 2008-01-17 Al Riddoch <alriddoch@googlemail.com>
* server/Admin.cpp, server/Connection.cpp, server/Connection.h,
	  server/ServerRouting.cpp, server/ServerRouting.h: Use the much
	  simpler OperationRouter interface when handling routing operations
	  round the server.
2008-01-17 16:42:23 +00:00
Al Riddoch
b4c79181c5 2008-01-12 Al Riddoch <alriddoch@googlemail.com>
* common/BaseEntity.cpp, common/custom.cpp, common/inheritance.cpp,
	  common/inheritance.h, common/op_switch.h, common/types.h,
	  rulesets/Character.cpp, rulesets/Creator.cpp,
	  rulesets/PythonThingScript.cpp, server/Account.cpp,
	  server/Connection.cpp, server/ExternalMind.cpp,
	  tests/OOGThingtest.cpp, tests/inheritancetest.cpp:
	  Remove a set of pointless definitions, and use the originals
	  throughout the code.
2008-01-12 22:41:10 +00:00
Al Riddoch
41ce55e11e 2008-01-12 Al Riddoch <alriddoch@googlemail.com>
* common/OperationRouter.cpp, common/OperationRouter.h: Interface
	  class for objects when can handle or route operations.

	* common/BaseEntity.h, common/BaseEntity.cpp: Remove standard
	  implementation of operation handler, forcing class to provide
	  more specific implementations.

	* rulesets/LocatedEntity.h, rulesets/LocatedEntity.cpp: Add an
	  implementation of the OperationRouter interface, suitable for
	  IG operations.

	* server/ServerRouting.h, server/Peer.cpp, server/Peer.h,
	  rulesets/MemEntity.h: Add placeholder OperationRouter
	  implementations.

	* server/Connection.cpp: Update OperationRouter implementation to
	  be better suited.

	* server/Account.cpp, server/Account.h: Implement OperationRouter
	  for accounts.
2008-01-12 18:08:03 +00:00
Al Riddoch
bd3a9e153c 2007-11-28 Al Riddoch <alriddoch@zepler.org>
* client/BaseClient.cpp, client/CharacterClient.cpp,
	  client/CharacterClient.h, client/CreatorClient.cpp,
	  client/CreatorClient.h, rulesets/BaseMind.cpp, rulesets/BaseMind.h,
	  rulesets/Character.cpp, rulesets/Entity.cpp, rulesets/Entity.h,
	  rulesets/MindFactory.cpp, rulesets/MindFactory.h, rulesets/Thing.cpp,
	  rulesets/World.cpp, server/Account.cpp, server/Connection.cpp,
	  server/EntityFactory.cpp, server/Persistor.cpp,
	  server/Persistor_impl.h, server/Restorer_impl.h,
	  server/WorldRouter.cpp: Remove the hard name attribute, now that
	  most entities don't set it.
2007-11-28 20:22:42 +00:00
Al Riddoch
87ecdcad4b 2007-07-30 Al Riddoch <alriddoch@zepler.org>
* client/Py_CreatorClient.cpp, common/Database.cpp,
	  common/accountbase.cpp, common/system.cpp, rulesets/Character.cpp,
	  rulesets/Motion.cpp, rulesets/Plant.cpp, rulesets/Py_Location.cpp,
	  rulesets/Py_Mind.cpp, rulesets/Py_Operation.cpp,
	  rulesets/Py_Point3D.cpp, rulesets/Py_Statistics.cpp,
	  rulesets/Py_Task.cpp, rulesets/Py_TerrainProperty.cpp,
	  rulesets/Py_Thing.cpp, rulesets/Py_Vector3D.cpp,
	  rulesets/Py_WorldTime.cpp, rulesets/Python_API.cpp,
	  rulesets/TerrainProperty.cpp, server/Admin.cpp,
	  server/CommServer.cpp, server/Connection.cpp,
	  server/EntityFactory.cpp, server/WorldRouter.cpp,
	  tools/cycmd.cpp, tools/cyconvertrules.cpp, tools/cyctrl.cpp:
	  Remove unnecessary () from conditional expressions, where operator
	  binding is clear.
2007-07-30 18:12:50 +00:00
Al Riddoch
e7d031876e 2007-07-29 Al Riddoch <alriddoch@zepler.org>
* common/log.cpp, common/log.h, common/BaseEntity.cpp,
	  common/BaseEntity.h: Switch to taking a C++ string reference rather
	  than a char *, for the rest of the logging and error related
	  calls.

	* common/Database.cpp, common/log.cpp, common/log.h,
	  rulesets/PythonMindScript.cpp, server/Account.cpp,
	  server/Admin.cpp, server/Connection.cpp, server/Player.cpp,
	  tools/cyisoload.cpp: Convert over to using the new API correctly.
2007-07-29 12:22:58 +00:00
Al Riddoch
2069f3dd4c 2007-07-29 Al Riddoch <alriddoch@zepler.org>
* 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:
2007-07-29 03:33:33 +00:00
Al Riddoch
8c336bc66f 2007-02-20 Al Riddoch <alriddoch@zepler.org>
* common/globals.cpp, common/globals.h: Add a config flag
	  to control whether database code is enabled.

	* server/EntityFactory.cpp, server/EntityFactory.h,
	  server/PersistantThingFactory.cpp, server/PersistantThingFactory.h,
	  server/PersistantThingFactory_impl.h, server/Persistor.cpp:
	  Re-work the persistence code so that persistent or non-persistent
	  versions of entity factories are installed at startup, removing
	  the need to check whether the database is enabled during
	  runtime.

	* common/newid.cpp, server/Connection.cpp, server/server.cpp:
	  Replace the const that used to control whether the database
	  was used with the config flag.
2007-02-20 00:52:41 +00:00
Al Riddoch
72125ffd44 2007-01-17 Al Riddoch <alriddoch@zepler.org>
* server/Connection.cpp: Remove some debugging output.
2007-01-17 23:12:21 +00:00
Al Riddoch
6e5ca40d72 2007-01-17 Al Riddoch <alriddoch@zepler.org>
* rulesets/Entity.h, rulesets/Entity.cpp: Set argument names on
	  some methods. Add a new method allowing a property to be set
	  externally.

	* server/ExternalProperty.cpp, server/ExternalProperty.h: Add a new
	  property which reflects whether an entity is connected to the
	  outside world via an external mind.

	* server/Connection.cpp, server/Connection.h: Add a new method which
	  hooks up an avatar to the connection, installing an ExternalProperty
	  if necessary.

	* server/Account.cpp: Use the new Connection method to hook up
	  existing avatars.
2007-01-17 23:00:56 +00:00
Al Riddoch
73e636a85b 2007-01-17 Al Riddoch <alriddoch@zepler.org>
* server/Account.cpp: Fix the name of character inventory items.

	* server/Connection.cpp: Stop any movement when the client
	  disconnects.
2007-01-17 10:04:14 +00:00
Al Riddoch
9a56dac06c 2006-10-26 Al Riddoch <alriddoch@zepler.org>
* Add RCS Id keywords to every file, for better version tracking.
2006-10-26 00:48:00 +00:00
Al Riddoch
c0f8184395 2006-08-07 Al Riddoch <alriddoch@zepler.org>
* server/Connection.h, server/Connection.cpp: Change disconnectObject
	  to removePlayer to make it clearer what the return value means,
	  and return a pointer to the removed object if it is a player account.

	* server/Connection.cpp: When removing an account which has been
	  logged out, remove all its characters which are not currently in
	  use from the connections list.
2006-08-07 15:57:22 +00:00
Al Riddoch
d9bbee6d40 2006-08-07 Al Riddoch <alriddoch@zepler.org>
* server/Connection.h, server/Connection.cpp: Move the code that
	  decouples an object from the subscribed connection into its
	  own function, so the same code is invoked from two different
	  places.
2006-08-06 23:37:01 +00:00
Al Riddoch
60c62e2d86 2006-06-26 Al Riddoch <alriddoch@zepler.org>
* rulesets/Entity.cpp, server/Account.cpp, server/Admin.cpp,
	  server/Connection.cpp, server/EntityFactory.h,
	  server/Persistor_impl.h, tools/cycmd.cpp:
	  Switch from using deprecated sigc++ 1.2 headers to the right
	  sigc++ 2.0 equivalents.
2006-06-26 16:49:25 +00:00
Al Riddoch
07da807b3b 2006-06-06 Al Riddoch <alriddoch@zepler.org>
* common/BaseEntity.cpp, rulesets/Character.cpp, rulesets/Creator.cpp,
	  server/Account.cpp, server/Admin.cpp, server/Connection.cpp,
	  server/Lobby.cpp, server/WorldRouter.cpp: Don't bother with serial
	  numbers on ops generated inside the server. They just leak and upset
	  clients.
2006-06-07 00:13:39 +00:00
Al Riddoch
4bfb14f060 2006-06-05 Al Riddoch <alriddoch@zepler.org>
* server/Connection.cpp, server/CommClient.cpp, server/Account.cpp:
	  Only set refnos on ops if the client has set a serial number.

	* rulesets/Character.cpp: Simplify handling the transfer of
	  operations from client to in-game. Don't give new operations
	  serial numbers at this point.
2006-06-05 12:57:29 +00:00
Al Riddoch
8031c1e470 2006-05-23 Al Riddoch <alriddoch@zepler.org>
* server/Connection.cpp: Remove debug output.
2006-05-23 01:33:53 +00:00
Al Riddoch
0399017f5b 2006-05-16 Al Riddoch <alriddoch@zepler.org>
* server/Connection.cpp: Don't remove characters from the connection
	  when they are logged out.
2006-05-16 23:11:08 +00:00
Al Riddoch
222cf66384 2006-05-16 Al Riddoch <alriddoch@zepler.org>
* server/Connection.cpp; Fix the wrong dynamic cast.
2006-05-16 22:03:38 +00:00
Al Riddoch
edd4d0a5ec 2006-05-16 Al Riddoch <alriddoch@zepler.org>
* server/Connection.cpp: Slightly simplify the code that handles
	  subscribing character entities to a connection.
2006-05-16 21:55:53 +00:00
Al Riddoch
8b38db23cc 2006-05-16 Al Riddoch <alriddoch@zepler.org>
* common/system.cpp: Return 0 on security check fail, as -1 is
	  signed.

	* server/Connection.cpp: Re-order logging messages so that messages
	  reflect the fact the a broken connection occurs before the
	  subscriptions associated with that connection can be dropped.
	  Implement logging out just specific objects without closing the
	  connection.
2006-05-16 21:44:26 +00:00
Al Riddoch
a884fa4866 2006-05-06 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp, common/newid.cpp, server/server.cpp:
	  Modify new ID checks so that code still runs when database is
	  unavailable, and events requiring new IDs fail cleanly.

	* server/Connection.cpp: Report a failure to create a player
	  account if no ID available.

	* rulesets/BaseMind.cpp: When processing appearance ops, handle
	  stamp more efficiently, report an error if ID is missing
	  from argument.

	* server/IdlePSQLConnector.cpp, server/IdlePSQLConnector.h:
	  Implement re-connecting to the Database if connection is lost.

	* rulesets/Character.cpp, rulesets/Entity.cpp, rulesets/Thing.cpp:
	  Ensure STAMP is present on appearance op args.

	* server/CommListener.cpp, server/CommListener.h,
	  server/CommPeerListener.cpp, server/CommPeerListener.h,
	  server/CommSlaveListener.cpp, server/CommSlaveListener.h,
	  server/CommUnixListener.cpp, server/CommUnixListener.h:
	  Add a return value to method for creating new client socket
	  objects, and use it to return failure if no ID is available
	  from the database for a new object.

	* rulesets/Py_Point3D.cpp, rulesets/Py_Vector3D.cpp,
	  rulesets/Python_API.cpp: Add "new" method for class wrappers, and
	  call the in place constructor from new rather than init. Re-write
	  internal function for creating new instances so it uses the "new"
	  method.

	* rulesets/Py_Statistics.cpp: Remove some obsolete code inadvertedly
	  copied from another file. Comment out some unused code to get rid
	  of a warning.

	* server/CommPSQLSocket.cpp: Clear the database connection from
	  destructor.

	* tests/python_class.cpp: A new test for experimenting with new
	  Python wrappers.
2006-05-06 21:36:57 +00:00