Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client#getUniqueIdentifier() returns empty String #13

Open
moritz-baumgart opened this issue Dec 15, 2019 · 5 comments
Open

Client#getUniqueIdentifier() returns empty String #13

moritz-baumgart opened this issue Dec 15, 2019 · 5 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@moritz-baumgart
Copy link

When iterating over LocalTeamspeakClientSocket#listClients(), Client#getUniqueIdentifier() returns an empty string for every Client.

I did a workaround looking something like this:
LocalTeamspeakClientSocket#getClientInfo(Client#getId()).getUniqueIdentifier()

Example:

LocalTeamspeakClientSocket localTeamspeakClientSocket;
...
for (Client client : localTeamspeakClientSocket.listClients()) {

      client .getUniqueIdentifier()   // Returns ""

      localTeamspeakClientSocket.getClientInfo(client.getId()).getUniqueIdentifier()   // Returns unique identifier


}
@Manevolent
Copy link
Owner

Thanks for reporting the issue, I'll take a look.

@moritz-baumgart
Copy link
Author

@Manevolent Perfect! I also looked a bit around in the code and found a few odd block comments, e.g. above listChannels() or listClients() in LocalTeamspeakClientSocket.java. These seem to belong to a diffrent method...

@Manevolent
Copy link
Owner

Manevolent commented Dec 16, 2019

Unfortunately, it looks like the listClients() call leverages the client/server query call clientlist. The response object for clientlist returns (from the server),

  • clid
  • cid
  • client_database_id
  • client_nickname
  • client_type

None of these values are a UUID for a client (like a unique identifier), so I don't think I am able to expose a UUID, even if I wanted to, on this method. Ideally, we'd probably track the clients sent through events and expose that via an API as well, but this is more of a long-term goal.

In the mean-time, TS3Listener does adapt for the events that do this, which are:
notifycliententerview (corresponds to ClientJoinEvent)
notifyclientleftview (corresponds to ClientLeaveEvent)

At least ClientJoinEvent does share the UUID, its properties appear to be:

  • cfid
  • ctid
  • reasonid
  • clid
  • client_unique_identifier
  • client_nickname

... and so forth

@Manevolent
Copy link
Owner

I'm going to leave this open, because this is a bit of an eye-sore in the code. I'll start a long-term goal to get better client tracking, and add non-blocking methods to retrieve client information in the project. I suspect we'll need to wrap around the client socket with another class that better abstracts accessing the client state in general.

@Manevolent Manevolent added enhancement New feature or request bug Something isn't working labels Feb 17, 2020
@MarkL4YG
Copy link

The clientlist query command has several flags. One of them is -uid which will tell TeamSpeak to also return the client_unique_id field in its answer. 🤔
(The other flags should be -away, -voice, -times, -groups, -info, -icon and -country)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants