Commit graph

190 commits

Author SHA1 Message Date
Alistair Riddoch
208f553f04 Move the functionality for loading rule data, and configuring into Ruleset. 2009-08-19 02:47:15 +01:00
Alistair Riddoch
f1f6fb8ed2 Move restricted option to new mechanism. 2009-04-09 00:27:11 +01:00
Alistair Riddoch
e4be4eed46 Move more options to the new dynamic mechanism. 2009-04-09 00:13:15 +01:00
Alistair Riddoch
670c09f990 Move metaserver boolean option to the new mechanism. 2009-04-08 21:56:24 +01:00
Alistair Riddoch
61d57f84b7 Move socket config options to the new mechanism. 2009-04-08 21:22:19 +01:00
Alistair Riddoch
86210acd97 Move CommServer setup into its own function. 2009-04-08 09:46:04 +01:00
Alistair Riddoch
617f66dbef Convert trial option peer_port to the new machanism. 2009-04-08 02:21:54 +01:00
Alistair Riddoch
8e91087bef Correct the section of the httpport option 2009-04-08 02:02:44 +01:00
Alistair Riddoch
521b8fdf09 Add new inlined config options system inspired by gflags 2009-04-07 23:17:49 +01: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
84c1a94412 Rename files for EntityBuilder from EntityFactory to match the class rename. 2009-03-12 00:50:25 +00:00
Al Riddoch
6d38e8f9d4 2009-02-09 Al Riddoch <alriddoch@googlemail.com>
* server/server.cpp: Switch the python listener over to using a
	  unix socket using the configuration setting.
2009-02-09 05:41:27 +00:00
Al Riddoch
ac7665e3c0 2009-01-30 Al Riddoch <alriddoch@googlemail.com>
* server/CommClientFactory.cpp, server/CommClientFactory.h,
	  server/server.cpp: Add in test support for the python client.
2009-01-30 00:43:41 +00:00
Al Riddoch
e3858e1c36 2009-01-29 Al Riddoch <alriddoch@googlemail.com>
* server/CommClientFactory.cpp, server/CommClientFactory.h: Add a
	  new factory for http client objects.

	* server/CommStreamListener.cpp, server/CommStreamListener.h:
	  Move the client factory behavior into this base class
	  as all listners will now be using it.

	* server/CommTCPListener.cpp, server/CommTCPListener.h,
	  server/CommUnixListener.cpp, server/CommUnixListener.h:
	  Require a client factory reference and pass to the base class
	  which uses it.

	* server/Makefile.am: Remove obsolete special purpose listeners.

	* server/server.cpp: Use straight TCP listeners for everything
	  as no special purpose listener functionality is required any more.
2009-01-29 16:26:25 +00:00
Al Riddoch
af0b5cb7e3 2009-01-28 Al Riddoch <alriddoch@googlemail.com>
* server/CommListener.cpp, server/CommListener.h,
	  server/server.cpp: Rename class to CommAtlasListener.
2009-01-28 15:56:14 +00:00
Al Riddoch
61415545d8 2009-01-28 Al Riddoch <alriddoch@googlemail.com>
* server/CommPeer.h, server/CommPeer.cpp: Re-factor CommPeer to
	  only be used for initiating peer connections.

	* server/Admin.cpp: Use the modified CommPeer constructor.

	* server/CommClient.h, server/CommClient.cpp: Make the connection
	  a pointer rather than a reference, and pass it in during setup.

	* server/CommClientFactory.h, server/CommClientFactory.cpp: Re-factor
	  the commclient factory to take connection type as a template param,
	  and create the client and connection objects separately.

	* server/server.cpp: Use the modified CommClientFactory parameter.

	* server/Makefile.am: Remove the different kinds of client class
	  from the build.
