ts3j icon indicating copy to clipboard operation
ts3j copied to clipboard

Can't connect to ts server

Open n00bst3r opened this issue 4 years ago • 2 comments

Hi!

I don't get what I'm doing wrong here. This is in general my ClientSocket Bean:

@Bean
	public LocalTeamspeakClientSocket localTeamspeakClientSocket() throws IOException, TimeoutException, CommandException, InterruptedException, GeneralSecurityException {
		LocalTeamspeakClientSocket localTeamspeakClientSocket = new LocalTeamspeakClientSocket();
		localTeamspeakClientSocket.setIdentity(LocalIdentity.generateNew(10));
		localTeamspeakClientSocket.setNickname("Audiobot");
		localTeamspeakClientSocket.addListener(new Ts3AudioBotListener());
		return localTeamspeakClientSocket;

	}

And this is the way I connect to the server:

`          localTeamspeakClientSocket.connect(
                    new InetSocketAddress(
                            InetAddress.getByName(appConfig.getServerurl()),
                            appConfig.getServerport() // UDP client port, Teamspeak3 client uses 9987
                    ),
                    appConfig.getServerpassword(),
                    50000L
            );`

The password is correct if I debug and look at the password.

But the response from the Server is:

[DEBUG] [COMMAND] error id=1028 msg=invalid\sserver\spassword

I don't get what I'm doing wrong here. Do you have any idea?

Thanks for your help in advance and best regards

n00bst3r avatar May 28 '21 10:05 n00bst3r

Based on reading:

https://github.com/Manevolent/ts3j/blob/master/src/main/java/com/github/manevolent/ts3j/protocol/socket/client/LocalTeamspeakClientSocket.java#L391

and,

https://github.com/Manevolent/ts3j/blob/master/src/main/java/com/github/manevolent/ts3j/protocol/packet/handler/client/LocalClientHandlerConnecting.java#L261

I think we transport the password correctly through the chain there. However, I suppose it could be possible that the password field on the initial command is wrong. That, or the bytes of the password aren't getting transported properly.

Manevolent avatar May 28 '21 16:05 Manevolent

Hello, any ideas how this could be solved? I'm trying to use this library in my project, but I'm having the same issue, where I can't connect to a password protected ts server. Only if a server doesn't have a password, it connects successfully.

Bettehem avatar Jul 30 '22 12:07 Bettehem