diff --git a/src/as/com/threerings/io/ObjectInputStream.as b/src/as/com/threerings/io/ObjectInputStream.as index b1b472925..c92f6af44 100644 --- a/src/as/com/threerings/io/ObjectInputStream.as +++ b/src/as/com/threerings/io/ObjectInputStream.as @@ -52,6 +52,10 @@ public class ObjectInputStream var cname :String = Translations.getFromServer(readUTF()); Log.debug("read cname: " + cname); var streamer :Streamer = Streamer.getStreamerByJavaName(cname); + if (streamer == Streamer.BAD_STREAMER) { + Log.warning("OMG, cannot stream" + cname); + return null; + } cmap = new ClassMapping(code, cname, streamer); _classMap[code] = cmap; diff --git a/src/as/com/threerings/io/ObjectOutputStream.as b/src/as/com/threerings/io/ObjectOutputStream.as index 34067a00d..3eb63cec3 100644 --- a/src/as/com/threerings/io/ObjectOutputStream.as +++ b/src/as/com/threerings/io/ObjectOutputStream.as @@ -38,9 +38,9 @@ public class ObjectOutputStream if (cmap == null) { var streamer :Streamer = Streamer.getStreamer(obj); // streamer may be null to indicate a Streamable object - if (streamer == null) { + if (streamer == Streamer.BAD_STREAMER) { // TODO - trace("OMG, cannot stream ", cname); + Log.warning("OMG, cannot stream " + cname); return; } diff --git a/src/as/com/threerings/io/Streamer.as b/src/as/com/threerings/io/Streamer.as index 34d2951d7..09c6db579 100644 --- a/src/as/com/threerings/io/Streamer.as +++ b/src/as/com/threerings/io/Streamer.as @@ -18,6 +18,8 @@ import com.threerings.io.streamers.StringStreamer; public class Streamer { + public static const BAD_STREAMER :Streamer = new Streamer(null, null); + public static function getStreamer (obj :Object) :Streamer { if (obj is Streamable) { @@ -39,7 +41,7 @@ public class Streamer return streamer; } - return undefined; + return BAD_STREAMER; } public static function getStreamerByClass (clazz :Class) :Streamer @@ -56,7 +58,7 @@ public class Streamer } } - return undefined; + return BAD_STREAMER; } public static function getStreamerByJavaName (jname :String) :Streamer diff --git a/src/as/com/threerings/msoy/client/MsoyContext.as b/src/as/com/threerings/msoy/client/MsoyContext.as index 23133d375..b69f37e89 100644 --- a/src/as/com/threerings/msoy/client/MsoyContext.as +++ b/src/as/com/threerings/msoy/client/MsoyContext.as @@ -22,6 +22,7 @@ public class MsoyContext // TODO: verify params to these constructors _msgmgr = new MessageManager("rsrc"); + _locdir = new LocationDirector(this); _chatdir = new ChatDirector(this, _msgmgr, "general"); } @@ -40,7 +41,7 @@ public class MsoyContext // documentation inherited from interface CrowdContext public function getLocationDirector () :LocationDirector { - return null; // TODO + return _locdir; } // documentation inherited from interface CrowdContext @@ -71,6 +72,8 @@ public class MsoyContext protected var _msgmgr :MessageManager; + protected var _locdir :LocationDirector; + protected var _chatdir :ChatDirector; } } diff --git a/src/as/com/threerings/presents/client/ClientSubscriber.as b/src/as/com/threerings/presents/client/ClientSubscriber.as index 929939219..1d5a684ad 100644 --- a/src/as/com/threerings/presents/client/ClientSubscriber.as +++ b/src/as/com/threerings/presents/client/ClientSubscriber.as @@ -11,7 +11,7 @@ import com.threerings.presents.Log; * This class is used by the InvocationDirector to subscribe * to the client object. */ -internal class ClientSubscriber implements Subscriber +public class ClientSubscriber implements Subscriber { public function ClientSubscriber (invdir :InvocationDirector) { diff --git a/src/as/com/threerings/presents/client/InvocationDirector.as b/src/as/com/threerings/presents/client/InvocationDirector.as index efcbb2b98..2f287f4ac 100644 --- a/src/as/com/threerings/presents/client/InvocationDirector.as +++ b/src/as/com/threerings/presents/client/InvocationDirector.as @@ -1,7 +1,7 @@ package com.threerings.presents.client { import mx.collections.IViewCursor; -import mx.collections.ListCollectionView; +import mx.collections.ArrayCollection; import com.threerings.util.SimpleMap; @@ -35,15 +35,6 @@ public class InvocationDirector _omgr = omgr; _client = client; - var subby :Object = new Object(); - subby.objectAvailable = function (obj :DObject) :void { - gotClientObject(obj as ClientObject); - } - subby.requestFailed = function ( - oid :int, cause :ObjectAccessError) :void { - gotClientObjectFailed(oid, cause); - } - _omgr.subscribeToObject(cloid, new ClientSubscriber(this)); } @@ -364,7 +355,7 @@ public class InvocationDirector /** All registered receivers are maintained in a list so that we can * assign receiver ids to them when we go online. */ - internal var _reclist :ListCollectionView = new ListCollectionView(); + internal var _reclist :ArrayCollection = new ArrayCollection(); /** The last time we flushed our listeners. */ protected var _lastFlushTime :Number;