Digital Paint Discussion Board

Development => Bugs, Feature Requests, and Feedback => Topic started by: Burt_Gummer on August 04, 2005, 01:27:05 AM

Title: XML feed for server stats
Post by: Burt_Gummer on August 04, 2005, 01:27:05 AM
I think it would be cool to have an XML feed of current server stats so that you could put the stats of your server or your clan's server on your website.  I already have a plugin for my e107 website that will get the server stats from a ShoutCast server, but I would like to add the stats from my DP server once I get it up and running.
Title: Re: XML feed for server stats
Post by: loial21 on August 04, 2005, 01:29:54 AM
Jitspoe ...
I personally have asked for global stats as a matter of fact would offer the web space. Getting it done well.....I can wish at least.
Title: Re: XML feed for server stats
Post by: Burt_Gummer on August 04, 2005, 02:35:47 PM
BTW, jitspoe, I know I was talking about this last night on IRC, but today I talked to a couple guys they work with, and one, who knows C and C++ pretty well might be able to help me make this possible in build 014.

FYI, just in case I have to tell u first before I modify the source.
Title: Re: XML feed for server stats
Post by: jitspoe on August 04, 2005, 05:16:00 PM
Your best bet would be to parse the stdlogs.  When enabled (sl_logging 1, I think), it will log various events, such as kills/deaths, grabs, caps, name changes, etc.  That's how er33t did their stats.
Title: Re: XML feed for server stats
Post by: Burt_Gummer on August 04, 2005, 06:07:07 PM
But do the stdlogs update in almost real time?

Also, what file directory is this located in?
Title: Re: XML feed for server stats
Post by: loial21 on August 04, 2005, 07:26:18 PM
I belive they had to be updated.
Title: Re: XML feed for server stats
Post by: Burt_Gummer on August 04, 2005, 10:48:47 PM
Yeah, I checked out the file, but the file just keeps getting bigger and bigger and bigger (because new entries to the log get added at the end).  Eventually, that would take forever to parse.  What I need that file to display is just the Server name, connected users, current map, and maybe even team/player who is winning and their score.
Title: Re: XML feed for server stats
Post by: loial21 on August 05, 2005, 12:32:52 AM
No that needs to be a dp gui interface with the maplist, lke game spy offers. My opinion. How big can that file get? I have virtual space or drive space or even web space and the willingness to update.
Title: _
Post by: IronFist on August 05, 2005, 11:50:15 AM
Post removed
Title: Re: XML feed for server stats
Post by: Burt_Gummer on August 05, 2005, 01:31:08 PM
So if I was going to query one of the current servers, I would use the PHP $fp = fsockopen("udp://217.20.118.15", 22222, $errno, $errstr);

correct?  Now the major problem:  figuring out how to parse the data.
Title: Re: XML feed for server stats
Post by: jitspoe on August 05, 2005, 01:52:47 PM
Yup, there's actually two ways to query the server.  One just gives the name/player count/map.  The other lists all the players and server side variables (can't remember which is which).  The game is set up so that some server variables display the score and who's on what team.  It should be fairly easy to parse with php.  I can't remember what the other one was called.  I'd have to look it up.
Title: Re: XML feed for server stats
Post by: BurtGummer on August 05, 2005, 04:23:05 PM
I just need the variable names and I should be able to figure something out.
Title: _
Post by: IronFist on August 05, 2005, 06:44:36 PM
Post removed
Title: Re: XML feed for server stats
Post by: jitspoe on August 05, 2005, 07:33:16 PM
I think the players are listed after a newline or some character like that.

\pb\!1\pp\!0!2 -- that shows who's on what team, so if your player list were:

joe
jack
jill

1 (jack, since it's 0-based) would be on blue.
0 and 2 (joe and jill) would be purple.

_scores\Purple:2 Blue:1 shows the scores - pretty straightforward.
Title: Re: XML feed for server stats
Post by: loial21 on August 05, 2005, 09:16:21 PM
I want stats for EVL servers :(!!!!
Title: Re: XML feed for server stats
Post by: SdC.Captin on August 07, 2005, 10:30:20 PM
ok so on my site i want server stats like the Sou site


what code do i use??
Title: Re: XML feed for server stats
Post by: Burt_Gummer on August 08, 2005, 01:48:48 AM
I have a working adaptation of the SOU server stats script.  Check it out on http://www.taloncomputing.us/


BTW, if anyone wants the page and plugin folder to add this to an e107 based site, email me at zjcochran@gmail.com

If you don't have e107, you can get it from http://www.e107.org

For other plugins:  http://www.e107coders.org/

For themes:  http://www.e107themes.org/
Title: Re: XML feed for server stats
Post by: Burt_Gummer on August 08, 2005, 01:52:58 AM
Also, in order to use this plugin and e107, you will need to have a server that supports PHP, and have a MySQL database (for e107).
Title: Re: XML feed for server stats
Post by: [eR33t]XBain on August 08, 2005, 02:59:16 PM
I had eR33t's dpstats running on a system using perl/MySQL and PHP to draw the front end.  The data could be retrieved from anything that can interface with MySQL(such as the TCL eggdrop we had running in our channels).  There was a perl backend stdlog reader that ran every 30 minutes on the two public servers.  It wasn't real-time because I liked to have all the data at once for an entire map's play so that more stats could be calculated such as high kill/death/cap/grab counts for each map.
I would distribute the script but it does not function 100%, install easily, configure easily or efficiently buffer MySQL queries and really bogs down most systems.
Title: Re: XML feed for server stats
Post by: Burt_Gummer on August 08, 2005, 04:28:04 PM
One the Detailed Stats page that is linked to in the menu plugin I wrote, I gave it a javascript to make a popup stats window with a meta tag to make it refresh every second so that it looks like almost live stats.