Crossfire JXClient, Trunk
|
Public Member Functions | |
void | addClientSocketListener (@NotNull final ClientSocketListener clientSocketListener) |
void | connect (@NotNull final String hostname, final int port) |
DefaultServerConnection (@NotNull final GuiStateManager guiStateManager, @Nullable final DebugWriter debugProtocol) throws IOException | |
void | disconnect (@NotNull final String reason) |
void | removeClientSocketListener (@NotNull final ClientSocketListener clientSocketListener) |
void | start () |
void | stop () throws InterruptedException |
void | writePacket (final byte @NotNull[] packet, final int length, @NotNull final ClientSocketMonitorCommand monitor) |
Private Attributes | |
final ClientSocket | clientSocket |
One of the two most important classes, ServerConnection performs most of the network-related work. It either decodes commands sent by the server itself, or delegates their processing to other classes, like Map or Faces.
Definition at line 40 of file DefaultServerConnection.java.
com.realtime.crossfire.jxclient.server.server.DefaultServerConnection.DefaultServerConnection | ( | @NotNull final GuiStateManager | guiStateManager, |
@Nullable final DebugWriter | debugProtocol | ||
) | throws IOException |
Creates a new instance.
guiStateManager | the gui state manager to update |
debugProtocol | tf non- null
|
IOException | if an internal error occurs |
Definition at line 55 of file DefaultServerConnection.java.
References com.realtime.crossfire.jxclient.server.server.DefaultServerConnection.clientSocket.
void com.realtime.crossfire.jxclient.server.server.DefaultServerConnection.addClientSocketListener | ( | @NotNull final ClientSocketListener | clientSocketListener | ) |
Adds a ClientSocketListener to notify.
clientSocketListener | the client socket listener to add |
Implements com.realtime.crossfire.jxclient.server.server.ServerConnection.
Definition at line 75 of file DefaultServerConnection.java.
References com.realtime.crossfire.jxclient.server.socket.ClientSocket.addClientSocketListener(), and com.realtime.crossfire.jxclient.server.server.DefaultServerConnection.clientSocket.
Referenced by com.realtime.crossfire.jxclient.server.crossfire.DefaultCrossfireServerConnection.addClientSocketListener().
void com.realtime.crossfire.jxclient.server.server.DefaultServerConnection.connect | ( | @NotNull final String | hostname, |
final int | port | ||
) |
Attempts to connect the client to a server.
hostname | the hostname to connect to |
port | the port to connect to |
Implements com.realtime.crossfire.jxclient.server.server.ServerConnection.
Definition at line 97 of file DefaultServerConnection.java.
References com.realtime.crossfire.jxclient.server.server.DefaultServerConnection.clientSocket, and com.realtime.crossfire.jxclient.server.socket.ClientSocket.connect().
Referenced by com.realtime.crossfire.jxclient.server.crossfire.DefaultCrossfireServerConnection.connect().
void com.realtime.crossfire.jxclient.server.server.DefaultServerConnection.disconnect | ( | @NotNull final String | reason | ) |
Disconnects from the server. Does nothing if not connected.
reason | the reason for the disconnect |
Implements com.realtime.crossfire.jxclient.server.server.ServerConnection.
Definition at line 102 of file DefaultServerConnection.java.
References com.realtime.crossfire.jxclient.server.server.DefaultServerConnection.clientSocket, and com.realtime.crossfire.jxclient.server.socket.ClientSocket.disconnect().
Referenced by com.realtime.crossfire.jxclient.server.crossfire.DefaultCrossfireServerConnection.disconnect().
void com.realtime.crossfire.jxclient.server.server.DefaultServerConnection.removeClientSocketListener | ( | @NotNull final ClientSocketListener | clientSocketListener | ) |
Removes a ClientSocketListener to notify.
clientSocketListener | the client socket listener to remove |
Implements com.realtime.crossfire.jxclient.server.server.ServerConnection.
Definition at line 80 of file DefaultServerConnection.java.
References com.realtime.crossfire.jxclient.server.server.DefaultServerConnection.clientSocket, and com.realtime.crossfire.jxclient.server.socket.ClientSocket.removeClientSocketListener().
Referenced by com.realtime.crossfire.jxclient.server.crossfire.DefaultCrossfireServerConnection.removeClientSocketListener().
void com.realtime.crossfire.jxclient.server.server.DefaultServerConnection.start | ( | ) |
Starts operation.
Definition at line 62 of file DefaultServerConnection.java.
References com.realtime.crossfire.jxclient.server.server.DefaultServerConnection.clientSocket, and com.realtime.crossfire.jxclient.server.socket.ClientSocket.start().
Referenced by com.realtime.crossfire.jxclient.server.crossfire.DefaultCrossfireServerConnection.start().
void com.realtime.crossfire.jxclient.server.server.DefaultServerConnection.stop | ( | ) | throws InterruptedException |
Stops operation.
InterruptedException | if stopping was interrupted |
Definition at line 70 of file DefaultServerConnection.java.
References com.realtime.crossfire.jxclient.server.server.DefaultServerConnection.clientSocket, and com.realtime.crossfire.jxclient.server.socket.ClientSocket.stop().
Referenced by com.realtime.crossfire.jxclient.server.crossfire.DefaultCrossfireServerConnection.stop().
void com.realtime.crossfire.jxclient.server.server.DefaultServerConnection.writePacket | ( | final byte @NotNull[] | packet, |
final int | length, | ||
@NotNull final ClientSocketMonitorCommand | monitor | ||
) |
Writes a Crossfire Message on the socket, so it is sent to the server.
packet | the packet to be sent; it does not include the length bytes but only actual payload data |
length | the length of packet
|
monitor | the monitor command to send to script processes |
Definition at line 92 of file DefaultServerConnection.java.
References com.realtime.crossfire.jxclient.server.server.DefaultServerConnection.clientSocket, and com.realtime.crossfire.jxclient.server.socket.ClientSocket.writePacket().
Referenced by com.realtime.crossfire.jxclient.server.crossfire.DefaultCrossfireServerConnection.sendAccountCharacterCreate(), com.realtime.crossfire.jxclient.server.crossfire.DefaultCrossfireServerConnection.sendAccountCreate(), com.realtime.crossfire.jxclient.server.crossfire.DefaultCrossfireServerConnection.sendAccountLink(), com.realtime.crossfire.jxclient.server.crossfire.DefaultCrossfireServerConnection.sendAccountLogin(), com.realtime.crossfire.jxclient.server.crossfire.DefaultCrossfireServerConnection.sendAccountPassword(), com.realtime.crossfire.jxclient.server.crossfire.DefaultCrossfireServerConnection.sendAccountPlay(), com.realtime.crossfire.jxclient.server.crossfire.DefaultCrossfireServerConnection.sendAddme(), com.realtime.crossfire.jxclient.server.crossfire.DefaultCrossfireServerConnection.sendApply(), com.realtime.crossfire.jxclient.server.crossfire.DefaultCrossfireServerConnection.sendAskface(), com.realtime.crossfire.jxclient.server.crossfire.DefaultCrossfireServerConnection.sendExamine(), com.realtime.crossfire.jxclient.server.crossfire.DefaultCrossfireServerConnection.sendLock(), com.realtime.crossfire.jxclient.server.crossfire.DefaultCrossfireServerConnection.sendLookat(), com.realtime.crossfire.jxclient.server.crossfire.DefaultCrossfireServerConnection.sendMark(), com.realtime.crossfire.jxclient.server.crossfire.DefaultCrossfireServerConnection.sendMove(), com.realtime.crossfire.jxclient.server.crossfire.DefaultCrossfireServerConnection.sendNcom(), com.realtime.crossfire.jxclient.server.crossfire.DefaultCrossfireServerConnection.sendRawString(), com.realtime.crossfire.jxclient.server.crossfire.DefaultCrossfireServerConnection.sendReply(), com.realtime.crossfire.jxclient.server.crossfire.DefaultCrossfireServerConnection.sendRequestinfo(), com.realtime.crossfire.jxclient.server.crossfire.DefaultCrossfireServerConnection.sendSetup(), com.realtime.crossfire.jxclient.server.crossfire.DefaultCrossfireServerConnection.sendToggleextendedtext(), and com.realtime.crossfire.jxclient.server.crossfire.DefaultCrossfireServerConnection.sendVersion().
|
private |
The ClientSocket instance used to connect to Crossfire servers.
Definition at line 46 of file DefaultServerConnection.java.
Referenced by com.realtime.crossfire.jxclient.server.server.DefaultServerConnection.addClientSocketListener(), com.realtime.crossfire.jxclient.server.server.DefaultServerConnection.connect(), com.realtime.crossfire.jxclient.server.server.DefaultServerConnection.DefaultServerConnection(), com.realtime.crossfire.jxclient.server.server.DefaultServerConnection.disconnect(), com.realtime.crossfire.jxclient.server.server.DefaultServerConnection.removeClientSocketListener(), com.realtime.crossfire.jxclient.server.server.DefaultServerConnection.start(), com.realtime.crossfire.jxclient.server.server.DefaultServerConnection.stop(), and com.realtime.crossfire.jxclient.server.server.DefaultServerConnection.writePacket().