We need to send the tick out with a different message identifier
because otherwise the EZGameController will try to unmarshall the value. The marshalling/unmarshalling is purely clientside, the server doesn't understand how to do it, so it must dispatch a different event that just contains a nice normal integer. git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@85 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
@@ -89,6 +89,11 @@ public class EZGameController extends GameController
|
||||
// this is chat send by the game, let's route it like
|
||||
// localChat, which is also sent by the game
|
||||
gameObjImpl.localChat((String) event.getArgs()[0]);
|
||||
|
||||
} else if (EZGameObject.TICKER.equals(name)) {
|
||||
Object[] args = event.getArgs();
|
||||
dispatchUserEvent(new MessageReceivedEvent(
|
||||
gameObjImpl, (String) args[0], (Integer) args[1]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,9 @@ public class EZGameObject extends GameObject
|
||||
/** The identifier for a MessageEvent containing game-system chat. */
|
||||
public static final String GAME_CHAT = "Uchat";
|
||||
|
||||
/** The identifier for a MessageEvent containing ticker notifications. */
|
||||
public static final String TICKER = "Utick";
|
||||
|
||||
// AUTO-GENERATED: FIELDS START
|
||||
/** The field name of the <code>turnHolder</code> field. */
|
||||
public static final String TURN_HOLDER = "turnHolder";
|
||||
|
||||
@@ -394,7 +394,7 @@ public class EZGameManager extends GameManager
|
||||
public void expired ()
|
||||
{
|
||||
_omgr.postEvent(
|
||||
new MessageEvent(_oid, EZGameObject.USER_MESSAGE,
|
||||
new MessageEvent(_oid, EZGameObject.TICKER,
|
||||
new Object[] { _name, _value++ }));
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user