Moved the typed object registry into the same package with the rest of

the typed object stuff; made events typed so they can be transported;
further wiring up of event dispatch over the network.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@34 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2001-06-11 17:44:04 +00:00
parent a8bddf0238
commit 89083f4708
11 changed files with 183 additions and 43 deletions
@@ -1,5 +1,5 @@
//
// $Id: PresentsClient.java,v 1.3 2001/06/09 23:39:04 mdb Exp $
// $Id: PresentsClient.java,v 1.4 2001/06/11 17:44:04 mdb Exp $
package com.threerings.cocktail.cher.server;
@@ -155,7 +155,10 @@ public class Client implements Subscriber, MessageHandler
// forward the event to the client
Connection conn = getConnection();
if (conn != null) {
conn.postMessage(new EventNotification(event));
// only typed events will be forwarded to the client, so we
// need not worry that a non-typed event would make it here
TypedEvent tevent = (TypedEvent)event;
conn.postMessage(new EventNotification(tevent));
} else {
Log.info("Dropped event forward notification " +
"[client=" + this + ", event=" + event + "].");
@@ -1,5 +1,5 @@
//
// $Id: ConnectionManager.java,v 1.4 2001/06/02 01:30:37 mdb Exp $
// $Id: ConnectionManager.java,v 1.5 2001/06/11 17:44:04 mdb Exp $
package com.threerings.cocktail.cher.server.net;
@@ -17,7 +17,6 @@ import com.threerings.cocktail.cher.io.FramingOutputStream;
import com.threerings.cocktail.cher.io.TypedObjectFactory;
import com.threerings.cocktail.cher.net.Credentials;
import com.threerings.cocktail.cher.net.DownstreamMessage;
import com.threerings.cocktail.cher.net.Registry;
/**
* The connection manager manages the socket on which connections are
@@ -322,9 +321,4 @@ public class ConnectionManager extends LoopingThread
protected static final int CONNECTION_ESTABLISHED = 0;
protected static final int CONNECTION_FAILED = 1;
protected static final int CONNECTION_CLOSED = 2;
// register our shared objects
static {
Registry.registerTypedObjects();
}
}