Official Soldat Forums

Soldat Fans => Fan Apps => Topic started by: Maff^ on August 06, 2006, 09:23:57 pm

Title: Zitro-Stats Addon: ZitroStats-Query
Post by: Maff^ on August 06, 2006, 09:23:57 pm
As of version 1.20061005 of Zitro-Stats (http://zitrostats.sourceforge.net/) this script is a default plugin that's packed togheter with the Zitro-Stats files. So just download the newest Zitro-Stats package. thx

Hi there :)

I'm running a Soldat server for about two weeks now, and a few days back I installed oLaf's wonderful Zitro-Stats (http://zitrostats.sourceforge.net/) script. I kinda missed live stats, so i could see who was playing on my server (I didn't want to lauch a gamebrowser/admintool each time I just wanted a quick look).

So I decided to make a simple/quick script to query a Soldat server (using Qstat) and display the results on the Zitro-Stats page.

This is how it looks like:
(http://bl-tyrone.student.utwente.nl/~Mafioso/ZitroStats-Query/screenshot_crop.png) (http://bl-tyrone.student.utwente.nl/~Mafioso/ZitroStats-Query/screenshot.png)
You can also view the a live version on my Zitro-Stats page (http://bl-tyrone.student.utwente.nl/zitrostats/).

The script works by injecting some javascript code (by adding this to the server info field) into the index page. The javascript uses a XMLHttpRequest to request the results of the query script. (Better known as AJAX.) The query php script executes the qstat exe in order to retrieve the server stats, and puts the result in a nice zitrostats-sytle-matching format. And Voilà! a nicely integrated server-info pallet on your Zitro-Stats page.

You can download the following rar package ZitroStats-Query-v0.01.rar (http://bl-tyrone.student.utwente.nl/~Mafioso/ZitroStats-Query/ZitroStats-Query-v0.01.rar) (8.1KB).
A readme-file is located in the rar package, but also available on my webspace: readme.txt (http://bl-tyrone.student.utwente.nl/~Mafioso/ZitroStats-Query/readme.txt), this file includes some more information, requirements and installation instructions.

Comments are always welcome, also if you have problems installing the script, let me know so I can try to help you.


To-do/Feature list for v0.1

If you have a feature request, be sure to post it here. And maybe i can add it to the to-do list.
Title: Re: Zitro-Stats Addon: ZitroStats-Query
Post by: Death on August 07, 2006, 03:08:34 pm
What is your sevrer?....
Title: Re: Zitro-Stats Addon: ZitroStats-Query
Post by: FliesLikeABrick on August 07, 2006, 03:16:18 pm
... the screenshot shows his server's name, IP, and port.  What else could you want?
Title: Re: Zitro-Stats Addon: ZitroStats-Query
Post by: Maff^ on August 07, 2006, 03:19:43 pm
What is your sevrer?....
I'm not sure what you mean with that..

If you're asking me what the ip/port is of my Soldat server.. it's the one in the screenshot (130.89.164.52:23073).
If you're asking me what the web address of my Zitro-Stats page is.. http://bl-tyrone.student.utwente.nl/zitrostats/ (also in my post above)
If you're asking me what the web address of this 'project' is ... http://bl-tyrone.student.utwente.nl/zitrostats/ (see signature)

edit: I was a bit to slow

BTW, if someone is going to use this script, please let me know (here), as I'm curious if anybody is going to use this :)
Title: Re: Zitro-Stats Addon: ZitroStats-Query
Post by: Death on August 07, 2006, 08:40:07 pm
I meant which one his server is and the ip and port didn't work but when I tried again it did.
Title: Re: Zitro-Stats Addon: ZitroStats-Query
Post by: Leo on August 08, 2006, 02:08:36 pm
Nice addon but it won't work when my PC is off.
Title: Re: Zitro-Stats Addon: ZitroStats-Query
Post by: Maff^ on August 08, 2006, 02:39:29 pm
How do you mean?
Is your PC running the Soldat server, and you have a other server as webhost? if so, the script should report 'Server seems to be offline.'

Please supply some more information, so I can understand the problem, and fix it.
Title: Re: Zitro-Stats Addon: ZitroStats-Query
Post by: Leo on August 08, 2006, 02:50:45 pm
My servers are hosted by hosting companies in where I can't run Qstat. This must be run in my own PC which is not 24/7 open, my servers are always online though ;)
Title: Re: Zitro-Stats Addon: ZitroStats-Query
Post by: Maff^ on August 08, 2006, 05:23:37 pm
Ok, I was afraid that was the case, I'm thinking of losing the qstat part by writing it's function completely in PHP (it's not to hard, but it takes some more time). Or maybe setting up a tunneling system (so my server does the Qstat part).

Also I'm thinking of making a install file, which would alter the ZitroStats files (so it's still easy to set up), and easy to maintain (trough the ZitroStats admin page).

Date Posted: August 08, 2006, 04:29:33 PM
I made a PHP-only (test) version ...
Download qsQuery.rar (http://bl-tyrone.student.utwente.nl/~Mafioso/ZitroStats-Query/qsQuery.rar) from my server, and extract it in your ZitroStats folder. You would have to re-edit the query.php file, as it is overwritten.
(Requirements: PHP Socket support & A provider that allows inbound/outbound UDP traffic)

I personally still prefer the Qstat version, as it seems to do it's job a bit quicker.

Please let me now how this works out for you (and a link with the result).
Title: Re: Zitro-Stats Addon: ZitroStats-Query
Post by: Leo on August 08, 2006, 11:49:51 pm
What I should write to server section at zitr-stats ? There is no readme :)
Title: Re: Zitro-Stats Addon: ZitroStats-Query
Post by: Maff^ on August 09, 2006, 02:36:30 am
Sorry, I forgot to mention it's exactly the same as the previous version, but here is updated version...

Place this code only in the first server info box:
Code: [Select]
<script src="AjaxRequest.js"></script>
<script>
function getQueryResult(objname, host, port)
{
var obj = document.getElementById(objname);
if (obj)
{
AjaxRequest.get(
{
'url':'query.php?adr='+host+':'+port
,'onSuccess':function(req){ obj.innerHTML = req.responseText; }
,'onError':function(req){ obj.innerHTML = 'Could not load the query script.<br /><a href="'+req.url+'" target="_blank">'+req.url+'</a><br />Make sure you placed the script in the right folder.'; }
  }
);
}
}
</script>

And this code in all of your server info boxes:
Code: [Select]
<div id="server1"></div>
<script>getQueryResult('server1', 'localhost', 20373);</script>
(You should change 'server1' for server 2 and server 3, and so on. Also change the 'localhost' part, and maybe the port number if necessary.
Title: Re: Zitro-Stats Addon: ZitroStats-Query
Post by: Leo on August 09, 2006, 03:48:55 am
Ehmm.... I did this and nothing shows there.
Title: Re: Zitro-Stats Addon: ZitroStats-Query
Post by: Maff^ on August 09, 2006, 07:43:43 am
It should work for your "Full Real CTF" server (85.214.35.115:24274), add the server to the 'trusted' server list like this: $servers[] = '85.214.35.115:24274';  (or set $limitServers to false).

And add the lines to the first server infobox (after the existing code):
Code: [Select]
<div id="leoCTF"></div>
<script>getQueryResult('leoCTF', '85.214.35.115', 24274);</script>

I'm looking into why the 2 other servers won't return the info.. Do you have access to the soldat.ini 's ? If so, could post/PM them (delete the passwords :P)
Title: Re: Zitro-Stats Addon: ZitroStats-Query
Post by: Leo on August 10, 2006, 07:04:58 am
So, what's up with that ? Did you fix the bug ?

*Maff here, Maff there, where's Maff ?  :o :o
Title: Re: Zitro-Stats Addon: ZitroStats-Query
Post by: Maff^ on August 11, 2006, 03:41:48 pm
Sorry, I was offline for a couple of days, painting my room and laying a laminate floor in it..

I did find what was cause the javascript bug, and fixt it in my post, I already changed the code in your zitrostats page :P. You need to and the new INF server adress to your $servers (as it has a new port). Anyway, contact me on IRC if you have some more trouble.
Title: Re: Zitro-Stats Addon: ZitroStats-Query
Post by: Leo on August 11, 2006, 04:21:17 pm
Works perfect, thanks :)

Link: www.soldat-lra.net/status
Title: Re: Zitro-Stats Addon: ZitroStats-Query
Post by: RaMBocL on August 16, 2006, 04:04:08 am
thx! it's works but i get a bug when i want to put more than 1 server.... the servers erase or something like that... T_T


 ???
Title: Re: Zitro-Stats Addon: ZitroStats-Query
Post by: Maff^ on August 16, 2006, 06:00:06 am
This is a known bug, sorry for that. I thought I changed the above code, but apparently I forgot (or something went wrong).

change this:
Code: [Select]
obj = document.getElementById(objname);into:
Code: [Select]
var obj = document.getElementById(objname);
And it should work fine ..
Title: Re: Zitro-Stats Addon: ZitroStats-Query
Post by: RaMBocL on August 16, 2006, 12:23:15 pm
This is a known bug, sorry for that. I thought I changed the above code, but apparently I forgot (or something went wrong).

change this:
Code: [Select]
obj = document.getElementById(objname);into:
Code: [Select]
var obj = document.getElementById(objname);
And it should work fine ..


doesn't work T_T...  first I create server 1 then server 2 but server 2 overwrite server  1 o.o! so the sever control panel shows only server #2
Title: Re: Zitro-Stats Addon: ZitroStats-Query
Post by: Maff^ on August 16, 2006, 01:54:48 pm
doesn't work T_T... first I create server 1 then server 2 but server 2 overwrite server 1 o.o! so the sever control panel shows only server #2
If you post a link to your zitrostats page i could take a look. With this info I don't know what's wrong.
Or you could contact me on IRC, else it takes forever, and a lot of posts here (like with Leo :P). You can find me on #hcl@quakenet, or contact me on MSN (I've updated my profile).

Title: Re: Zitro-Stats Addon: ZitroStats-Query
Post by: dominikkk26 on April 23, 2011, 02:20:38 pm
Please renew links to download!
Title: Re: Zitro-Stats Addon: ZitroStats-Query
Post by: Leo on April 24, 2011, 02:30:12 am
Just use the latest version of zitro, works fine: http://sourceforge.net/projects/zitrostats/files/
Title: Re: Zitro-Stats Addon: ZitroStats-Query
Post by: PKS|Shooter on May 13, 2011, 01:27:44 pm
ffs i cant get any file 404 Not Found