From ba5b931adc560da4b92e35884812adc74eea6efd Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Fri, 12 Jan 2007 19:14:22 +0000 Subject: [PATCH] Fixed some wee bugs: calling setProperty() with an array was encoding it as byte[][], even when an index was passed in. Messages of arrays were also encoding as byte[][] for the server, even though the server doesn't care about messages. git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@145 c613c5cb-e716-0410-b11b-feb51c14d237 --- src/as/com/threerings/ezgame/client/GameControlBackend.as | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/as/com/threerings/ezgame/client/GameControlBackend.as b/src/as/com/threerings/ezgame/client/GameControlBackend.as index 830c2715..e66c3d47 100644 --- a/src/as/com/threerings/ezgame/client/GameControlBackend.as +++ b/src/as/com/threerings/ezgame/client/GameControlBackend.as @@ -146,7 +146,7 @@ public class GameControlBackend { validatePropertyChange(propName, value, index); - var encoded :Object = EZObjectMarshaller.encode(value); + var encoded :Object = EZObjectMarshaller.encode(value, (index == -1)); _ezObj.ezGameService.setProperty( _ctx.getClient(), propName, encoded, index, createLoggingListener("setProperty")); @@ -170,7 +170,7 @@ public class GameControlBackend validateName(messageName); validateValue(value); - var encoded :Object = EZObjectMarshaller.encode(value); + var encoded :Object = EZObjectMarshaller.encode(value, false); _ezObj.ezGameService.sendMessage(_ctx.getClient(), messageName, encoded, playerIndex, createLoggingListener("sendMessage")); @@ -420,6 +420,9 @@ public class GameControlBackend throw new ArgumentError("Property " + propName + " is not an Array."); } + + } else if (index != -1) { + throw new ArgumentError("Invalid index specified: " + index); } // validate the value too