 |
Crossfire JXClient, Trunk
|
Go to the documentation of this file.
23 package com.realtime.crossfire.jxclient.server.crossfire;
28 import java.util.Collection;
29 import org.jetbrains.annotations.NotNull;
30 import org.jetbrains.annotations.Nullable;
31 import org.junit.Assert;
45 private final StringBuilder
sb =
new StringBuilder();
80 sb.append(
"apply ").append(tag).append(
"\n");
99 public void sendLock(
final boolean val,
final int tag) {
100 sb.append(
"lock ").append(val).append(
" ").append(tag).append(
"\n");
110 sb.append(
"mark ").append(tag).append(
"\n");
114 public void sendMove(
final int to,
final int tag,
final int nrof) {
115 sb.append(
"move ").append(to).append(
" ").append(tag).append(
" ").append(nrof).append(
"\n");
119 public int sendNcom(
final int repeat, @NotNull
final String command) {
120 sb.append(
"ncom ").append(repeat).append(
" ").append(command).append(
"\n");
126 sb.append(
"raw ").append(command).append(
"\n");
140 public void sendSetup(@NotNull
final String... options) {
150 public void sendVersion(
final int csval,
final int scval, @NotNull
final String vinfo) {
176 throw new AssertionError();
180 public void connect(@NotNull
final String hostname,
final int port) {
190 public void sendAccountLogin(@NotNull
final String login, @NotNull
final String password) {
200 public void sendAccountLink(
final int force, @NotNull
final String login, @NotNull
final String password) {
210 public void sendAccountCharacterCreate(@NotNull
final String login, @NotNull
final String password, @NotNull
final Collection<String> attributes) {
215 public void sendAccountPassword(@NotNull
final String currentPassword, @NotNull
final String newPassword) {
222 return sb.toString();
Interface for classes interested in faces received from the Crossfire server.
void addFaceReceivedListener(@NotNull final AskfaceFaceQueueListener listener)
Registers a listener to be called whenever a face has been received.
void addCrossfireMapScrollListener(@NotNull final CrossfireMapScrollListener listener)
Registers a listener to be called whenever the map was scolled.
void start()
Starts operation.
void connect(@NotNull final String hostname, final int port)
Attempts to connect the client to a server.
void sendReply(@NotNull final String text)
Sends a "reply" command to the server.
void setPreferredMapSize(final int preferredMapWidth, final int preferredMapHeight)
Sets the preferred map size.
void sendRawString(@NotNull final String command)
Sends an arbitrary string command to the server.
void sendVersion(final int csval, final int scval, @NotNull final String vinfo)
Sends a "version" command to the server.
void sendExamine(final int tag)
Sends an "examine" command to the server.
void sendMove(final int to, final int tag, final int nrof)
Sends a "move" command to the server.
final StringBuilder sb
Collects sent commands.
void sendAccountPassword(@NotNull final String currentPassword, @NotNull final String newPassword)
Sends a request to change the account's password.
Manages image information ("faces") needed to display the map view, items, and spell icons.
Abstract base class for CrossfireServerConnection implementing classes.
void sendAccountCreate(@NotNull final String login, @NotNull final String password)
Sends a request to create a new account.
void sendSetup(@NotNull final String... options)
Sends a "setup" command to the server.
void sendLock(final boolean val, final int tag)
Sends a "lock" command to the server.
void disconnect(@NotNull final String reason)
Disconnects from the server.
void stop()
Stops operation.
void sendAddme()
Sends an "addme" command to the server.
TestCrossfireServerConnection()
Creates a new instance.
void sendAccountLink(final int force, @NotNull final String login, @NotNull final String password)
Sends a request to add an existing character to an account.
Runs the action directly.
void sendAccountPlay(@NotNull final String name)
Sends a request to play a character from an account.
void sendAccountCharacterCreate(@NotNull final String login, @NotNull final String password, @NotNull final Collection< String > attributes)
Sends a request to create a new character associated to the account.
Interface for listeners interested in map related commands.
String getAccountName()
Returns the current account name.
Interface for listeners interested in ClientSocket related events.
void sendRequestinfo(@NotNull final String infoType)
Sends a "requestinfo" command to the server.
void setCrossfireUpdateMapListener(@NotNull final CrossfireUpdateMapListener listener)
Sets a listener to be notified about map changes.
void sendApply(final int tag)
Sends an "apply" command to the server.
void removeClientSocketListener(@NotNull final ClientSocketListener clientSocketListener)
Removes a ClientSocketListener to notify.
Implements CrossfireServerConnection for regression tests.
void sendLookat(final int dx, final int dy)
Sends a "lookat" command to the server.
void sendAskface(final int faceNum)
Sends an "askface" command.
void setPreferredNumLookObjects(final int preferredNumLookObjects)
Sets the maximum number of objects in the ground view.
void sendMark(final int tag)
Sends a "mark" command to the server.
void sendAccountLogin(@NotNull final String login, @NotNull final String password)
Asks for an account login.
void sendToggleextendedtext(@NotNull final int... types)
Sends a "toggleextendedtext" command to the server.
int sendNcom(final int repeat, @NotNull final String command)
Sends a "ncom" command to the server.
Combines all model classes that are updated.
void addClientSocketListener(@NotNull final ClientSocketListener clientSocketListener)
Adds a ClientSocketListener to notify.