From 0b5d63b6f7addb4a57ed5360dfbf8aeac61f3ed9 Mon Sep 17 00:00:00 2001 From: Phyrone Date: Thu, 21 May 2020 13:06:27 +0200 Subject: [PATCH] unknown events will be catched and no longer break the whole client (f.e. on teaspeak servers) --- .../socket/client/LocalTeamspeakClientSocket.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/github/manevolent/ts3j/protocol/socket/client/LocalTeamspeakClientSocket.java b/src/main/java/com/github/manevolent/ts3j/protocol/socket/client/LocalTeamspeakClientSocket.java index fbd6322..086f3a7 100644 --- a/src/main/java/com/github/manevolent/ts3j/protocol/socket/client/LocalTeamspeakClientSocket.java +++ b/src/main/java/com/github/manevolent/ts3j/protocol/socket/client/LocalTeamspeakClientSocket.java @@ -433,9 +433,13 @@ public class LocalTeamspeakClientSocket if (processor != null) { processor.process(client, singleCommand); } else if (singleCommand.getName().startsWith("notify")) { - TS3Event event = TS3Event.createEvent(singleCommand); + try { + TS3Event event = TS3Event.createEvent(singleCommand); + commandExecutionService.submit(() -> listeners.forEach(event::fire)); + } catch (IllegalArgumentException exception) { + exception.printStackTrace(); + } - commandExecutionService.submit(() -> listeners.forEach(event::fire)); } else { CommandProcessor awaitingCommandProcessor; @@ -521,9 +525,9 @@ public class LocalTeamspeakClientSocket if (microphone != null && microphoneThread == null) { microphoneThread = new HighPrecisionTimer( - 20, - 5F, // up to 100ms of drift/catchup - new MicrophoneTask() + 20, + 5F, // up to 100ms of drift/catchup + new MicrophoneTask() ); microphoneThread.setDaemon(true);