Added a simple chat server test framework onto which I will built a

JME-based client.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3512 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2005-04-20 22:30:19 +00:00
parent 00038b69bf
commit 9d2505c115
6 changed files with 475 additions and 0 deletions
@@ -0,0 +1,45 @@
//
// $Id$
package com.threerings.crowd.server;
import com.threerings.crowd.Log;
import com.threerings.crowd.data.JabberConfig;
import com.threerings.crowd.data.PlaceObject;
/**
* A basic server that creates a single room and sticks everyone in it
* where they can chat with one another.
*/
public class JabberServer extends CrowdServer
{
// documentation inherited
public void init ()
throws Exception
{
super.init();
// create a single location
plreg.createPlace(
new JabberConfig(), new PlaceRegistry.CreationObserver() {
public void placeCreated (PlaceObject place, PlaceManager pmgr) {
Log.info("Created chat room " + pmgr.where() + ".");
_place = pmgr;
}
});
}
public static void main (String[] args)
{
JabberServer server = new JabberServer();
try {
server.init();
server.run();
} catch (Exception e) {
Log.warning("Unable to initialize server.");
Log.logStackTrace(e);
}
}
protected PlaceManager _place;
}