2009-01-28 02:21:29 +00:00
Al Riddoch
cb3c3033bd 2009-01-28 Al Riddoch <alriddoch@googlemail.com>
* server/CommLocalClient.cpp, server/CommLocalClient.h: Fix the
	  constructor interface to match that used by the factory.

	* server/CommClientFactory.cpp: Add support for CommLocalClient.

	* server/CommUnixListener.cpp, server/CommUnixListener.h:
	  Convert the unix listener to use the CommClientFactory to remove
	  duplicated code.

	* server/server.cpp: Use the new style of listener API on the unix
	  socket.
2009-01-28 01:24:57 +00:00
Al Riddoch
f30deb46d8 2009-01-28 Al Riddoch <alriddoch@googlemail.com>
* server/CommListener.cpp, server/CommListener.h: Refactor from
	  a template to a regular class that uses the factories.

	* server/server.cpp: Fix usage of CommListener.
2009-01-28 00:54:13 +00:00
Al Riddoch
662b098aaf 2009-01-27 Al Riddoch <alriddoch@googlemail.com>
* server/CommListener.h, server/CommListener.cpp: Make the
	  Atlas listener a template for handling the various types
	  of socket to use.

	* server/server.cpp: Use the CommListener template correctly.

	* server/CommPeerListener.cpp, server/CommPeerListener.h,
	  server/Makefile.am: Remove the obsolete explicit peer listener
	  from the build.
2009-01-27 23:46:20 +00:00
Al Riddoch
6d690a1157 2009-01-15 Al Riddoch <alriddoch@googlemail.com>
* server/server.cpp: Add commented out code to set up the
	  UpdateTester.
2009-01-15 18:48:20 +00:00
Al Riddoch
b3e38c4ca6 2008-12-11 Al Riddoch <alriddoch@googlemail.com>
* server/server.cpp: Improve the message on a security check failure.
2008-12-11 18:34:13 +00:00
Al Riddoch
245a2e954d 2008-11-17 Al Riddoch <alriddoch@googlemail.com>
* server/server.cpp: Add the call to the storage system restoring
	  the world.
2008-11-17 18:13:05 +00:00
Al Riddoch
8f7d5ec937 2008-11-17 Al Riddoch <alriddoch@googlemail.com>
* server/server.cpp: Use the variable for the default instance
	  name.
2008-11-17 01:24:15 +00:00
Al Riddoch
c0756531ad 2008-11-09 Al Riddoch <alriddoch@googlemail.com>
* server/server.cpp: Improve error reporting, and add settings
	  information to most of the socket failure errors.
2008-11-09 06:21:14 +00:00
Al Riddoch
67a9d94314 2008-11-03 Al Riddoch <alriddoch@googlemail.com>
* common/system.cpp, common/system.h: Add security_init(), a
	  function to initialise any security or crypto related libraries
	  used. This is required by recent version of libgcrypt when
	  using hash functions.

	* server/server.cpp, tests/systemtest.cpp, tools/cypasswd.cpp:
	  Call security_init() in all programs that use security related
	  functions.
2008-11-03 17:12:31 +00:00
Al Riddoch
014b2095ba 2008-10-27 Al Riddoch <alriddoch@googlemail.com>
* 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.
2008-10-27 00:53:29 +00:00
Al Riddoch
cd99b94e91 2008-08-29 Al Riddoch <alriddoch@googlemail.com>
* server/CommHttpListener.cpp, server/CommHttpListener.h: New
	  class to listen for http connections.

	* server/CommHttpClient.cpp, server/CommHttpClient.h: New class to
	  handle http requests.

	* server/server.cpp: Hack in a http listen socket on 6780.
2008-08-29 13:03:21 +00:00
Al Riddoch
e3aafac169 2008-08-25 Al Riddoch <alriddoch@googlemail.com>
* server/StorageManager.cpp, server/StorageManager.h,
	  server/servery.cpp: Add a stub function to be used to bootstrap
	  world persistence.
2008-08-25 15:47:11 +00:00
Al Riddoch
4b7b7c6ccc 2008-08-22 Al Riddoch <alriddoch@googlemail.com>
* server/IdleConnector.cpp, server/IdleConnector.h: A generic sigc++
	  based class for functions which need to be called regularly.

	* server/StorageManager.cpp, server/StorageManager.h: Add a method
	  to be called once a second from the idler.

	* server/server.cpp: Hook the idler up to storage manager.
