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
This commit is contained in:
@@ -146,7 +146,7 @@ public class GameControlBackend
|
|||||||
{
|
{
|
||||||
validatePropertyChange(propName, value, index);
|
validatePropertyChange(propName, value, index);
|
||||||
|
|
||||||
var encoded :Object = EZObjectMarshaller.encode(value);
|
var encoded :Object = EZObjectMarshaller.encode(value, (index == -1));
|
||||||
_ezObj.ezGameService.setProperty(
|
_ezObj.ezGameService.setProperty(
|
||||||
_ctx.getClient(), propName, encoded, index,
|
_ctx.getClient(), propName, encoded, index,
|
||||||
createLoggingListener("setProperty"));
|
createLoggingListener("setProperty"));
|
||||||
@@ -170,7 +170,7 @@ public class GameControlBackend
|
|||||||
validateName(messageName);
|
validateName(messageName);
|
||||||
validateValue(value);
|
validateValue(value);
|
||||||
|
|
||||||
var encoded :Object = EZObjectMarshaller.encode(value);
|
var encoded :Object = EZObjectMarshaller.encode(value, false);
|
||||||
_ezObj.ezGameService.sendMessage(_ctx.getClient(),
|
_ezObj.ezGameService.sendMessage(_ctx.getClient(),
|
||||||
messageName, encoded, playerIndex,
|
messageName, encoded, playerIndex,
|
||||||
createLoggingListener("sendMessage"));
|
createLoggingListener("sendMessage"));
|
||||||
@@ -420,6 +420,9 @@ public class GameControlBackend
|
|||||||
throw new ArgumentError("Property " + propName +
|
throw new ArgumentError("Property " + propName +
|
||||||
" is not an Array.");
|
" is not an Array.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else if (index != -1) {
|
||||||
|
throw new ArgumentError("Invalid index specified: " + index);
|
||||||
}
|
}
|
||||||
|
|
||||||
// validate the value too
|
// validate the value too
|
||||||
|
|||||||
Reference in New Issue
Block a user