diff --git a/src/main/java/com/github/manevolent/ts3j/protocol/packet/handler/client/LocalClientHandlerConnecting.java b/src/main/java/com/github/manevolent/ts3j/protocol/packet/handler/client/LocalClientHandlerConnecting.java index ddfd096..6451b0a 100644 --- a/src/main/java/com/github/manevolent/ts3j/protocol/packet/handler/client/LocalClientHandlerConnecting.java +++ b/src/main/java/com/github/manevolent/ts3j/protocol/packet/handler/client/LocalClientHandlerConnecting.java @@ -24,7 +24,7 @@ import java.util.Random; import java.util.concurrent.TimeoutException; public class LocalClientHandlerConnecting extends LocalClientHandler { - private static final byte[] INIT1_VERSION = new byte[] { 0x09, (byte)0x83, (byte)0x8C, (byte)0xCF }; + private static final byte[] INIT1_VERSION = new byte[]{0x09, (byte) 0x83, (byte) 0x8C, (byte) 0xCF}; private byte[] randomBytes; private byte[] alphaBytes; @@ -66,10 +66,10 @@ public class LocalClientHandlerConnecting extends LocalClientHandler { switch (init1.getStep().getNumber()) { case 1: - PacketBody8Init1.Step1 serverReplyStep1 = (PacketBody8Init1.Step1)init1.getStep(); + PacketBody8Init1.Step1 serverReplyStep1 = (PacketBody8Init1.Step1) init1.getStep(); // Check nonce. It's received backwards, so walk backwards over the array received - for (int i = 0; i < 4; i ++) { + for (int i = 0; i < 4; i++) { if (randomBytes[3 - i] != serverReplyStep1.getA0reversed()[i]) { Ts3Debugging.debug("[WARNING] random byte mismatch!"); break; @@ -84,7 +84,7 @@ public class LocalClientHandlerConnecting extends LocalClientHandler { step = step2; break; case 3: - PacketBody8Init1.Step3 serverReplyStep3 = (PacketBody8Init1.Step3)init1.getStep(); + PacketBody8Init1.Step3 serverReplyStep3 = (PacketBody8Init1.Step3) init1.getStep(); // Calculate 'y' // which is the result of x ^ (2 ^ level) % n as an unsigned @@ -131,8 +131,8 @@ public class LocalClientHandlerConnecting extends LocalClientHandler { initiv.add( new CommandSingleParameter( - "ip", - getClient().getOption("client.hostname", String.class) + "ip", + getClient().getOption("client.hostname", String.class) ) ); @@ -228,11 +228,22 @@ public class LocalClientHandlerConnecting extends LocalClientHandler { "clientinit", ProtocolRole.CLIENT, new CommandSingleParameter("client_nickname", getClient().getNickname()), - new CommandSingleParameter("client_version", "3.?.? [Build: 5680278000]"), - new CommandSingleParameter("client_platform", "Windows"), + new CommandSingleParameter( + "client_version", + getClient().getOption("client.version_string", String.class) != null ? + getClient().getOption("client.version_string", String.class) : + "3.?.? [Build: 5680278000]" + ), + new CommandSingleParameter("client_platform", + getClient().getOption("client.version_platform", String.class) != null ? + getClient().getOption("client.version_platform", String.class) : + "Windows" + ), new CommandSingleParameter( "client_version_sign", - "DX5NIYLvfJEUjuIbCidnoeozxIDRRkpq3I9vVMBmE9L2qnekOoBzSenkzsg2lC9CMv8K5hkEzhr2TYUYSwUXCg==" + getClient().getOption("client.version_sign", String.class) != null ? + getClient().getOption("client.version_sign", String.class) : + "DX5NIYLvfJEUjuIbCidnoeozxIDRRkpq3I9vVMBmE9L2qnekOoBzSenkzsg2lC9CMv8K5hkEzhr2TYUYSwUXCg==" ), new CommandSingleParameter("client_input_hardware", "1"), new CommandSingleParameter("client_output_hardware", "1"), 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 8a131bf..5432e66 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 @@ -60,9 +60,9 @@ public class LocalTeamspeakClientSocket /** * The internal command buffer - * + *
* This buffer ascends through specific command codes, which are calculated using: - * + *
* get
*/
private Map
* This is not enabled by default.
*
* @param enabled Event simultaneous (parallel) processing enabled
@@ -307,8 +307,9 @@ public class LocalTeamspeakClientSocket
/**
* Initiates a connection to a server
+ *
* @param hostname Hostname to contact
- * @param timeout timeout, in milliseconds, to complete a connection.
+ * @param timeout timeout, in milliseconds, to complete a connection.
*/
public void connect(String hostname, long timeout) throws IOException, TimeoutException {
connect(hostname, null, timeout);
@@ -316,9 +317,10 @@ public class LocalTeamspeakClientSocket
/**
* Initiates a connection to a server
+ *
* @param hostname Hostname to contact
* @param password server password (may be null)
- * @param timeout timeout, in milliseconds, to complete a connection.
+ * @param timeout timeout, in milliseconds, to complete a connection.
*/
public void connect(String hostname, String password, long timeout) throws
IOException,
@@ -338,9 +340,10 @@ public class LocalTeamspeakClientSocket
/**
* Initiates a connection to a server
- * @param remote remote sever to contact
+ *
+ * @param remote remote sever to contact
* @param password server password (may be null)
- * @param timeout timeout, in milliseconds, to complete a connection.
+ * @param timeout timeout, in milliseconds, to complete a connection.
*/
public void connect(InetSocketAddress remote, String password, long timeout)
throws IOException, TimeoutException {
@@ -457,9 +460,10 @@ public class LocalTeamspeakClientSocket
/**
* Executes a command.
+ *
* @param command Command to execute.
* @return Future, command response object.
- * @throws IOException if there is a connectivity-level exception.
+ * @throws IOException if there is a connectivity-level exception.
* @throws TimeoutException if command send times out.
*/
public CommandResponse
+ * Here is a list of the additional display paramters you will receive for
+ * each of the possible modifier parameters.
+ *
* @param channelId channel ID to look at
* @return list of channel clients
* @throws IOException
@@ -1041,7 +1045,7 @@ public class LocalTeamspeakClientSocket
/**
* Sends a text message a specified target. The type of the target is determined by targetmode while target
- specifies the ID of the recipient, whether it be a virtual server, a channel or a client.
+ * specifies the ID of the recipient, whether it be a virtual server, a channel or a client.
*/
public void sendServerMessage(String message)
throws IOException, TimeoutException, InterruptedException, CommandException {
@@ -1056,7 +1060,7 @@ public class LocalTeamspeakClientSocket
/**
* Sends a text message a specified target. The type of the target is determined by targetmode while target
- specifies the ID of the recipient, whether it be a virtual server, a channel or a client.
+ * specifies the ID of the recipient, whether it be a virtual server, a channel or a client.
*/
public void sendChannelMessage(int channelId, String message)
throws IOException, TimeoutException, InterruptedException, CommandException {
@@ -1071,7 +1075,7 @@ public class LocalTeamspeakClientSocket
/**
* Sends a text message a specified target. The type of the target is determined by targetmode while target
- specifies the ID of the recipient, whether it be a virtual server, a channel or a client.
+ * specifies the ID of the recipient, whether it be a virtual server, a channel or a client.
*/
public void sendPrivateMessage(int clientId, String message)
throws IOException, TimeoutException, InterruptedException, CommandException {
@@ -1086,8 +1090,8 @@ public class LocalTeamspeakClientSocket
/**
* Moves one or more clients specified with clid to the channel with ID cid. If
- the target channel has a password, it needs to be specified with cpw. If the
- channel has no password, the parameter can be omitted.
+ * the target channel has a password, it needs to be specified with cpw. If the
+ * channel has no password, the parameter can be omitted.
*/
public void clientMove(int clientId, int channelId, String password)
throws IOException, TimeoutException, InterruptedException, CommandException {
@@ -1107,8 +1111,8 @@ public class LocalTeamspeakClientSocket
/**
* Moves one or more clients specified with clid to the channel with ID cid. If
- the target channel has a password, it needs to be specified with cpw. If the
- channel has no password, the parameter can be omitted.
+ * the target channel has a password, it needs to be specified with cpw. If the
+ * channel has no password, the parameter can be omitted.
*/
public Iterable