Open ourselves up a bit, to let subclasses pass their own data through ObjectInputStream's handy clientProps functionality. A prime example: sending along an injection context to streamed objects.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6630 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Par Winzell
2011-04-22 15:58:45 +00:00
parent b4e8609a95
commit 7faeb29c4f
2 changed files with 14 additions and 4 deletions
@@ -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