2008-08-22 18:59:06 +00:00
Al Riddoch
ea6fda8fcd 2008-08-17 Al Riddoch <alriddoch@googlemail.com>
* server/server.cpp: Try out the StorageManager.
2008-08-17 21:18:45 +00:00
Al Riddoch
e0b864b55d 2007-12-20 Al Riddoch <alriddoch@zepler.org>
* server/Makefile.am, server/Restoration.h, server/Restorer.h,
	  server/server.cpp: Remove the counter part templated restorer
	  code from the build.
2007-12-20 21:19:04 +00:00
Al Riddoch
3a2bc079e9 2007-12-20 Al Riddoch <alriddoch@zepler.org>
* server/EntityFactory.cpp, server/EntityFactory.h, server/Admin.cpp,
	  server/PersistantThingFactory.cpp, server/WorldRouter.cpp,
	  server/server.cpp: Rename EntityFactory to EntityBuilder, to make
	  it's function clearer.
2007-12-20 19:27:12 +00:00
Al Riddoch
733cc79989 2007-12-06 Al Riddoch <alriddoch@zepler.org>
* common/system.h: Add a new exit status code indicating that no
	  ports were available in the dynamic range.

	* server/server.cpp, common/system.cpp: When there are no ports
	  available, write an appropriate message, and a hint describing
	  how to allocate more.
2007-12-06 23:50:14 +00:00
Al Riddoch
fb12fd3bac 2007-12-05 Al Riddoch <alriddoch@zepler.org>
* server/Persistance.cpp: Add an information message when attempting
	  to create a new instance database.

	* server/server.cpp: Store a new value for the start of the dynamic
	  port range, if one is allocated.

	* common/globals.cpp: Force the instance name into lower case
	  alphanumeric, and underscore only. Reject it if it can't easily
	  be forced.
2007-12-06 02:46:32 +00:00
Al Riddoch
a479ebf547 2007-12-05 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp, common/Database.h: Add a new API for
	  attempting to bootstrap an instance database from the master.

	* server/Persistance.h, server/Persistance.cpp: Make some of the
	  functions in the persistence API non-static, so they work
	  more cleanly and consistently. Use the new return codes
	  specified in the config header. If an instance can't get a database
	  connection, use the master database to try and create one.

	* server/server.cpp: Use the persistence code the way it is
	  intended to be used.
2007-12-05 23:40:05 +00:00
Al Riddoch
46fa541e69 2007-12-05 Al Riddoch <alriddoch@zepler.org>
* common/globals.h, common/globals.cpp: Provide a separate function
	  for saving user settings back to the home directory. When
	  configuring a new instance, store the ruleset in user settings,
	  and log an informational message rather than a warning.

	* server/server.cpp: When dynamically assigning a port to a new
	  instance, store the port in user settings, and log an informational
	  message. Save the user configuration once the validity has been
	  completely verified and applied.
2007-12-05 17:33:19 +00:00
Al Riddoch
60d115ae59 2007-12-05 Al Riddoch <alriddoch@zepler.org>
* server/server.cpp: Fix up the warning message so it gives correct
	  instructions about disabling the database for instances.
2007-12-05 14:11:06 +00:00
Al Riddoch
7d1ffad045 2007-12-05 Al Riddoch <alriddoch@zepler.org>
* server/server.cpp: Make nice default to 1, so that it works the
	  same on all instances.
2007-12-05 01:23:52 +00:00
Al Riddoch
ce42e54c4b 2007-12-04 Al Riddoch <alriddoch@zepler.org>
* common/globals.cpp, common/globals.h: Add a new config setting for
	  the instance short name, and support per-instance configuration.
	  Add config settings for a dynamic port range.

	* server/server.cpp: Support per-instance configuration and use a
	  dynamic port for non-default instances.
