How Do I Get Game Data Out
Moderator: Moderators
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!!

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!!
escuchame


-
dcoshea
- Colour Sergeant
- Posts: 94
- Joined: Thu Mar 04, 2004 3:00 am
- Location: Sydney, Australia
- Contact:
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 lagSlopester wrote:No. I only want to get the stats out, not back in. Does this mean I don't need any cvars business?
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 meIt 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.
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
Sounds like a standard disclaimer I should put on the bottom of everything I sayIf I ever get it going I'll post the script etc... But don't hold your breath!!
Regards,
David
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 
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
-
dcoshea
- Colour Sergeant
- Posts: 94
- Joined: Thu Mar 04, 2004 3:00 am
- Location: Sydney, Australia
- Contact:
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.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.
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
Regards,
David
aha ,well usually the tourneys i run are timebased
.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
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 .
-
dcoshea
- Colour Sergeant
- Posts: 94
- Joined: Thu Mar 04, 2004 3:00 am
- Location: Sydney, Australia
- Contact:
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.M&M wrote:aha ,well usually the tourneys i run are timebased.so i could prolly set a time limit 2 check the server or something
That mohstats program probably does it, have you looked at it yet?.i dont know much about scripting so i dont prolly know what im talking aboutbut 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 .
Regards,
David
-
dcoshea
- Colour Sergeant
- Posts: 94
- Joined: Thu Mar 04, 2004 3:00 am
- Location: Sydney, Australia
- Contact:
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 yourselfM&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
Regards,
David
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
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
escuchame


-
nuggets
- General
- Posts: 1006
- Joined: Fri Feb 28, 2003 2:57 am
- Location: U-england-K (england in the UK) :P
- Contact:
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
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
hope this helps, prob not cos it's all foreign 2 me :-/
