notifyclientchatclosed event handled
This commit is contained in:
+3
-1
@@ -29,7 +29,7 @@ public class MusicPlayer {
|
||||
* @throws Exception
|
||||
*/
|
||||
public static void main(String[] args) throws Exception {
|
||||
Ts3Debugging.setEnabled(false);
|
||||
Ts3Debugging.setEnabled(true);
|
||||
|
||||
// Open file
|
||||
FFmpeg.register();
|
||||
@@ -139,6 +139,8 @@ public class MusicPlayer {
|
||||
System.err.println(((double)(System.nanoTime() - start) / 1_000_000_000D) + " " + (sink.getPacketsSent() / 50D) + " " + sink.getUnderflows());
|
||||
|
||||
if (sleep > 0) Thread.sleep(sleep);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
System.err.println("Draining...");
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.github.manevolent.ts3j.event;
|
||||
|
||||
import com.github.manevolent.ts3j.api.ClientProperty;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class ClientChatClosedEvent extends BaseEvent {
|
||||
public ClientChatClosedEvent(Map<String, String> map) {
|
||||
super(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fire(TS3Listener listener) {
|
||||
listener.onClientChatClosed(this);
|
||||
}
|
||||
|
||||
public int getClientId() {
|
||||
return getInt("clid");
|
||||
}
|
||||
|
||||
public String getUniqueClientIdentifier() {
|
||||
return get("cluid");
|
||||
}
|
||||
}
|
||||
@@ -79,6 +79,8 @@ public interface TS3Event {
|
||||
return new ClientPokeEvent(command.toMap());
|
||||
case "notifyclientchatcomposing": // CLIENT
|
||||
return new ClientChatComposingEvent(command.toMap());
|
||||
case "notifyclientchatclosed": // CLIENT
|
||||
return new ClientChatClosedEvent(command.toMap());
|
||||
case "notifypermissionlist": // CLIENT
|
||||
return new PermissionListEvent(command.toMap());
|
||||
default:
|
||||
|
||||
@@ -54,4 +54,5 @@ public interface TS3Listener {
|
||||
default void onClientComposing(ClientChatComposingEvent e) {}
|
||||
default void onPermissionList(PermissionListEvent e) {}
|
||||
default void onConnected(ConnectedEvent e) {}
|
||||
default void onClientChatClosed(ClientChatClosedEvent e) {}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,8 @@ public class ServerConnectionTest {
|
||||
|
||||
client.subscribeAll();
|
||||
|
||||
Thread.sleep(100000);
|
||||
|
||||
client.disconnect("BYE");
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
|
||||
Reference in New Issue
Block a user