WIP checkpoint: Phase 5(b) narya streamer codegen for ART field-order

Pre-crash safety checkpoint (box rebooted mid-implementation; NOT verified
complete). GenStreamableTask flatten-mode + GenStreamUtil runtime helper +
ObjectInputStream changes; explicit read/writeObject instrumentation across
presents net + dobj event classes so ART matches HotSpot's ClassUtil.getFields
order without the global sort flag (no data migration). narya 1.21.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HhfHCXYp2ctWi76Z91y9Ut
This commit is contained in:
2026-07-05 19:56:40 +12:00
parent 12e65f059f
commit 9ea7ecf9ee
27 changed files with 676 additions and 11 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
<parent>
<groupId>com.threerings</groupId>
<artifactId>narya-parent</artifactId>
<version>1.20</version>
<version>1.21</version>
</parent>
<artifactId>narya</artifactId>
@@ -0,0 +1,107 @@
//
// Narya library - tools for developing networked games
// Copyright (C) 2002-2025 Three Rings Design, Inc., All Rights Reserved
// https://github.com/threerings/narya/blob/master/LICENSE
package com.threerings.io;
import java.lang.reflect.Field;
import java.util.concurrent.ConcurrentHashMap;
import java.io.IOException;
/**
* Runtime support for the explicit {@code readObject}/{@code writeObject} methods emitted by {@link
* com.threerings.presents.tools.GenStreamableTask} in "flatten" mode.
*
* <p>The default reflective {@link Streamer} streams a class's fields in {@link
* com.samskivert.util.ClassUtil#getFields} order, which is <em>superclass-first</em> but relies on
* {@link Class#getDeclaredFields} <em>within</em> each class. That per-class order is not defined by
* the JVM spec and differs between HotSpot (server/desktop) and ART (Android) &mdash; so a default
* streamed object written by one and read by the other misaligns. The generated methods stream each
* field explicitly, in an order captured from HotSpot at build time, by calling {@link #readField}/
* {@link #writeField} here. Because those methods delegate to the very same {@link FieldMarshaller}
* the reflective streamer uses, the produced bytes are identical to the legacy reflective form on
* HotSpot (so existing persisted boards and DB blobs read unchanged, and desktop&harr;server is
* unaffected) while being deterministic on ART.
*/
public final class GenStreamUtil
{
/**
* Reads the named field of {@code target} (declared by {@code declaringClass}) from the stream,
* using the same {@link FieldMarshaller} the reflective streamer would use.
*/
public static void readField (
Class<?> declaringClass, String name, Object target, ObjectInputStream in)
throws IOException, ClassNotFoundException
{
Entry entry = entry(declaringClass, name);
try {
entry.marshaller.readField(entry.field, target, in);
} catch (IOException ioe) {
throw ioe;
} catch (ClassNotFoundException cnfe) {
throw cnfe;
} catch (RuntimeException re) {
throw re;
} catch (Exception e) {
throw new IOException("Failure reading field [class=" + declaringClass.getName() +
", field=" + name + "]", e);
}
}
/**
* Writes the named field of {@code source} (declared by {@code declaringClass}) to the stream,
* using the same {@link FieldMarshaller} the reflective streamer would use.
*/
public static void writeField (
Class<?> declaringClass, String name, Object source, ObjectOutputStream out)
throws IOException
{
Entry entry = entry(declaringClass, name);
try {
entry.marshaller.writeField(entry.field, source, out);
} catch (IOException ioe) {
throw ioe;
} catch (RuntimeException re) {
throw re;
} catch (Exception e) {
throw new IOException("Failure writing field [class=" + declaringClass.getName() +
", field=" + name + "]", e);
}
}
protected static Entry entry (Class<?> declaringClass, String name)
{
String key = declaringClass.getName() + "#" + name;
Entry entry = _cache.get(key);
if (entry == null) {
Field field;
try {
field = declaringClass.getDeclaredField(name);
} catch (NoSuchFieldException nsfe) {
throw new RuntimeException("Missing streamed field [class=" +
declaringClass.getName() + ", field=" + name + "]", nsfe);
}
field.setAccessible(true);
entry = new Entry(field, FieldMarshaller.getFieldMarshaller(field));
_cache.put(key, entry);
}
return entry;
}
protected static final class Entry
{
public final Field field;
public final FieldMarshaller marshaller;
public Entry (Field field, FieldMarshaller marshaller) {
this.field = field;
this.marshaller = marshaller;
}
}
/** Caches the resolved (accessible) field + its marshaller, keyed by declaring class + name. */
protected static final ConcurrentHashMap<String, Entry> _cache = new ConcurrentHashMap<String, Entry>();
private GenStreamUtil () {}
}
@@ -412,5 +412,5 @@ public class ObjectInputStream extends DataInputStream
protected static volatile List<String> _allowedPrefixes;
/** Used to activate verbose debug logging. */
protected static final boolean STREAM_DEBUG = false;
protected static final boolean STREAM_DEBUG = Boolean.getBoolean("com.threerings.io.streamDebug");
}
@@ -165,4 +165,24 @@ public class AttributeChangedEvent extends NamedEvent
protected Object _value;
protected transient Object _oldValue = UNSET_OLD_VALUE;
// AUTO-GENERATED: METHODS 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.presents.dobj.DEvent.class, "_toid", this, ins);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.dobj.NamedEvent.class, "_name", this, ins);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.dobj.AttributeChangedEvent.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.presents.dobj.DEvent.class, "_toid", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.dobj.NamedEvent.class, "_name", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.dobj.AttributeChangedEvent.class, "_value", this, out);
}
// AUTO-GENERATED: METHODS END
}
@@ -173,4 +173,22 @@ public class CompoundEvent extends DEvent
/** A list of the events associated with this compound event. */
protected StreamableArrayList<DEvent> _events;
// AUTO-GENERATED: METHODS 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.presents.dobj.DEvent.class, "_toid", this, ins);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.dobj.CompoundEvent.class, "_events", 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.DEvent.class, "_toid", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.dobj.CompoundEvent.class, "_events", this, out);
}
// AUTO-GENERATED: METHODS END
}
@@ -178,4 +178,26 @@ public class ElementUpdatedEvent extends NamedEvent
protected Object _value;
protected int _index;
protected transient Object _oldValue = UNSET_OLD_VALUE;
// AUTO-GENERATED: METHODS 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.presents.dobj.DEvent.class, "_toid", this, ins);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.dobj.NamedEvent.class, "_name", this, ins);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.dobj.ElementUpdatedEvent.class, "_value", this, ins);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.dobj.ElementUpdatedEvent.class, "_index", 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.DEvent.class, "_toid", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.dobj.NamedEvent.class, "_name", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.dobj.ElementUpdatedEvent.class, "_value", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.dobj.ElementUpdatedEvent.class, "_index", this, out);
}
// AUTO-GENERATED: METHODS END
}
@@ -107,4 +107,24 @@ public class EntryAddedEvent<T extends DSet.Entry> extends EntryEvent<T>
/** Used when this event is generated on the authoritative server where object changes are made
* immediately. This lets us know not to apply ourselves when we're actually dispatched. */
protected transient boolean _alreadyApplied;
// AUTO-GENERATED: METHODS 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.presents.dobj.DEvent.class, "_toid", this, ins);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.dobj.NamedEvent.class, "_name", this, ins);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.dobj.EntryAddedEvent.class, "_entry", 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.DEvent.class, "_toid", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.dobj.NamedEvent.class, "_name", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.dobj.EntryAddedEvent.class, "_entry", this, out);
}
// AUTO-GENERATED: METHODS END
}
@@ -109,4 +109,24 @@ public class EntryRemovedEvent<T extends DSet.Entry> extends EntryEvent<T>
@SuppressWarnings("unchecked")
protected transient T _oldEntry = (T)UNSET_OLD_ENTRY;
// AUTO-GENERATED: METHODS 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.presents.dobj.DEvent.class, "_toid", this, ins);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.dobj.NamedEvent.class, "_name", this, ins);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.dobj.EntryRemovedEvent.class, "_key", 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.DEvent.class, "_toid", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.dobj.NamedEvent.class, "_name", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.dobj.EntryRemovedEvent.class, "_key", this, out);
}
// AUTO-GENERATED: METHODS END
}
@@ -112,4 +112,24 @@ public class EntryUpdatedEvent<T extends DSet.Entry> extends EntryEvent<T>
@SuppressWarnings("unchecked")
protected transient T _oldEntry = (T)UNSET_OLD_ENTRY;
// AUTO-GENERATED: METHODS 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.presents.dobj.DEvent.class, "_toid", this, ins);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.dobj.NamedEvent.class, "_name", this, ins);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.dobj.EntryUpdatedEvent.class, "_entry", 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.DEvent.class, "_toid", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.dobj.NamedEvent.class, "_name", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.dobj.EntryUpdatedEvent.class, "_entry", this, out);
}
// AUTO-GENERATED: METHODS END
}
@@ -89,4 +89,26 @@ public class InvocationNotificationEvent extends DEvent
/** The arguments to the receiver method being invoked. */
protected Object[] _args;
// AUTO-GENERATED: METHODS 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.presents.dobj.DEvent.class, "_toid", this, ins);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.dobj.InvocationNotificationEvent.class, "_receiverId", this, ins);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.dobj.InvocationNotificationEvent.class, "_methodId", this, ins);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.dobj.InvocationNotificationEvent.class, "_args", 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.DEvent.class, "_toid", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.dobj.InvocationNotificationEvent.class, "_receiverId", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.dobj.InvocationNotificationEvent.class, "_methodId", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.dobj.InvocationNotificationEvent.class, "_args", this, out);
}
// AUTO-GENERATED: METHODS END
}
@@ -89,4 +89,26 @@ public class InvocationRequestEvent extends DEvent
/** The arguments to the method being invoked. */
protected Object[] _args;
// AUTO-GENERATED: METHODS 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.presents.dobj.DEvent.class, "_toid", this, ins);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.dobj.InvocationRequestEvent.class, "_invCode", this, ins);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.dobj.InvocationRequestEvent.class, "_methodId", this, ins);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.dobj.InvocationRequestEvent.class, "_args", 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.DEvent.class, "_toid", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.dobj.InvocationRequestEvent.class, "_invCode", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.dobj.InvocationRequestEvent.class, "_methodId", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.dobj.InvocationRequestEvent.class, "_args", this, out);
}
// AUTO-GENERATED: METHODS END
}
@@ -88,4 +88,26 @@ public class InvocationResponseEvent extends DEvent
/** The arguments to the method being invoked. */
protected Object[] _args;
// AUTO-GENERATED: METHODS 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.presents.dobj.DEvent.class, "_toid", this, ins);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.dobj.InvocationResponseEvent.class, "_requestId", this, ins);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.dobj.InvocationResponseEvent.class, "_methodId", this, ins);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.dobj.InvocationResponseEvent.class, "_args", 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.DEvent.class, "_toid", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.dobj.InvocationResponseEvent.class, "_requestId", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.dobj.InvocationResponseEvent.class, "_methodId", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.dobj.InvocationResponseEvent.class, "_args", this, out);
}
// AUTO-GENERATED: METHODS END
}
@@ -74,4 +74,24 @@ public class MessageEvent extends NamedEvent
}
protected Object[] _args;
// AUTO-GENERATED: METHODS 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.presents.dobj.DEvent.class, "_toid", this, ins);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.dobj.NamedEvent.class, "_name", this, ins);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.dobj.MessageEvent.class, "_args", 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.DEvent.class, "_toid", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.dobj.NamedEvent.class, "_name", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.dobj.MessageEvent.class, "_args", this, out);
}
// AUTO-GENERATED: METHODS END
}
@@ -78,4 +78,24 @@ public class ObjectAddedEvent extends NamedEvent
protected int _oid;
protected transient boolean _alreadyApplied;
// AUTO-GENERATED: METHODS 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.presents.dobj.DEvent.class, "_toid", this, ins);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.dobj.NamedEvent.class, "_name", this, ins);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.dobj.ObjectAddedEvent.class, "_oid", 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.DEvent.class, "_toid", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.dobj.NamedEvent.class, "_name", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.dobj.ObjectAddedEvent.class, "_oid", this, out);
}
// AUTO-GENERATED: METHODS END
}
@@ -47,4 +47,20 @@ public class ObjectDestroyedEvent extends DEvent
buf.append("DESTROY:");
super.toString(buf);
}
// AUTO-GENERATED: METHODS 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.presents.dobj.DEvent.class, "_toid", 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.DEvent.class, "_toid", this, out);
}
// AUTO-GENERATED: METHODS END
}
@@ -78,4 +78,24 @@ public class ObjectRemovedEvent extends NamedEvent
protected int _oid;
protected transient boolean _alreadyApplied;
// AUTO-GENERATED: METHODS 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.presents.dobj.DEvent.class, "_toid", this, ins);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.dobj.NamedEvent.class, "_name", this, ins);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.dobj.ObjectRemovedEvent.class, "_oid", 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.DEvent.class, "_toid", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.dobj.NamedEvent.class, "_name", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.dobj.ObjectRemovedEvent.class, "_oid", this, out);
}
// AUTO-GENERATED: METHODS END
}
@@ -55,4 +55,22 @@ public class ReleaseLockEvent extends NamedEvent
buf.append("UNLOCK:");
super.toString(buf);
}
// AUTO-GENERATED: METHODS 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.presents.dobj.DEvent.class, "_toid", this, ins);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.dobj.NamedEvent.class, "_name", 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.DEvent.class, "_toid", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.dobj.NamedEvent.class, "_name", this, out);
}
// AUTO-GENERATED: METHODS END
}
@@ -31,4 +31,24 @@ public class ServerMessageEvent extends MessageEvent
// this is what makes us server-only
return true;
}
// AUTO-GENERATED: METHODS 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.presents.dobj.DEvent.class, "_toid", this, ins);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.dobj.NamedEvent.class, "_name", this, ins);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.dobj.MessageEvent.class, "_args", 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.DEvent.class, "_toid", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.dobj.NamedEvent.class, "_name", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.dobj.MessageEvent.class, "_args", this, out);
}
// AUTO-GENERATED: METHODS END
}
@@ -113,7 +113,11 @@ public class AESAuthRequest extends AuthRequest
public void writeObject (ObjectOutputStream out)
throws IOException
{
out.defaultWriteObject();
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.net.UpstreamMessage.class, "messageId", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.net.AuthRequest.class, "_creds", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.net.AuthRequest.class, "_version", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.net.AuthRequest.class, "_zone", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.net.AuthRequest.class, "_bootGroups", this, out);
ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
ObjectOutputStream oOut = new ObjectOutputStream(byteOut);
oOut.writeObject(_clearCreds);
@@ -136,7 +140,11 @@ public class AESAuthRequest extends AuthRequest
public void readObject (ObjectInputStream in)
throws IOException, ClassNotFoundException
{
in.defaultReadObject();
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.net.UpstreamMessage.class, "messageId", this, in);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.net.AuthRequest.class, "_creds", this, in);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.net.AuthRequest.class, "_version", this, in);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.net.AuthRequest.class, "_zone", this, in);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.net.AuthRequest.class, "_bootGroups", this, in);
_contents = new byte[in.readInt()];
in.read(_contents);
}
@@ -89,7 +89,11 @@ public class AuthRequest extends UpstreamMessage
throws IOException, ClassNotFoundException
{
try {
in.defaultReadObject();
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.net.UpstreamMessage.class, "messageId", this, in);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.net.AuthRequest.class, "_creds", this, in);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.net.AuthRequest.class, "_version", this, in);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.net.AuthRequest.class, "_zone", this, in);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.net.AuthRequest.class, "_bootGroups", this, in);
} catch (IOException ioe) {
// if we fail here because the client is old, leave ourselves with a partially
// initialized set of credentials, which the server will generally cope with by telling
@@ -108,4 +112,17 @@ public class AuthRequest extends UpstreamMessage
/** The set of bootstrap service groups this client is interested in. */
protected String[] _bootGroups;
// AUTO-GENERATED: METHODS START
// from interface Streamable
public void writeObject (com.threerings.io.ObjectOutputStream out)
throws java.io.IOException
{
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.net.UpstreamMessage.class, "messageId", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.net.AuthRequest.class, "_creds", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.net.AuthRequest.class, "_version", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.net.AuthRequest.class, "_zone", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.net.AuthRequest.class, "_bootGroups", this, out);
}
// AUTO-GENERATED: METHODS END
}
@@ -45,4 +45,24 @@ public class FailureResponse extends DownstreamMessage
protected int _oid;
protected String _message;
// AUTO-GENERATED: METHODS 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.presents.net.DownstreamMessage.class, "messageId", this, ins);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.net.FailureResponse.class, "_oid", this, ins);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.net.FailureResponse.class, "_message", 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.net.DownstreamMessage.class, "messageId", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.net.FailureResponse.class, "_oid", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.net.FailureResponse.class, "_message", this, out);
}
// AUTO-GENERATED: METHODS END
}
@@ -63,7 +63,7 @@ public class PingRequest extends UpstreamMessage
// network
_packStamp = System.currentTimeMillis();
out.defaultWriteObject();
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.net.UpstreamMessage.class, "messageId", this, out);
}
/**
@@ -76,7 +76,7 @@ public class PingRequest extends UpstreamMessage
// the network
_unpackStamp = System.currentTimeMillis();
in.defaultReadObject();
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.net.UpstreamMessage.class, "messageId", this, in);
}
@Override
@@ -83,7 +83,9 @@ public class PongResponse extends DownstreamMessage
_processDelay = (int)(_packStamp - _pingStamp);
}
out.defaultWriteObject();
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.net.DownstreamMessage.class, "messageId", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.net.PongResponse.class, "_packStamp", this, out);
com.threerings.io.GenStreamUtil.writeField(com.threerings.presents.net.PongResponse.class, "_processDelay", this, out);
}
/**
@@ -96,7 +98,9 @@ public class PongResponse extends DownstreamMessage
// the network
_unpackStamp = System.currentTimeMillis();
in.defaultReadObject();
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.net.DownstreamMessage.class, "messageId", this, in);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.net.PongResponse.class, "_packStamp", this, in);
com.threerings.io.GenStreamUtil.readField(com.threerings.presents.net.PongResponse.class, "_processDelay", this, in);
}
@Override