Files
narya/src/java/com/threerings/whirled/server/WhirledServer.java
T
Michael Bayne a0e9044e93 Config clean up and unification. The base servers were doing more than
they needed to and when all that was stripped away, they didn't really
need their own config files.

Now what little config they need is provided by the users of these basic
services so that said users can make their own decisions about where to
obtain configuration information.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1820 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-10-21 20:56:21 +00:00

60 lines
1.8 KiB
Java

//
// $Id: WhirledServer.java,v 1.15 2002/10/21 20:56:21 mdb Exp $
package com.threerings.whirled.server;
import com.threerings.crowd.server.CrowdServer;
import com.threerings.whirled.Log;
import com.threerings.whirled.server.persist.SceneRepository;
import com.threerings.whirled.server.persist.DummySceneRepository;
/**
* The whirled server extends the {@link CrowdServer} and provides access
* to managers and the like that are needed by the Whirled serviecs.
*/
public class WhirledServer extends CrowdServer
{
/** The scene registry. */
public static SceneRegistry screg;
/**
* Initializes all of the server services and prepares for operation.
*/
public void init ()
throws Exception
{
// do the base server initialization
super.init();
// configure the client to use our whirled client
clmgr.setClientClass(WhirledClient.class);
// create the scene repository
_screp = createSceneRepository();
// create our scene registry
screg = new SceneRegistry(invmgr, _screp);
Log.info("Whirled server initialized.");
}
/**
* Creates the scene repository that will be used by this server. If a
* derived class wishes to use a particular kind of scene repository
* (which they most likely will), they should override this method and
* instantiate the scene repository of their choosing.
*
* @exception Exception thrown if any error occurs while instantiating
* or initializing the scene repository.
*/
protected SceneRepository createSceneRepository ()
throws Exception
{
return new DummySceneRepository();
}
/** The scene repository in use by this server. */
protected SceneRepository _screp;
}