Page 2 of 3

Posted: Tue Mar 23, 2004 9:03 pm
by M&M
if u manage 2 reach a solution plz tell me as i would love 2 have a script/proram do that 4 me :wink:

Posted: Wed Mar 24, 2004 12:18 am
by dcoshea
Slopester wrote:thx m8.

dunno nuthin bout cvars so gonna do a bit of reading - thx for pointers :D
No worries! So what are you planning to use cvars for - once you have collected the statistics, do you want to get them back into the map scripts for some reason?

Regards,
David

Posted: Wed Mar 24, 2004 7:47 pm
by Slopester
No. I only want to get the stats out, not back in. Does this mean I don't need any cvars business?

Basically I'm trying to operate a league and tryin to avoid putting all game scores in by hand. End results are to be auto dumped (via PHP) into database and reproduced using PHP to a web page.
It would be nice to get end-of-game scores out as the game is clearly doing all the kills/deaths calculations and presenting them at the end of each map. This would save loads of scripting but if the only way to get that data is to monitor each kill/death and do the maths in PHP, I'll have to settle for that.

If I ever get it going I'll post the script etc... But don't hold your breath!!
:D

Posted: Wed Mar 24, 2004 9:30 pm
by dcoshea
Slopester wrote:No. I only want to get the stats out, not back in. Does this mean I don't need any cvars business?
Yes, that's correct, you won't need to use cvars for anything. You can't get access to score information within the map script (without using triggers and getting potentially inaccurate information and probably lag :) ) so there is no need to use map scripts, and hence no need to use cvars to communiate with them.
It would be nice to get end-of-game scores out as the game is clearly doing all the kills/deaths calculations and presenting them at the end of each map. This would save loads of scripting but if the only way to get that data is to monitor each kill/death and do the maths in PHP, I'll have to settle for that.
I guess you are talking about TDM or FFA? For those game types, you can query the server in the same way GameSpy does to get the kills/deaths, and not have to parse the log file. Here's the bit I don't like about that method - you have to keep checking the scores table frequently enough that you're going to have gotten it at least once between the time when play ends on one map and the server starts loading the next map (how many seconds is that?). I guess it's not bad, but it just seems a bit messy to me :) You'd of course have to keep the most recent scores table you downloaded in memory plus the one before that, and if the most recent one indicates a different map to the previous one, it means the previous one was the last one for the map and you should record the scores on that to your database. Another issue with this method is that you won't know anything about players who leave during the match, or even too soon after it finishes. To avoid the issue of people leaving too soon after it finishes, perhaps every time you download the scores table you could compare it to the previous one, and if the only difference is that a player left (i.e. no scores increased) you could ignore the new table and keep the old one.

Polling the scores table via the GameSpy query port doesn't work for objective matches or other round-based matches because, for each player, instead of kills, it shows you the team's number of round wins, and instead of deaths it gives you 0.

The benefit I see of reading the server log is that you can tell exactly when a map change occured. Also, if for some reason you weren't polling the GameSpy query port for a few moments (network outage, script crashed, etc.), the data is still there in the log file until the server gets shut down and restarted (every time the server starts the qconsole.log file is overwritten). Also you don't need any tricks to compare the scores tables like I suggested above. On the other hand, your code to parse the messages in the log file might get confused if somebody uses a name like "Foo was rifled" or "in the head" so you'd need to pay a lot of attention to that part of your code :)
If I ever get it going I'll post the script etc... But don't hold your breath!!
:D
Sounds like a standard disclaimer I should put on the bottom of everything I say :)

Regards,
David

