WebSocket disconnected event
This commit is contained in:
parent
b38a3201d3
commit
a9c0e24378
@ -7,6 +7,11 @@ public interface FlexLibAdapter {
|
||||
*/
|
||||
public default void onWebSocketConnect() {}
|
||||
|
||||
/**
|
||||
* Called when WebSocket is disconnected
|
||||
*/
|
||||
public default void onWebSocketDisconnect() {}
|
||||
|
||||
/**
|
||||
* Called when player friend list or friend requests are updated
|
||||
* @param player
|
||||
|
@ -19,4 +19,9 @@ public final class FlexLibAdapterImpl implements FlexLibAdapter {
|
||||
this.flexLib.getLogger().info("WebSocket connected");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWebSocketDisconnect() {
|
||||
this.flexLib.getLogger().info("WebSocket disconnected");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -34,6 +34,9 @@ public final class WebSocketClient {
|
||||
|
||||
protected void disable() {
|
||||
this.webSocket.disconnect();
|
||||
for (final FlexLibAdapter listener : this.flexLib.getEventListeners()) {
|
||||
listener.onWebSocketDisconnect();
|
||||
}
|
||||
}
|
||||
|
||||
private WebSocket createWebSocket(final String url, final String token) throws IOException {
|
||||
|
Loading…
Reference in New Issue
Block a user