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
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
But again, this only works if you're only listening to one channel
Henny022
@Henny022
´´´´´´
ups

            @Override
            public void onClientMoved(ClientMovedEvent e)
            {
                int sourceChannel = clientChannelMap.get(e.getClientId());
                int targetChannel = e.getTargetChannelId();
                clientChannelMap.put(e.getClientId(), targetChannel);
                //do your stuff with the channel ids
            }
something like that
astrolamb-gaming
@astrolamb-gaming
Lol so the virtual server id I had to use was 987. Took awhile to figure that out. Thanks again for the help.
Henny022
@Henny022
glad you did it
always glad to help again
astrolamb-gaming
@astrolamb-gaming
So if I wanted my code to react to messages in any channel, would i have to make multiple connections, one for each channel I wanted to listen to?
Roger Baumgartner
@rogermb
Yes. This is a well known limitation of the TS3 server query interface: For whatever reason, TeamSpeak decided that a server query could only ever listen to the chat messages in one channel. So if you really need (and quite often, you don't) to listen to all channel chat, you'll need to have multiple queries
People often solve this issue by having a single query that sends a private message to whoever joins the server
So if they want to issue any bot commands or whatever, they'd just send a private message in that window
That way, you'll also prevent flooding chats with people typing various commands
astrolamb-gaming
@astrolamb-gaming
Is there a way to find out if a client's permissions are changed, or if they are added to a different server group?
Roger Baumgartner
@rogermb
Nope and nope
At least, there's no event for it
astrolamb-gaming
@astrolamb-gaming
Ok, thanks
astrolamb-gaming
@astrolamb-gaming
I'm trying to change the name of a channel, and I'm a bit confused about how TS3Api#editChannel() works. The second parameter, options, is what I'm trying to figure out. If I'm understanding correctly, options should be a Map<ChannelProperty, String>, but ChannelProperty.CHANNEL_NAME causes an issue because it's an integer, when it should be a ChannelProperty. Can anyone shed some light on this for me?
astrolamb-gaming
@astrolamb-gaming
Never mind, I was using Map wrong lol.
Henny022
@Henny022
glad its solved
astrolamb-gaming
@astrolamb-gaming
for events, specifically onClientJoin(), is there a difference between getInvokerUniqueId() and getUniqueClientIdentifier()?
astrolamb-gaming
@astrolamb-gaming
Ah, thanks!
Henny022
@Henny022
no probleom
JenkePlays
@JenkePlays_twitter
Hey, How can I get the clientUID in the ClientLeaveEvent?
Roger Baumgartner
@rogermb
You can't. TS3 only sends you the client ID
JenkePlays
@JenkePlays_twitter
Also it doesnt work?
Roger Baumgartner
@rogermb
You'll have to save a client's UId, for example in a (Hash)Map that maps from client ID to UId

Also it doesnt work?

What doesn't work?

JenkePlays
@JenkePlays_twitter
To get the clientUID
I have tried this:
Client c = api.getClientInfo(e.getClientId());
Roger Baumgartner
@rogermb
Think about what you're trying to do
getClientInfo only works on clients that are online
When you get a ClientLeaveEvent, the client has left the server
JenkePlays
@JenkePlays_twitter
Thank you its works :D
astrolamb-gaming
@astrolamb-gaming
Is there a way to get the root channel of a sub-channel?
Roger Baumgartner
@rogermb
@astrolamb-gaming I think you're looking for Channel(Info)#getParentChannelId
JenkePlays
@JenkePlays_twitter
Can I set the Output of the API in a Text Document?
Roger Baumgartner
@rogermb
Yes! Either use a different logging provider, or for a much simpler solution, create your own config file for the bundled SLF4J-Simple logger. You could create a copy of the logging config file we use and then set org.slf4j.simpleLogger.logFile to your desired file name