Auto-unwrap invocation response arguments as well.

Make Long not wrapped for now.
Don't svn update until after mdb regenerates everything..


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4569 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2007-02-12 21:49:21 +00:00
parent b217e87519
commit 69ea4f349f
2 changed files with 20 additions and 9 deletions
@@ -199,6 +199,8 @@ public class InvocationDirector
return;
}
unwrapArgs(args);
// log.info("Dispatching invocation response " +
// "[listener=" + listener + ", methId=" + methodId +
// ", args=" + StringUtil.toString(args) + "].");
@@ -238,13 +240,7 @@ public class InvocationDirector
return;
}
if (args != null) {
for (var ii :int = 0; ii < args.length; ii++) {
if (args[ii] is Wrapped) {
args[ii] = (args[ii] as Wrapped).unwrap();
}
}
}
unwrapArgs(args);
// log.info("Dispatching invocation notification " +
// "[receiver=" + decoder.receiver + ", methodId=" + methodId +
@@ -297,6 +293,21 @@ public class InvocationDirector
// TODO: or fuck it?
}
/**
* Unwrap any arguments that have arrived from the server in wrapped
* types.
*/
protected function unwrapArgs (args :Array) :void
{
if (args != null) {
for (var ii :int = 0; ii < args.length; ii++) {
if (args[ii] is Wrapped) {
args[ii] = (args[ii] as Wrapped).unwrap();
}
}
}
}
/**
* Used to generate monotonically increasing invocation request ids.
*/
+2 -2
View File
@@ -4,7 +4,7 @@ package com.threerings.util {
* Equivalent to java.lang.Long.
*/
public class Long
implements Equalable, Wrapped
implements Equalable
{
public var high :int;
public var low :int;
@@ -30,7 +30,7 @@ public class Long
return (this.high == that.high) && (this.low == that.low);
}
// from Wrapped
// from Wrapped, except that we don't implement Wrapped anymore
public function unwrap () :Object
{
return low; // TODO