 |
Crossfire JXClient, Trunk
|
Go to the documentation of this file.
23 package com.realtime.crossfire.jxclient.window;
36 import java.awt.Frame;
37 import java.util.Objects;
38 import org.jetbrains.annotations.NotNull;
39 import org.jetbrains.annotations.Nullable;
119 @SuppressWarnings(
"FieldCanBeLocal")
123 public void start() {
128 public void metaserver() {
133 public void preConnecting(@NotNull
final String serverInfo) {
138 public void connecting(@NotNull
final String serverInfo) {
143 public void connecting(@NotNull
final ClientSocketState clientSocketState, @NotNull
final String param) {
148 public void connected() {
153 public void connectFailed(@NotNull
final String reason) {
166 public void pickupChanged(
final int pickupOptions) {
223 if (Objects.equals(
this.character,
character)) {
229 if (
hostname !=
null && this.character !=
null) {
266 frame.setTitle(title);
273 public void setHost(@Nullable
final String serverInfo) {
274 @Nullable
final String newHostname;
276 if (serverInfo ==
null) {
281 final String[] tmp = serverInfo.split(
":", 2);
282 newHostname = tmp[0];
286 if (Objects.equals(
hostname, newHostname) &&
port == newPort) {
String hostname
The currently connected server.
All defined entries in the settings file.
void updateTitle()
Updates the window title to reflect the current connection state.
Interface for listeners interested in "pickup" messages.
Adds encoding/decoding of crossfire protocol packets to a ServerConnection.
void remove(@NotNull final String key)
Removes a key.
long getLong(@NotNull final SettingsEntry< Long > key)
Returns the long associated with the specified key at a node or.
final Settings settings
The settings instance to use.
final Logger logger
The Logger that is notified about changed server names.
Interface for listeners interested gui state changes.
JXCConnection(@NotNull final KeybindingsManager keybindingsManager, @NotNull final Shortcuts shortcuts, @NotNull final Settings settings, @NotNull final Pickup characterPickup, @NotNull final CrossfireServerConnection server, @NotNull final GuiStateManager guiStateManager, @NotNull final Logger logger)
Creates a new instance.
final CrossfirePickupListener crossfirePickupListener
The CrossfirePickupListener for tracking pickup mode changes.
Utility class for parsing strings into numbers.
final Shortcuts shortcuts
The Shortcuts to update.
final CrossfireServerConnection server
The CrossfireServerConnection instance used to connect to the Crossfire server.
void addCrossfirePickupListener(@NotNull CrossfirePickupListener listener)
Adds a listener to be notified about received "pickup" messages.
String getHostname()
Returns the currently connected server.
void updatePickupMode(final long pickupMode, final boolean sendToServer)
Sets the pickup mode.
void setHostname(@Nullable final String hostname)
Updates the hostname.
void disconnect(@NotNull String reason)
Disconnects from the server.
static final SettingsEntry< String > SERVER
The server to which the previous connection was made.
void removeCrossfirePickupListener(@NotNull CrossfirePickupListener listener)
Removes a listener to be notified about received "pickup" messages.
void putLong(@NotNull final SettingsEntry< Long > key, final long value)
Stores a key/value pair.
Logs received messages to a file.
void connect(@NotNull String hostname, int port)
Attempts to connect the client to a server.
String character
The currently logged in character.
Maintains the current GuiState.
static int parseInt(@NotNull final String string, final int defaultValue)
Converts a string into an int value.
static SettingsEntry< Long > getPickupSettingsEntry(@NotNull final String hostname, @NotNull final String characterName)
Returns the SettingsEntry for the default pickup mode of a character.
final GuiStateListener guiStateListener
The GuiStateListener for detecting established or dropped connections.
void disconnect(@NotNull final String reason)
Disconnects from the Crossfire server.
void setFrame(@Nullable final Frame frame)
Sets the Frame for updating the title.
Defines constants for pickup mode.
long getPickupMode()
Returns the pickup mode.
int getPort()
Returns the currently connected port.
Maintains a set of key/value pairs.
int port
The currently connected port.
void connect()
Connects to the Crossfire server.
static final int DEFAULT_CROSSFIRE_PORT
The default port number for Crossfire servers.
static final String TITLE_PREFIX
The prefix for the window title.
void unloadPerCharacterBindings()
Unloads (clears and saves) the per-character key bindings.
void setHost(@Nullable final String serverInfo)
Updates information about the connected host.
static final long PU_NOTHING
Pickup mode: nothing.
final KeybindingsManager keybindingsManager
The KeybindingsManager to update.
Connection progress states of the Crossfire server connection.
void loadPerCharacterBindings(@NotNull final CharSequence hostname, @NotNull final CharSequence character)
Loads the per-character key bindings.
Manages a list of Shortcuts.
static void loadShortcuts(@NotNull final Shortcuts shortcuts, @NotNull final CharSequence hostname, @NotNull final CharSequence character)
Load shortcut info from the backing file.
void putString(@NotNull final SettingsEntry<?> key, @NotNull final String value)
Stores a key/value pair.
final Pickup characterPickup
The Pickup instance to update.
void setCharacter(@Nullable final String character)
Updates the active character name.
Frame frame
The Frame for updating the title or.