Basic support for datagram messaging. Hope I haven't fucked
anything up! git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5090 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -34,6 +34,9 @@ import com.threerings.presents.data.InvocationMarshaller;
|
||||
*/
|
||||
public class BootstrapData extends SimpleStreamableObject
|
||||
{
|
||||
/** The unique id of the client's connection (used to address datagrams). */
|
||||
public int connectionId;
|
||||
|
||||
/** The oid of this client's associated distributed object. */
|
||||
public int clientOid;
|
||||
|
||||
|
||||
@@ -63,6 +63,14 @@ public abstract class Credentials implements Streamable
|
||||
_username = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string to use in a hash on the datagram contents to authenticate client datagrams.
|
||||
*/
|
||||
public String getDatagramSecret ()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
public int hashCode ()
|
||||
{
|
||||
|
||||
@@ -37,6 +37,12 @@ public abstract class DownstreamMessage extends SimpleStreamableObject
|
||||
*/
|
||||
public short messageId = -1;
|
||||
|
||||
/**
|
||||
* When sending, this acts as a hint that the message may be transmitted as a datagram.
|
||||
* When receiving, it indicates that the message was received as a datagram.
|
||||
*/
|
||||
public transient boolean datagram;
|
||||
|
||||
/**
|
||||
* Generates a string representation of this instance.
|
||||
*/
|
||||
|
||||
@@ -41,6 +41,12 @@ public abstract class UpstreamMessage extends SimpleStreamableObject
|
||||
/** A timestamp indicating when this upstream message was received. */
|
||||
public transient long received;
|
||||
|
||||
/**
|
||||
* When sending, this acts as a hint that the message may be transmitted as a datagram.
|
||||
* When receiving, it indicates that the message was received as a datagram.
|
||||
*/
|
||||
public transient boolean datagram;
|
||||
|
||||
/**
|
||||
* Each upstream message derived class must provide a zero argument
|
||||
* constructor so that it can be unserialized when read from the
|
||||
|
||||
@@ -47,6 +47,12 @@ public class UsernamePasswordCreds extends Credentials
|
||||
return _password;
|
||||
}
|
||||
|
||||
@Override // documentation inherited
|
||||
public String getDatagramSecret ()
|
||||
{
|
||||
return _password;
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
public int hashCode ()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user