From 92ce73208a28736d8321344758f823d74f0171b6 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Mon, 7 Aug 2006 23:23:39 +0000 Subject: [PATCH] Wasn't streaming in GameConfig or GameObject; Fix a compile error in FlexGameConfigurator git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@35 c613c5cb-e716-0410-b11b-feb51c14d237 --- .../game/client/FlexGameConfigurator.as | 3 +- .../threerings/parlor/game/data/GameConfig.as | 20 ++++++++++++ .../threerings/parlor/game/data/GameObject.as | 32 +++++++++++++++++++ 3 files changed, 54 insertions(+), 1 deletion(-) diff --git a/src/as/com/threerings/parlor/game/client/FlexGameConfigurator.as b/src/as/com/threerings/parlor/game/client/FlexGameConfigurator.as index 311da5ba..d9558dad 100644 --- a/src/as/com/threerings/parlor/game/client/FlexGameConfigurator.as +++ b/src/as/com/threerings/parlor/game/client/FlexGameConfigurator.as @@ -19,7 +19,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -package com.threerings.parlor.game.client; +package com.threerings.parlor.game.client { import mx.core.Container; import mx.core.UIComponent; @@ -75,3 +75,4 @@ public /*abstract*/ class FlexGameConfigurator extends GameConfigurator /** The grid on which the config options are placed. */ protected var _grid :Grid = new Grid(); } +} diff --git a/src/as/com/threerings/parlor/game/data/GameConfig.as b/src/as/com/threerings/parlor/game/data/GameConfig.as index e0d8d373..44c43b91 100644 --- a/src/as/com/threerings/parlor/game/data/GameConfig.as +++ b/src/as/com/threerings/parlor/game/data/GameConfig.as @@ -27,6 +27,8 @@ import com.threerings.util.Hashable; import com.threerings.util.Name; import com.threerings.util.StringUtil; +import com.threerings.io.ObjectInputStream; +import com.threerings.io.ObjectOutputStream; import com.threerings.io.TypedArray; import com.threerings.crowd.data.PlaceConfig; @@ -162,5 +164,23 @@ public /*abstract*/ class GameConfig extends PlaceConfig return copy; } + + override public function writeObject (out :ObjectOutputStream) :void + { + super.writeObject(out); + + out.writeObject(players); + out.writeBoolean(rated); + out.writeObject(ais); + } + + override public function readObject (ins :ObjectInputStream) :void + { + super.readObject(ins); + + players = (ins.readObject() as TypedArray); + rated = ins.readBoolean(); + ais = (ins.readObject() as TypedArray); + } } } diff --git a/src/as/com/threerings/parlor/game/data/GameObject.as b/src/as/com/threerings/parlor/game/data/GameObject.as index bf04f9dd..400f0815 100644 --- a/src/as/com/threerings/parlor/game/data/GameObject.as +++ b/src/as/com/threerings/parlor/game/data/GameObject.as @@ -25,6 +25,8 @@ import com.threerings.util.Integer; import com.threerings.util.langBoolean; import com.threerings.util.Name; +import com.threerings.io.ObjectInputStream; +import com.threerings.io.ObjectOutputStream; import com.threerings.io.TypedArray; import com.threerings.crowd.data.PlaceObject; @@ -438,5 +440,35 @@ public class GameObject extends PlaceObject this.playerStatus[index] = value; } // AUTO-GENERATED: METHODS END + + override public function writeObject (out :ObjectOutputStream) :void + { + super.writeObject(out); + + out.writeObject(gameService); + out.writeInt(state); + out.writeBoolean(isRated); + out.writeBoolean(isPrivate); + out.writeObject(players); + out.writeField(winners); + out.writeInt(roundId); + out.writeField(playerStatus); + } + + override public function readObject (ins :ObjectInputStream) :void + { + super.readObject(ins); + + gameService = (ins.readObject() as GameMarshaller); + state = ins.readInt(); + isRated = ins.readBoolean(); + isPrivate = ins.readBoolean(); + players = (ins.readObject() as TypedArray); + winners = (ins.readField(TypedArray.getJavaType(Boolean)) + as TypedArray); + roundId = ins.readInt(); + playerStatus = (ins.readField(TypedArray.getJavaType(int)) + as TypedArray); + } } }