Brought code into line with the new streaming world order.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1606 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,20 +1,17 @@
|
||||
//
|
||||
// $Id: ForwardEventRequest.java,v 1.9 2001/10/11 04:07:53 mdb Exp $
|
||||
// $Id: ForwardEventRequest.java,v 1.10 2002/07/23 05:52:48 mdb Exp $
|
||||
|
||||
package com.threerings.presents.net;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
|
||||
import com.threerings.presents.dobj.TypedEvent;
|
||||
import com.threerings.presents.io.TypedObjectFactory;
|
||||
import com.threerings.io.ObjectInputStream;
|
||||
import com.threerings.io.ObjectOutputStream;
|
||||
|
||||
import com.threerings.presents.dobj.DEvent;
|
||||
|
||||
public class ForwardEventRequest extends UpstreamMessage
|
||||
{
|
||||
/** The code for a forward event request. */
|
||||
public static final short TYPE = TYPE_BASE + 4;
|
||||
|
||||
/**
|
||||
* Zero argument constructor used when unserializing an instance.
|
||||
*/
|
||||
@@ -26,45 +23,44 @@ public class ForwardEventRequest extends UpstreamMessage
|
||||
/**
|
||||
* Constructs a forward event request for the supplied event.
|
||||
*/
|
||||
public ForwardEventRequest (TypedEvent event)
|
||||
public ForwardEventRequest (DEvent event)
|
||||
{
|
||||
_event = event;
|
||||
}
|
||||
|
||||
public short getType ()
|
||||
{
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the event that we wish to have forwarded.
|
||||
*/
|
||||
public TypedEvent getEvent ()
|
||||
public DEvent getEvent ()
|
||||
{
|
||||
return _event;
|
||||
}
|
||||
|
||||
public void writeTo (DataOutputStream out)
|
||||
/**
|
||||
* Writes our custom streamable fields.
|
||||
*/
|
||||
public void writeObject (ObjectOutputStream out)
|
||||
throws IOException
|
||||
{
|
||||
super.writeTo(out);
|
||||
// write the event out to the stream
|
||||
TypedObjectFactory.writeTo(out, _event);
|
||||
super.writeObject(out);
|
||||
out.writeObject(_event);
|
||||
}
|
||||
|
||||
public void readFrom (DataInputStream in)
|
||||
throws IOException
|
||||
/**
|
||||
* Reads our custom streamable fields.
|
||||
*/
|
||||
public void readObject (ObjectInputStream in)
|
||||
throws IOException, ClassNotFoundException
|
||||
{
|
||||
super.readFrom(in);
|
||||
// read the event in from the stream
|
||||
_event = (TypedEvent)TypedObjectFactory.readFrom(in);
|
||||
super.readObject(in);
|
||||
_event = (DEvent)in.readObject();
|
||||
}
|
||||
|
||||
public String toString ()
|
||||
{
|
||||
return "[type=FWD, msgid=" + messageId + ", evt=" + _event + "]";
|
||||
return "[type=FWD, evt=" + _event + "]";
|
||||
}
|
||||
|
||||
/** The event which we are forwarding. */
|
||||
protected TypedEvent _event;
|
||||
protected DEvent _event;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user