Generated streamers for stats/parlor data + narya 1.22 (Epic A1 Phase 5)
vilya's wire-value classes streamed reflectively, which breaks on Android/ART (nondeterministic Class.getDeclaredFields order): a Stat read on-device pulled a Place object into Stat._type and desynced the game-object subscription. Generated explicit declaration-ordered read/writeObject for stats/data (Stat subclasses + StatModifier pass-through substitution), parlor/data (Table & co.) and parlor/game/data via bang's genStreamableLibs task — byte-identical on HotSpot, deterministic on ART. narya 1.17 -> 1.22 (generated code references com.threerings.io.GenStreamUtil) + explicit jsr250 provided dep (@Generated no longer supplied transitively). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HhfHCXYp2ctWi76Z91y9Ut
This commit is contained in:
+11
-1
@@ -21,7 +21,17 @@
|
||||
<dependency>
|
||||
<groupId>com.threerings</groupId>
|
||||
<artifactId>narya</artifactId>
|
||||
<version>1.17</version>
|
||||
<!-- 1.22: the Epic A1 Phase 5 generated streamers reference
|
||||
com.threerings.io.GenStreamUtil (added in narya 1.21) -->
|
||||
<version>1.22</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<!-- javax.annotation.Generated on the genservice-generated sources (SOURCE retention, so
|
||||
compile-only); narya 1.17 supplied it transitively, 1.22 no longer does -->
|
||||
<groupId>javax.annotation</groupId>
|
||||
<artifactId>jsr250-api</artifactId>
|
||||
<version>1.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.threerings</groupId>
|
||||
|
||||
@@ -54,4 +54,26 @@ public class ChoiceParameter extends Parameter
|
||||
{
|
||||
return start;
|
||||
}
|
||||
|
||||
// from interface Streamable
|
||||
public void readObject (com.threerings.io.ObjectInputStream ins)
|
||||
throws java.io.IOException, java.lang.ClassNotFoundException
|
||||
{
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.parlor.data.Parameter.class, "ident", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.parlor.data.Parameter.class, "name", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.parlor.data.Parameter.class, "tip", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.parlor.data.ChoiceParameter.class, "choices", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.parlor.data.ChoiceParameter.class, "start", this, ins);
|
||||
}
|
||||
|
||||
// from interface Streamable
|
||||
public void writeObject (com.threerings.io.ObjectOutputStream out)
|
||||
throws java.io.IOException
|
||||
{
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.parlor.data.Parameter.class, "ident", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.parlor.data.Parameter.class, "name", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.parlor.data.Parameter.class, "tip", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.parlor.data.ChoiceParameter.class, "choices", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.parlor.data.ChoiceParameter.class, "start", this, out);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,4 +48,28 @@ public class RangeParameter extends Parameter
|
||||
{
|
||||
return start;
|
||||
}
|
||||
|
||||
// from interface Streamable
|
||||
public void readObject (com.threerings.io.ObjectInputStream ins)
|
||||
throws java.io.IOException, java.lang.ClassNotFoundException
|
||||
{
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.parlor.data.Parameter.class, "ident", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.parlor.data.Parameter.class, "name", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.parlor.data.Parameter.class, "tip", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.parlor.data.RangeParameter.class, "minimum", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.parlor.data.RangeParameter.class, "maximum", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.parlor.data.RangeParameter.class, "start", this, ins);
|
||||
}
|
||||
|
||||
// from interface Streamable
|
||||
public void writeObject (com.threerings.io.ObjectOutputStream out)
|
||||
throws java.io.IOException
|
||||
{
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.parlor.data.Parameter.class, "ident", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.parlor.data.Parameter.class, "name", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.parlor.data.Parameter.class, "tip", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.parlor.data.RangeParameter.class, "minimum", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.parlor.data.RangeParameter.class, "maximum", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.parlor.data.RangeParameter.class, "start", this, out);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -467,4 +467,30 @@ public class Table
|
||||
|
||||
/** On the server, the usernames that have been banned from this table. */
|
||||
protected transient HashSet<Name> _bannedUsers;
|
||||
|
||||
// from interface Streamable
|
||||
public void readObject (com.threerings.io.ObjectInputStream ins)
|
||||
throws java.io.IOException, java.lang.ClassNotFoundException
|
||||
{
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.parlor.data.Table.class, "tableId", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.parlor.data.Table.class, "lobbyOid", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.parlor.data.Table.class, "gameOid", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.parlor.data.Table.class, "players", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.parlor.data.Table.class, "watchers", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.parlor.data.Table.class, "config", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.parlor.data.Table.class, "tconfig", this, ins);
|
||||
}
|
||||
|
||||
// from interface Streamable
|
||||
public void writeObject (com.threerings.io.ObjectOutputStream out)
|
||||
throws java.io.IOException
|
||||
{
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.parlor.data.Table.class, "tableId", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.parlor.data.Table.class, "lobbyOid", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.parlor.data.Table.class, "gameOid", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.parlor.data.Table.class, "players", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.parlor.data.Table.class, "watchers", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.parlor.data.Table.class, "config", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.parlor.data.Table.class, "tconfig", this, out);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,4 +43,24 @@ public class TableConfig extends SimpleStreamableObject
|
||||
|
||||
/** Whether the table is "private". */
|
||||
public boolean privateTable;
|
||||
|
||||
// from interface Streamable
|
||||
public void readObject (com.threerings.io.ObjectInputStream ins)
|
||||
throws java.io.IOException, java.lang.ClassNotFoundException
|
||||
{
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.parlor.data.TableConfig.class, "desiredPlayerCount", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.parlor.data.TableConfig.class, "minimumPlayerCount", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.parlor.data.TableConfig.class, "teamMemberIndices", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.parlor.data.TableConfig.class, "privateTable", this, ins);
|
||||
}
|
||||
|
||||
// from interface Streamable
|
||||
public void writeObject (com.threerings.io.ObjectOutputStream out)
|
||||
throws java.io.IOException
|
||||
{
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.parlor.data.TableConfig.class, "desiredPlayerCount", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.parlor.data.TableConfig.class, "minimumPlayerCount", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.parlor.data.TableConfig.class, "teamMemberIndices", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.parlor.data.TableConfig.class, "privateTable", this, out);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,4 +42,24 @@ public class ToggleParameter extends Parameter
|
||||
{
|
||||
return start;
|
||||
}
|
||||
|
||||
// from interface Streamable
|
||||
public void readObject (com.threerings.io.ObjectInputStream ins)
|
||||
throws java.io.IOException, java.lang.ClassNotFoundException
|
||||
{
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.parlor.data.Parameter.class, "ident", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.parlor.data.Parameter.class, "name", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.parlor.data.Parameter.class, "tip", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.parlor.data.ToggleParameter.class, "start", this, ins);
|
||||
}
|
||||
|
||||
// from interface Streamable
|
||||
public void writeObject (com.threerings.io.ObjectOutputStream out)
|
||||
throws java.io.IOException
|
||||
{
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.parlor.data.Parameter.class, "ident", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.parlor.data.Parameter.class, "name", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.parlor.data.Parameter.class, "tip", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.parlor.data.ToggleParameter.class, "start", this, out);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,4 +47,20 @@ public class GameAI extends SimpleStreamableObject
|
||||
this.personality = personality;
|
||||
this.skill = skill;
|
||||
}
|
||||
|
||||
// from interface Streamable
|
||||
public void readObject (com.threerings.io.ObjectInputStream ins)
|
||||
throws java.io.IOException, java.lang.ClassNotFoundException
|
||||
{
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.parlor.game.data.GameAI.class, "personality", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.parlor.game.data.GameAI.class, "skill", this, ins);
|
||||
}
|
||||
|
||||
// from interface Streamable
|
||||
public void writeObject (com.threerings.io.ObjectOutputStream out)
|
||||
throws java.io.IOException
|
||||
{
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.parlor.game.data.GameAI.class, "personality", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.parlor.game.data.GameAI.class, "skill", this, out);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -434,4 +434,32 @@ public class GameObject extends PlaceObject
|
||||
this.playerStatus[index] = value;
|
||||
}
|
||||
// AUTO-GENERATED: METHODS END
|
||||
|
||||
// from interface Streamable
|
||||
public void readObject (com.threerings.io.ObjectInputStream ins)
|
||||
throws java.io.IOException, java.lang.ClassNotFoundException
|
||||
{
|
||||
super.readObject(ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.parlor.game.data.GameObject.class, "state", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.parlor.game.data.GameObject.class, "isRated", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.parlor.game.data.GameObject.class, "isPrivate", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.parlor.game.data.GameObject.class, "players", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.parlor.game.data.GameObject.class, "winners", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.parlor.game.data.GameObject.class, "sessionId", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.parlor.game.data.GameObject.class, "playerStatus", this, ins);
|
||||
}
|
||||
|
||||
// from interface Streamable
|
||||
public void writeObject (com.threerings.io.ObjectOutputStream out)
|
||||
throws java.io.IOException
|
||||
{
|
||||
super.writeObject(out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.parlor.game.data.GameObject.class, "state", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.parlor.game.data.GameObject.class, "isRated", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.parlor.game.data.GameObject.class, "isPrivate", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.parlor.game.data.GameObject.class, "players", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.parlor.game.data.GameObject.class, "winners", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.parlor.game.data.GameObject.class, "sessionId", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.parlor.game.data.GameObject.class, "playerStatus", this, out);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,4 +59,26 @@ public class ByteByteStringMapStat extends StringMapStat
|
||||
{
|
||||
return Byte.MAX_VALUE;
|
||||
}
|
||||
|
||||
// from interface Streamable
|
||||
public void readObject (com.threerings.io.ObjectInputStream ins)
|
||||
throws java.io.IOException, java.lang.ClassNotFoundException
|
||||
{
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.stats.data.Stat.class, "_type", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.stats.data.Stat.class, "_modified", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.stats.data.Stat.class, "_modCount", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.stats.data.StringMapStat.class, "_keys", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.stats.data.StringMapStat.class, "_values", this, ins);
|
||||
}
|
||||
|
||||
// from interface Streamable
|
||||
public void writeObject (com.threerings.io.ObjectOutputStream out)
|
||||
throws java.io.IOException
|
||||
{
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.stats.data.Stat.class, "_type", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.stats.data.Stat.class, "_modified", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.stats.data.Stat.class, "_modCount", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.stats.data.StringMapStat.class, "_keys", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.stats.data.StringMapStat.class, "_values", this, out);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,4 +50,24 @@ public class ByteStringSetStat extends StringSetStat
|
||||
_values[ii] = aux.getCodeString(_type, in.readByte());
|
||||
}
|
||||
}
|
||||
|
||||
// from interface Streamable
|
||||
public void readObject (com.threerings.io.ObjectInputStream ins)
|
||||
throws java.io.IOException, java.lang.ClassNotFoundException
|
||||
{
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.stats.data.Stat.class, "_type", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.stats.data.Stat.class, "_modified", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.stats.data.Stat.class, "_modCount", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.stats.data.StringSetStat.class, "_values", this, ins);
|
||||
}
|
||||
|
||||
// from interface Streamable
|
||||
public void writeObject (com.threerings.io.ObjectOutputStream out)
|
||||
throws java.io.IOException
|
||||
{
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.stats.data.Stat.class, "_type", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.stats.data.Stat.class, "_modified", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.stats.data.Stat.class, "_modCount", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.stats.data.StringSetStat.class, "_values", this, out);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,4 +90,24 @@ public class IntArrayStat extends Stat
|
||||
|
||||
/** Contains the integer list value of this statistic. */
|
||||
protected int[] _value = new int[0];
|
||||
|
||||
// from interface Streamable
|
||||
public void readObject (com.threerings.io.ObjectInputStream ins)
|
||||
throws java.io.IOException, java.lang.ClassNotFoundException
|
||||
{
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.stats.data.Stat.class, "_type", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.stats.data.Stat.class, "_modified", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.stats.data.Stat.class, "_modCount", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.stats.data.IntArrayStat.class, "_value", this, ins);
|
||||
}
|
||||
|
||||
// from interface Streamable
|
||||
public void writeObject (com.threerings.io.ObjectOutputStream out)
|
||||
throws java.io.IOException
|
||||
{
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.stats.data.Stat.class, "_type", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.stats.data.Stat.class, "_modified", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.stats.data.Stat.class, "_modCount", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.stats.data.IntArrayStat.class, "_value", this, out);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,4 +118,26 @@ public class IntSetStat extends SetStat<Integer>
|
||||
protected StreamableArrayIntSet _intSet = new StreamableArrayIntSet();
|
||||
|
||||
protected static final int MAX_MAX_SIZE = 255;
|
||||
|
||||
// from interface Streamable
|
||||
public void readObject (com.threerings.io.ObjectInputStream ins)
|
||||
throws java.io.IOException, java.lang.ClassNotFoundException
|
||||
{
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.stats.data.Stat.class, "_type", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.stats.data.Stat.class, "_modified", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.stats.data.Stat.class, "_modCount", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.stats.data.IntSetStat.class, "_maxSize", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.stats.data.IntSetStat.class, "_intSet", this, ins);
|
||||
}
|
||||
|
||||
// from interface Streamable
|
||||
public void writeObject (com.threerings.io.ObjectOutputStream out)
|
||||
throws java.io.IOException
|
||||
{
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.stats.data.Stat.class, "_type", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.stats.data.Stat.class, "_modified", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.stats.data.Stat.class, "_modCount", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.stats.data.IntSetStat.class, "_maxSize", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.stats.data.IntSetStat.class, "_intSet", this, out);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,4 +44,20 @@ public class IntSetStatAdder extends StatModifier<IntSetStat>
|
||||
}
|
||||
|
||||
protected int _value;
|
||||
|
||||
// from interface Streamable
|
||||
public void readObject (com.threerings.io.ObjectInputStream ins)
|
||||
throws java.io.IOException, java.lang.ClassNotFoundException
|
||||
{
|
||||
super.readObject(ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.stats.data.IntSetStatAdder.class, "_value", this, ins);
|
||||
}
|
||||
|
||||
// from interface Streamable
|
||||
public void writeObject (com.threerings.io.ObjectOutputStream out)
|
||||
throws java.io.IOException
|
||||
{
|
||||
super.writeObject(out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.stats.data.IntSetStatAdder.class, "_value", this, out);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,4 +86,24 @@ public class IntStat extends Stat
|
||||
|
||||
/** Contains the integer value of this statistic. */
|
||||
protected int _value;
|
||||
|
||||
// from interface Streamable
|
||||
public void readObject (com.threerings.io.ObjectInputStream ins)
|
||||
throws java.io.IOException, java.lang.ClassNotFoundException
|
||||
{
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.stats.data.Stat.class, "_type", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.stats.data.Stat.class, "_modified", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.stats.data.Stat.class, "_modCount", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.stats.data.IntStat.class, "_value", this, ins);
|
||||
}
|
||||
|
||||
// from interface Streamable
|
||||
public void writeObject (com.threerings.io.ObjectOutputStream out)
|
||||
throws java.io.IOException
|
||||
{
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.stats.data.Stat.class, "_type", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.stats.data.Stat.class, "_modified", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.stats.data.Stat.class, "_modCount", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.stats.data.IntStat.class, "_value", this, out);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,4 +44,20 @@ public class IntStatIncrementer extends StatModifier<IntStat>
|
||||
}
|
||||
|
||||
protected int _delta;
|
||||
|
||||
// from interface Streamable
|
||||
public void readObject (com.threerings.io.ObjectInputStream ins)
|
||||
throws java.io.IOException, java.lang.ClassNotFoundException
|
||||
{
|
||||
super.readObject(ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.stats.data.IntStatIncrementer.class, "_delta", this, ins);
|
||||
}
|
||||
|
||||
// from interface Streamable
|
||||
public void writeObject (com.threerings.io.ObjectOutputStream out)
|
||||
throws java.io.IOException
|
||||
{
|
||||
super.writeObject(out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.stats.data.IntStatIncrementer.class, "_delta", this, out);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,4 +47,20 @@ public class IntStatMinimumer extends StatModifier<IntStat>
|
||||
}
|
||||
|
||||
protected int _minimum;
|
||||
|
||||
// from interface Streamable
|
||||
public void readObject (com.threerings.io.ObjectInputStream ins)
|
||||
throws java.io.IOException, java.lang.ClassNotFoundException
|
||||
{
|
||||
super.readObject(ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.stats.data.IntStatMinimumer.class, "_minimum", this, ins);
|
||||
}
|
||||
|
||||
// from interface Streamable
|
||||
public void writeObject (com.threerings.io.ObjectOutputStream out)
|
||||
throws java.io.IOException
|
||||
{
|
||||
super.writeObject(out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.stats.data.IntStatMinimumer.class, "_minimum", this, out);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,4 +50,24 @@ public class IntStringSetStat extends StringSetStat
|
||||
_values[ii] = aux.getCodeString(_type, in.readInt());
|
||||
}
|
||||
}
|
||||
|
||||
// from interface Streamable
|
||||
public void readObject (com.threerings.io.ObjectInputStream ins)
|
||||
throws java.io.IOException, java.lang.ClassNotFoundException
|
||||
{
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.stats.data.Stat.class, "_type", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.stats.data.Stat.class, "_modified", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.stats.data.Stat.class, "_modCount", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.stats.data.StringSetStat.class, "_values", this, ins);
|
||||
}
|
||||
|
||||
// from interface Streamable
|
||||
public void writeObject (com.threerings.io.ObjectOutputStream out)
|
||||
throws java.io.IOException
|
||||
{
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.stats.data.Stat.class, "_type", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.stats.data.Stat.class, "_modified", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.stats.data.Stat.class, "_modCount", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.stats.data.StringSetStat.class, "_values", this, out);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,4 +80,20 @@ public class MaxIntStat extends IntStat
|
||||
|
||||
/** The largest value ever accumulated to this stat. */
|
||||
protected int _maxValue;
|
||||
|
||||
// from interface Streamable
|
||||
public void readObject (com.threerings.io.ObjectInputStream ins)
|
||||
throws java.io.IOException, java.lang.ClassNotFoundException
|
||||
{
|
||||
super.readObject(ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.stats.data.MaxIntStat.class, "_maxValue", this, ins);
|
||||
}
|
||||
|
||||
// from interface Streamable
|
||||
public void writeObject (com.threerings.io.ObjectOutputStream out)
|
||||
throws java.io.IOException
|
||||
{
|
||||
super.writeObject(out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.stats.data.MaxIntStat.class, "_maxValue", this, out);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,4 +72,20 @@ public class MaxValueIntStat extends IntStat
|
||||
|
||||
/** The largest value that this stat has been assigned. */
|
||||
protected int _maxValue;
|
||||
|
||||
// from interface Streamable
|
||||
public void readObject (com.threerings.io.ObjectInputStream ins)
|
||||
throws java.io.IOException, java.lang.ClassNotFoundException
|
||||
{
|
||||
super.readObject(ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.stats.data.MaxValueIntStat.class, "_maxValue", this, ins);
|
||||
}
|
||||
|
||||
// from interface Streamable
|
||||
public void writeObject (com.threerings.io.ObjectOutputStream out)
|
||||
throws java.io.IOException
|
||||
{
|
||||
super.writeObject(out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.stats.data.MaxValueIntStat.class, "_maxValue", this, out);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,4 +50,24 @@ public class ShortStringSetStat extends StringSetStat
|
||||
_values[ii] = aux.getCodeString(_type, in.readShort());
|
||||
}
|
||||
}
|
||||
|
||||
// from interface Streamable
|
||||
public void readObject (com.threerings.io.ObjectInputStream ins)
|
||||
throws java.io.IOException, java.lang.ClassNotFoundException
|
||||
{
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.stats.data.Stat.class, "_type", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.stats.data.Stat.class, "_modified", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.stats.data.Stat.class, "_modCount", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.stats.data.StringSetStat.class, "_values", this, ins);
|
||||
}
|
||||
|
||||
// from interface Streamable
|
||||
public void writeObject (com.threerings.io.ObjectOutputStream out)
|
||||
throws java.io.IOException
|
||||
{
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.stats.data.Stat.class, "_type", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.stats.data.Stat.class, "_modified", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.stats.data.Stat.class, "_modCount", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.stats.data.StringSetStat.class, "_values", this, out);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public abstract class StatModifier<T extends Stat>
|
||||
throws IOException
|
||||
{
|
||||
out.writeInt(_type.code());
|
||||
out.defaultWriteObject();
|
||||
|
||||
}
|
||||
|
||||
/** Reads our custom streamable fields. */
|
||||
@@ -69,7 +69,7 @@ public abstract class StatModifier<T extends Stat>
|
||||
throws IOException, ClassNotFoundException
|
||||
{
|
||||
_type = Stat.getType(in.readInt());
|
||||
in.defaultReadObject();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user