A little bit of tweakery so that the invocation director to use

is known by any invocation marshaller, and so the client does
not need to be passed in.

Just here on the actionscript side for now, but this change may
make its way to Java.

Other changes may follow...


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5904 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2009-08-13 06:17:28 +00:00
parent 505a9c3a53
commit fe3d89132d
4 changed files with 27 additions and 11 deletions
@@ -28,6 +28,7 @@ import com.threerings.io.ObjectOutputStream;
import com.threerings.io.Streamable;
import com.threerings.presents.client.Client;
import com.threerings.presents.client.InvocationDirector;
import com.threerings.presents.client.InvocationService;
import com.threerings.presents.dobj.DObjectManager;
@@ -73,11 +74,9 @@ public class InvocationMarshaller
* Called by generated invocation marshaller code; packages up and
* sends the specified invocation service request.
*/
protected function sendRequest (
client :Client, methodId :int, args :Array) :void
protected function sendRequest (methodId :int, args :Array) :void
{
client.getInvocationDirector().sendRequest(
_invOid, _invCode, methodId, args);
_invDir.sendRequest(_invOid, _invCode, methodId, args);
}
/**
@@ -101,6 +100,9 @@ public class InvocationMarshaller
{
_invOid = ins.readInt();
_invCode = ins.readInt();
// this is sorta hacky, but so is actionscript.
_invDir = ins.getClientProperty("invDir");
}
/** The oid of the invocation object, where invocation service
@@ -110,5 +112,8 @@ public class InvocationMarshaller
/** The invocation service code assigned to this service when it was
* registered on the server. */
protected var _invCode :int;
/** The invocation director we use. */
protected var _invDir :InvocationDirector;
}
}
@@ -60,10 +60,8 @@ public class InvocationMarshaller_ListenerMarshaller
listener.requestFailed((args[0] as String));
} else {
Log.getLog(this).warning(
"Requested to dispatch unknown invocation response " +
"[listener=" + listener + ", methodId=" + methodId +
", args=" + args + "].");
Log.getLog(this).warning("Requested to dispatch unknown invocation response",
"listener", listener, "methodId", methodId, "args", args);
}
}