Skip to content

Commit

Permalink
Ignore plugin messages from disconnected players
Browse files Browse the repository at this point in the history
  • Loading branch information
ajgeiss0702 committed Jun 10, 2023
1 parent 0899bf8 commit e5d9df9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Expand Up @@ -30,6 +30,7 @@ public EventHandlerImpl(QueueMain main) {

@Override
public void handleMessage(AdaptedPlayer receivingPlayer, byte[] data) {
if(!receivingPlayer.isConnected()) return;
if(communicationManager == null) {
communicationManager = new CommunicationManager(main);
}
Expand Down
Expand Up @@ -51,6 +51,7 @@ public void handle(AdaptedPlayer receivingPlayer, byte[] data) throws IOExceptio
ComResponse response = handler.handleMessage(receivingPlayer, in.readUTF());

if(response == null) return;
if(!receivingPlayer.isConnected()) return;

main.getPlatformMethods().sendPluginMessage(
receivingPlayer,
Expand Down

0 comments on commit e5d9df9

Please sign in to comment.