2007-12-04 19:18:17 +00:00
Al Riddoch
29415a6a6e 2007-11-14 Al Riddoch <alriddoch@zepler.org>
* common/globals.cpp, common/globals.h: Modify the loadConfig
	  function so it takes usage hints, and checks the options in known
	  sections against those in the usage help.

	* client/client.cpp, server/server.cpp, tools/cyaddrules.cpp,
	  tools/cycmd.cpp, tools/cydumprules.cpp, tools/cyloadrules.cpp,
	  tools/cypasswd.cpp: Convert all calls to loadConfig to provide
	  the right hints.
2007-11-14 22:40:17 +00:00
Al Riddoch
826320991d 2007-11-05 Al Riddoch <alriddoch@zepler.org>
* server/server.cpp, server/slave.cpp: Use less verbose function
	  template to read config values.
2007-11-05 19:24:50 +00:00
Al Riddoch
4adaff13ef 2007-10-01 Al Riddoch <alriddoch@zepler.org>
* common/globals.cpp: Make a missing config file no longer fatal,
	  as the default are now sane, and do work.

	* server/server.cpp: Fix up some error and status messages.
2007-10-01 04:57:15 +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
e2f97526c3 2007-07-09 Al Riddoch <alriddoch@zepler.org>
* scripts/cyphesis-setup.sh: Complete the database setup script
	  functionality. Clean up the output, and polish.

	* server/PersistantThingFactory.cpp, server/PersistantThingFactory.h,
	  server/PersistantThingFactory_impl.h: Partially specialise the non
	  persistent entity factory so we can register the persistor database
	  tables for the world object when persistence is disabled, so the
	  state of this entity can be restored.

	* server/server.cpp: Tidy up the startup output.

	* server/EntityFactory.cpp: Don't try and set up world persistence if
	  it is turned off.
2007-07-08 23:45:12 +00:00
Al Riddoch
f8a2731576 2007-06-19 Al Riddoch <alriddoch@zepler.org>
* common/globals.cpp, common/globals.h: Change the type and name
	  of the ruleset list to a string.

	* rulesets/Python_API.cpp, server/EntityFactory.cpp,
	  server/server.cpp, tools/cyaddrules.cpp, tools/cydumprules.cpp,
	  tools/cyloadrules.cpp: Switch to using single ruleset config
	  variable.
2007-06-19 13:19:57 +00:00
Al Riddoch
d597378886 2007-04-28 Al Riddoch <alriddoch@zepler.org>
* common/globals.cpp, common/globals.h: Add interfact and mechanism
	  for showing usage data for all the programs given one central
	  location for the data.

	* server/server.cpp: Test out the usage function.

	* tools/cypasswd.cpp: Display usage using the old mechanism.
2007-04-28 16:45:13 +00:00
Al Riddoch
41d00bcab1 2007-04-28 Al Riddoch <alriddoch@zepler.org>
* commong/globals.h, common/globals.cpp: Add definitions for different
	  error codes from reading the config file, in particular codes that
	  indicate that the user has requested version, help or usage
	  information. Add a function for reporting the version of tools.

	* server/server.cpp: Add support for version or usage arguments,
	  including specific reporting of the server build number, which is
	  does not apply when reporting the version of other components.

	* tools/Makefile.am: Fix the globals modules dependency on consts.

	* tools/cypasswd.cpp: Add support for version or usage arguments.
2007-04-28 15:21:17 +00:00
Al Riddoch
a02c5455c8 2007-02-20 Al Riddoch <alriddoch@zepler.org>
* server/server.cpp: Clean up database error messages, and add
	  hint about disabling the database if this is required.
2007-02-20 14:56:31 +00:00
Al Riddoch
c1fde0fd8d 2007-02-20 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp: Improve the presentation of Database error
	  messages.

	* server/server.cpp: If connecting to the database fails, just
	  disable it, and report plenty of error information.
2007-02-20 01:12:48 +00:00