java.lang.Objectcom.realtime.crossfire.jxclient.stats.PoisonWatcher
public class PoisonWatcher
Helper class to synthesize an "is poisoned" stat value. The Crossfire server currently does not send this information, therefore drawinfo messages are tracked.
| Field Summary | |
|---|---|
private boolean |
active
Whether poisoning is active. |
private static java.lang.String |
ASSERT_MESSAGE
The text message the server sends in poisoned state. |
private static java.lang.String |
DE_ASSERT_MESSAGE
The text message the server sends when the poison wears off. |
private CrossfireDrawextinfoListener |
drawextinfoListener
The drawextinfo listener to receive drawextinfo messages. |
private CrossfireDrawinfoListener |
drawinfoListener
The drawinfo listener to receive drawinfo messages. |
private Stats |
stats
The stats instance to notify. |
private java.lang.Object |
sync
The object used for synchronization. |
private static int |
TIMEOUT_DE_ASSERT
Timeout after that the "poisoned" state is reset. |
private TimeoutEvent |
timeoutEvent
The timeout event used to turn off poisoning if the de-assert message was missed. |
| Constructor Summary | |
|---|---|
PoisonWatcher(Stats stats,
CrossfireServerConnection crossfireServerConnection)
Create a new instance. |
|
| Method Summary | |
|---|---|
private void |
check(java.lang.String message)
Examine a text message. |
private void |
setActive(boolean active)
Set the current poisoned state. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private boolean active
@NotNull private static final java.lang.String ASSERT_MESSAGE
@NotNull private static final java.lang.String DE_ASSERT_MESSAGE
@NotNull private final CrossfireDrawextinfoListener drawextinfoListener
@NotNull private final CrossfireDrawinfoListener drawinfoListener
@NotNull private final Stats stats
@NotNull private final java.lang.Object sync
private static final int TIMEOUT_DE_ASSERT
@NotNull private final TimeoutEvent timeoutEvent
| Constructor Detail |
|---|
public PoisonWatcher(@NotNull
Stats stats,
@NotNull
CrossfireServerConnection crossfireServerConnection)
stats - The stats instance to notify.crossfireServerConnection - The connection to watch.| Method Detail |
|---|
private void check(@NotNull
java.lang.String message)
message - The text message.private void setActive(boolean active)
active - The new poisoned state.