From 69ea4f349fd84e0e2884b87ee40f20a76eadd91d Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Mon, 12 Feb 2007 21:49:21 +0000 Subject: [PATCH] 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 --- .../presents/client/InvocationDirector.as | 25 +++++++++++++------ src/as/com/threerings/util/Long.as | 4 +-- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src/as/com/threerings/presents/client/InvocationDirector.as b/src/as/com/threerings/presents/client/InvocationDirector.as index 93a9fc228..3d294a637 100644 --- a/src/as/com/threerings/presents/client/InvocationDirector.as +++ b/src/as/com/threerings/presents/client/InvocationDirector.as @@ -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. */ diff --git a/src/as/com/threerings/util/Long.as b/src/as/com/threerings/util/Long.as index ac7294568..e7cc11dba 100644 --- a/src/as/com/threerings/util/Long.as +++ b/src/as/com/threerings/util/Long.as @@ -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