These are chat archives for TheHolyWaffle/TeamSpeak-3-Java-API

5th
Nov 2016
xJustx
@xJustx
Nov 05 2016 16:33
Hey.. why I can't get the current clients of a channel with api.getChannelInfo(1) ?
Roger Baumgartner
@rogermb
Nov 05 2016 16:34
Because the Server Query interface just doesn't send us that information :P
This API is just a wrapper around the telnet query interface TS3 servers offer
xJustx
@xJustx
Nov 05 2016 16:34
mmh okay :D
Roger Baumgartner
@rogermb
Nov 05 2016 16:35
If you need to get all clients in channel 1, you'll need to call getClients() and then only consider those clients for which Client#getChannelId() == 1
xJustx
@xJustx
Nov 05 2016 16:36
yeah, thanks!
Roger Baumgartner
@rogermb
Nov 05 2016 16:36
You're welcome :)
xJustx
@xJustx
Nov 05 2016 16:44
Uhm.. on the onClientMoved event I can get the target channel of the user. But can I still get the old one? :p
Roger Baumgartner
@rogermb
Nov 05 2016 16:45
Nope, another limitation of the server query interface ^^
xJustx
@xJustx
Nov 05 2016 16:45
Okay, thanks.
Roger Baumgartner
@rogermb
Nov 05 2016 16:45
TeamSpeak just doesn't send us that kind of information :P
xJustx
@xJustx
Nov 05 2016 16:45
Haha :D
Roger Baumgartner
@rogermb
Nov 05 2016 16:45
I'd suggest you keep the current channel of each user in a HashMap, mapping client IDs to current channel IDs
xJustx
@xJustx
Nov 05 2016 16:46
Yeah okay ^^
Roger Baumgartner
@rogermb
Nov 05 2016 16:46
Basically, when they join, you put their current channel ID into the map (does not have to be the default channel!), when they move you update it (after you've queried the old one) and when they leave the server, you can remove the entry from the map again, to ensure you don't "leak" memory