diff --git a/src/java/com/threerings/crowd/chat/data/ChatMessage.java b/src/java/com/threerings/crowd/chat/data/ChatMessage.java index 3bfaa2bdc..55c74a412 100644 --- a/src/java/com/threerings/crowd/chat/data/ChatMessage.java +++ b/src/java/com/threerings/crowd/chat/data/ChatMessage.java @@ -21,8 +21,12 @@ package com.threerings.crowd.chat.data; +import java.io.IOException; + import com.samskivert.util.StringUtil; +import com.threerings.io.ObjectInputStream; +import com.threerings.io.ObjectOutputStream; import com.threerings.io.Streamable; /** @@ -37,8 +41,8 @@ public abstract class ChatMessage /** The bundle to use when translating this message. */ public String bundle; - /** The client side 'localtype' of this chat, set to the type - * registered with an auxiliary source in the ChatDirector. */ + /** The client side 'localtype' of this chat, set to the type registered with an auxiliary + * source in the ChatDirector. */ public transient String localtype; /** The client time that this message was created. */ @@ -61,8 +65,8 @@ public abstract class ChatMessage } /** - * Once this message reaches the client, the information contained within - * is changed around a bit. + * Once this message reaches the client, the information contained within is changed around a + * bit. */ public void setClientInfo (String msg, String localtype) { @@ -85,7 +89,24 @@ public abstract class ChatMessage */ public String toString () { - return StringUtil.shortClassName(this) + - StringUtil.fieldsToString(this); + return StringUtil.shortClassName(this) + StringUtil.fieldsToString(this); } + + // AUTO-GENERATED: METHODS START + // from interface Streamable + public void readObject (ObjectInputStream ins) + throws IOException, ClassNotFoundException + { + message = ins.readUTF(); + bundle = ins.readUTF(); + } + + // from interface Streamable + public void writeObject (ObjectOutputStream out) + throws IOException + { + out.writeUTF(message); + out.writeUTF(bundle); + } + // AUTO-GENERATED: METHODS END } diff --git a/src/java/com/threerings/crowd/chat/data/SystemMessage.java b/src/java/com/threerings/crowd/chat/data/SystemMessage.java index 4708b8c00..cd9ce3228 100644 --- a/src/java/com/threerings/crowd/chat/data/SystemMessage.java +++ b/src/java/com/threerings/crowd/chat/data/SystemMessage.java @@ -21,25 +21,27 @@ package com.threerings.crowd.chat.data; +import java.io.IOException; + +import com.threerings.io.ObjectInputStream; +import com.threerings.io.ObjectOutputStream; + /** - * A ChatMessage that represents a message that came from the server - * and did not result from direct user action. + * A ChatMessage that represents a message that came from the server and did not result from direct + * user action. */ public class SystemMessage extends ChatMessage { - /** Attention level constant to indicate that this message is merely - * providing the user with information. */ + /** Attention level constant to indicate that this message is merely providing the user with + * information. */ public static final byte INFO = 0; - /** Attention level constant to indicate that this message is the - * result of a user action. */ + /** Attention level constant to indicate that this message is the result of a user action. */ public static final byte FEEDBACK = 1; /** Attention level constant to indicate that some action is required. */ public static final byte ATTENTION = 2; - //---- - /** The attention level of this message. */ public byte attentionLevel; @@ -56,4 +58,22 @@ public class SystemMessage extends ChatMessage super(message, bundle); this.attentionLevel = attentionLevel; } + + // AUTO-GENERATED: METHODS START + // from interface Streamable + public void readObject (ObjectInputStream ins) + throws IOException, ClassNotFoundException + { + super.readObject(ins); + attentionLevel = ins.readByte(); + } + + // from interface Streamable + public void writeObject (ObjectOutputStream out) + throws IOException + { + super.writeObject(out); + out.writeByte(attentionLevel); + } + // AUTO-GENERATED: METHODS END } diff --git a/src/java/com/threerings/crowd/chat/data/TellFeedbackMessage.java b/src/java/com/threerings/crowd/chat/data/TellFeedbackMessage.java index 014bd4d96..a8d403c50 100644 --- a/src/java/com/threerings/crowd/chat/data/TellFeedbackMessage.java +++ b/src/java/com/threerings/crowd/chat/data/TellFeedbackMessage.java @@ -21,6 +21,10 @@ package com.threerings.crowd.chat.data; +import java.io.IOException; + +import com.threerings.io.ObjectInputStream; +import com.threerings.io.ObjectOutputStream; import com.threerings.util.Name; /** @@ -52,5 +56,23 @@ public class TellFeedbackMessage extends UserMessage return _failure ? null : "m.told_format"; } + // AUTO-GENERATED: METHODS START + // from interface Streamable + public void readObject (ObjectInputStream ins) + throws IOException, ClassNotFoundException + { + super.readObject(ins); + _failure = ins.readBoolean(); + } + + // from interface Streamable + public void writeObject (ObjectOutputStream out) + throws IOException + { + super.writeObject(out); + out.writeBoolean(_failure); + } + // AUTO-GENERATED: METHODS END + protected boolean _failure; } diff --git a/src/java/com/threerings/crowd/chat/data/UserMessage.java b/src/java/com/threerings/crowd/chat/data/UserMessage.java index f52fd12ff..90aeba155 100644 --- a/src/java/com/threerings/crowd/chat/data/UserMessage.java +++ b/src/java/com/threerings/crowd/chat/data/UserMessage.java @@ -21,6 +21,10 @@ package com.threerings.crowd.chat.data; +import java.io.IOException; + +import com.threerings.io.ObjectOutputStream; +import com.threerings.io.ObjectInputStream; import com.threerings.util.Name; /** @@ -52,8 +56,8 @@ public class UserMessage extends ChatMessage } /** - * Constructs a user message for a player originated tell (which has no - * bundle and is in the default mode). + * Constructs a user message for a player originated tell (which has no bundle and is in the + * default mode). */ public UserMessage (Name speaker, String message) { @@ -63,9 +67,8 @@ public class UserMessage extends ChatMessage } /** - * Returns the name to display for the speaker. Some types of messages - * may wish to not use the canonical name for the speaker and should thus - * override this function. + * Returns the name to display for the speaker. Some types of messages may wish to not use the + * canonical name for the speaker and should thus override this function. */ public Name getSpeakerDisplayName () { @@ -87,4 +90,24 @@ public class UserMessage extends ChatMessage } return "m.speak_format"; } + + // AUTO-GENERATED: METHODS START + // from interface Streamable + public void readObject (ObjectInputStream ins) + throws IOException, ClassNotFoundException + { + super.readObject(ins); + speaker = (Name)ins.readObject(); + mode = ins.readByte(); + } + + // from interface Streamable + public void writeObject (ObjectOutputStream out) + throws IOException + { + super.writeObject(out); + out.writeObject(speaker); + out.writeByte(mode); + } + // AUTO-GENERATED: METHODS END } diff --git a/src/java/com/threerings/crowd/chat/data/UserSystemMessage.java b/src/java/com/threerings/crowd/chat/data/UserSystemMessage.java index d7fe47ce4..36346c9bd 100644 --- a/src/java/com/threerings/crowd/chat/data/UserSystemMessage.java +++ b/src/java/com/threerings/crowd/chat/data/UserSystemMessage.java @@ -21,17 +21,19 @@ package com.threerings.crowd.chat.data; +import java.io.IOException; + +import com.threerings.io.ObjectInputStream; +import com.threerings.io.ObjectOutputStream; import com.threerings.util.Name; /** - * A system message triggered by the activity of another user. - * If the user is muted we can suppress this message, unlike a normal - * system message. + * A system message triggered by the activity of another user. If the user is muted we can suppress + * this message, unlike a normal system message. */ public class UserSystemMessage extends SystemMessage { - /** The "speaker" of this message, the user that triggered that this - * message be sent to us. */ + /** The "speaker" of this message, the user that triggered that this message be sent to us. */ public Name speaker; /** Suitable for unserialization. */ @@ -50,10 +52,27 @@ public class UserSystemMessage extends SystemMessage /** * Construct a UserSystemMessage. */ - public UserSystemMessage (Name sender, String message, String bundle, - byte attentionLevel) + public UserSystemMessage (Name sender, String message, String bundle, byte attentionLevel) { super(message, bundle, attentionLevel); this.speaker = sender; } + + // AUTO-GENERATED: METHODS START + // from interface Streamable + public void readObject (ObjectInputStream ins) + throws IOException, ClassNotFoundException + { + super.readObject(ins); + speaker = (Name)ins.readObject(); + } + + // from interface Streamable + public void writeObject (ObjectOutputStream out) + throws IOException + { + super.writeObject(out); + out.writeObject(speaker); + } + // AUTO-GENERATED: METHODS END } diff --git a/src/java/com/threerings/crowd/data/OccupantInfo.java b/src/java/com/threerings/crowd/data/OccupantInfo.java index a37b2703d..406e00a42 100644 --- a/src/java/com/threerings/crowd/data/OccupantInfo.java +++ b/src/java/com/threerings/crowd/data/OccupantInfo.java @@ -21,6 +21,10 @@ package com.threerings.crowd.data; +import java.io.IOException; + +import com.threerings.io.ObjectInputStream; +import com.threerings.io.ObjectOutputStream; import com.threerings.io.SimpleStreamableObject; import com.threerings.util.Name; @@ -29,20 +33,17 @@ import com.threerings.presents.dobj.DSet; import com.threerings.crowd.data.BodyObject; /** - * The occupant info object contains all of the information about an - * occupant of a place that should be shared with other occupants of the - * place. These objects are stored in the place object itself and are - * updated when bodies enter and exit a place. + * The occupant info object contains all of the information about an occupant of a place that + * should be shared with other occupants of the place. These objects are stored in the place object + * itself and are updated when bodies enter and exit a place. * - *

A system that builds upon the Crowd framework can extend this class to - * include extra information about their occupants. They will need to provide a - * derived {@link BodyObject} that creates and configures their occupant info - * in {@link BodyObject#createOccupantInfo}. + *

A system that builds upon the Crowd framework can extend this class to include extra + * information about their occupants. They will need to provide a derived {@link BodyObject} that + * creates and configures their occupant info in {@link BodyObject#createOccupantInfo}. * - *

Note also that this class implements {@link Cloneable} which means - * that if derived classes add non-primitive attributes, they are - * responsible for adding the code to clone those attributes when a clone - * is requested. + *

Note also that this class implements {@link Cloneable} which means that if derived classes + * add non-primitive attributes, they are responsible for adding the code to clone those attributes + * when a clone is requested. */ public class OccupantInfo extends SimpleStreamableObject implements DSet.Entry, Cloneable @@ -69,8 +70,7 @@ public class OccupantInfo extends SimpleStreamableObject public byte status = ACTIVE; /** - * Creates an occupant info with information from the specified occupant's - * body object. + * Creates an occupant info with information from the specified occupant's body object. */ public OccupantInfo (BodyObject body) { @@ -107,4 +107,24 @@ public class OccupantInfo extends SimpleStreamableObject throw new RuntimeException(cnse); } } + + // AUTO-GENERATED: METHODS START + // from interface Streamable + public void readObject (ObjectInputStream ins) + throws IOException, ClassNotFoundException + { + bodyOid = ins.readInt(); + username = (Name)ins.readObject(); + status = ins.readByte(); + } + + // from interface Streamable + public void writeObject (ObjectOutputStream out) + throws IOException + { + out.writeInt(bodyOid); + out.writeObject(username); + out.writeByte(status); + } + // AUTO-GENERATED: METHODS END } diff --git a/src/java/com/threerings/crowd/data/TokenRing.java b/src/java/com/threerings/crowd/data/TokenRing.java index 67f764a1a..4bbba09a5 100644 --- a/src/java/com/threerings/crowd/data/TokenRing.java +++ b/src/java/com/threerings/crowd/data/TokenRing.java @@ -21,16 +21,20 @@ package com.threerings.crowd.data; +import java.io.IOException; + +import com.threerings.io.ObjectInputStream; +import com.threerings.io.ObjectOutputStream; import com.threerings.io.SimpleStreamableObject; /** - * Defines access control tokens that convey certain privileges to users - * (see {@link BodyObject#checkAccess}). + * Defines access control tokens that convey certain privileges to users (see {@link + * BodyObject#checkAccess}). */ public class TokenRing extends SimpleStreamableObject { - /** Indicates that this user is an administrator and can do things - * like broadcast, shutdown the server and whatnot. */ + /** Indicates that this user is an administrator and can do things like broadcast, shutdown the + * server and whatnot. */ public static final int ADMIN = (1 << 0); /** @@ -49,10 +53,9 @@ public class TokenRing extends SimpleStreamableObject } /** - * Returns true if this token ring contains the specified token or tokens, - * exactly. - * For example, if you pass in the OR of two or more tokens, - * then the ring must contain all of those tokens. + * Returns true if this token ring contains the specified token or tokens, exactly. For + * example, if you pass in the OR of two or more tokens, then the ring must contain all of + * those tokens. */ public boolean holdsToken (int token) { @@ -68,8 +71,7 @@ public class TokenRing extends SimpleStreamableObject } /** - * Convenience function for checking whether this ring holds the - * {@link #ADMIN} token. + * Convenience function for checking whether this ring holds the {@link #ADMIN} token. */ public boolean isAdmin () { @@ -112,6 +114,22 @@ public class TokenRing extends SimpleStreamableObject _tokens &= ~token; } + // AUTO-GENERATED: METHODS START + // from interface Streamable + public void readObject (ObjectInputStream ins) + throws IOException, ClassNotFoundException + { + _tokens = ins.readInt(); + } + + // from interface Streamable + public void writeObject (ObjectOutputStream out) + throws IOException + { + out.writeInt(_tokens); + } + // AUTO-GENERATED: METHODS END + /** The tokens contained in this ring (composed together bitwise). */ protected int _tokens; } diff --git a/src/java/com/threerings/crowd/peer/data/CrowdClientInfo.java b/src/java/com/threerings/crowd/peer/data/CrowdClientInfo.java index 313548a64..668b516e3 100644 --- a/src/java/com/threerings/crowd/peer/data/CrowdClientInfo.java +++ b/src/java/com/threerings/crowd/peer/data/CrowdClientInfo.java @@ -21,6 +21,10 @@ package com.threerings.crowd.peer.data; +import java.io.IOException; + +import com.threerings.io.ObjectInputStream; +import com.threerings.io.ObjectOutputStream; import com.threerings.util.Name; import com.threerings.presents.peer.data.ClientInfo; @@ -42,4 +46,20 @@ public class CrowdClientInfo extends ClientInfo // makes lookups much more efficient return visibleName; } + + // AUTO-GENERATED: METHODS START + // from interface Streamable + public void readObject (ObjectInputStream ins) + throws IOException, ClassNotFoundException + { + visibleName = (Name)ins.readObject(); + } + + // from interface Streamable + public void writeObject (ObjectOutputStream out) + throws IOException + { + out.writeObject(visibleName); + } + // AUTO-GENERATED: METHODS END } diff --git a/src/java/com/threerings/presents/data/ConMgrStats.java b/src/java/com/threerings/presents/data/ConMgrStats.java index a42c1000a..2dd579e79 100644 --- a/src/java/com/threerings/presents/data/ConMgrStats.java +++ b/src/java/com/threerings/presents/data/ConMgrStats.java @@ -21,6 +21,10 @@ package com.threerings.presents.data; +import java.io.IOException; + +import com.threerings.io.ObjectInputStream; +import com.threerings.io.ObjectOutputStream; import com.threerings.io.SimpleStreamableObject; /** @@ -29,20 +33,18 @@ import com.threerings.io.SimpleStreamableObject; public class ConMgrStats extends SimpleStreamableObject implements Cloneable { - /** The size of the queue of waiting to auth sockets. This is a snapshot at - * the time the stats are requested. */ + /** The size of the queue of waiting to auth sockets. This is a snapshot at the time the stats + * are requested. */ public int authQueueSize; - /** The size of the queue of waiting to die sockets. This is a snapshot at - * the time the stats are requested. */ + /** The size of the queue of waiting to die sockets. This is a snapshot at the time the stats + * are requested. */ public int deathQueueSize; - /** The outgoing queue size. This is a snapshot at the time the stats are - * requested. */ + /** The outgoing queue size. This is a snapshot at the time the stats are requested. */ public int outQueueSize; - /** The overflow queue size. This is a snapshot at the time the stats are - * requested. */ + /** The overflow queue size. This is a snapshot at the time the stats are requested. */ public int overQueueSize; /** The number of connection events since the server started up. */ @@ -72,4 +74,38 @@ public class ConMgrStats extends SimpleStreamableObject throw new RuntimeException(cnse); } } + + // AUTO-GENERATED: METHODS START + // from interface Streamable + public void readObject (ObjectInputStream ins) + throws IOException, ClassNotFoundException + { + authQueueSize = ins.readInt(); + deathQueueSize = ins.readInt(); + outQueueSize = ins.readInt(); + overQueueSize = ins.readInt(); + connects = ins.readInt(); + disconnects = ins.readInt(); + bytesIn = ins.readLong(); + bytesOut = ins.readLong(); + msgsIn = ins.readInt(); + msgsOut = ins.readInt(); + } + + // from interface Streamable + public void writeObject (ObjectOutputStream out) + throws IOException + { + out.writeInt(authQueueSize); + out.writeInt(deathQueueSize); + out.writeInt(outQueueSize); + out.writeInt(overQueueSize); + out.writeInt(connects); + out.writeInt(disconnects); + out.writeLong(bytesIn); + out.writeLong(bytesOut); + out.writeInt(msgsIn); + out.writeInt(msgsOut); + } + // AUTO-GENERATED: METHODS END } diff --git a/src/java/com/threerings/presents/data/InvocationMarshaller.java b/src/java/com/threerings/presents/data/InvocationMarshaller.java index 36c80feeb..108d14c64 100644 --- a/src/java/com/threerings/presents/data/InvocationMarshaller.java +++ b/src/java/com/threerings/presents/data/InvocationMarshaller.java @@ -21,8 +21,12 @@ package com.threerings.presents.data; +import java.io.IOException; + import com.samskivert.util.StringUtil; +import com.threerings.io.ObjectInputStream; +import com.threerings.io.ObjectOutputStream; import com.threerings.io.Streamable; import com.threerings.presents.Log; @@ -234,6 +238,32 @@ public class InvocationMarshaller } } + /** + * Generates a string representation of this instance. + */ + public String toString () + { + return "[invOid=" + _invOid + ", code=" + _invCode + ", type=" + getClass().getName() + "]"; + } + + // AUTO-GENERATED: METHODS START + // from interface Streamable + public void readObject (ObjectInputStream ins) + throws IOException, ClassNotFoundException + { + _invOid = ins.readInt(); + _invCode = ins.readInt(); + } + + // from interface Streamable + public void writeObject (ObjectOutputStream out) + throws IOException + { + out.writeInt(_invOid); + out.writeInt(_invCode); + } + // AUTO-GENERATED: METHODS END + /** * Called by generated invocation marshaller code; packages up and sends the specified * invocation service request. @@ -243,14 +273,6 @@ public class InvocationMarshaller client.getInvocationDirector().sendRequest(_invOid, _invCode, methodId, args); } - /** - * Generates a string representation of this instance. - */ - public String toString () - { - return "[invOid=" + _invOid + ", code=" + _invCode + ", type=" + getClass().getName() + "]"; - } - /** The oid of the invocation object, where invocation service requests are sent. */ protected int _invOid; diff --git a/src/java/com/threerings/presents/peer/data/ClientInfo.java b/src/java/com/threerings/presents/peer/data/ClientInfo.java index cbb2be1a2..374641c2d 100644 --- a/src/java/com/threerings/presents/peer/data/ClientInfo.java +++ b/src/java/com/threerings/presents/peer/data/ClientInfo.java @@ -21,6 +21,10 @@ package com.threerings.presents.peer.data; +import java.io.IOException; + +import com.threerings.io.ObjectInputStream; +import com.threerings.io.ObjectOutputStream; import com.threerings.io.SimpleStreamableObject; import com.threerings.util.Name; @@ -40,4 +44,20 @@ public class ClientInfo extends SimpleStreamableObject { return username; } + + // AUTO-GENERATED: METHODS START + // from interface Streamable + public void readObject (ObjectInputStream ins) + throws IOException, ClassNotFoundException + { + username = (Name)ins.readObject(); + } + + // from interface Streamable + public void writeObject (ObjectOutputStream out) + throws IOException + { + out.writeObject(username); + } + // AUTO-GENERATED: METHODS END }