Central Forums Helpbot
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
Pages: [1] 2   Go Down
Print
Topic: !ts (teamspeak)  (Read 7163 times)
« on: January 05, 2010, 05:00:45 AM »
VhaBot Developers
Full Member

View Profile
***

Epeen: 5
Posts: 204


Ok. Attached is my first cut at the TS plugin.  There's some stuff I don't know how to do... so maybe Nat or Mit can fix-up my plugin for me.

Notes:

This plugin is for TeamSpeak v. 3.  The query protocol and responses have changed since version 2.  I can probably modify this plugin fairly easily to make it compatible with v. 2 servers as well, but first, maybe someone can make it work more like the other plugins:

The server/port/virtual settings are all hard-coded.  I don't know how to make them configurable the way other plugins are.  (Ok, I'm also too lazy to figure out which plugins have configuration stuff that I can snarf.)

The are additional things that the TS server reports that I haven't added to the status report.  Maybe someone who actually uses TS (and who also has a sound card) can tell me what they'd like reported.  I copied most of the status reports from the budabot plugin.  I think it would be good to present a listing of actual user names of people logged onto TS, but I'm still looking into how to do that.

There are other things about TS that I don't understand.  It seems v3 has moved to a "bot shell" model like vhabot does.  So v2 had 1 server with multiple channels.  Now v3 has multiple virtual servers, each with multiple channels.  So I have questions:

1) How would most people/orgs use TS?  Everyone would be directed toward one virtual server?  The TS plugin right now has a setting for a particular virtual server, but perhaps with a syntax of "!ts [virtual_server_id]" we can allow the selection of other virtual servers.  Or is this completely unnecessary and just one server per plugin is sufficient?

2) How do channels work?  Do most TS operators separate teams into different channels? Do people care how many people are on a particular channel or how many channels there are?  How much channel information should the plugin report?

Stuff like that.  Since I don't use TS, I don't know what people would be interested in.

Edit: Rats it seems my conversion from milliseconds to time is wrong... I need to fix that.

* ll_TeamSpeak.cs (6.2 KB - downloaded 204 times.)
« Last Edit: January 09, 2010, 07:24:32 PM by Llie »
Logged
« Reply #1 on: January 05, 2010, 10:20:25 PM »
Apprentice coder
VhaBot Developers
Novice

View Profile
***

Epeen: 4
Posts: 446


Excellent work Llie!

I'll take a look at the configuration side of things and post an update probably tomorrow. No doubt I'll have to sort out a TS3 server, but I would really appreciate if you'd do a search/replace for the old commands .. and it can be used for TS2 as well Smiley

As always, watch this space!!
Logged
« Reply #2 on: January 06, 2010, 07:31:17 AM »
VhaBot Developers
Full Member

View Profile
***

Epeen: 5
Posts: 204


I can probably add TS2 compatibility pretty easily once you add the config settings.
Logged
« Reply #3 on: January 09, 2010, 04:51:46 AM »
Noob

View Profile


Epeen: 0
Posts: 3


Are you going to implement a list-function to list all usernames connected to the ts3-server? =) Would be great.

btw: this plugin is really nice. THANKS! =)

Greetz

TTL86
Logged
« Reply #4 on: January 09, 2010, 08:04:25 AM »
VhaBot Developers
Full Member

View Profile
***

Epeen: 5
Posts: 204


I'll look into it and try to roll it up when Mit posts his changes with the bot configuration stuff.
Logged
« Reply #5 on: January 09, 2010, 10:25:41 AM »
Apprentice coder
VhaBot Developers
Novice

View Profile
***

Epeen: 4
Posts: 446


I'll look into it and try to roll it up when Mit posts his changes with the bot configuration stuff.

Work in progress .. the configuration stuff mostly complete .. just checking whether I can put a sanity check on the connection so we get a meaningful error message if it fails.
Logged
« Reply #6 on: January 09, 2010, 04:40:02 PM »
VhaBot Developers
Full Member

View Profile
***

Epeen: 5
Posts: 204


Yeah, I was meaning to do that.  I have a comment for where that should be in the code, but I'm not sure how to "break out" of the plugin in a graceful way.

FYI. There's no need for a "Port" variable in the config.  The plugin can find out what port the TS server is using for voice chat.
« Last Edit: January 09, 2010, 07:25:40 PM by Llie »
Logged
« Reply #7 on: January 10, 2010, 01:23:45 AM »
Apprentice coder
VhaBot Developers
Novice

View Profile
***

Epeen: 4
Posts: 446


FYI. There's no need for a "Port" variable in the config.  The plugin can find out what port the TS server is using for voice chat.

Oh, but surely it still needs the TCP control port for web access?!
But thats quite nifty. You don't think you can create a connect string automagically do you?! Tongue

Update soon: Watch this space!!
Logged
« Reply #8 on: January 10, 2010, 04:12:42 AM »
VhaBot Developers
Full Member

View Profile
***

Epeen: 5
Posts: 204


Actually there is.  The TCP query port for TS v.2 protocol is 51234 and for TS v.3 is 10011 by default.  As far as I know these server TCP query ports are not configurable.  They're part of the protocol specification.  In other news, I've cleaned up my plugin a little and implemented the names of the connected clients for the TS v.3 protocol and also a switch that checks what protocol version the server is (so instead of deleting the "Port" variable, maybe just change it to "TSVersion") and now the plugin can report basic information from v.2 TS servers.  I'd like to include the ts "server name", but the way the two protocols handles "string values" is different, so its a hassle.  If someone really wants the server's name "string" and "welcome message" displayed, then they're gonna have to do it themselves or bribe me with AO Phatz.  Tongue

