public abstract class AbstractCrossfireServerConnection extends java.lang.Object implements CrossfireServerConnection
CrossfireServerConnection
implementing
classes.Modifier and Type | Field and Description |
---|---|
protected static @NotNull java.nio.charset.Charset |
UTF8
The
Charset used for parsing or encoding strings received from or
sent to the Crossfire server. |
Modifier | Constructor and Description |
---|---|
protected |
AbstractCrossfireServerConnection(@NotNull Model model)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addCrossfireAccountListener(@NotNull CrossfireAccountListener listener)
Adds a listener to be notified about account events.
|
void |
addCrossfireComcListener(@NotNull CrossfireComcListener listener)
Adds a listener to be notified about received comc commands.
|
void |
addCrossfireDrawextinfoListener(@NotNull CrossfireDrawextinfoListener listener)
Adds a new listener monitoring the drawextinfo S->C messages.
|
void |
addCrossfireDrawinfoListener(@NotNull CrossfireDrawinfoListener listener)
Adds a new listener monitoring the drawinfo S->C messages.
|
void |
addCrossfireFailureListener(@NotNull CrossfireFailureListener listener)
Adds a listener to be notified of failure messages.
|
void |
addCrossfireMagicmapListener(@NotNull CrossfireMagicmapListener listener)
Adds a listener from the list of objects listening to magicmap messages.
|
void |
addCrossfireMusicListener(@NotNull CrossfireMusicListener listener)
Adds a listener to be notified about received music commands.
|
void |
addCrossfirePickupListener(@NotNull CrossfirePickupListener listener)
Adds a listener to be notified about received "pickup" messages.
|
void |
addCrossfireQueryListener(@NotNull CrossfireQueryListener listener)
Adds a new listener monitoring the query S->C messages.
|
void |
addCrossfireSoundListener(@NotNull CrossfireSoundListener listener)
Adds a listener to be notified about received sound commands.
|
void |
addCrossfireTickListener(@NotNull CrossfireTickListener listener)
Adds a listener to be notified about tick changes.
|
void |
addCrossfireUpdateItemListener(@NotNull CrossfireUpdateItemListener crossfireUpdateItemListener)
Adds a listener to be notified about item changes.
|
void |
addPacketWatcherListener(@NotNull ReceivedPacketListener listener)
Adds a listener to be notified about received packets.
|
void |
addSentReplyListener(@NotNull SentReplyListener listener)
Adds a listener to be notified about sent reply packets.
|
protected void |
clearFailure()
Inform the various failure listeners that they can clean the last
displayed failure.
|
void |
drawextinfo(int color,
int type,
int subtype,
@NotNull java.lang.String message)
Pretends that a drawextinfo message has been received.
|
void |
drawInfo(@NotNull 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.
|
protected void |
fireAddAccount(@NotNull com.realtime.crossfire.jxclient.account.CharacterInformation characterInformation) |
protected void |
fireAddItemReceived(int location,
int tag,
int flags,
int weight,
int faceNum,
java.lang.String name,
java.lang.String namePl,
int anim,
int animSpeed,
int nrof,
int type) |
protected void |
fireCommandComcReceived(int packetNo,
int time) |
protected void |
fireCommandQueryReceived(@NotNull java.lang.String prompt,
int queryType) |
protected void |
fireCommandSound2Received(int x,
int y,
int dir,
int volume,
int type,
@NotNull java.lang.String action,
@NotNull java.lang.String name) |
protected void |
fireCommandSoundReceived(int x,
int y,
int num,
int type) |
protected void |
fireDelinvReceived(int tag) |
protected void |
fireDelitemReceived(int[] tags) |
protected void |
fireEndAccountList(int count) |
protected void |
fireFaceReceived(int faceNum,
int faceSetNum,
int faceChecksum,
@NotNull java.lang.String faceName) |
protected void |
fireFailure(@NotNull java.lang.String command,
@NotNull java.lang.String arguments) |
protected void |
fireMagicMap() |
protected void |
fireManageAccount() |
protected void |
fireMusicReceived(@NotNull java.lang.String music) |
protected void |
firePickupChanged(int pickupOptions) |
protected void |
firePlayerReceived(int tag,
int weight,
int faceNum,
@NotNull java.lang.String name) |
protected void |
fireReplySent() |
protected void |
fireSelectCharacter(@NotNull java.lang.String accountName,
@NotNull java.lang.String characterName) |
protected void |
fireStartAccountList(@NotNull java.lang.String accountName) |
protected void |
fireStartPlaying() |
protected void |
fireTick(int tickNo) |
protected void |
fireUpditemReceived(int flags,
int tag,
int valLocation,
int valFlags,
int valWeight,
int valFaceNum,
@NotNull java.lang.String valName,
@NotNull java.lang.String valNamePl,
int valAnim,
int valAnimSpeed,
int valNrof) |
protected static @NotNull java.lang.String |
newString(@NotNull java.nio.ByteBuffer byteBuffer,
int start,
int len)
Extracts a string from a
ByteBuffer range. |
protected void |
notifyPacketWatcherListeners(@NotNull java.lang.String command,
@NotNull ClientSocketMonitorCommand args)
Notifies all
ReceivedPacketListeners about
a packet. |
void |
removeCrossfireAccountListener(@NotNull CrossfireAccountListener listener)
Removes a listener to be notified about account events.
|
void |
removeCrossfireDrawextinfoListener(@NotNull CrossfireDrawextinfoListener listener)
Removes the given listener from the list of objects listening to the
drawextinfo S->C messages.
|
void |
removeCrossfireDrawinfoListener(@NotNull CrossfireDrawinfoListener listener)
Removes the given listener from the list of objects listening to the
drawinfo S->C messages.
|
void |
removeCrossfireFailureListener(@NotNull CrossfireFailureListener listener)
Removes a listener to be notified of failure messages.
|
void |
removeCrossfireMagicmapListener(@NotNull CrossfireMagicmapListener listener)
Removes a listener from the list of objects listening to magicmap
messages.
|
void |
removeCrossfirePickupListener(@NotNull CrossfirePickupListener listener)
Removes a listener to be notified about received "pickup" messages.
|
void |
removeCrossfireQueryListener(@NotNull CrossfireQueryListener listener)
Removes the given listener from the list of objects listening to the
query S->C messages.
|
void |
removeCrossfireUpdateItemListener(@NotNull CrossfireUpdateItemListener crossfireUpdateItemListener)
Removes a listener to be notified about item changes.
|
void |
removePacketWatcherListener(@NotNull ReceivedPacketListener listener)
Removes a listener to be notified about received packets.
|
void |
removeSentReplyListener(@NotNull SentReplyListener listener)
Removes a listener to be notified about sent reply packets.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAccountName, sendAccountCharacterCreate, sendAccountCreate, sendAccountLink, sendAccountLogin, sendAccountPassword, sendAccountPlay, sendAddme, sendApply, sendExamine, sendLock, sendLookat, sendMark, sendMove, sendNcom, sendRawString, sendReply, sendRequestinfo, sendSetup, sendToggleextendedtext, sendVersion, setCrossfireUpdateMapListener, setPreferredMapSize, setPreferredNumLookObjects, start, stop
addFaceReceivedListener, sendAskface
addClientSocketListener, connect, disconnect, removeClientSocketListener
@NotNull protected static final @NotNull java.nio.charset.Charset UTF8
Charset
used for parsing or encoding strings received from or
sent to the Crossfire server.protected AbstractCrossfireServerConnection(@NotNull @NotNull Model model)
model
- the model instance to updatepublic void addCrossfireDrawinfoListener(@NotNull @NotNull CrossfireDrawinfoListener listener)
CrossfireServerConnection
addCrossfireDrawinfoListener
in interface CrossfireServerConnection
listener
- the listener to removepublic void removeCrossfireDrawinfoListener(@NotNull @NotNull CrossfireDrawinfoListener listener)
CrossfireServerConnection
removeCrossfireDrawinfoListener
in interface CrossfireServerConnection
listener
- the listener to removepublic void addCrossfireDrawextinfoListener(@NotNull @NotNull CrossfireDrawextinfoListener listener)
CrossfireServerConnection
addCrossfireDrawextinfoListener
in interface CrossfireServerConnection
listener
- the listener to removepublic void removeCrossfireDrawextinfoListener(@NotNull @NotNull CrossfireDrawextinfoListener listener)
CrossfireServerConnection
removeCrossfireDrawextinfoListener
in interface CrossfireServerConnection
listener
- the listener to removepublic void addCrossfireQueryListener(@NotNull @NotNull CrossfireQueryListener listener)
CrossfireServerConnection
addCrossfireQueryListener
in interface CrossfireServerConnection
listener
- the listener to removepublic void removeCrossfireQueryListener(@NotNull @NotNull CrossfireQueryListener listener)
CrossfireServerConnection
removeCrossfireQueryListener
in interface CrossfireServerConnection
listener
- the listener to removepublic void addCrossfireMagicmapListener(@NotNull @NotNull CrossfireMagicmapListener listener)
CrossfireServerConnection
addCrossfireMagicmapListener
in interface CrossfireServerConnection
listener
- the listener to addpublic void removeCrossfireMagicmapListener(@NotNull @NotNull CrossfireMagicmapListener listener)
CrossfireServerConnection
removeCrossfireMagicmapListener
in interface CrossfireServerConnection
listener
- the listener to removepublic void addCrossfireUpdateItemListener(@NotNull @NotNull CrossfireUpdateItemListener crossfireUpdateItemListener)
CrossfireServerConnection
addCrossfireUpdateItemListener
in interface CrossfireServerConnection
crossfireUpdateItemListener
- the listener to addpublic void removeCrossfireUpdateItemListener(@NotNull @NotNull CrossfireUpdateItemListener crossfireUpdateItemListener)
CrossfireServerConnection
removeCrossfireUpdateItemListener
in interface CrossfireServerConnection
crossfireUpdateItemListener
- the listener to removepublic void addCrossfireTickListener(@NotNull @NotNull CrossfireTickListener listener)
CrossfireServerConnection
addCrossfireTickListener
in interface CrossfireServerConnection
listener
- the listener to addpublic void addCrossfireSoundListener(@NotNull @NotNull CrossfireSoundListener listener)
CrossfireServerConnection
addCrossfireSoundListener
in interface CrossfireServerConnection
listener
- the listener to addpublic void addCrossfireMusicListener(@NotNull @NotNull CrossfireMusicListener listener)
CrossfireServerConnection
addCrossfireMusicListener
in interface CrossfireServerConnection
listener
- the listener to addpublic void addCrossfireComcListener(@NotNull @NotNull CrossfireComcListener listener)
CrossfireServerConnection
addCrossfireComcListener
in interface CrossfireServerConnection
listener
- the listener to addpublic void addPacketWatcherListener(@NotNull @NotNull ReceivedPacketListener listener)
CrossfireServerConnection
addPacketWatcherListener
in interface CrossfireServerConnection
listener
- the listener to addpublic void addCrossfireAccountListener(@NotNull @NotNull CrossfireAccountListener listener)
CrossfireServerConnection
addCrossfireAccountListener
in interface CrossfireServerConnection
listener
- the listener to addpublic void removeCrossfireAccountListener(@NotNull @NotNull CrossfireAccountListener listener)
CrossfireServerConnection
removeCrossfireAccountListener
in interface CrossfireServerConnection
listener
- the listener to removepublic void removePacketWatcherListener(@NotNull @NotNull ReceivedPacketListener listener)
CrossfireServerConnection
removePacketWatcherListener
in interface CrossfireServerConnection
listener
- the listener to addpublic void addSentReplyListener(@NotNull @NotNull SentReplyListener listener)
CrossfireServerConnection
addSentReplyListener
in interface CrossfireServerConnection
listener
- the listener to addpublic void removeSentReplyListener(@NotNull @NotNull SentReplyListener listener)
CrossfireServerConnection
removeSentReplyListener
in interface CrossfireServerConnection
listener
- the listener to addpublic void addCrossfirePickupListener(@NotNull @NotNull CrossfirePickupListener listener)
CrossfireServerConnection
addCrossfirePickupListener
in interface CrossfireServerConnection
listener
- the listener to addpublic void removeCrossfirePickupListener(@NotNull @NotNull CrossfirePickupListener listener)
CrossfireServerConnection
removeCrossfirePickupListener
in interface CrossfireServerConnection
listener
- the listener to removepublic void addCrossfireFailureListener(@NotNull @NotNull CrossfireFailureListener listener)
CrossfireServerConnection
addCrossfireFailureListener
in interface CrossfireServerConnection
listener
- the listener to addpublic void removeCrossfireFailureListener(@NotNull @NotNull CrossfireFailureListener listener)
CrossfireServerConnection
removeCrossfireFailureListener
in interface CrossfireServerConnection
listener
- the listener to removeprotected void fireManageAccount()
protected void fireStartAccountList(@NotNull @NotNull java.lang.String accountName)
protected void fireAddAccount(@NotNull @NotNull com.realtime.crossfire.jxclient.account.CharacterInformation characterInformation)
protected void fireEndAccountList(int count)
protected void fireStartPlaying()
protected void fireCommandComcReceived(int packetNo, int time)
protected void fireDelinvReceived(int tag)
protected void fireDelitemReceived(int[] tags)
protected void fireFaceReceived(int faceNum, int faceSetNum, int faceChecksum, @NotNull @NotNull java.lang.String faceName)
protected void fireFailure(@NotNull @NotNull java.lang.String command, @NotNull @NotNull java.lang.String arguments)
protected void clearFailure()
protected void fireAddItemReceived(int location, int tag, int flags, int weight, int faceNum, java.lang.String name, java.lang.String namePl, int anim, int animSpeed, int nrof, int type)
protected void fireMagicMap()
protected void fireMusicReceived(@NotNull @NotNull java.lang.String music)
protected void firePickupChanged(int pickupOptions)
protected void firePlayerReceived(int tag, int weight, int faceNum, @NotNull @NotNull java.lang.String name)
protected void fireCommandQueryReceived(@NotNull @NotNull java.lang.String prompt, int queryType)
protected void fireCommandSoundReceived(int x, int y, int num, int type)
protected void fireCommandSound2Received(int x, int y, int dir, int volume, int type, @NotNull @NotNull java.lang.String action, @NotNull @NotNull java.lang.String name)
protected void fireTick(int tickNo)
protected void fireUpditemReceived(int flags, int tag, int valLocation, int valFlags, int valWeight, int valFaceNum, @NotNull @NotNull java.lang.String valName, @NotNull @NotNull java.lang.String valNamePl, int valAnim, int valAnimSpeed, int valNrof)
public void drawInfo(@NotNull @NotNull java.lang.String message, int color)
CrossfireServerConnection
drawInfo
in interface CrossfireServerConnection
message
- the messagecolor
- the colorpublic void drawextinfo(int color, int type, int subtype, @NotNull @NotNull java.lang.String message)
CrossfireServerConnection
drawextinfo
in interface CrossfireServerConnection
color
- the colortype
- the message typesubtype
- the message subtypemessage
- the messagepublic void drawInfoSetDebugMode(boolean printMessageTypes)
CrossfireServerConnection
drawInfoSetDebugMode
in interface CrossfireServerConnection
printMessageTypes
- whether to enable or disable message typesprotected void fireReplySent()
protected void notifyPacketWatcherListeners(@NotNull @NotNull java.lang.String command, @NotNull @NotNull ClientSocketMonitorCommand args)
ReceivedPacketListeners
about
a packet.command
- the command stringargs
- the command arguments@NotNull protected static @NotNull java.lang.String newString(@NotNull @NotNull java.nio.ByteBuffer byteBuffer, int start, int len)
ByteBuffer
range.byteBuffer
- the byte bufferstart
- the start index of the stringlen
- the length of the stringprotected void fireSelectCharacter(@NotNull @NotNull java.lang.String accountName, @NotNull @NotNull java.lang.String characterName)