Crossfire JXClient, Trunk
|
Public Member Functions | |
void | addClientSocketListener (@NotNull final ClientSocketListener clientSocketListener) |
void | addCrossfireMapScrollListener (@NotNull final CrossfireMapScrollListener listener) |
void | addFaceReceivedListener (@NotNull final AskfaceFaceQueueListener listener) |
void | connect (@NotNull final String hostname, final int port) |
void | disconnect (@NotNull final String reason) |
String | getAccountName () |
void | removeClientSocketListener (@NotNull final ClientSocketListener clientSocketListener) |
void | sendAccountCharacterCreate (@NotNull final String login, @NotNull final String password, @NotNull final Collection< String > attributes) |
void | sendAccountCreate (@NotNull final String login, @NotNull final String password) |
void | sendAccountLink (final int force, @NotNull final String login, @NotNull final String password) |
void | sendAccountLogin (@NotNull final String login, @NotNull final String password) |
void | sendAccountPassword (@NotNull final String currentPassword, @NotNull final String newPassword) |
void | sendAccountPlay (@NotNull final String name) |
void | sendAddme () |
void | sendApply (final int tag) |
void | sendAskface (final int faceNum) |
void | sendExamine (final int tag) |
void | sendLock (final boolean val, final int tag) |
void | sendLookat (final int dx, final int dy) |
void | sendMark (final int tag) |
void | sendMove (final int to, final int tag, final int nrof) |
int | sendNcom (final int repeat, @NotNull final String command) |
void | sendRawString (@NotNull final String command) |
void | sendReply (@NotNull final String text) |
void | sendRequestinfo (@NotNull final String infoType) |
void | sendSetup (@NotNull final String... options) |
void | sendToggleextendedtext (@NotNull final int... types) |
void | sendVersion (final int csval, final int scval, @NotNull final String vinfo) |
void | setCrossfireUpdateMapListener (@NotNull final CrossfireUpdateMapListener listener) |
void | setPreferredMapSize (final int preferredMapWidth, final int preferredMapHeight) |
void | setPreferredNumLookObjects (final int preferredNumLookObjects) |
void | start () |
void | stop () |
TestCrossfireServerConnection () | |
String | toString () |
Public Member Functions inherited from com.realtime.crossfire.jxclient.server.crossfire.AbstractCrossfireServerConnection | |
void | addCrossfireAccountListener (@NotNull final CrossfireAccountListener listener) |
void | addCrossfireComcListener (@NotNull final CrossfireComcListener listener) |
void | addCrossfireDrawextinfoListener (@NotNull final CrossfireDrawextinfoListener listener) |
void | addCrossfireDrawinfoListener (@NotNull final CrossfireDrawinfoListener listener) |
void | addCrossfireFailureListener (@NotNull final CrossfireFailureListener listener) |
void | addCrossfireMagicmapListener (@NotNull final CrossfireMagicmapListener listener) |
void | addCrossfireMusicListener (@NotNull final CrossfireMusicListener listener) |
void | addCrossfirePickupListener (@NotNull final CrossfirePickupListener listener) |
void | addCrossfireQueryListener (@NotNull final CrossfireQueryListener listener) |
void | addCrossfireSoundListener (@NotNull final CrossfireSoundListener listener) |
void | addCrossfireTickListener (@NotNull final CrossfireTickListener listener) |
void | addCrossfireUpdateItemListener (@NotNull final CrossfireUpdateItemListener crossfireUpdateItemListener) |
void | addPacketWatcherListener (@NotNull final ReceivedPacketListener listener) |
void | addSentPacketListener (@NotNull final SentPacketListener listener) |
void | drawextinfo (final int color, final int type, final int subtype, @NotNull final String message) |
void | drawInfo (@NotNull final String message, final int color) |
void | drawInfoSetDebugMode (final boolean printMessageTypes) |
void | removeCrossfireAccountListener (@NotNull final CrossfireAccountListener listener) |
void | removeCrossfireDrawextinfoListener (@NotNull final CrossfireDrawextinfoListener listener) |
void | removeCrossfireDrawinfoListener (@NotNull final CrossfireDrawinfoListener listener) |
void | removeCrossfireFailureListener (@NotNull final CrossfireFailureListener listener) |
void | removeCrossfireMagicmapListener (@NotNull final CrossfireMagicmapListener listener) |
void | removeCrossfirePickupListener (@NotNull final CrossfirePickupListener listener) |
void | removeCrossfireQueryListener (@NotNull final CrossfireQueryListener listener) |
void | removeCrossfireUpdateItemListener (@NotNull final CrossfireUpdateItemListener crossfireUpdateItemListener) |
void | removePacketWatcherListener (@NotNull final ReceivedPacketListener listener) |
void | removeSentPacketListener (@NotNull final SentPacketListener listener) |
Public Member Functions inherited from com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection | |
void | drawextinfo (int color, int type, int subtype, String message) |
Private Attributes | |
final StringBuilder | sb = new StringBuilder() |
Additional Inherited Members | |
Protected Member Functions inherited from com.realtime.crossfire.jxclient.server.crossfire.AbstractCrossfireServerConnection | |
AbstractCrossfireServerConnection (@NotNull final Model model) | |
void | clearFailure () |
void | fireAddAccount (@NotNull final CharacterInformation characterInformation) |
void | fireAddItemReceived (final int location, final int tag, final int flags, final int weight, final int faceNum, final String name, final String namePl, final int anim, final int animSpeed, final int nrof, final int type) |
void | fireCommandComcReceived (final int packetNo, final int time) |
void | fireCommandQueryReceived (@NotNull final String prompt, final int queryType) |
void | fireCommandSound2Received (final int x, final int y, final int dir, final int volume, final int type, @NotNull final String action, @NotNull final String name) |
void | fireCommandSoundReceived (final int x, final int y, final int num, final int type) |
void | fireDelinvReceived (final int tag) |
void | fireDelitemReceived (final int @NotNull[] tags) |
void | fireEndAccountList (final int count) |
void | fireFaceReceived (final int faceNum, final int faceSetNum, final int faceChecksum, @NotNull final String faceName) |
void | fireFailure (@NotNull final String command, @NotNull final String arguments) |
void | fireMagicMap () |
void | fireManageAccount () |
void | fireMarkSent (final int tag) |
void | fireMusicReceived (@NotNull final String music) |
void | firePickupChanged (final int pickupOptions) |
void | firePlayerReceived (final int tag, final int weight, final int faceNum, @NotNull final String name) |
void | fireReplySent () |
void | fireSelectCharacter (@NotNull final String accountName, @NotNull final String characterName) |
void | fireStartAccountList (@NotNull final String accountName) |
void | fireStartPlaying () |
void | fireTick (final int tickNo) |
void | fireUpditemReceived (final int flags, final int tag, final int valLocation, final int valFlags, final int valWeight, final int valFaceNum, @NotNull final String valName, @NotNull final String valNamePl, final int valAnim, final int valAnimSpeed, final int valNrof) |
void | notifyPacketWatcherListeners (@NotNull final String command, @NotNull final ClientSocketMonitorCommand args) |
Static Protected Member Functions inherited from com.realtime.crossfire.jxclient.server.crossfire.AbstractCrossfireServerConnection | |
static String | newString (@NotNull final ByteBuffer byteBuffer, final int start, final int len) |
Static Protected Attributes inherited from com.realtime.crossfire.jxclient.server.crossfire.AbstractCrossfireServerConnection | |
static final Charset | UTF8 = StandardCharsets.UTF_8 |
Implements CrossfireServerConnection for regression tests. All functions do call Assert#fail(). Sub-classes may override some functions.
Definition at line 39 of file TestCrossfireServerConnection.java.
com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.TestCrossfireServerConnection | ( | ) |
Creates a new instance.
Definition at line 50 of file TestCrossfireServerConnection.java.
void com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.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 171 of file TestCrossfireServerConnection.java.
void com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.addCrossfireMapScrollListener | ( | @NotNull final CrossfireMapScrollListener | listener | ) |
Registers a listener to be called whenever the map was scolled.
listener | the listener |
Implements com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.
Definition at line 65 of file TestCrossfireServerConnection.java.
void com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.addFaceReceivedListener | ( | @NotNull final AskfaceFaceQueueListener | listener | ) |
Registers a listener to be called whenever a face has been received.
listener | the listener |
Implements com.realtime.crossfire.jxclient.faces.AskfaceQueue.
Definition at line 89 of file TestCrossfireServerConnection.java.
void com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.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 180 of file TestCrossfireServerConnection.java.
void com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.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 185 of file TestCrossfireServerConnection.java.
String com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.getAccountName | ( | ) |
Returns the current account name.
Implements com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.
Definition at line 166 of file TestCrossfireServerConnection.java.
void com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.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 175 of file TestCrossfireServerConnection.java.
void com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.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.
login | the character's name |
password | the character's password |
attributes | the character attributes |
Implements com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.
Definition at line 210 of file TestCrossfireServerConnection.java.
void com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.sendAccountCreate | ( | @NotNull final String | login, |
@NotNull final String | password | ||
) |
Sends a request to create a new account.
login | the account login |
password | the account password |
Implements com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.
Definition at line 205 of file TestCrossfireServerConnection.java.
void com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.sendAccountLink | ( | final int | force, |
@NotNull final String | login, | ||
@NotNull final String | password | ||
) |
Sends a request to add an existing character to an account.
force | 0 to allow failure, 1 to force in certain situations |
login | the character's login |
password | the character's password |
Implements com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.
Definition at line 200 of file TestCrossfireServerConnection.java.
void com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.sendAccountLogin | ( | @NotNull final String | login, |
@NotNull final String | password | ||
) |
Asks for an account login.
login | the account login |
password | the account password |
Implements com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.
Definition at line 190 of file TestCrossfireServerConnection.java.
void com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.sendAccountPassword | ( | @NotNull final String | currentPassword, |
@NotNull final String | newPassword | ||
) |
Sends a request to change the account's password.
currentPassword | current account password |
newPassword | new account password |
Implements com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.
Definition at line 215 of file TestCrossfireServerConnection.java.
void com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.sendAccountPlay | ( | @NotNull final String | name | ) |
Sends a request to play a character from an account.
name | the character's name to play |
Implements com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.
Definition at line 195 of file TestCrossfireServerConnection.java.
void com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.sendAddme | ( | ) |
Sends an "addme" command to the server.
Implements com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.
Definition at line 74 of file TestCrossfireServerConnection.java.
void com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.sendApply | ( | final int | tag | ) |
Sends an "apply" command to the server.
tag | the item to apply |
Implements com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.
Definition at line 79 of file TestCrossfireServerConnection.java.
References com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.sb.
void com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.sendAskface | ( | final int | faceNum | ) |
Sends an "askface" command.
faceNum | the face number to request |
Implements com.realtime.crossfire.jxclient.faces.AskfaceQueue.
Definition at line 84 of file TestCrossfireServerConnection.java.
void com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.sendExamine | ( | final int | tag | ) |
Sends an "examine" command to the server.
tag | the item to examine |
Implements com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.
Definition at line 94 of file TestCrossfireServerConnection.java.
void com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.sendLock | ( | final boolean | val, |
final int | tag | ||
) |
Sends a "lock" command to the server.
val | whether to lock the item |
tag | the item to lock |
Implements com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.
Definition at line 99 of file TestCrossfireServerConnection.java.
References com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.sb.
void com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.sendLookat | ( | final int | dx, |
final int | dy | ||
) |
Sends a "lookat" command to the server.
dx | the x-coordinate in tiles, relative to the player |
dy | the y-coordinate in tiles, relative to the player |
Implements com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.
Definition at line 104 of file TestCrossfireServerConnection.java.
void com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.sendMark | ( | final int | tag | ) |
Sends a "mark" command to the server.
tag | the item to mark |
Implements com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.
Definition at line 109 of file TestCrossfireServerConnection.java.
References com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.sb.
void com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.sendMove | ( | final int | to, |
final int | tag, | ||
final int | nrof | ||
) |
Sends a "move" command to the server.
to | the destination location |
tag | the item to move |
nrof | the number of items to move |
Implements com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.
Definition at line 114 of file TestCrossfireServerConnection.java.
References com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.sb.
int com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.sendNcom | ( | final int | repeat, |
@NotNull final String | command | ||
) |
Sends a "ncom" command to the server.
repeat | the repeat count |
command | the command |
Implements com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.
Definition at line 119 of file TestCrossfireServerConnection.java.
References com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.sb.
void com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.sendRawString | ( | @NotNull final String | command | ) |
Sends an arbitrary string command to the server.
command | the command |
Implements com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.
Definition at line 125 of file TestCrossfireServerConnection.java.
References com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.sb.
void com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.sendReply | ( | @NotNull final String | text | ) |
Sends a "reply" command to the server.
text | the text to reply |
Implements com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.
Definition at line 130 of file TestCrossfireServerConnection.java.
void com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.sendRequestinfo | ( | @NotNull final String | infoType | ) |
Sends a "requestinfo" command to the server.
infoType | the info type to request |
Implements com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.
Definition at line 135 of file TestCrossfireServerConnection.java.
void com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.sendSetup | ( | @NotNull final String... | options | ) |
Sends a "setup" command to the server.
options | the option/value pairs to send |
Implements com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.
Definition at line 140 of file TestCrossfireServerConnection.java.
void com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.sendToggleextendedtext | ( | @NotNull final int... | types | ) |
Sends a "toggleextendedtext" command to the server.
types | the types to request |
Implements com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.
Definition at line 145 of file TestCrossfireServerConnection.java.
void com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.sendVersion | ( | final int | csval, |
final int | scval, | ||
@NotNull final String | vinfo | ||
) |
Sends a "version" command to the server.
csval | the client version number |
scval | the server version number |
vinfo | the client identification string |
Implements com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.
Definition at line 150 of file TestCrossfireServerConnection.java.
void com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.setCrossfireUpdateMapListener | ( | @NotNull final CrossfireUpdateMapListener | listener | ) |
Sets a listener to be notified about map changes. At most one such listener may be set.
listener | the listener |
Implements com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.
Definition at line 69 of file TestCrossfireServerConnection.java.
void com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.setPreferredMapSize | ( | final int | preferredMapWidth, |
final int | preferredMapHeight | ||
) |
Sets the preferred map size.
preferredMapWidth | the preferred map width in tiles; must be odd |
preferredMapHeight | the preferred map height in tiles; must be odd |
Implements com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.
Definition at line 155 of file TestCrossfireServerConnection.java.
void com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.setPreferredNumLookObjects | ( | final int | preferredNumLookObjects | ) |
Sets the maximum number of objects in the ground view. Must not be called in connected state.
preferredNumLookObjects | the number of objects |
IllegalArgumentException | if the number of objects is invalid |
Implements com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.
Definition at line 160 of file TestCrossfireServerConnection.java.
void com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.start | ( | ) |
Starts operation.
Implements com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.
Definition at line 55 of file TestCrossfireServerConnection.java.
void com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.stop | ( | ) |
Stops operation.
InterruptedException | if stopping was interrupted |
Implements com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.
Definition at line 60 of file TestCrossfireServerConnection.java.
String com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.toString | ( | ) |
Definition at line 221 of file TestCrossfireServerConnection.java.
References com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.sb.
|
private |
Collects sent commands.
Definition at line 45 of file TestCrossfireServerConnection.java.
Referenced by com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.sendApply(), com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.sendLock(), com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.sendMark(), com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.sendMove(), com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.sendNcom(), com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.sendRawString(), and com.realtime.crossfire.jxclient.server.crossfire.TestCrossfireServerConnection.toString().