com.realtime.crossfire.jxclient.server.crossfire
Interface CrossfireServerConnection

All Superinterfaces:
ServerConnection
All Known Implementing Classes:
DefaultCrossfireServerConnection

public interface CrossfireServerConnection
extends ServerConnection

Adds encoding/decoding of crossfire protocol packets to a ServerConnection.


Method Summary
 void addCrossfireAccountListener(CrossfireAccountListener listener)
          Adds a listener to be notified about account events.
 void addCrossfireComcListener(CrossfireComcListener listener)
          Adds a listener to be notified about received comc commands.
 void addCrossfireDrawextinfoListener(CrossfireDrawextinfoListener listener)
          Adds a new listener monitoring the drawextinfo S->C messages.
 void addCrossfireDrawinfoListener(CrossfireDrawinfoListener listener)
          Adds a new listener monitoring the drawinfo S->C messages.
 void addCrossfireExpTableListener(CrossfireExpTableListener crossfireExpTableListener)
          Adds a listener to be notified about received experience table changes.
 void addCrossfireFaceListener(CrossfireFaceListener listener)
          Adds a listener to be notified about received face commands.
 void addCrossfireFailureListener(CrossfireFailureListener listener)
          Adds a listener to be notified of failure messages.
 void addCrossfireMagicmapListener(CrossfireMagicmapListener listener)
          Adds a listener from the list of objects listening to magicmap messages.
 void addCrossfireMusicListener(CrossfireMusicListener listener)
          Adds a listener to be notified about received music commands.
 void addCrossfirePickupListener(CrossfirePickupListener listener)
          Adds a listener to be notified about received "pickup" messages.
 void addCrossfireQueryListener(CrossfireQueryListener listener)
          Adds a new listener monitoring the query S->C messages.
 void addCrossfireServerConnectionListener(CrossfireServerConnectionListener listener)
          Adds a listener to be notified about connection progress.
 void addCrossfireSkillInfoListener(CrossfireSkillInfoListener listener)
          Adds a listener to be notified about received skill info changes.
 void addCrossfireSoundListener(CrossfireSoundListener listener)
          Adds a listener to be notified about received sound commands.
 void addCrossfireSpellListener(CrossfireSpellListener listener)
          Adds a listener to be notified about received spell commands.
 void addCrossfireStatsListener(CrossfireStatsListener crossfireStatsListener)
          Adds a listener to be notified about stats changes.
 void addCrossfireTickListener(CrossfireTickListener listener)
          Adds a listener to be notified about tick changes.
 void addCrossfireUpdateFaceListener(CrossfireUpdateFaceListener listener)
          Add a listener to be notified about face image changes.
 void addCrossfireUpdateItemListener(CrossfireUpdateItemListener crossfireUpdateItemListener)
          Adds a listener to be notified about item changes.
 void addCrossfireUpdateMapListener(CrossfireUpdateMapListener listener)
          Adds a listener to be notified about map changes.
 void addPacketWatcherListener(ReceivedPacketListener listener)
          Adds a listener to be notified about received packets.
 void addSentReplyListener(SentReplyListener listener)
          Adds a listener to be notified about sent reply packets.
 void drawextinfo(int color, int type, int subtype, java.lang.String message)
          Pretends that a drawextinfo message has been received.
 void drawInfo(java.lang.String message, int color)
          Pretends that a drawinfo message has been received.
 void drawInfoSetDebugMode(boolean printMessageTypes)
          Enables or disables printing of message types.
 java.lang.String getAccountName()
          Returns the current account name.
 int getMapHeight()
          Returns the map height in tiles.
 int getMapWidth()
          Returns the map width in tiles.
 void removeCrossfireAccountListener(CrossfireAccountListener listener)
          Removes a listener to be notified about account events.
 void removeCrossfireDrawextinfoListener(CrossfireDrawextinfoListener listener)
          Removes the given listener from the list of objects listening to the drawextinfo S->C messages.
 void removeCrossfireDrawinfoListener(CrossfireDrawinfoListener listener)
          Removes the given listener from the list of objects listening to the drawinfo S->C messages.
 void removeCrossfireFailureListener(CrossfireFailureListener listener)
          Removes a listener to be notified of failure messages.
 void removeCrossfireMagicmapListener(CrossfireMagicmapListener listener)
          Removes a listener from the list of objects listening to magicmap messages.
 void removeCrossfirePickupListener(CrossfirePickupListener listener)
          Removes a listener to be notified about received "pickup" messages.
 void removeCrossfireQueryListener(CrossfireQueryListener listener)
          Removes the given listener from the list of objects listening to the query S->C messages.
 void removeCrossfireSkillInfoListener(CrossfireSkillInfoListener listener)
          Removes a listener to be notified about received skill info changes.
 void removeCrossfireUpdateItemListener(CrossfireUpdateItemListener crossfireUpdateItemListener)
          Removes a listener to be notified about item changes.
 void removePacketWatcherListener(ReceivedPacketListener listener)
          Removes a listener to be notified about received packets.
 void removeSentReplyListener(SentReplyListener listener)
          Removes a listener to be notified about sent reply packets.
 void sendAccountCharacterCreate(java.lang.String login, java.lang.String password)
          Sends a request to create a new character associated to the account.
 void sendAccountCreate(java.lang.String login, java.lang.String password)
          Sends a request to create a new account.
 void sendAccountLink(int force, java.lang.String login, java.lang.String password)
          Sends a request to add an existing character to an account.
 void sendAccountLogin(java.lang.String login, java.lang.String password)
          Asks for an account login.
 void sendAccountPlay(java.lang.String name)
          Sends a request to play a character from an account.
 void sendAddme()
          Sends an "addme" command to the server.
 void sendApply(int tag)
          Sends an "apply" command to the server.
 void sendAskface(int num)
          Sends an "askface" command to the server.
 void sendExamine(int tag)
          Sends an "examine" command to the server.
 void sendLock(boolean val, int tag)
          Sends a "lock" command to the server.
 void sendLookat(int dx, int dy)
          Sends a "lookat" command to the server.
 void sendMark(int tag)
          Sends a "mark" command to the server.
 void sendMove(int to, int tag, int nrof)
          Sends a "move" command to the server.
 int sendNcom(int repeat, java.lang.String command)
          Sends a "ncom" command to the server.
 void sendReply(java.lang.String text)
          Sends a "reply" command to the server.
 void sendRequestinfo(java.lang.String infoType)
          Sends a "requestinfo" command to the server.
 void sendSetup(java.lang.String... options)
          Sends a "setup" command to the server.
 void sendToggleextendedtext(int... types)
          Sends a "toggleextendedtext" command to the server.
 void sendVersion(int csval, int scval, java.lang.String vinfo)
          Sends a "version" command to the server.
 void setPreferredMapSize(int preferredMapWidth, int preferredMapHeight)
          Sets the preferred map size.
 void setPreferredNumLookObjects(int preferredNumLookObjects)
          Sets the maximum number of objects in the ground view.
 void start()
          Starts operation.
 void stop()
          Stops operation.
 
