Allow EZGames to have custom configuration options specified as XML.

git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@240 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
Ray Greenwell
2007-03-13 00:50:14 +00:00
parent 565c700d61
commit 3825cf2e68
5 changed files with 226 additions and 0 deletions
@@ -33,6 +33,7 @@ import com.threerings.parlor.game.client.GameConfigurator;
import com.threerings.parlor.game.data.GameConfig;
import com.threerings.ezgame.client.EZGameController;
import com.threerings.ezgame.util.EZObjectMarshaller;
/**
* A game config for a simple multiplayer ez game.
@@ -53,6 +54,9 @@ public class EZGameConfig extends GameConfig
/** The game type. */
public var gameType :int = SEATED_GAME;
/** Any custom configuration options. */
public var customConfig :Object;
public function EZGameConfig ()
{
// nothing needed
@@ -115,6 +119,8 @@ public class EZGameConfig extends GameConfig
persistentGameId = ins.readInt();
gameMedia = (ins.readField(String) as String);
gameType = ins.readByte();
customConfig = EZObjectMarshaller.decode(ins.readObject());
}
// from interface Streamable
@@ -126,6 +132,8 @@ public class EZGameConfig extends GameConfig
out.writeInt(persistentGameId);
out.writeField(gameMedia);
out.writeByte(gameType);
out.writeObject(EZObjectMarshaller.encode(customConfig, false));
}
}
}