Instrument crowd data classes with generated streamers (Epic A1 Phase 5)
The presents transport layer got explicit streamers in 1.21/1.22, but crowd's value classes (OccupantInfo, chat messages, BodyObject/PlaceObject fields) still streamed reflectively — nondeterministic field order on Android/ART. Generated with bang's genStreamableLibs task (ancestor-aware flatten mode). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HhfHCXYp2ctWi76Z91y9Ut
This commit is contained in:
@@ -32,4 +32,22 @@ public class SystemMessage extends ChatMessage
|
||||
super(message, bundle);
|
||||
this.attentionLevel = attentionLevel;
|
||||
}
|
||||
|
||||
// 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.crowd.chat.data.ChatMessage.class, "message", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.crowd.chat.data.ChatMessage.class, "bundle", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.crowd.chat.data.SystemMessage.class, "attentionLevel", this, ins);
|
||||
}
|
||||
|
||||
// from interface Streamable
|
||||
public void writeObject (com.threerings.io.ObjectOutputStream out)
|
||||
throws java.io.IOException
|
||||
{
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.crowd.chat.data.ChatMessage.class, "message", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.crowd.chat.data.ChatMessage.class, "bundle", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.crowd.chat.data.SystemMessage.class, "attentionLevel", this, out);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,4 +36,20 @@ public class TellFeedbackMessage extends UserMessage
|
||||
}
|
||||
|
||||
protected boolean _failure;
|
||||
|
||||
// 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.crowd.chat.data.TellFeedbackMessage.class, "_failure", 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.crowd.chat.data.TellFeedbackMessage.class, "_failure", this, out);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,4 +62,24 @@ public class UserMessage extends ChatMessage
|
||||
}
|
||||
return "m.speak_format";
|
||||
}
|
||||
|
||||
// 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.crowd.chat.data.ChatMessage.class, "message", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.crowd.chat.data.ChatMessage.class, "bundle", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.crowd.chat.data.UserMessage.class, "speaker", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.crowd.chat.data.UserMessage.class, "mode", this, ins);
|
||||
}
|
||||
|
||||
// from interface Streamable
|
||||
public void writeObject (com.threerings.io.ObjectOutputStream out)
|
||||
throws java.io.IOException
|
||||
{
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.crowd.chat.data.ChatMessage.class, "message", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.crowd.chat.data.ChatMessage.class, "bundle", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.crowd.chat.data.UserMessage.class, "speaker", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.crowd.chat.data.UserMessage.class, "mode", this, out);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,4 +32,20 @@ public class UserSystemMessage extends SystemMessage
|
||||
super(message, bundle, attentionLevel);
|
||||
this.speaker = sender;
|
||||
}
|
||||
|
||||
// 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.crowd.chat.data.UserSystemMessage.class, "speaker", 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.crowd.chat.data.UserSystemMessage.class, "speaker", this, out);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,4 +237,28 @@ public class BodyObject extends ClientObject
|
||||
|
||||
/** The default (no tokens) access control. */
|
||||
protected static final TokenRing EMPTY_TOKENS = new TokenRing(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.presents.dobj.DObject.class, "_oid", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.data.ClientObject.class, "username", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.data.ClientObject.class, "receivers", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.crowd.data.BodyObject.class, "location", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.crowd.data.BodyObject.class, "status", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.crowd.data.BodyObject.class, "awayMessage", this, ins);
|
||||
}
|
||||
|
||||
// from interface Streamable
|
||||
public void writeObject (com.threerings.io.ObjectOutputStream out)
|
||||
throws java.io.IOException
|
||||
{
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.dobj.DObject.class, "_oid", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.data.ClientObject.class, "username", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.data.ClientObject.class, "receivers", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.crowd.data.BodyObject.class, "location", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.crowd.data.BodyObject.class, "status", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.crowd.data.BodyObject.class, "awayMessage", this, out);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,4 +117,22 @@ public class OccupantInfo extends SimpleStreamableObject
|
||||
throw new AssertionError(cnse);
|
||||
}
|
||||
}
|
||||
|
||||
// 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.crowd.data.OccupantInfo.class, "bodyOid", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.crowd.data.OccupantInfo.class, "username", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.crowd.data.OccupantInfo.class, "status", this, ins);
|
||||
}
|
||||
|
||||
// from interface Streamable
|
||||
public void writeObject (com.threerings.io.ObjectOutputStream out)
|
||||
throws java.io.IOException
|
||||
{
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.crowd.data.OccupantInfo.class, "bodyOid", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.crowd.data.OccupantInfo.class, "username", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.crowd.data.OccupantInfo.class, "status", this, out);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,4 +37,18 @@ public class Place extends SimpleStreamableObject
|
||||
{
|
||||
return placeOid;
|
||||
}
|
||||
|
||||
// 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.crowd.data.Place.class, "placeOid", this, ins);
|
||||
}
|
||||
|
||||
// from interface Streamable
|
||||
public void writeObject (com.threerings.io.ObjectOutputStream out)
|
||||
throws java.io.IOException
|
||||
{
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.crowd.data.Place.class, "placeOid", this, out);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -236,4 +236,24 @@ public class PlaceObject extends DObject
|
||||
this.speakService = value;
|
||||
}
|
||||
// AUTO-GENERATED: METHODS END
|
||||
|
||||
// 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.presents.dobj.DObject.class, "_oid", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.crowd.data.PlaceObject.class, "occupants", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.crowd.data.PlaceObject.class, "occupantInfo", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.crowd.data.PlaceObject.class, "speakService", this, ins);
|
||||
}
|
||||
|
||||
// from interface Streamable
|
||||
public void writeObject (com.threerings.io.ObjectOutputStream out)
|
||||
throws java.io.IOException
|
||||
{
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.dobj.DObject.class, "_oid", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.crowd.data.PlaceObject.class, "occupants", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.crowd.data.PlaceObject.class, "occupantInfo", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.crowd.data.PlaceObject.class, "speakService", this, out);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,4 +89,18 @@ public class TokenRing extends SimpleStreamableObject
|
||||
|
||||
/** The tokens contained in this ring (composed together bitwise). */
|
||||
protected int _tokens;
|
||||
|
||||
// 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.crowd.data.TokenRing.class, "_tokens", this, ins);
|
||||
}
|
||||
|
||||
// from interface Streamable
|
||||
public void writeObject (com.threerings.io.ObjectOutputStream out)
|
||||
throws java.io.IOException
|
||||
{
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.crowd.data.TokenRing.class, "_tokens", this, out);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,4 +16,20 @@ public class CrowdClientInfo extends ClientInfo
|
||||
{
|
||||
/** The client's visible name, which is used for chatting. */
|
||||
public Name visibleName;
|
||||
|
||||
// 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.presents.peer.data.ClientInfo.class, "username", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.crowd.peer.data.CrowdClientInfo.class, "visibleName", this, ins);
|
||||
}
|
||||
|
||||
// from interface Streamable
|
||||
public void writeObject (com.threerings.io.ObjectOutputStream out)
|
||||
throws java.io.IOException
|
||||
{
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.peer.data.ClientInfo.class, "username", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.crowd.peer.data.CrowdClientInfo.class, "visibleName", this, out);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,4 +101,38 @@ public class CrowdNodeObject extends NodeObject
|
||||
this.hostedChannels = clone;
|
||||
}
|
||||
// AUTO-GENERATED: METHODS END
|
||||
|
||||
// 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.presents.dobj.DObject.class, "_oid", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.peer.data.NodeObject.class, "nodeName", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.peer.data.NodeObject.class, "bootStamp", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.peer.data.NodeObject.class, "peerService", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.peer.data.NodeObject.class, "clients", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.peer.data.NodeObject.class, "locks", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.peer.data.NodeObject.class, "acquiringLock", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.peer.data.NodeObject.class, "releasingLock", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.peer.data.NodeObject.class, "cacheData", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.crowd.peer.data.CrowdNodeObject.class, "crowdPeerService", this, ins);
|
||||
com.threerings.io.GenStreamUtil.readField(com.threerings.crowd.peer.data.CrowdNodeObject.class, "hostedChannels", this, ins);
|
||||
}
|
||||
|
||||
// from interface Streamable
|
||||
public void writeObject (com.threerings.io.ObjectOutputStream out)
|
||||
throws java.io.IOException
|
||||
{
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.dobj.DObject.class, "_oid", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.peer.data.NodeObject.class, "nodeName", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.peer.data.NodeObject.class, "bootStamp", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.peer.data.NodeObject.class, "peerService", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.peer.data.NodeObject.class, "clients", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.peer.data.NodeObject.class, "locks", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.peer.data.NodeObject.class, "acquiringLock", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.peer.data.NodeObject.class, "releasingLock", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.peer.data.NodeObject.class, "cacheData", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.crowd.peer.data.CrowdNodeObject.class, "crowdPeerService", this, out);
|
||||
com.threerings.io.GenStreamUtil.writeField(com.threerings.crowd.peer.data.CrowdNodeObject.class, "hostedChannels", this, out);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user