Methods inherited from interface com.realtime.crossfire.jxclient.server.server.ServerConnection
addClientSocketListener, connect, disconnect, removeClientSocketListener
 

Method Detail

addCrossfireAccountListener

void addCrossfireAccountListener(@NotNull
                                 CrossfireAccountListener listener)
Adds a listener to be notified about account events.

Parameters:
listener - the listener to add.

addCrossfireComcListener

void addCrossfireComcListener(@NotNull
                              CrossfireComcListener listener)
Adds a listener to be notified about received comc commands.

Parameters:
listener - the listener to add

addCrossfireDrawextinfoListener

void addCrossfireDrawextinfoListener(@NotNull
                                     CrossfireDrawextinfoListener listener)
Adds a new listener monitoring the drawextinfo S->C messages.

Parameters:
listener - the listener to remove

addCrossfireDrawinfoListener

void addCrossfireDrawinfoListener(@NotNull
                                  CrossfireDrawinfoListener listener)
Adds a new listener monitoring the drawinfo S->C messages.

Parameters:
listener - the listener to remove

addCrossfireExpTableListener

void addCrossfireExpTableListener(@NotNull
                                  CrossfireExpTableListener crossfireExpTableListener)
Adds a listener to be notified about received experience table changes.

Parameters:
crossfireExpTableListener - the listener to add

