More revamped serialization cleanup.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2079 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,19 +1,14 @@
|
||||
//
|
||||
// $Id: LobbyConfig.java,v 1.6 2002/07/23 05:54:52 mdb Exp $
|
||||
// $Id: LobbyConfig.java,v 1.7 2002/12/20 23:41:26 mdb Exp $
|
||||
|
||||
package com.threerings.micasa.lobby;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JLabel;
|
||||
|
||||
import java.util.Properties;
|
||||
import com.samskivert.util.StringUtil;
|
||||
|
||||
import com.threerings.io.ObjectInputStream;
|
||||
import com.threerings.io.ObjectOutputStream;
|
||||
|
||||
import com.threerings.crowd.data.PlaceConfig;
|
||||
import com.threerings.parlor.game.GameConfig;
|
||||
import com.threerings.micasa.util.MiCasaContext;
|
||||
@@ -65,26 +60,6 @@ public class LobbyConfig extends PlaceConfig
|
||||
_gameConfigClass = getConfigValue(config, "game_config");
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes our custom streamable fields.
|
||||
*/
|
||||
public void writeObject (ObjectOutputStream out)
|
||||
throws IOException
|
||||
{
|
||||
out.defaultWriteObject();
|
||||
out.writeUTF(_gameConfigClass);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads our custom streamable fields.
|
||||
*/
|
||||
public void readObject (ObjectInputStream in)
|
||||
throws IOException, ClassNotFoundException
|
||||
{
|
||||
in.defaultReadObject();
|
||||
_gameConfigClass = in.readUTF();
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
protected void toString (StringBuffer buf)
|
||||
{
|
||||
|
||||
@@ -1,15 +1,10 @@
|
||||
//
|
||||
// $Id: Table.java,v 1.11 2002/08/14 19:07:53 mdb Exp $
|
||||
// $Id: Table.java,v 1.12 2002/12/20 23:41:26 mdb Exp $
|
||||
|
||||
package com.threerings.parlor.data;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.samskivert.util.StringUtil;
|
||||
|
||||
import com.threerings.io.ObjectInputStream;
|
||||
import com.threerings.io.ObjectOutputStream;
|
||||
|
||||
import com.threerings.presents.dobj.DSet;
|
||||
|
||||
import com.threerings.parlor.data.ParlorCodes;
|
||||
@@ -255,26 +250,6 @@ public class Table
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes our custom streamable fields.
|
||||
*/
|
||||
public void writeObject (ObjectOutputStream out)
|
||||
throws IOException
|
||||
{
|
||||
out.defaultWriteObject();
|
||||
out.writeObject(_tconfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads our custom streamable fields.
|
||||
*/
|
||||
public void readObject (ObjectInputStream in)
|
||||
throws IOException, ClassNotFoundException
|
||||
{
|
||||
in.defaultReadObject();
|
||||
_tconfig = (TableConfig)in.readObject();
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a string representation of this table instance.
|
||||
*/
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
//
|
||||
// $Id: InvocationMarshaller.java,v 1.3 2002/12/08 02:18:50 mdb Exp $
|
||||
// $Id: InvocationMarshaller.java,v 1.4 2002/12/20 23:41:26 mdb Exp $
|
||||
|
||||
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;
|
||||
@@ -129,26 +125,6 @@ public class InvocationMarshaller
|
||||
_invOid, _invCode, methodId, args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes this instance to the supplied output stream.
|
||||
*/
|
||||
public void writeObject (ObjectOutputStream out)
|
||||
throws IOException
|
||||
{
|
||||
out.writeInt(_invOid);
|
||||
out.writeShort(_invCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads this instance from the supplied input stream.
|
||||
*/
|
||||
public void readObject (ObjectInputStream in)
|
||||
throws IOException
|
||||
{
|
||||
_invOid = in.readInt();
|
||||
_invCode = in.readShort();
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a string representation of this instance.
|
||||
*/
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
//
|
||||
// $Id: CompoundEvent.java,v 1.7 2002/12/20 23:29:04 mdb Exp $
|
||||
// $Id: CompoundEvent.java,v 1.8 2002/12/20 23:41:26 mdb Exp $
|
||||
|
||||
package com.threerings.presents.dobj;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.threerings.io.ObjectInputStream;
|
||||
import com.threerings.io.ObjectOutputStream;
|
||||
import com.threerings.util.StreamableArrayList;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
//
|
||||
// $Id: DEvent.java,v 1.11 2002/07/23 05:52:48 mdb Exp $
|
||||
// $Id: DEvent.java,v 1.12 2002/12/20 23:41:26 mdb Exp $
|
||||
|
||||
package com.threerings.presents.dobj;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.threerings.io.ObjectInputStream;
|
||||
import com.threerings.io.ObjectOutputStream;
|
||||
import com.threerings.io.Streamable;
|
||||
|
||||
/**
|
||||
@@ -91,26 +87,6 @@ public abstract class DEvent implements Streamable
|
||||
// the default is to do nothing
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes our custom streamable fields.
|
||||
*/
|
||||
public void writeObject (ObjectOutputStream out)
|
||||
throws IOException
|
||||
{
|
||||
out.defaultWriteObject();
|
||||
out.writeInt(_toid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads our custom streamable fields.
|
||||
*/
|
||||
public void readObject (ObjectInputStream in)
|
||||
throws IOException, ClassNotFoundException
|
||||
{
|
||||
in.defaultReadObject();
|
||||
_toid = in.readInt();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs and returns a string representation of this event.
|
||||
*/
|
||||
|
||||
@@ -1,17 +1,14 @@
|
||||
//
|
||||
// $Id: DObject.java,v 1.55 2002/12/12 00:30:47 mdb Exp $
|
||||
// $Id: DObject.java,v 1.56 2002/12/20 23:41:26 mdb Exp $
|
||||
|
||||
package com.threerings.presents.dobj;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.samskivert.util.ListUtil;
|
||||
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;
|
||||
@@ -696,26 +693,6 @@ public class DObject implements Streamable
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes our custom streamable fields.
|
||||
*/
|
||||
public void writeObject (ObjectOutputStream out)
|
||||
throws IOException
|
||||
{
|
||||
out.defaultWriteObject();
|
||||
out.writeInt(_oid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads our custom streamable fields.
|
||||
*/
|
||||
public void readObject (ObjectInputStream in)
|
||||
throws IOException, ClassNotFoundException
|
||||
{
|
||||
in.defaultReadObject();
|
||||
_oid = in.readInt();
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes this object from participation in any transaction in which
|
||||
* it might be taking part.
|
||||
|
||||
@@ -1,17 +1,14 @@
|
||||
//
|
||||
// $Id: DSet.java,v 1.24 2002/12/20 23:29:04 mdb Exp $
|
||||
// $Id: DSet.java,v 1.25 2002/12/20 23:41:26 mdb Exp $
|
||||
|
||||
package com.threerings.presents.dobj;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Comparator;
|
||||
import java.util.Iterator;
|
||||
|
||||
import com.samskivert.util.ArrayUtil;
|
||||
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;
|
||||
@@ -297,36 +294,6 @@ public class DSet
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes our custom streamable fields.
|
||||
*/
|
||||
public void writeObject (ObjectOutputStream out)
|
||||
throws IOException
|
||||
{
|
||||
out.defaultWriteObject();
|
||||
|
||||
int ecount = _entries.length;
|
||||
for (int ii = 0; ii < ecount; ii++) {
|
||||
if (_entries[ii] != null) {
|
||||
out.writeObject(_entries[ii]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads our custom streamable fields.
|
||||
*/
|
||||
public void readObject (ObjectInputStream in)
|
||||
throws IOException, ClassNotFoundException
|
||||
{
|
||||
in.defaultReadObject();
|
||||
|
||||
_entries = new Entry[Math.max(_size, INITIAL_CAPACITY)];
|
||||
for (int ii = 0; ii < _size; ii++) {
|
||||
_entries[ii] = (Entry)in.readObject();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a string representation of this set instance.
|
||||
*/
|
||||
@@ -347,7 +314,7 @@ public class DSet
|
||||
}
|
||||
|
||||
/** The entries of the set (in a sparse array). */
|
||||
protected transient Entry[] _entries = new Entry[INITIAL_CAPACITY];
|
||||
protected Entry[] _entries = new Entry[INITIAL_CAPACITY];
|
||||
|
||||
/** The number of entries in this set. */
|
||||
protected int _size;
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
//
|
||||
// $Id: OidList.java,v 1.5 2002/07/23 05:52:48 mdb Exp $
|
||||
// $Id: OidList.java,v 1.6 2002/12/20 23:41:26 mdb Exp $
|
||||
|
||||
package com.threerings.presents.dobj;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.threerings.io.ObjectInputStream;
|
||||
import com.threerings.io.ObjectOutputStream;
|
||||
import com.threerings.io.Streamable;
|
||||
|
||||
/**
|
||||
@@ -113,28 +109,6 @@ public class OidList implements Streamable
|
||||
return _oids[index];
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes our custom streamable fields.
|
||||
*/
|
||||
public void writeObject (ObjectOutputStream out)
|
||||
throws IOException
|
||||
{
|
||||
out.defaultWriteObject();
|
||||
out.writeInt(_size);
|
||||
out.writeObject(_oids);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads our custom streamable fields.
|
||||
*/
|
||||
public void readObject (ObjectInputStream in)
|
||||
throws IOException, ClassNotFoundException
|
||||
{
|
||||
in.defaultReadObject();
|
||||
_size = in.readInt();
|
||||
_oids = (int[])in.readObject();
|
||||
}
|
||||
|
||||
public String toString ()
|
||||
{
|
||||
StringBuffer buf = new StringBuffer();
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
//
|
||||
// $Id: AuthRequest.java,v 1.10 2002/12/20 23:28:24 mdb Exp $
|
||||
// $Id: AuthRequest.java,v 1.11 2002/12/20 23:41:26 mdb Exp $
|
||||
|
||||
package com.threerings.presents.net;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.threerings.io.ObjectInputStream;
|
||||
import com.threerings.io.ObjectOutputStream;
|
||||
|
||||
public class AuthRequest extends UpstreamMessage
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
//
|
||||
// $Id: AuthResponse.java,v 1.13 2002/12/20 23:28:24 mdb Exp $
|
||||
// $Id: AuthResponse.java,v 1.14 2002/12/20 23:41:26 mdb Exp $
|
||||
|
||||
package com.threerings.presents.net;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.threerings.io.ObjectInputStream;
|
||||
import com.threerings.io.ObjectOutputStream;
|
||||
|
||||
/**
|
||||
* The auth response communicates authentication success or failure as
|
||||
* well as associated information via a distribted object transmitted
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
//
|
||||
// $Id: BootstrapNotification.java,v 1.5 2002/12/20 23:28:24 mdb Exp $
|
||||
// $Id: BootstrapNotification.java,v 1.6 2002/12/20 23:41:26 mdb Exp $
|
||||
|
||||
package com.threerings.presents.net;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.threerings.io.ObjectInputStream;
|
||||
import com.threerings.io.ObjectOutputStream;
|
||||
|
||||
/**
|
||||
* A bootstrap notification is delivered to the client once the server has
|
||||
* fully initialized itself in preparation for dealing with this client.
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
//
|
||||
// $Id: Credentials.java,v 1.10 2002/12/20 23:28:24 mdb Exp $
|
||||
// $Id: Credentials.java,v 1.11 2002/12/20 23:41:26 mdb Exp $
|
||||
|
||||
package com.threerings.presents.net;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.threerings.io.ObjectInputStream;
|
||||
import com.threerings.io.ObjectOutputStream;
|
||||
import com.threerings.io.Streamable;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
//
|
||||
// $Id: DownstreamMessage.java,v 1.10 2002/12/20 23:28:24 mdb Exp $
|
||||
// $Id: DownstreamMessage.java,v 1.11 2002/12/20 23:41:26 mdb Exp $
|
||||
|
||||
package com.threerings.presents.net;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.threerings.io.ObjectInputStream;
|
||||
import com.threerings.io.ObjectOutputStream;
|
||||
import com.threerings.io.SimpleStreamableObject;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
//
|
||||
// $Id: EventNotification.java,v 1.12 2002/12/20 23:28:24 mdb Exp $
|
||||
// $Id: EventNotification.java,v 1.13 2002/12/20 23:41:26 mdb Exp $
|
||||
|
||||
package com.threerings.presents.net;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.threerings.io.ObjectInputStream;
|
||||
import com.threerings.io.ObjectOutputStream;
|
||||
|
||||
import com.threerings.presents.dobj.DEvent;
|
||||
|
||||
public class EventNotification extends DownstreamMessage
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
//
|
||||
// $Id: FailureResponse.java,v 1.9 2002/12/20 23:28:24 mdb Exp $
|
||||
// $Id: FailureResponse.java,v 1.10 2002/12/20 23:41:26 mdb Exp $
|
||||
|
||||
package com.threerings.presents.net;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.threerings.io.ObjectInputStream;
|
||||
import com.threerings.io.ObjectOutputStream;
|
||||
|
||||
public class FailureResponse extends DownstreamMessage
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
//
|
||||
// $Id: ForwardEventRequest.java,v 1.11 2002/12/20 23:28:24 mdb Exp $
|
||||
// $Id: ForwardEventRequest.java,v 1.12 2002/12/20 23:41:26 mdb Exp $
|
||||
|
||||
package com.threerings.presents.net;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.threerings.io.ObjectInputStream;
|
||||
import com.threerings.io.ObjectOutputStream;
|
||||
|
||||
import com.threerings.presents.dobj.DEvent;
|
||||
|
||||
public class ForwardEventRequest extends UpstreamMessage
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
//
|
||||
// $Id: ObjectResponse.java,v 1.13 2002/12/20 23:28:24 mdb Exp $
|
||||
// $Id: ObjectResponse.java,v 1.14 2002/12/20 23:41:26 mdb Exp $
|
||||
|
||||
package com.threerings.presents.net;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.threerings.io.ObjectInputStream;
|
||||
import com.threerings.io.ObjectOutputStream;
|
||||
|
||||
import com.threerings.presents.dobj.DObject;
|
||||
|
||||
public class ObjectResponse extends DownstreamMessage
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
//
|
||||
// $Id: SubscribeRequest.java,v 1.7 2002/12/20 23:28:24 mdb Exp $
|
||||
// $Id: SubscribeRequest.java,v 1.8 2002/12/20 23:41:26 mdb Exp $
|
||||
|
||||
package com.threerings.presents.net;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.threerings.io.ObjectInputStream;
|
||||
import com.threerings.io.ObjectOutputStream;
|
||||
|
||||
public class SubscribeRequest extends UpstreamMessage
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
//
|
||||
// $Id: UnsubscribeRequest.java,v 1.8 2002/12/20 23:28:24 mdb Exp $
|
||||
// $Id: UnsubscribeRequest.java,v 1.9 2002/12/20 23:41:26 mdb Exp $
|
||||
|
||||
package com.threerings.presents.net;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.threerings.io.ObjectInputStream;
|
||||
import com.threerings.io.ObjectOutputStream;
|
||||
|
||||
public class UnsubscribeRequest extends UpstreamMessage
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
//
|
||||
// $Id: UpstreamMessage.java,v 1.10 2002/12/20 23:28:24 mdb Exp $
|
||||
// $Id: UpstreamMessage.java,v 1.11 2002/12/20 23:41:26 mdb Exp $
|
||||
|
||||
package com.threerings.presents.net;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.threerings.io.ObjectInputStream;
|
||||
import com.threerings.io.ObjectOutputStream;
|
||||
import com.threerings.io.SimpleStreamableObject;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
//
|
||||
// $Id: UsernamePasswordCreds.java,v 1.10 2002/12/20 23:28:24 mdb Exp $
|
||||
// $Id: UsernamePasswordCreds.java,v 1.11 2002/12/20 23:41:26 mdb Exp $
|
||||
|
||||
package com.threerings.presents.net;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.threerings.io.ObjectInputStream;
|
||||
import com.threerings.io.ObjectOutputStream;
|
||||
|
||||
public class UsernamePasswordCreds extends Credentials
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
//
|
||||
// $Id: SceneSummary.java,v 1.4 2002/07/23 05:54:53 mdb Exp $
|
||||
// $Id: SceneSummary.java,v 1.5 2002/12/20 23:41:27 mdb Exp $
|
||||
|
||||
package com.threerings.whirled.zone.data;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.samskivert.util.StringUtil;
|
||||
|
||||
import com.threerings.util.DirectionCodes;
|
||||
import com.threerings.util.DirectionUtil;
|
||||
|
||||
import com.threerings.io.ObjectInputStream;
|
||||
import com.threerings.io.ObjectOutputStream;
|
||||
import com.threerings.io.Streamable;
|
||||
|
||||
/**
|
||||
@@ -54,26 +50,6 @@ public class SceneSummary implements Streamable
|
||||
_population = population;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes our custom streamable fields.
|
||||
*/
|
||||
public void writeObject (ObjectOutputStream out)
|
||||
throws IOException
|
||||
{
|
||||
out.defaultWriteObject();
|
||||
out.writeInt(getPopulation());
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads our custom streamable fields.
|
||||
*/
|
||||
public void readObject (ObjectInputStream in)
|
||||
throws IOException, ClassNotFoundException
|
||||
{
|
||||
in.defaultReadObject();
|
||||
_population = in.readInt();
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a string representation of this instance.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user