More progress.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3861 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2006-02-17 05:11:31 +00:00
parent cd7e127bc6
commit 74c35b6d65
22 changed files with 1632 additions and 19 deletions
@@ -109,8 +109,12 @@ public class Communicator
protected function inputFrameReceived (event :FrameAvailableEvent) :void
{
// convert the frame data into a message from the server
_inStream.setSource(event.getFrameData());
var frameData :ByteArray = event.getFrameData();
_inStream.setSource(frameData);
var msg :DownstreamMessage = _inStream.readObject();
if (frameData.bytesAvailable > 0) {
trace("OMG, we didn't fully read the frame. Surely there's a bug");
}
if (_omgr != null) {
// if we're logged on, then just do the normal thing
@@ -119,7 +123,7 @@ public class Communicator
}
// Otherwise, this would be the AuthResponse to our logon attempt.
var rsp :AuthResponse = (msg as AuthResponse); // TODO: as correct?
var rsp :AuthResponse = (msg as AuthResponse);
var data :AuthResponseData = rsp.getData();
if (data.code !== AuthResponseData.SUCCESS) {
shutdown(new Error(data.code));
@@ -0,0 +1,33 @@
package com.threerings.presents.client {
import com.threerings.presents.dobj.DObjectManager;
public class InvocationDirector
{
public function init (omgr :DObjectManager, cloid :int, client :Client) :void
{
if (_clobj != null) {
trace("Zoiks, client object around during invmgr init!");
cleanup();
}
_omgr = omgr;
_client = client;
// TODO : lots more
}
public function cleanup () :void
{
_clobj = null;
// TODO: lots more
}
protected var _omgr :DObjectManager;
protected var _client :Client;
protected var _clobj :ClientObject;
}
}