addCrossfireFaceListener

void addCrossfireFaceListener(@NotNull
                              CrossfireFaceListener listener)
Adds a listener to be notified about received face commands.

Parameters:
listener - the listener to add

addCrossfireFailureListener

void addCrossfireFailureListener(@NotNull
                                 CrossfireFailureListener listener)
Adds a listener to be notified of failure messages.

Parameters:
listener - listener to add.

addCrossfireMagicmapListener

void addCrossfireMagicmapListener(@NotNull
                                  CrossfireMagicmapListener listener)
Adds a listener from the list of objects listening to magicmap messages.

Parameters:
listener - the listener to add

addCrossfireMusicListener

void addCrossfireMusicListener(@NotNull
                               CrossfireMusicListener listener)
Adds a listener to be notified about received music commands.

Parameters:
listener - the listener to add

addCrossfirePickupListener

void addCrossfirePickupListener(@NotNull
                                CrossfirePickupListener listener)
Adds a listener to be notified about received "pickup" messages.

Parameters:
listener - the listener to add

addCrossfireQueryListener

void addCrossfireQueryListener(@NotNull
                               CrossfireQueryListener listener)
Adds a new listener monitoring the query S->C messages.

Parameters:
listener - the listener to remove

addCrossfireServerConnectionListener

void addCrossfireServerConnectionListener(@NotNull
                                          CrossfireServerConnectionListener listener)
Adds a listener to be notified about connection progress.

Parameters:
listener - the listener to add

addCrossfireSkillInfoListener

void addCrossfireSkillInfoListener(@NotNull
                                   CrossfireSkillInfoListener listener)
Adds a listener to be notified about received skill info changes.

Parameters:
listener - the listener to add

addCrossfireSoundListener

void addCrossfireSoundListener(@NotNull
                               CrossfireSoundListener listener)
Adds a listener to be notified about received sound commands.

Parameters:
listener - the listener to add

addCrossfireSpellListener

void addCrossfireSpellListener(@NotNull
                               CrossfireSpellListener listener)
Adds a listener to be notified about received spell commands.

Parameters:
listener - the listener to add

addCrossfireStatsListener

void addCrossfireStatsListener(@NotNull
                               CrossfireStatsListener crossfireStatsListener)
Adds a listener to be notified about stats changes.

Parameters:
crossfireStatsListener - the listener to add

addCrossfireTickListener

void addCrossfireTickListener(@NotNull
                              CrossfireTickListener listener)
Adds a listener to be notified about tick changes.

Parameters:
listener - the listener to add

addCrossfireUpdateFaceListener

void addCrossfireUpdateFaceListener(@NotNull
                                    CrossfireUpdateFaceListener listener)
Add a listener to be notified about face image changes.

Parameters:
listener - the listener to add

addCrossfireUpdateItemListener

void addCrossfireUpdateItemListener(@NotNull
                                    CrossfireUpdateItemListener crossfireUpdateItemListener)
Adds a listener to be notified about item changes.

Parameters:
crossfireUpdateItemListener - the listener to add

addCrossfireUpdateMapListener

void addCrossfireUpdateMapListener(@NotNull
                                   CrossfireUpdateMapListener listener)
Adds a listener to be notified about map changes.

Parameters:
listener - the listener to add

addPacketWatcherListener

void addPacketWatcherListener(@NotNull
                              ReceivedPacketListener listener)
Adds a listener to be notified about received packets.

Parameters:
listener - the listener to add

addSentReplyListener

void addSentReplyListener(@NotNull
                          SentReplyListener listener)
Adds a listener to be notified about sent reply packets.

Parameters:
listener - the listener to add

drawextinfo

void drawextinfo(int color,
                 int type,
                 int subtype,
                 java.lang.String message)
Pretends that a drawextinfo message has been received.

Parameters:
type - the message type
subtype - the message subtype
message - the message
color - the color

drawInfo

void drawInfo(@NotNull
              java.lang.String message,
              int color)
Pretends that a drawinfo message has been received.

Parameters:
message - the message
color - the color

drawInfoSetDebugMode

void drawInfoSetDebugMode(boolean printMessageTypes)
Enables or disables printing of message types.

Parameters:
printMessageTypes - whether to enable or disable message types

getAccountName

@Nullable
java.lang.String getAccountName()
Returns the current account name.

Returns:
the current account name or null

getMapHeight

int getMapHeight()
Returns the map height in tiles.

Returns:
the map height

getMapWidth

int getMapWidth()
Returns the map width in tiles.

Returns:
the map width

removeCrossfireAccountListener

void removeCrossfireAccountListener(@NotNull
                                    CrossfireAccountListener listener)
Removes a listener to be notified about account events.

Parameters:
listener - the listener to remove.

removeCrossfireDrawextinfoListener

void removeCrossfireDrawextinfoListener(@NotNull
                                        CrossfireDrawextinfoListener listener)
Removes the given listener from the list of objects listening to the drawextinfo S->C messages.

Parameters:
listener - the listener to remove

removeCrossfireDrawinfoListener

void removeCrossfireDrawinfoListener(@NotNull
                                     CrossfireDrawinfoListener listener)
Removes the given listener from the list of objects listening to the drawinfo S->C messages.

Parameters:
listener - the listener to remove

removeCrossfireFailureListener

void removeCrossfireFailureListener(@NotNull
                                    CrossfireFailureListener listener)
Removes a listener to be notified of failure messages.

Parameters:
listener - listener to be removed.

removeCrossfireMagicmapListener

void removeCrossfireMagicmapListener(@NotNull
                                     CrossfireMagicmapListener listener)
Removes a listener from the list of objects listening to magicmap messages.

Parameters:
listener - the listener to remove

removeCrossfirePickupListener

void removeCrossfirePickupListener(@NotNull
                                   CrossfirePickupListener listener)
Removes a listener to be notified about received "pickup" messages.

Parameters:
listener - the listener to remove

removeCrossfireQueryListener

void removeCrossfireQueryListener(@NotNull
                                  CrossfireQueryListener listener)
Removes the given listener from the list of objects listening to the query S->C messages.

Parameters:
listener - the listener to remove

removeCrossfireSkillInfoListener

void removeCrossfireSkillInfoListener(@NotNull
                                      CrossfireSkillInfoListener listener)
Removes a listener to be notified about received skill info changes.

Parameters:
listener - the listener to remove

removeCrossfireUpdateItemListener

void removeCrossfireUpdateItemListener(@NotNull
                                       CrossfireUpdateItemListener crossfireUpdateItemListener)
Removes a listener to be notified about item changes.

Parameters:
crossfireUpdateItemListener - the listener to remove

removePacketWatcherListener

void removePacketWatcherListener(@NotNull
                                 ReceivedPacketListener listener)
Removes a listener to be notified about received packets.

Parameters:
listener - the listener to add

removeSentReplyListener

void removeSentReplyListener(@NotNull
                             SentReplyListener listener)
Removes a listener to be notified about sent reply packets.

Parameters:
listener - the listener to add

sendAccountCharacterCreate

void sendAccountCharacterCreate(@NotNull
                                java.lang.String login,
                                @NotNull
                                java.lang.String password)
Sends a request to create a new character associated to the account.

Parameters:
login - the character's name
password - the character's password

sendAccountCreate

void sendAccountCreate(@NotNull
                       java.lang.String login,
                       @NotNull
                       java.lang.String password)
Sends a request to create a new account.

Parameters:
login - the account login
password - the account password

sendAccountLink

void sendAccountLink(int force,
                     @NotNull
                     java.lang.String login,
                     @NotNull
                     java.lang.String password)
Sends a request to add an existing character to an account.

Parameters:
force - 0 to allow failure, 1 to force in certain situations
login - the character's login
password - the character's password

sendAccountLogin

void sendAccountLogin(@NotNull
                      java.lang.String login,
                      @NotNull
                      java.lang.String password)
Asks for an account login.

Parameters:
login - the account login
password - the account password

sendAccountPlay

void sendAccountPlay(@NotNull
                     java.lang.String name)
Sends a request to play a character from an account.

Parameters:
name - the character's name to play

sendAddme

void sendAddme()
Sends an "addme" command to the server.


sendApply

void sendApply(int tag)
Sends an "apply" command to the server.

Parameters:
tag - the item to apply

sendAskface

void sendAskface(int num)
Sends an "askface" command to the server.

Parameters:
num - the face to query

sendExamine

void sendExamine(int tag)
Sends an "examine" command to the server.

Parameters:
tag - the item to examine

sendLock

void sendLock(boolean val,
              int tag)
Sends a "lock" command to the server.

Parameters:
val - whether to lock the item
tag - the item to lock

sendLookat

void sendLookat(int dx,
                int dy)
Sends a "lookat" command to the server.

Parameters:
dx - the x-coordinate in tiles, relative to the player
dy - the y-coordinate in tiles, relative to the player

sendMark

void sendMark(int tag)
Sends a "mark" command to the server.

Parameters:
tag - the item to mark

sendMove

void sendMove(int to,
              int tag,
              int nrof)
Sends a "move" command to the server.

Parameters:
to - the destination location
tag - the item to move
nrof - the number of items to move

sendNcom

int sendNcom(int repeat,
             @NotNull
             java.lang.String command)
Sends a "ncom" command to the server.

Parameters:
repeat - the repeat count
command - the command
Returns:
the packet id

sendReply

void sendReply(@NotNull
               java.lang.String text)
Sends a "reply" command to the server.

Parameters:
text - the text to reply

sendRequestinfo

void sendRequestinfo(@NotNull
                     java.lang.String infoType)
Sends a "requestinfo" command to the server.

Parameters:
infoType - the info type to request

sendSetup

void sendSetup(@NotNull
               java.lang.String... options)
Sends a "setup" command to the server.

Parameters:
options - the option/value pairs to send

sendToggleextendedtext

void sendToggleextendedtext(@NotNull
                            int... types)
Sends a "toggleextendedtext" command to the server.

Parameters:
types - the types to request

sendVersion

void sendVersion(int csval,
                 int scval,
                 @NotNull
                 java.lang.String vinfo)
Sends a "version" command to the server.

Parameters:
csval - the client version number
scval - the server version number
vinfo - the client identification string

setPreferredMapSize

void setPreferredMapSize(int preferredMapWidth,
                         int preferredMapHeight)
Sets the preferred map size.

Parameters:
preferredMapWidth - the preferred map width in tiles; must be odd
preferredMapHeight - the preferred map height in tiles; must be odd

setPreferredNumLookObjects

void setPreferredNumLookObjects(int preferredNumLookObjects)
Sets the maximum number of objects in the ground view. Must not be called in connected state.

Parameters:
preferredNumLookObjects - the number of objects
Throws:
java.lang.IllegalArgumentException - if the number of objects is invalid

start

void start()
Starts operation.


stop

void stop()
          throws java.lang.InterruptedException
Stops operation.

Throws:
java.lang.InterruptedException - if stopping was interrupted