monrovia.client.protocol
Class UdpSender
java.lang.Object
|
+--monrovia.client.protocol.UdpSender
- public class UdpSender
- extends java.lang.Object
UdpSender is the clients udp message sender
for sending udp messages to the server
Constructor Summary |
UdpSender(java.io.DataOutputStream pDataOutputStream)
Constructor |
UdpSender(int pClientUdpReceiverPort,
java.lang.String pServerAddr,
int pServerUdpPort)
Constructor |
Method Summary |
void |
addCommand(int cmd)
addCommand adds a command without arguments:
gonorth |
void |
addCommand(int cmd,
int arg1)
addCommand adds a command with one int argument:
drop, itemID |
void |
addCommand(int cmd,
int arg1,
int arg2)
addCommand adds a command with two int arguments:
teleport, x, y |
void |
addCommand(int cmd,
java.lang.String arg1)
addCommand adds a command with a string argument:
say, nyt sä alat olee asian ytimessä |
void |
flush()
flush is called when one wishes to send the packet |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mDatagramConnection
public javax.microedition.io.DatagramConnection mDatagramConnection
UdpSender
public UdpSender(int pClientUdpReceiverPort,
java.lang.String pServerAddr,
int pServerUdpPort)
- Constructor
- Parameters:
pDatagramConnection
- the udpsocket / "connection"pServerAddr
- the address of the serverpServerUdpPort
- the port of the server
UdpSender
public UdpSender(java.io.DataOutputStream pDataOutputStream)
- Constructor
- Parameters:
pTcpConnection
- a tcp connection for sending
flush
public void flush()
- flush is called when one wishes to send the packet
addCommand
public void addCommand(int cmd)
- addCommand adds a command without arguments:
gonorth
- Parameters:
cmd
- the command id
addCommand
public void addCommand(int cmd,
int arg1)
- addCommand adds a command with one int argument:
drop, itemID
- Parameters:
cmd
- the command idarg1
- the argument
addCommand
public void addCommand(int cmd,
int arg1,
int arg2)
- addCommand adds a command with two int arguments:
teleport, x, y
- Parameters:
cmd
- the command idarg1
- the first argumentarg2
- the second argument
addCommand
public void addCommand(int cmd,
java.lang.String arg1)
- addCommand adds a command with a string argument:
say, nyt sä alat olee asian ytimessä
- Parameters:
cmd
- the command idarg1
- the string argument