Posted: Wed Mar 24, 2004 9:49 pm
by M&M
well,y do u have 2 check the server every few seconds ?cant u just get the final results? like say ,when the game ends send final results 2 so and so.and keep doing that until u got all results then add them all?
i would like 2 have only the final results but i dont need them 2 be posted in php ,i would like them 2 be posted in something as simple as notepad if its possible.i would like 2 help but my scripting knowledge is very limited :( .the only thing i can do is hold my breathe :wink:

Posted: Wed Mar 24, 2004 10:24 pm
by dcoshea
M&M wrote:well,y do u have 2 check the server every few seconds ?cant u just get the final results? like say ,when the game ends send final results 2 so and so.
If you're writing a program which just uses the query port, there's no way for it to know when the map has ended, except to detect that the server has changed to a new map. If you're parsing the log file, you might be able to detect the game has ended somehow - there might be some message written to the log file like "round over", but I don't think so.

I have put a summary of some of the things I've mentioned, plus a bit more, up at http://dynamic6.gamespy.com/~rjukanproj ... Statistics

I'd like to point out that mohstats is written in PHP (it's an application though, as I understand it, not actually something that has to run on a web server) and it's open source, so you should get it, try it out, and if it doesn't do what you want you can easily extend it :) It probably has a good range of features already, though.

Regards,
David

Posted: Wed Mar 24, 2004 11:54 pm
by M&M
aha ,well usually the tourneys i run are timebased :wink: .so i could prolly set a time limit 2 check the server or something .i dont know much about scripting so i dont prolly know what im talking about :lol: but i really would like 2 do something like that .at least something that gathers the score of all players in a ffa ,on several map rotations .

Posted: Thu Mar 25, 2004 12:48 am
by dcoshea
M&M wrote:aha ,well usually the tourneys i run are timebased :wink: .so i could prolly set a time limit 2 check the server or something
You'd have to start the program which polls the server at exactly the same time as the server, and somehow account for the loading time of each map. That'd be pretty difficult I think.
.i dont know much about scripting so i dont prolly know what im talking about :lol: but i really would like 2 do something like that .at least something that gathers the score of all players in a ffa ,on several map rotations .
That mohstats program probably does it, have you looked at it yet? :) I think if you look at mohstats you'll find you don't need to think about scripting at all, just about how to enable logging on your server and how to install PHP :)

Regards,
David

Posted: Thu Mar 25, 2004 12:52 am
by M&M
i tried 2 dload it ,but i somehow ended up with a bunch of broken links leading 2 nowhere .i did manage 2 reach the file but i didnt understand how 2 get it onto my harddrive .ill prolly try 2morow as im very tired 2day and i want 2 slleeeeeppp so im not thinking very straight :wink:

Posted: Thu Mar 25, 2004 1:38 am
by dcoshea
M&M wrote:i tried 2 dload it ,but i somehow ended up with a bunch of broken links leading 2 nowhere .i did manage 2 reach the file but i didnt understand how 2 get it onto my harddrive .ill prolly try 2morow as im very tired 2day and i want 2 slleeeeeppp so im not thinking very straight :wink:
Well I'm not an expert on PHP but I might be able to help you get it working if you can't get it working yourself :)

Regards,
David

Posted: Thu Mar 25, 2004 8:59 pm
by Slopester
Thx as usual david - ur a wise man!

I hear what ur saying about best to avoid constant polling and coz I'll b running TDMs I think I'll stick with the logfile. Class.

I think some idiot in my clan changed all the localisation too so mohstats won't read it! We got 'xplayer was slapped upside the head by yplayer' and the like instead of 'was shot by'! lol That's my problem tho! Cheerz for wisdom m8.
I'll def post script when i sort it :D

Posted: Fri Mar 26, 2004 12:55 am
by M&M
**holds breathe *** **face becomes red ** :oops: **waiting ** ......

Posted: Fri Mar 26, 2004 9:43 am
by dcoshea
M&M wrote:**holds breathe *** **face becomes red ** :oops: **waiting ** ......
How's the installation of PHP and mohstats going?

Regards,
David

Posted: Sat Jun 05, 2004 12:30 am
by puckeye
kai0ty wrote:u shud just go to one of the sites u mentioned and look at the source. its probably tyhe easiest way.
And it's also called stealing !

Posted: Sat Jun 05, 2004 10:36 am
by nuggets
shut up with ya stealing comment, why come to a forum and say people are stealing?

if you read anything in this forum of any use, don't use it as you'll be accussed of the same thing

and don't quote me on this, cos you'll also be done by me for copyright infringement ;)