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 bb94e57..f25133b 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 @@ -768,6 +768,23 @@ public class LocalTeamspeakClientSocket executeCommand(command).complete(); } + public void subscribeAll() throws IOException, TimeoutException, ExecutionException, InterruptedException { + Command command = new SingleCommand("channelsubscribeall", ProtocolRole.CLIENT); + executeCommand(command).get(); + } + + public Client getClientInfo(int clientId) + throws IOException, TimeoutException, ExecutionException, InterruptedException { + Command command = new SingleCommand( + "clientinfo", + ProtocolRole.CLIENT, + new CommandSingleParameter("clid", Integer.toString(clientId)) + ); + + Iterable clients = executeCommand(command, x -> new Client(x.toMap())).get(); + return clients.iterator().next(); + } + public void disconnect() throws IOException, TimeoutException, @@ -786,5 +803,4 @@ public class LocalTeamspeakClientSocket } } - } diff --git a/src/test/java/com/github/manevolent/ts3j/ServerConnectionTest.java b/src/test/java/com/github/manevolent/ts3j/ServerConnectionTest.java index 88f863a..c634bc1 100644 --- a/src/test/java/com/github/manevolent/ts3j/ServerConnectionTest.java +++ b/src/test/java/com/github/manevolent/ts3j/ServerConnectionTest.java @@ -1,6 +1,7 @@ package com.github.manevolent.ts3j; import com.github.manevolent.ts3j.api.Channel; +import com.github.manevolent.ts3j.api.Client; import com.github.manevolent.ts3j.identity.LocalIdentity; import com.github.manevolent.ts3j.protocol.client.ClientConnectionState; import com.github.manevolent.ts3j.protocol.socket.client.LocalTeamspeakClientSocket; @@ -40,6 +41,10 @@ public class ServerConnectionTest { assertEquals(client.getState(), ClientConnectionState.CONNECTED); + for (Client c : client.listClients()) { + client.getClientInfo(c.getId()); + } + client.disconnect(); client.waitForState(ClientConnectionState.DISCONNECTED, 10000L);