Just waiting your plugin post so I can integrate the changes.
Logged
« Reply #9 on: January 10, 2010, 04:47:57 AM »
Apprentice coder
VhaBot Developers
Novice

View Profile
***

Epeen: 4
Posts: 446


I've added the 'Port' variable anyway .. if the server responds with its version number, it'll be easy to switch versions by itself.

There may be the facility to change TCP port .. but possibly only in commercial version.

Will post my iteration tomorrow (Sun).

Thanks again Llie Tongue
Logged
« Reply #10 on: January 10, 2010, 04:59:57 AM »
VhaBot Developers
Full Member

View Profile
***

Epeen: 5
Posts: 204


Ya... no... Without knowing a priori what the sever version is, you don't know which TCP port to connect to in order to query for information.  The really smarty way would be to try both and see which one works, but that would involve timeouts and whatnot and result in apparent sluggishness in the bot.  Instead of "Port" it really should just be "TSVersion" and the UDP chat port will be pulled from the query.

P.S. "Are we havin fun yet?"
Logged
« Reply #11 on: January 10, 2010, 05:06:55 AM »
Apprentice coder
VhaBot Developers
Novice

View Profile
***

Epeen: 4
Posts: 446


Err .. you just specify the port, and if it connects ..
Code:
                   if ( responseData == "TS3" ) {

User sets the port .. whether its TS3 or TS2 .. and then script detects from connection response Tongue
Easy! Cheesy

Don't make me come over there Llliee ..... !!! Tongue
Logged
« Reply #12 on: January 10, 2010, 05:10:02 AM »
Apprentice coder
VhaBot Developers
Novice

View Profile
***

Epeen: 4
Posts: 446


Oh you mean .. hmm .. well ok then.

*returns, tail between legs*

ROFL .. its YOUR plugin .. stop tellin me what to do .. or .. meh .. I give up .. too much blood in my caffeine stream!
« Last Edit: January 10, 2010, 05:14:56 AM by veremit »
Logged
« Reply #13 on: January 10, 2010, 05:19:17 AM »
VhaBot Developers
Full Member

View Profile
***

Epeen: 5
Posts: 204


What the heck do I know?  I don't even use TeamSpeak.  Remember? Mine is the PC too ancient to have a sound card?
Logged
« Reply #14 on: January 10, 2010, 05:25:46 AM »
Apprentice coder
VhaBot Developers
Novice

View Profile
***

Epeen: 4
Posts: 446


What the heck do I know?  I don't even use TeamSpeak.  Remember? Mine is the PC too ancient to have a sound card?

I'll send you one of my spares Tongue Its all on-board nowadays .. don't need a discrete card like you used to.
Logged
« Reply #15 on: January 10, 2010, 06:59:51 PM »
Novice

View Profile
****

Epeen: 3
Posts: 481


veremit stepping on other people's toes... no surprise. :p
----------------------------------------------------------
Sex is like hacking. You get in, you get out, and you hope you didn't leave something behind that can be traced back to you.
----------------------------------------------------------
Naturalistic - RK 1 220 Doctor

Campalot Coder and Superadmin
Logged
« Reply #16 on: January 10, 2010, 08:26:35 PM »
Apprentice coder
VhaBot Developers
Novice

View Profile
***

Epeen: 4
Posts: 446


veremit stepping on other people's toes... no surprise. :p

*steps on Nat's foot with high-heels on*
Logged
« Reply #17 on: January 11, 2010, 02:25:51 AM »
Apprentice coder
VhaBot Developers
Novice

View Profile
***

Epeen: 4
Posts: 446


Not extensively tested, but added:

- Configuration interface, with server address, version, virtual server ID, password options
- Ability to auto-select port based on TS version
- Breaks out if connection fails .. needs extra SocketException info though

Please report any issues, thank you!

* ll_TeamSpeak.cs (8.46 KB - downloaded 134 times.)
Logged
« Reply #18 on: January 11, 2010, 05:03:29 AM »
VhaBot Developers
Full Member

View Profile
***

Epeen: 5
Posts: 204


Buggers.

There's some kind of problem with the TS2 part of my plugin.  I was about to implement the user name lookup for TS2, but the code barfs somewhere.  I was slowly marching through the code by moving a debug statement when I realized I should remove the try/catch block which was trapping all the exceptions regardless of whether it was socket related or not.  Live and learn.  By the time I discovered that I was fed up with this thing again.

Anyhow, the TS2 user listing is messier than the TS3 output.  It's rows of tab delimited data, with a header row (also tab delimited).  That's what I need to work on (well, that and fixing whatever is currently bugged), but first I have to figure out where it's barfed.  I'll probably work on it Monday morning because this is annoying me and I'd rather be playing in my free time than debugging code.

Here's the half-baked version in case someone else spots the obvious bug.  Mit's configuration stuff is merged in (so at least now in the future I have something to model).  It turns out that a port is needed for TS2 (stupid TS2), but not TS3, so I'll need to modify the configuration description text a little.  Anyhow, for TS2, you must specify the voice chat port which turns out to also identify the server, whereas, for TS3 you can have lots of virtual servers, and you specify them by ID number, because there's no way to interrogate the TS2 server from the TCP query interface what port to talk to.  Either way... its needed.

* ll_TeamSpeak.cs (17.78 KB - downloaded 236 times.)
Logged
« Reply #19 on: January 11, 2010, 05:44:48 AM »
Apprentice coder
VhaBot Developers
Novice

View Profile
***

Epeen: 4
Posts: 446


Llie:-

Line 352: Comment out the } - its the close-brace of the try {} catch {} block.

ie.
Code:
                    stream.Close();
                    sockclient.Close();
                    // }
                    // catch
Logged
Pages: [1] 2   Go Up
Print
Jump to: