public interface CrossfireServerConnection extends AskfaceQueue, ServerConnection
ServerConnection
.Modifier and Type | Method and Description |
---|---|
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 |
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 |
addCrossfireSoundListener(CrossfireSoundListener listener)
Adds a listener to be notified about received sound commands.
|
void |
addCrossfireTickListener(CrossfireTickListener listener)
Adds a listener to be notified about tick changes.
|
void |
addCrossfireUpdateItemListener(CrossfireUpdateItemListener crossfireUpdateItemListener)
Adds a listener to be notified about item 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.
|
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 |
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 |
sendAccountPassword(java.lang.String currentPassword,
java.lang.String newPassword)
Sends a request to change the account's password.
|
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 |
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 |
setCrossfireUpdateMapListener(CrossfireUpdateMapListener listener)
Sets a listener to be notified about map changes.
|
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.
|
sendAskface
addClientSocketListener, connect, disconnect, removeClientSocketListener
void addCrossfireAccountListener(@NotNull CrossfireAccountListener listener)
listener
- the listener to addvoid addCrossfireComcListener(@NotNull CrossfireComcListener listener)
listener
- the listener to addvoid addCrossfireDrawextinfoListener(@NotNull CrossfireDrawextinfoListener listener)
listener
- the listener to removevoid addCrossfireDrawinfoListener(@NotNull CrossfireDrawinfoListener listener)
listener
- the listener to removevoid addCrossfireFailureListener(@NotNull CrossfireFailureListener listener)
listener
- the listener to addvoid addCrossfireMagicmapListener(@NotNull CrossfireMagicmapListener listener)
listener
- the listener to addvoid addCrossfireMusicListener(@NotNull CrossfireMusicListener listener)
listener
- the listener to addvoid addCrossfirePickupListener(@NotNull CrossfirePickupListener listener)
listener
- the listener to addvoid addCrossfireQueryListener(@NotNull CrossfireQueryListener listener)
listener
- the listener to removevoid addCrossfireSoundListener(@NotNull CrossfireSoundListener listener)
listener
- the listener to addvoid addCrossfireTickListener(@NotNull CrossfireTickListener listener)
listener
- the listener to addvoid addCrossfireUpdateItemListener(@NotNull CrossfireUpdateItemListener crossfireUpdateItemListener)
crossfireUpdateItemListener
- the listener to addvoid addPacketWatcherListener(@NotNull ReceivedPacketListener listener)
listener
- the listener to addvoid addSentReplyListener(@NotNull SentReplyListener listener)
listener
- the listener to addvoid drawextinfo(int color, int type, int subtype, java.lang.String message)
type
- the message typesubtype
- the message subtypemessage
- the messagecolor
- the colorvoid drawInfo(@NotNull java.lang.String message, int color)
message
- the messagecolor
- the colorvoid drawInfoSetDebugMode(boolean printMessageTypes)
printMessageTypes
- whether to enable or disable message types@Nullable java.lang.String getAccountName()
null
void removeCrossfireAccountListener(@NotNull CrossfireAccountListener listener)
listener
- the listener to removevoid removeCrossfireDrawextinfoListener(@NotNull CrossfireDrawextinfoListener listener)
listener
- the listener to removevoid removeCrossfireDrawinfoListener(@NotNull CrossfireDrawinfoListener listener)
listener
- the listener to removevoid removeCrossfireFailureListener(@NotNull CrossfireFailureListener listener)
listener
- the listener to removevoid removeCrossfireMagicmapListener(@NotNull CrossfireMagicmapListener listener)
listener
- the listener to removevoid removeCrossfirePickupListener(@NotNull CrossfirePickupListener listener)
listener
- the listener to removevoid removeCrossfireQueryListener(@NotNull CrossfireQueryListener listener)
listener
- the listener to removevoid removeCrossfireUpdateItemListener(@NotNull CrossfireUpdateItemListener crossfireUpdateItemListener)
crossfireUpdateItemListener
- the listener to removevoid removePacketWatcherListener(@NotNull ReceivedPacketListener listener)
listener
- the listener to addvoid removeSentReplyListener(@NotNull SentReplyListener listener)
listener
- the listener to addvoid sendAccountCharacterCreate(@NotNull java.lang.String login, @NotNull java.lang.String password)
login
- the character's namepassword
- the character's passwordvoid sendAccountCreate(@NotNull java.lang.String login, @NotNull java.lang.String password)
login
- the account loginpassword
- the account passwordvoid sendAccountLink(int force, @NotNull java.lang.String login, @NotNull java.lang.String password)
force
- 0 to allow failure, 1 to force in certain situationslogin
- the character's loginpassword
- the character's passwordvoid sendAccountLogin(@NotNull java.lang.String login, @NotNull java.lang.String password)
login
- the account loginpassword
- the account passwordvoid sendAccountPassword(@NotNull java.lang.String currentPassword, @NotNull java.lang.String newPassword)
currentPassword
- current account passwordnewPassword
- new account passwordvoid sendAccountPlay(@NotNull java.lang.String name)
name
- the character's name to playvoid sendAddme()
void sendApply(int tag)
tag
- the item to applyvoid sendExamine(int tag)
tag
- the item to examinevoid sendLock(boolean val, int tag)
val
- whether to lock the itemtag
- the item to lockvoid sendLookat(int dx, int dy)
dx
- the x-coordinate in tiles, relative to the playerdy
- the y-coordinate in tiles, relative to the playervoid sendMark(int tag)
tag
- the item to markvoid sendMove(int to, int tag, int nrof)
to
- the destination locationtag
- the item to movenrof
- the number of items to moveint sendNcom(int repeat, @NotNull java.lang.String command)
repeat
- the repeat countcommand
- the commandvoid sendReply(@NotNull java.lang.String text)
text
- the text to replyvoid sendRequestinfo(@NotNull java.lang.String infoType)
infoType
- the info type to requestvoid sendSetup(@NotNull java.lang.String... options)
options
- the option/value pairs to sendvoid sendToggleextendedtext(@NotNull int... types)
types
- the types to requestvoid sendVersion(int csval, int scval, @NotNull java.lang.String vinfo)
csval
- the client version numberscval
- the server version numbervinfo
- the client identification stringvoid setCrossfireUpdateMapListener(@Nullable CrossfireUpdateMapListener listener)
listener
- the listener to set or null
to unset itvoid setPreferredMapSize(int preferredMapWidth, int preferredMapHeight)
preferredMapWidth
- the preferred map width in tiles; must be oddpreferredMapHeight
- the preferred map height in tiles; must be oddvoid setPreferredNumLookObjects(int preferredNumLookObjects)
preferredNumLookObjects
- the number of objectsjava.lang.IllegalArgumentException
- if the number of objects is invalidvoid start()
void stop() throws java.lang.InterruptedException
java.lang.InterruptedException
- if stopping was interrupted