diff --git a/src/java/com/threerings/presents/server/PresentsServer.java b/src/java/com/threerings/presents/server/PresentsServer.java index 7d7adc5a8..302c1d540 100644 --- a/src/java/com/threerings/presents/server/PresentsServer.java +++ b/src/java/com/threerings/presents/server/PresentsServer.java @@ -1,5 +1,5 @@ // -// $Id: PresentsServer.java,v 1.15 2001/11/08 02:59:30 mdb Exp $ +// $Id: PresentsServer.java,v 1.16 2001/11/08 05:39:51 mdb Exp $ package com.threerings.presents.server; @@ -57,9 +57,11 @@ public class PresentsServer // create our authentication manager authmgr = new AuthManager(new DummyAuthenticator()); // create our connection manager - conmgr = new ConnectionManager(config, authmgr); - // create our client manager - clmgr = new ClientManager(conmgr); + if (createConnectionManager()) { + conmgr = new ConnectionManager(config, authmgr); + // create our client manager + clmgr = new ClientManager(conmgr); + } // create our distributed object manager omgr = new PresentsDObjectMgr(); // create our invocation manager @@ -117,6 +119,16 @@ public class PresentsServer } } + /** + * In local testing mode, we don't want to create a connection manager + * and listen to client connections. So we provide this method that + * can be overridden by a testing server. + */ + protected boolean createConnectionManager () + { + return true; + } + /** * Starts up all of the server services and enters the main server * event loop. @@ -126,7 +138,9 @@ public class PresentsServer // start up the auth manager authmgr.start(); // start up the connection manager - conmgr.start(); + if (conmgr != null) { + conmgr.start(); + } // invoke the dobjmgr event loop omgr.run(); } @@ -138,7 +152,9 @@ public class PresentsServer { // shut down our managers authmgr.shutdown(); - conmgr.shutdown(); + if (conmgr != null) { + conmgr.shutdown(); + } omgr.shutdown(); }