PDA

View Full Version : Parcing and Regex Help


patag
16-06-2004, 20:48
First time poster, so be gentle! :) BTW, love TS!

I'm currently working on a .NET application that will telnet into a TeamSpeak Server and execute the various commands to get the following information:

Global Information - gl
Server Information - si
Channel List - cl
Player List - pl

My question is specifically, has anyone written regex expressions to parse the above output? They don't have to be in .NET, php would work, I can port them.

I'd like to do this without having to use Webpost or mySQL or anything like that. I just want to telnet into the server, run my commands and parse the data. My goal is to create XML files from the data.

I've been able to telnet into the server with .NET already, so I know I can execute commands against the TS Server, just don't want to recreate the regex if I don't have to.

Here's a signature I created for the FPSMMO game PlanetSide: http://patag.universalrealms.com/ps/sig.aspx?WorldID=15&CharID=632254&TSLogin=patag&bg=6

It pulls in XML data from Dicepoint (the stats), TS info from a specific TS server, then uses GDI+ to dynamically write out the image.

Thanks for listening, I look forward to hearing from the forums gods!

patag
18-06-2004, 21:01
One RegEx down, several to go...



((\d{1,10}\s{1,10}){13})"\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}"\s{1,10}".*"\s{1,10}".*"



This will find the player after you execute the PL command. So far, I've written a page to loop through and grab all the players. I'll have to parse it a little more to wrap it with XML attributes.

I'll post more RegEx when I create them.

patag
19-06-2004, 20:55
FYI, here's a simple XML version of a channel listing and player listing. This is being generated from a telnet session to the server, I'm not using WebPost's of any sort.

I have to sort the channels and users, but for the most part, I have some of the base functionality I was looking for complete.

Here's my example right now - the feed is live: http://patag.universalrealms.com/ps/ts.aspx

patag
01-07-2004, 20:25
I updated my XML feed to include all of the commands that are necessary to display a active TeamSpeak server. If you test the following URL http://patag.universalrealms.com/ps/ts.aspx you will see a dump of data from one of official TeamSpeak Public servers.

Two things remain before I can start working on interfaces for the XML dump.

1- Sorting channels properly (Channel and Subchannels)
2- Placing Players within channels properly

After I get those two parts done, I'll start working on front ends to display the data.

Again, I point out this is being done without WebPosts. Everything is being pulled from a telnet session. Depending on how inspired I get, I might make a admin tool for moving players between channels, etc.

Feedback or questions would be appreciated. At this point, I feel like I'm talking to myself!

patag
03-07-2004, 16:12
I finished sorting the channels and I have placed all of the users in their proper channels now. But for some reason, I'm crashing when I try and pull all the data from the TS Public 3 server. I'll have to figure that one out, but here is a version that is working with a smaller server.

http://patag.universalrealms.com/ps/ts.aspx

patag
17-07-2004, 05:06
For the people who have been following me talking to myself, I've updated my TS monitor application.

Here is a very simple version of the XML feed being used inside of Flash.

http://patag.universalrealms.com/ts/flashts.html

Gryphon
17-07-2004, 05:33
That is very cool :D

patag
24-07-2004, 16:33
Link refreshed with the final version.

http://patag.universalrealms.com/ts/ts.html