org.xistrat.net.msg
Class F4Message
java.lang.Object
org.xistrat.net.msg.F4Message
public class F4Message
- extends java.lang.Object
F4Message wrapper class for messages
A message is used only (ONLY) between:
F4Server and F4Client, before the actual start of a game
PlayerServer and F4Client, after a game has been set up
it is NOT used between F4Daemon and PlayerServer whatsoever
There are many msgs.. usually a message is a requesto of
info, LOGIN, and there is the corresponding ACK, LOGIN_ACK
All message packing/unpacking of params is encapsulated in package "msg"
F4Message does message dispatching, i.e. building of proper
method calls from strings representing a socket emssage.
by calling the appropriate dispatchToXXXX(XXXX interface, String msg)
the XXXX interface is notified of an incoming message, with parameters
passed as method arguments.
the two specialized streams ClientServerPrintStream and ServerClientPrintStream
handles building of parameters in messages and sending messages on stream.
- Since:
- 0.5.42
Constructor Summary |
F4Message(java.lang.String msg)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
NEW_GAME
public static final int NEW_GAME
- message types
- See Also:
- Constant Field Values
NEW_GAME_ACK
public static final int NEW_GAME_ACK
- See Also:
- Constant Field Values
GAME_LIST
public static final int GAME_LIST
- See Also:
- Constant Field Values
GAME_LIST_ACK
public static final int GAME_LIST_ACK
- See Also:
- Constant Field Values
LOGIN
public static final int LOGIN
- See Also:
- Constant Field Values
LOGIN_ACK
public static final int LOGIN_ACK
- See Also:
- Constant Field Values
LOGIN_OF_ANOTHER
public static final int LOGIN_OF_ANOTHER
- See Also:
- Constant Field Values
UNDO
public static final int UNDO
- See Also:
- Constant Field Values
UNDO_ACK
public static final int UNDO_ACK
- See Also:
- Constant Field Values
UNDO_OF_ANOTHER
public static final int UNDO_OF_ANOTHER
- See Also:
- Constant Field Values
UNDO_REQ
public static final int UNDO_REQ
- See Also:
- Constant Field Values
REMOVE
public static final int REMOVE
- See Also:
- Constant Field Values
REMOVE_ACK
public static final int REMOVE_ACK
- See Also:
- Constant Field Values
REMOVE_OF_ANOTHER
public static final int REMOVE_OF_ANOTHER
- See Also:
- Constant Field Values
REMOVE_REQ
public static final int REMOVE_REQ
- See Also:
- Constant Field Values
LOGOUT
public static final int LOGOUT
- See Also:
- Constant Field Values
LOGOUT_ACK
public static final int LOGOUT_ACK
- See Also:
- Constant Field Values
LOGOUT_OF_ANOTHER
public static final int LOGOUT_OF_ANOTHER
- See Also:
- Constant Field Values
ABORT
public static final int ABORT
- See Also:
- Constant Field Values
ABORT_ACK
public static final int ABORT_ACK
- See Also:
- Constant Field Values
ABORT_OF_ANOTHER
public static final int ABORT_OF_ANOTHER
- See Also:
- Constant Field Values
GAME_START
public static final int GAME_START
- See Also:
- Constant Field Values
MOVE
public static final int MOVE
- See Also:
- Constant Field Values
MOVE_ACK
public static final int MOVE_ACK
- See Also:
- Constant Field Values
MOVE_REQ
public static final int MOVE_REQ
- See Also:
- Constant Field Values
FROMTO
public static final int FROMTO
- See Also:
- Constant Field Values
TO
public static final int TO
- See Also:
- Constant Field Values
PUT_ACK
public static final int PUT_ACK
- See Also:
- Constant Field Values
PASS
public static final int PASS
- See Also:
- Constant Field Values
PASS_ACK
public static final int PASS_ACK
- See Also:
- Constant Field Values
WIN
public static final int WIN
- See Also:
- Constant Field Values
LOSE
public static final int LOSE
- See Also:
- Constant Field Values
INFO
public static final int INFO
- See Also:
- Constant Field Values
NULL_MSG
public static final int NULL_MSG
- See Also:
- Constant Field Values
CLOSE_SOCKET
public static final int CLOSE_SOCKET
- See Also:
- Constant Field Values
SEP
public static final java.lang.String SEP
- See Also:
- Constant Field Values
EMPTY_STR
public static final java.lang.String EMPTY_STR
- See Also:
- Constant Field Values
F4Message
public F4Message(java.lang.String msg)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
booleanToStr
public static java.lang.String booleanToStr(boolean b)
dispatchToClient
public static void dispatchToClient(Client client,
java.lang.String msgString)
dispatchToServer
public static void dispatchToServer(Server server,
java.lang.String msgString)
dispatchToMultiServer
public static void dispatchToMultiServer(MultiServer multiServer,
java.lang.String msgString)