Disconnected and leave events were not on the proper handlers

This commit is contained in:
Manevolent
2018-08-05 19:47:35 -04:00
parent a316b76d70
commit 3d09c5ef21
2 changed files with 9 additions and 15 deletions
@@ -90,11 +90,12 @@ public class LocalTeamspeakClientSocket
throw new RuntimeException(e);
}
for (TS3Listener listener : listeners)
listener.onDisconnected(new DisconnectedEvent(command.toMap()));
DisconnectedEvent e = new DisconnectedEvent(command.toMap());
commandExecutionService.submit(() -> listeners.forEach(e::fire));
} else {
for (TS3Listener listener : listeners)
listener.onClientLeave(new ClientLeaveEvent(command.toMap()));
ClientLeaveEvent e = new ClientLeaveEvent(command.toMap());
commandExecutionService.submit(() -> listeners.forEach(e::fire));
}
}
});