public interface CrossfireServerConnection
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 |
---|
void addCrossfireAccountListener(@NotNull CrossfireAccountListener listener)
listener
- the listener to add.void 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 addCrossfireExpTableListener(@NotNull CrossfireExpTableListener crossfireExpTableListener)
crossfireExpTableListener
- the listener to addvoid addCrossfireFaceListener(@NotNull CrossfireFaceListener listener)
listener
- the listener to addvoid addCrossfireFailureListener(@NotNull CrossfireFailureListener listener)
listener
- listener to add.void 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 addCrossfireServerConnectionListener(@NotNull CrossfireServerConnectionListener listener)
listener
- the listener to addvoid addCrossfireSkillInfoListener(@NotNull CrossfireSkillInfoListener listener)
listener
- the listener to addvoid addCrossfireSoundListener(@NotNull CrossfireSoundListener listener)
listener
- the listener to addvoid addCrossfireSpellListener(@NotNull CrossfireSpellListener listener)
listener
- the listener to addvoid addCrossfireStatsListener(@NotNull CrossfireStatsListener crossfireStatsListener)
crossfireStatsListener
- the listener to addvoid addCrossfireTickListener(@NotNull CrossfireTickListener listener)
listener
- the listener to addvoid addCrossfireUpdateFaceListener(@NotNull CrossfireUpdateFaceListener listener)
listener
- the listener to addvoid addCrossfireUpdateItemListener(@NotNull CrossfireUpdateItemListener crossfireUpdateItemListener)
crossfireUpdateItemListener
- the listener to addvoid addCrossfireUpdateMapListener(@NotNull CrossfireUpdateMapListener listener)
listener
- 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
int getMapHeight()
int getMapWidth()
void removeCrossfireAccountListener(@NotNull CrossfireAccountListener listener)
listener
- the listener to remove.void removeCrossfireDrawextinfoListener(@NotNull CrossfireDrawextinfoListener listener)
listener
- the listener to removevoid removeCrossfireDrawinfoListener(@NotNull CrossfireDrawinfoListener listener)
listener
- the listener to removevoid removeCrossfireFailureListener(@NotNull CrossfireFailureListener listener)
listener
- listener to be removed.void 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 removeCrossfireSkillInfoListener(@NotNull CrossfireSkillInfoListener 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 sendAccountPlay(@NotNull java.lang.String name)
name
- the character's name to playvoid sendAddme()
void sendApply(int tag)
tag
- the item to applyvoid sendAskface(int num)
num
- the face to queryvoid 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 command
void 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 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 objects
java.lang.IllegalArgumentException
- if the number of objects is invalidvoid start()
void stop() throws java.lang.InterruptedException
java.lang.InterruptedException
- if stopping was interrupted