Ignore plugin messages from disconnected players
This commit is contained in:
@@ -30,6 +30,7 @@ public class EventHandlerImpl implements EventHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handleMessage(AdaptedPlayer receivingPlayer, byte[] data) {
|
public void handleMessage(AdaptedPlayer receivingPlayer, byte[] data) {
|
||||||
|
if(!receivingPlayer.isConnected()) return;
|
||||||
if(communicationManager == null) {
|
if(communicationManager == null) {
|
||||||
communicationManager = new CommunicationManager(main);
|
communicationManager = new CommunicationManager(main);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ public class CommunicationManager {
|
|||||||
ComResponse response = handler.handleMessage(receivingPlayer, in.readUTF());
|
ComResponse response = handler.handleMessage(receivingPlayer, in.readUTF());
|
||||||
|
|
||||||
if(response == null) return;
|
if(response == null) return;
|
||||||
|
if(!receivingPlayer.isConnected()) return;
|
||||||
|
|
||||||
main.getPlatformMethods().sendPluginMessage(
|
main.getPlatformMethods().sendPluginMessage(
|
||||||
receivingPlayer,
|
receivingPlayer,
|
||||||
|
|||||||
Reference in New Issue
Block a user