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

20th
Oct 2016
kreidlerflorett
@kreidlerflorett
Oct 20 2016 11:10
Hi have again a little question :D
Is it possible to get on a ChannelEditedEvent the password?
When I try api.getChannelInfo(e.getChannelId()).getPassword(); I only receve somthing like yYCoM7si5imzf6c8qgEaOVLFjW0=
Is it possible to decode that to the the password like 3357?
I like to save that password and create later again a channel with this password
Roger Baumgartner
@rogermb
Oct 20 2016 11:17
You can't get the password in plain text, sorry. Only that hash is available. It would be a huge security risk if you were able to read passwords set by users, since those users might also have used that password on other occasions.
But you can easily verify the hash if you know the password in plaintext. Pseudocode:
return toBase64(sha1(password.toUTF8Bytes));
kreidlerflorett
@kreidlerflorett
Oct 20 2016 11:31
Also is it also not possible to create a new channel with this hash, so that the password is in plaintext would be the same?
Roger Baumgartner
@rogermb
Oct 20 2016 11:32
Exactly. You can only get the hash from the server, but you have to send the plain text password to the server.
On this note, let me also stress that the Telnet protocol used for communicating with the TS3 server is unencrypted and unencryptable!
kreidlerflorett
@kreidlerflorett
Oct 20 2016 11:38
Ok, thank you very much!
It's very thankful for your help!
Roger Baumgartner
@rogermb
Oct 20 2016 11:39
You're welcome :blush:
LeoStoch
@LeoStoch
Oct 20 2016 14:18
Hey, possible to ask here some questions about an other API from waffle?
Roger Baumgartner
@rogermb
Oct 20 2016 14:29
Sure, that's why this channel exists :D
Wait, a different API? Not TeamSpeak related?
In that case, we probably won't be able to help you, @LeoStoch
LeoStoch
@LeoStoch
Oct 20 2016 14:47
The League-of-Legends-XMPP-Chat-Library
I want to combine the XMPP-Chat-Library and Teamspeak API but somehow it is not working
Roger Baumgartner
@rogermb
Oct 20 2016 15:00
Hmm, you'll have to ask @TheHolyWaffle directly about that one. Creating an issue on his GitHub repo is usually the best way of reaching him
LeoStoch
@LeoStoch
Oct 20 2016 15:02
Okay, tahnks...an other question about the temaspeak api...is there any way to listen in different channels?
thanks*
Roger Baumgartner
@rogermb
Oct 20 2016 15:05
If you're talking about channel chat: Nope, unfortunately not. That limitation of 1 channel's chat / query is imposed onto us by the TS3 ServerQuery interface, i.e. something we can't change
LeoStoch
@LeoStoch
Oct 20 2016 15:06
and checking if somebody is switching between channels?
Roger Baumgartner
@rogermb
Oct 20 2016 15:06
That works across the whole (virtual) server if you leave out the channelId argument
There's also a form of registerEvent that only takes a TS3EventType
LeoStoch
@LeoStoch
Oct 20 2016 15:07
Tried it with the ClientJoinEvent...but it is not starting if the channel the user was in is not the same channel like the bo ones
Roger Baumgartner
@rogermb
Oct 20 2016 15:08
Ah, no, that's a different event. ClientJoinEvent means a client joined the (virtual) server your query is in. For channel-to-channel switches you'll need to use ClientMovedEvent
LeoStoch
@LeoStoch
Oct 20 2016 15:09
Hmm...tried this in an older version too but it worked only when I was moving somebody
Roger Baumgartner
@rogermb
Oct 20 2016 15:10
Are you sure you're registered for all the event types you need?
To make sure, you could also just call registerAllEvents
LeoStoch
@LeoStoch
Oct 20 2016 15:14
api.sendServerMessage("Bot is online!");
api.moveClient(api.getChannelByNameExact("Bot-Channel", true).getId());
HashMap<String, String> map = SQL.map();
api.registerAllEvents();
api.addTS3Listeners(new TS3Listener() {
Roger Baumgartner
@rogermb
Oct 20 2016 15:18
That looks correct so far. Which methods of TS3Listener (nowadays TS3EventAdapter, allows you to leave out methods you don't care about) are you using and what specifically doesn't work as expected?
LeoStoch
@LeoStoch
Oct 20 2016 15:19
If I am trying to get a users target (switched) channel it is only working if I am moving him
Roger Baumgartner
@rogermb
Oct 20 2016 15:20
And you're doing that inside onClientMoved(ClientMovedEvent e), correct?
LeoStoch
@LeoStoch
Oct 20 2016 15:20
Yea
But it could me my mistake because I am not using the newest version
Roger Baumgartner
@rogermb
Oct 20 2016 15:22
Hmm, switching to the newest version is always a good idea, but I don't think it's what's causing your issues
And you don't even get an event notification if a client moves into or out of your channel; only if the bot is the one who's moving the client?
LeoStoch
@LeoStoch
Oct 20 2016 15:23
the event fires if the user is moved from anybody
but not is he is switching by his own
Roger Baumgartner
@rogermb
Oct 20 2016 15:25
I suspect that might be due to some kind of bug in your code, maybe some kind of check against null.
Would it be okay for you to post that onClientMoved code here?
It might very well be because you've confused "the client" with "the invoker" or something similar
LeoStoch
@LeoStoch
Oct 20 2016 15:26
@Override
public void onClientMoved(ClientMovedEvent arg0) {
if(arg0.getClientTargetId()== api.getChannelByNameExact("Bot-Channel", true).getId()){
api.sendPrivateMessage(arg0.getClientId(), "Welcome back :)");
}
}
@Override public void onClientMoved(ClientMovedEvent arg0) { if(arg0.getClientTargetId()== api.getChannelByNameExact("Bot-Channel", true).getId()){ api.sendPrivateMessage(arg0.getClientId(), "Welcome back :)"); } }
Roger Baumgartner
@rogermb
Oct 20 2016 15:33

Alright, I'll admit I have no idea what causes this issue :P

Just as a small optimization for that code: You could cache the ID of the bot channel, that ID won't change. Especially because calling API method can take quite some time due to flood rate settings, ping back and forth, IO work, etc.

LeoStoch
@LeoStoch
Oct 20 2016 15:34
Okay thanks...yeah maybe will n update fix the problem^^
Roger Baumgartner
@rogermb
Oct 20 2016 15:34
Alright :-D
LeoStoch
@LeoStoch
Oct 20 2016 15:34
Thanks and bye, have a nice day :D
Roger Baumgartner
@rogermb
Oct 20 2016 15:35
You, too! :D
LeoStoch
@LeoStoch
Oct 20 2016 15:43
Hey, sorry I am here again... :D
I forgot to ask the question abour the lolchat api :/
Roger Baumgartner
@rogermb
Oct 20 2016 15:45
I don't know anything about the League of Legends API, I've never worked on it. Waffle also doesn't frequent this chat, so you're unlikely to reach him here.
LeoStoch
@LeoStoch
Oct 20 2016 15:45
I think its just a java instead of api question...in the lolchatapi is an IOExpetion but I need to handle it with try/catch or something similar...how could I handle this?
Roger Baumgartner
@rogermb
Oct 20 2016 15:46
try {
    doSomethingDangerous();
} catch (IOException io) {
    // Handle the exception, e.g.
    io.printStackTrace();
}
LeoStoch
@LeoStoch
Oct 20 2016 15:48
Thats my current problem, I tried it but it is not working because e.printStackTrace() is already in the api...so I am getting every time an error
The catch code is never reached
Roger Baumgartner
@rogermb
Oct 20 2016 15:50
Well, if you're causing an IOException somewhere in that API, you're likely already doing something wrong in the first place :P
Just stepping through the code with the debugger might help.
But then again, it's not my code and I have no clue what that other API does. It's probably best to just contact Waffle directly.
LeoStoch
@LeoStoch
Oct 20 2016 15:56
Yeah, you are right...there is already an thread since 23 Nov 2015 about this..thats the problem :/
But anyway thanks
Roger Baumgartner
@rogermb
Oct 20 2016 15:56
Well, the project is open-source... If you find the root of the problem, you could always fix it yourself and maybe even create a Pull Request so everyone can benefit from that fix :-)