A bit more, more streaming issues. I might need to rework some stuff.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3985 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2006-03-28 02:02:22 +00:00
parent 538803e1fb
commit 90e4017801
8 changed files with 39 additions and 15 deletions
@@ -447,7 +447,6 @@ public class LocationDirector extends BasicDirector
// obtain our service handle
_lservice =
(client.requireService(LocationService) as LocationService);
Log.info("location service: " + _lservice);
}
protected function gotBodyObject (clobj :BodyObject) :void
@@ -55,7 +55,6 @@ public class LocationMarshaller extends InvocationMarshaller
// documentation inherited from interface
public function moveTo (arg1 :Client, arg2 :int, arg3 :MoveListener) :void
{
com.threerings.crowd.Log.debug("issuing moveTo: " + _invCode);
var listener3 :MoveMarshaller = new MoveMarshaller();
listener3.listener = arg3;
sendRequest(arg1, MOVE_TO, [ new Integer(arg2), listener3 ]);
@@ -24,6 +24,9 @@ package com.threerings.crowd.data {
import com.threerings.util.Iterator;
import com.threerings.util.Name;
import com.threerings.io.ObjectInputStream;
import com.threerings.io.ObjectOutputStream;
import com.threerings.presents.dobj.DObject;
import com.threerings.presents.dobj.DSet;
import com.threerings.presents.dobj.DSetEntry;
@@ -175,5 +178,24 @@ public class PlaceObject extends DObject
this.speakService = value;
}
// AUTO-GENERATED: METHODS END
// documentation inherited
public override function writeObject (out :ObjectOutputStream) :void
{
super.writeObject(out);
out.writeObject(occupants);
out.writeObject(occupantInfo);
out.writeObject(speakService);
}
// documentation inherited
public override function readObject (ins :ObjectInputStream) :void
{
super.readObject(ins);
// TODO: this needs fixing!
occupants = (ins.readField(OidList) as OidList);
occupantInfo = (ins.readField(DSet) as DSet);
speakService = (ins.readField(SpeakMarshaller) as SpeakMarshaller);
}
}
}
@@ -125,6 +125,10 @@ public class ObjectInputStream
? Streamer.getStreamerByClass(type as Class)
: Streamer.getStreamerByJavaName(type as String);
if (streamer == Streamer.BAD_STREAMER) {
throw new Error("Cannot field stream " + type);
}
var obj :Object = streamer.createObject(this);
streamer.readObject(obj, this);
return obj;
@@ -50,9 +50,6 @@ public class ObjectOutputStream
// TODO: if _nextCode blows short, log an error
writeShort(-cmap.code);
Log.debug("wrote classname: " +
((streamer == null) ? Translations.getToServer(cname)
: streamer.getJavaClassName()));
writeUTF((streamer == null) ? Translations.getToServer(cname)
: streamer.getJavaClassName());
@@ -30,7 +30,6 @@ public class ObjectArrayStreamer extends Streamer
:void
{
var arr :Array = (obj as Array);
com.threerings.presents.Log.debug("array length: " + arr.length);
out.writeInt(arr.length);
for (var ii :int = 0; ii < arr.length; ii++) {
out.writeObject(arr[ii]);
@@ -2,6 +2,8 @@ package com.threerings.msoy.client {
import flash.display.Stage;
import mx.core.Application;
import com.threerings.util.Name;
import com.threerings.presents.client.Client;
import com.threerings.presents.dobj.DSet;
@@ -24,11 +26,11 @@ import com.threerings.msoy.data.SimpleChatConfig;
public class MsoyClient extends Client
{
public function MsoyClient (stage :Stage)
public function MsoyClient (app :Application)
{
super(new UsernamePasswordCreds(new Name("guest"), "guest"));
_ctx = new MsoyContext(this, stage);
_ctx = new MsoyContext(this, app);
setServer("tasman.sea.earth.threerings.net", DEFAULT_SERVER_PORT);
logon();
@@ -3,6 +3,8 @@ package com.threerings.msoy.client {
import flash.display.DisplayObject;
import flash.display.Stage;
import mx.core.Application;
import com.threerings.util.MessageManager;
import com.threerings.presents.client.Client;
@@ -19,10 +21,10 @@ import com.threerings.crowd.chat.client.ChatDirector;
public class MsoyContext
implements CrowdContext
{
public function MsoyContext (client :Client, stage :Stage)
public function MsoyContext (client :Client, app :Application)
{
_client = client;
_stage = stage;
_app = app;
// TODO: verify params to these constructors
_msgmgr = new MessageManager("rsrc");
@@ -63,22 +65,22 @@ public class MsoyContext
// documentation inherited from interface CrowdContext
public function setPlaceView (view :PlaceView) :void
{
for (var ii :int = _stage.numChildren - 1; ii >= 0; ii--) {
_stage.removeChildAt(ii);
for (var ii :int = _app.numChildren - 1; ii >= 0; ii--) {
_app.removeChildAt(ii);
}
_stage.addChild(view as DisplayObject);
_app.addChild(view as DisplayObject);
}
// documentation inherited from interface CrowdContext
public function clearPlaceView (view :PlaceView) :void
{
_stage.removeChild(view as DisplayObject);
_app.removeChild(view as DisplayObject);
}
protected var _client :Client;
protected var _stage :Stage;
protected var _app :Application;
protected var _msgmgr :MessageManager;