UT3 WebStats v0.1 - 2008-04-04

General forum for discussions regarding UTStatsDB
Starbuck
Posts: 22
Joined: Fri Dec 28, 2007 2:25 pm

UT3 WebStats v0.1 - 2008-04-04

Postby Starbuck » Fri Apr 04, 2008 11:42 am

WebStats v0.1

WebApplication MOD for UT3 that returns current Player and Server stats in an XML format.

Homepage: http://forum.dirrtyclan.com/Default.aspx?g=posts&t=170
Download: http://forum.dirrtyclan.com/upload/WebS ... -04-04.zip

As everyone is probably well aware, current Player Stats is missing from the Gamespy query protocol made available for UT3. I'm hoping that this MOD can help bridge that gap.

My thought was that Panther may be able to integrate this into UTSTATSDB... Like a config option "Enter the WebStats address" (or maybe just the port) and if it's not provided, then show only Gamespy query stats. It would be awesome to see current player team/score/deaths/ping etc, along with time in game and time remaining, etc. on the UTSTATSDB main page as it is for UT2004.

More information along with instructions and a sample output can be found at the Homepage (above).

:ugeek:

Panther
Site Admin
Posts: 500
Joined: Sat Dec 08, 2007 12:51 am
Contact:

Re: UT3 WebStats v0.1 - 2008-04-04

Postby Panther » Fri Apr 04, 2008 12:42 pm

This is great, but why not integrate this into the Gamespy query protocol?

Starbuck
Posts: 22
Joined: Fri Dec 28, 2007 2:25 pm

Re: UT3 WebStats v0.1 - 2008-04-04

Postby Starbuck » Fri Apr 04, 2008 1:38 pm

At this point I wouldn't know where to start (if it's even possible)... I'll definately look into it.

Panther
Site Admin
Posts: 500
Joined: Sat Dec 08, 2007 12:51 am
Contact:

Re: UT3 WebStats v0.1 - 2008-04-04

Postby Panther » Fri Apr 04, 2008 1:50 pm

Perhaps looking at how it was done in El Muerte's ServerExt for UT2004 might help. Hopefully it can be done in a similar fashion with UT3, though I have seen how much more difficult things can be.

Starbuck
Posts: 22
Joined: Fri Dec 28, 2007 2:25 pm

Re: UT3 WebStats v0.1 - 2008-04-04

Postby Starbuck » Mon Apr 21, 2008 7:01 pm

As an experiment I have integrated player status from WebStats into the UTStatsDB main page: http://ut3stats.dirrtyclan.com/

The code is pretty straightforward...

Code: Select all

$xmlFileData = file_get_contents("http://webstatsaddress/stats/server.xml"); $xmlData = new SimpleXMLElement($xmlFileData); $playersNode = $xmlData->xpath('server/players/player'); echo "<table class=\"grid\" width=\"500\"><tr>"; echo "<th>&nbsp;&nbsp;</th>"; echo "<th>Clan</th>"; echo "<th>Player</th>"; echo "<th>Rank</th>"; echo "<th>Score</th>"; echo "<th>Kills</th>"; echo "<th>Deaths</th>"; echo "<th>Ping</th></tr>"; foreach($playersNode as $player) { echo "<tr>"; echo "<td bgcolor=\"". $player->teamHUDColor ."\"></td>"; echo "<td align=\"left\">" . $player->clanTag . "</td>"; echo "<td align=\"left\">" . $player->playerName . "</td>"; echo "<td>" . $player->ranking . "</td>"; echo "<td>" . $player->score . "</td>"; echo "<td>" . $player->kills . "</td>"; echo "<td>" . $player->deaths . "</td>"; echo "<td>" . $player->ping . "</td>"; echo "</tr>"; } echo "</table>";
PHP5 required

utssace
Posts: 18
Joined: Sat Dec 15, 2007 3:50 pm

Re: UT3 WebStats v0.1 - 2008-04-04

Postby utssace » Mon May 12, 2008 7:07 pm

hmmmm....we installed the webstats package but when we visit the address we get
this:

XML Parsing Error: no element found
Location: http://localhost:88/stats/resources/statst.xsl
Line Number 1, Column 1:

Any ideas what I am doing wrong here. Thanks

Starbuck
Posts: 22
Joined: Fri Dec 28, 2007 2:25 pm

Re: UT3 WebStats v0.1 - 2008-04-04

Postby Starbuck » Mon May 12, 2008 8:46 pm

What browser/version are you using?
View the page source on the page you are getting an error... copy and paste that as Code here in a new message.
Have you made any customizations to the XSL file?

Btw, this is a newer version you are using (v0.2)... you can always download and try v0.1 if you like (it doesn't include an XSL file).

Here are links to a couple other clan's implementations:

http://85.131.207.21:8000/stats/server.xml
http://8.6.75.152:9021/stats/server.xml

utssace
Posts: 18
Joined: Sat Dec 15, 2007 3:50 pm

Re: UT3 WebStats v0.1 - 2008-04-04

Postby utssace » Tue May 13, 2008 6:44 pm

It's working now.

A few questions please:

1) I am using an iframe to show this in our website. Is it safe having the ip address in the
iframe since peeps can view source code.

2) It doesn't update info unless I clear my browser cache. Can it be fixed to update on
browser refresh

3) Can this be implemented on UT99 & UT2k4 servers?

We like to use your webstats to act as a serverwatch on our website so people know
who is playing where.

Starbuck
Posts: 22
Joined: Fri Dec 28, 2007 2:25 pm

Re: UT3 WebStats v0.1 - 2008-04-04

Postby Starbuck » Tue May 13, 2008 8:49 pm

1 - IMO it doesn't matter... the only thing you really reveal is the port that your WebAdmin is running on... if you need to hide this for some reason then you will need to parse the xml in PHP or ASP.NET and forget about the default XSLT provided.

2 - Try editing stats/resources/statst.xsl add the following between the <head> and <style> tags:

Code: Select all

<meta http-Equiv="Cache-Control" Content="no-cache" /> <meta http-Equiv="Pragma" Content="no-cache" /> <meta http-Equiv="Expires" Content="0" />
Another option is to call a javascript function on page load that reloads the iframe with the following code (substituting the ID of your iframe):

Code: Select all

parent.frames[FrameID].window.location.reload();
3 - This was made for UT3 only... UT2K4 epic was kind enough to provide us with a built in means to get server/player info (I'm not sure what was available for UT99).

utssace
Posts: 18
Joined: Sat Dec 15, 2007 3:50 pm

Re: UT3 WebStats v0.1 - 2008-04-04

Postby utssace » Fri May 23, 2008 5:32 pm

I tried the meta entries above but still the same. I have to clear my browser cache and reload the page to see updated stats. I haven't tried the javascript function yet. Where do I put that code?

Starbuck
Posts: 22
Joined: Fri Dec 28, 2007 2:25 pm

Re: UT3 WebStats v0.1 - 2008-04-04

Postby Starbuck » Mon May 26, 2008 6:56 am

The javascript code should be inline after the iframe and before the closing body tag...

Code: Select all

<iframe id="ifrm" src="http://ut3.zapto.org:85/stats/server.xml"></iframe> <script type="text/javascript"> parent.frames["ifrm"].window.location.reload(); </script>
Here' one more option that attempts to randomize the src url for the the iframe - which in turn should prevent caching as the url should always be different...

Code: Select all

<iframe id="ifrm"></iframe> <script type="text/javascript"> parent.frames["ifrm"].window.location="http://ut3.zapto.org:85/stats/server.xml?RandomKey="+Math.random(); </script>
:geek:


Return to “UTStatsDB”