diff --git a/src/main/as/com/threerings/presents/client/Client.as b/src/main/as/com/threerings/presents/client/Client.as index 28ffb6c22..5e870214b 100644 --- a/src/main/as/com/threerings/presents/client/Client.as +++ b/src/main/as/com/threerings/presents/client/Client.as @@ -273,11 +273,22 @@ public class Client extends EventDispatcher // we need to wait for the CLIENT_WILL_LOGON to have been dispatched before we actually // tell the communicator to logon, so we run this through the callLater pipeline _comm = new Communicator(this); - callLater(_comm.logon); + callLater(function () :void { + _comm.logon(buildClientProps()); + }); return true; } + /** + * Create the client property object to pass to {@link ObjectInputStream}. Subclasses may + * add references useful during e.g. deserialization. + */ + protected function buildClientProps () :Object + { + return { invDir: _invdir }; + } + /** * Transitions a logged on client from its current server to the specified new server. * Currently this simply logs the client off of its current server (if it is logged on) and diff --git a/src/main/as/com/threerings/presents/client/Communicator.as b/src/main/as/com/threerings/presents/client/Communicator.as index aa22c5068..e0636339b 100644 --- a/src/main/as/com/threerings/presents/client/Communicator.as +++ b/src/main/as/com/threerings/presents/client/Communicator.as @@ -21,7 +21,6 @@ package com.threerings.presents.client { -import flash.errors.IOError; import flash.events.Event; import flash.events.IOErrorEvent; import flash.events.SecurityErrorEvent; @@ -55,13 +54,13 @@ public class Communicator _client = client; } - public function logon () :void + public function logon (clientProps :Object = null) :void { // create our input/output business _outBuffer = new ByteArray(); _outBuffer.endian = Endian.BIG_ENDIAN; _outStream = new ObjectOutputStream(_outBuffer); - _inStream = new ObjectInputStream(null, { invDir: _client.getInvocationDirector() }); + _inStream = new ObjectInputStream(null, clientProps); attemptLogon(0); }