From d855802a66aaa87618e70d74643fbdadfe8b6dfb Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Fri, 7 Dec 2007 03:58:18 +0000 Subject: [PATCH] Let's continue to decode the value for each requesting function (just to be safe), but let's document why we're doing that as well as do it outside the try/catch, in case there's an error in our code. git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@518 c613c5cb-e716-0410-b11b-feb51c14d237 --- src/as/com/threerings/ezgame/client/GameControlBackend.as | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/as/com/threerings/ezgame/client/GameControlBackend.as b/src/as/com/threerings/ezgame/client/GameControlBackend.as index 2bfb4714..1b80e968 100644 --- a/src/as/com/threerings/ezgame/client/GameControlBackend.as +++ b/src/as/com/threerings/ezgame/client/GameControlBackend.as @@ -417,8 +417,10 @@ public class GameControlBackend if (arr != null) { delete _cookieCallbacks[cookie.playerId]; for each (var fn :Function in arr) { + // we want to decode every time, in case usercode mangles the value + var decodedValue :Object = ObjectMarshaller.decode(cookie.cookie); try { - fn(ObjectMarshaller.decode(cookie.cookie)); + fn(decodedValue); } catch (err :Error) { log.warning("Error in user-code: " + err); log.logStackTrace(err);