org.newdawn.asd.net
Class LagCommand

java.lang.Object
  extended byorg.newdawn.dss.common.Command
      extended byorg.newdawn.asd.net.LagCommand

public class LagCommand
extends Command

A command indicating the lag status of a user


Field Summary
static short CODE
          The code identifing this type of command
 
Constructor Summary
LagCommand()
          Create a new command
LagCommand(java.lang.String username, boolean lagged)
          Create a new command
 
Method Summary
 java.lang.String getUsername()
          Get the username of the player identified as lagging
 boolean isLagged()
          Check if this command indicates lagging
 void readImpl(java.io.DataInputStream in)
          Provided to allow subclasses to add their data
 void writeImpl(java.io.DataOutputStream out)
          Provided to allow subclasses to add their data
 
Methods inherited from class org.newdawn.dss.common.Command
getCode, getPriorityHint, getSequenceNumber, getTime, read, setPriorityHint, setSequenceNumber, setTime, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CODE

public static final short CODE
The code identifing this type of command

See Also:
Constant Field Values
Constructor Detail

LagCommand

public LagCommand()
Create a new command


LagCommand

public LagCommand(java.lang.String username,
                  boolean lagged)
Create a new command

Parameters:
username - The username of the player identified for lagging
lagged - True if the user is lagging
Method Detail

getUsername

public java.lang.String getUsername()
Get the username of the player identified as lagging

Returns:
The user name of the player

isLagged

public boolean isLagged()
Check if this command indicates lagging

Returns:
True if the player identified is lagging

writeImpl

public void writeImpl(java.io.DataOutputStream out)
               throws java.io.IOException
Description copied from class: Command
Provided to allow subclasses to add their data

Specified by:
writeImpl in class Command
Parameters:
out - The output stream to which the data should be written
Throws:
java.io.IOException - Indicates a failure to send the data
See Also:
Command.writeImpl(java.io.DataOutputStream)

readImpl

public void readImpl(java.io.DataInputStream in)
              throws java.io.IOException
Description copied from class: Command
Provided to allow subclasses to add their data

Specified by:
readImpl in class Command
Parameters:
in - The input stream from which to read the data
Throws:
java.io.IOException - Indicates a failure to read the data
See Also:
Command.readImpl(java.io.DataInputStream)