Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 13 21:03
    rogermb commented #342
  • Oct 13 21:01
    DanielAlves123 commented #342
  • Oct 13 20:55
    DanielAlves123 closed #342
  • Oct 13 20:55
    DanielAlves123 commented #342
  • Oct 13 17:17
    rogermb commented #342
  • Oct 13 17:17
    rogermb labeled #342
  • Oct 13 11:52
    DanielAlves123 opened #342
  • Oct 09 11:39
    mnjg123 closed #305
  • Sep 14 21:26
    rogermb commented #339
  • Sep 14 21:24
    sgebauer commented #339
  • Sep 14 20:11
    rogermb commented #339
  • Sep 14 20:07
    sgebauer commented #339
  • Aug 31 12:36
    rogermb commented #341
  • Aug 31 12:35
    NewJavaDeveloper closed #341
  • Aug 31 12:35
    NewJavaDeveloper commented #341
  • Aug 31 12:05
    rogermb commented #341
  • Aug 31 12:03
    rogermb commented #341
  • Aug 31 11:45
    NewJavaDeveloper edited #341
  • Aug 31 11:44
    NewJavaDeveloper opened #341
  • Aug 16 15:31
    akaJonas opened #340
astrolamb-gaming
@astrolamb-gaming
My code, as is:
               try {
                    config.setQueryPort(ports[4]);
                    query.connect();
                    System.out.println("Connected.");
                } catch (Exception e) {
                    System.out.println("Failed.");
                }
        final TS3Api api = query.getApi();
                api.selectVirtualServerByPort(17587);
                System.out.println(api.setNickname("Yolo"));
Roger Baumgartner
@rogermb
Hmm, maybe 17587 just isn't correct or isn't being forwarded properly?
astrolamb-gaming
@astrolamb-gaming
"ports" being a list of the ports.
That's possible I suppose.
I tried connecting via my regular client with that port and it worked fine.
Roger Baumgartner
@rogermb
Well, that's weird as hell. And you mentioned that you can connect with multiple different server query ports?
astrolamb-gaming
@astrolamb-gaming
Yep
Roger Baumgartner
@rogermb
I mean, assuming your friend isn't some kind of port replicating wizard, that would mean that the same machine is running multiple TS3 servers
Or it's also possible that what you're connecting to is just a server that redirects all connections to different machines
astrolamb-gaming
@astrolamb-gaming
I'm not sure if he's using a service or hosting his own. If it's a service (I think it is) one machine could be running multiple servers.
Roger Baumgartner
@rogermb
If you've already made sure that your virtual server is not on any of the servers that correspond to the server query ports in your array, it might be a good idea to just ask your friend for the correct ports again :D
But speaking of which, you're just using your friend's server as a test server, right?
In that case, you could also just download the TS3 server application and install & run it on your own PC
astrolamb-gaming
@astrolamb-gaming
My friend's server is just the test server, and I got everything working with that one. It's the main server I want to use that's giving me fits.
Roger Baumgartner
@rogermb
Oh, alright ^^
If this is a professionally run TS3 server host, they might've also turned off server query connections
If this main server is yours, it might be worth checking if there's some sort of settings panel where you can configure your TS3 server
astrolamb-gaming
@astrolamb-gaming
It's not, but I'm working on getting admin privileges, which would probably help a lot :P
Roger Baumgartner
@rogermb
Alright. In that case I think you'll just have to contact the server administrator. Sorry ^^
astrolamb-gaming
@astrolamb-gaming
Incidentally, selectVirtualServerById(0) connects without an error but selectVirtualServerById(1) doesn't. Not really sure what the numbers correspond to or anything.
Roger Baumgartner
@rogermb
ID 0 is when you haven't selected any virtual server. So if you're not on a virtual server when running that command, it's basically a no-op
astrolamb-gaming
@astrolamb-gaming
Ah ok. Thanks for all the help.
Roger Baumgartner
@rogermb
ID 1 is the default virtual server ID, and most TS3 servers start at ID 1. Especially if you're using the non-commercial, no-license TS3 server, there will only ever be one virtual server
and that virtual server almost always has the ID 1. (Because why would anyone delete and re-create a virtual server on such a non-commercial TS3 server that is limited to just one virtual server)
astrolamb-gaming
@astrolamb-gaming
Ok, I have admin priveleges now. What does this error mean? The server is definitely running.
[[TeamSpeak-3-Java-API] SocketReader] WARN com.github.theholywaffle.teamspeak3.SocketReader - TS3 command error: {msg=server is not running, id=1033}
I've got a client connected and am chatting with people on the server right now so I know it's up.
Fabian
@Kakifrucht
Can you find out which command causes this message?
astrolamb-gaming
@astrolamb-gaming
Looks like TS3Api#selectVirtualServerById(1).

So I tried the following code:

                for (int i = 0; i < 10; i++) {
                    System.out.println(i + " " + api.selectVirtualServerById(i));
                }

Which showed i=5 returned true, but not 1. So it's the virtual server that wasn't running, not the main server.

astrolamb-gaming
@astrolamb-gaming
OK, new issue:
To connect a regular client to the server, you have to include the port as well as the ip. Without the port a client won't connect. When I try to use the query port, it connects to the ip, but it doesn't return the same channels when I use getChannels().get(i).getName().
JenkePlays
@JenkePlays_twitter
How can I get the Channel Quit?
Henny022
@Henny022
what do you mean by channel quit?
JenkePlays
@JenkePlays_twitter
If someone leaves a certain channel.
And than send him a Private Message.
Henny022
@Henny022
you need to make a listener for the client leave event and then check for the channel id
JenkePlays
@JenkePlays_twitter
In the Client Leave Event?
Henny022
@Henny022
i thought so, but im locking it up right now
JenkePlays
@JenkePlays_twitter
I have Tested this:

ClientInfo clientInfo = api.getClientInfo(e.getClientId());
int ClientChannel = clientInfo.getChannelId();
if(ClientChannel == 25) {
api.sendPrivateMessage(clientInfo.getId(), "This is a Test!");
}

This does not work.

Roger Baumgartner
@rogermb
@astrolamb-gaming You're almost certainly on the wrong virtual server then
Henny022
@Henny022
looks like you need to use onClientMoved and track the source channel by yourself with a map
Roger Baumgartner
@rogermb
Not even that. If I recall correctly, onClientMoved tells you where the client came from and what channel they're moving into
Henny022
@Henny022
i only saw getTargetChannel
JenkePlays
@JenkePlays_twitter
This work only with the Join in the Channel not out of the Channel
Roger Baumgartner
@rogermb
You're right. I must've misremembered
@JenkePlays_twitter Then use a data structure like a list or a set to track which clients are currently in your channel?
The events should basically all you need to know :P
Henny022
@Henny022
@JenkePlays_twitter whenever a user joins a channel, you need to store that channel in a map, and when he moves again, you read that channel and have the left channel
Roger Baumgartner
@rogermb
(And don't forget to call remove ^)
Ah, now I know why I thought it gave you both: If you're only listening to one channel, you'll get target == yourChannelId if the client joined the channel, target != yourChannelId if the client left the channel