Author Topic: XML feed for server stats  (Read 3724 times)

Burt_Gummer

  • Guest
XML feed for server stats
« on: August 03, 2005, 11:27:05 PM »
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.

loial21

  • Autococker
  • Posts: 2807
Re: XML feed for server stats
« Reply #1 on: August 03, 2005, 11:29:54 PM »
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.

Burt_Gummer

  • Guest
Re: XML feed for server stats
« Reply #2 on: August 04, 2005, 12: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.

jitspoe

  • Administrator
  • Autococker
  • Posts: 18802
Re: XML feed for server stats
« Reply #3 on: August 04, 2005, 03: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.

Burt_Gummer

  • Guest
Re: XML feed for server stats
« Reply #4 on: August 04, 2005, 04:07:07 PM »
But do the stdlogs update in almost real time?

Also, what file directory is this located in?

loial21

  • Autococker
  • Posts: 2807
Re: XML feed for server stats
« Reply #5 on: August 04, 2005, 05:26:18 PM »
I belive they had to be updated.

Burt_Gummer

  • Guest
Re: XML feed for server stats
« Reply #6 on: August 04, 2005, 08: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.

loial21

  • Autococker
  • Posts: 2807
Re: XML feed for server stats
« Reply #7 on: August 04, 2005, 10:32:52 PM »
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.

IronFist

  • Autococker
  • Posts: 1304
_
« Reply #8 on: August 05, 2005, 09:50:15 AM »
Post removed
« Last Edit: July 25, 2010, 11:14:58 PM by IronFist »

Burt_Gummer

  • Guest
Re: XML feed for server stats
« Reply #9 on: August 05, 2005, 11:31:08 AM »
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.

jitspoe

  • Administrator
  • Autococker
  • Posts: 18802
Re: XML feed for server stats
« Reply #10 on: August 05, 2005, 11:52:47 AM »
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.

BurtGummer

  • Guest
Re: XML feed for server stats
« Reply #11 on: August 05, 2005, 02:23:05 PM »
I just need the variable names and I should be able to figure something out.

IronFist

  • Autococker
  • Posts: 1304
_
« Reply #12 on: August 05, 2005, 04:44:36 PM »
Post removed
« Last Edit: July 25, 2010, 11:14:50 PM by IronFist »

jitspoe

  • Administrator
  • Autococker
  • Posts: 18802
Re: XML feed for server stats
« Reply #13 on: August 05, 2005, 05: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.

loial21

  • Autococker
  • Posts: 2807
Re: XML feed for server stats
« Reply #14 on: August 05, 2005, 07:16:21 PM »
I want stats for EVL servers :(!!!!

SdC.Captin

  • VM-68
  • Posts: 118
Re: XML feed for server stats
« Reply #15 on: August 07, 2005, 08:30:20 PM »
ok so on my site i want server stats like the Sou site


what code do i use??

Burt_Gummer

  • Stingray
  • Posts: 63
Re: XML feed for server stats
« Reply #16 on: August 07, 2005, 11:48:48 PM »
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/

Burt_Gummer

  • Stingray
  • Posts: 63
Re: XML feed for server stats
« Reply #17 on: August 07, 2005, 11:52:58 PM »
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).

[eR33t]XBain

  • Guest
Re: XML feed for server stats
« Reply #18 on: August 08, 2005, 12: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.

Burt_Gummer

  • Stingray
  • Posts: 63
Re: XML feed for server stats
« Reply #19 on: August 08, 2005, 02: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.