Web Output
by Christian Weber · in Technical Issues · 07/10/2002 (5:30 pm) · 3 replies
Hi all,
does anyone know how to read some variables out of a mp game and write it into a statistic-website?
thx,
Chris
does anyone know how to read some variables out of a mp game and write it into a statistic-website?
thx,
Chris
About the author
#2
07/11/2002 (4:04 am)
Thx for your help.
#3
Hey Alex, thanks for the plug!
Christian, I can think of a couple of ways to do what you want, depending on what it is you wish to accomplish. Based on your question, I'm not sure which would suit you best, so here's all of them:
Get Server Info on Demand
This is what I do with my GG Master Server Monitor. When the user opens the web page, it triggers a Perl script. This script opens a socket to the server(s) and based on the protocol of the server(s) is able to retrieve the information it needs. The script pretends that it is a game client, and has access to that type of information (game name, number of players, etc). The script then produces some HTML output to show the stats. You could probably do the same thing with PHP, although I'm certainly not a PHP expert.
The advantage of this is you can do it without needing to change code within the server you are monitoring, and can implement it on a web server that you do not have shell access to ie: do it just with available web technologies. The disadvantage is that the game server is polled everytime the web page is accessed, but not any more than the game itself would poll the servers.
Get Server Info Periodically
You would have a program that would periodically access the servers for the appropriate stats, and store this information in a database on the web server. Whenever a user requests the information from a web page, the database is accessed. This would require a program to run either on the Web server itself (if you have access) or on another machine that sends it to the web server.
The advantage is that your number of web page hits does not equal the same number of game server polls. eg: Poll the game server every five minutes, while you could have 1000's of web page hits per hour. The other advantage is that you can do this without needing to change any code on the game servers you are monitoring.
The disadvantage is that you need to have direct shell access to the web server to have your polling program run in the background, or have a separate machine that you own do the polling and push it up to the web server.
Game Server Sends Statistics to Web Server
In this scenario, you would engineer the game servers to periodically send their statistics to a database on the web server. Whenever a user requests the information from a web page, the database is accessed.
The advantage is that you have full control over what and when the game servers send their stats. You could pump out all kinds of information that you just can't get from the above options. The others usually just access the same data a connecting client has access to. Here, you could push up things like who is winning, or who has the most items. A good example is the Dark Age of Camelot Herald stats that show the status of their RvR campaign.
The disadvantage is that you need to be able to change code on the game server. If you're trying to monitor someone else's server, then you don't have that option.
Well, there ya go. Those were my thoughts on how you could accomplish what you want. Perhaps others will come up with some more methods, or improvements on my own. If you have any other questions, feel free to ask.
- LightWave Dave
07/11/2002 (8:44 am)
Greetings!Hey Alex, thanks for the plug!
Christian, I can think of a couple of ways to do what you want, depending on what it is you wish to accomplish. Based on your question, I'm not sure which would suit you best, so here's all of them:
Get Server Info on Demand
This is what I do with my GG Master Server Monitor. When the user opens the web page, it triggers a Perl script. This script opens a socket to the server(s) and based on the protocol of the server(s) is able to retrieve the information it needs. The script pretends that it is a game client, and has access to that type of information (game name, number of players, etc). The script then produces some HTML output to show the stats. You could probably do the same thing with PHP, although I'm certainly not a PHP expert.
The advantage of this is you can do it without needing to change code within the server you are monitoring, and can implement it on a web server that you do not have shell access to ie: do it just with available web technologies. The disadvantage is that the game server is polled everytime the web page is accessed, but not any more than the game itself would poll the servers.
Get Server Info Periodically
You would have a program that would periodically access the servers for the appropriate stats, and store this information in a database on the web server. Whenever a user requests the information from a web page, the database is accessed. This would require a program to run either on the Web server itself (if you have access) or on another machine that sends it to the web server.
The advantage is that your number of web page hits does not equal the same number of game server polls. eg: Poll the game server every five minutes, while you could have 1000's of web page hits per hour. The other advantage is that you can do this without needing to change any code on the game servers you are monitoring.
The disadvantage is that you need to have direct shell access to the web server to have your polling program run in the background, or have a separate machine that you own do the polling and push it up to the web server.
Game Server Sends Statistics to Web Server
In this scenario, you would engineer the game servers to periodically send their statistics to a database on the web server. Whenever a user requests the information from a web page, the database is accessed.
The advantage is that you have full control over what and when the game servers send their stats. You could pump out all kinds of information that you just can't get from the above options. The others usually just access the same data a connecting client has access to. Here, you could push up things like who is winning, or who has the most items. A good example is the Dark Age of Camelot Herald stats that show the status of their RvR campaign.
The disadvantage is that you need to be able to change code on the game server. If you're trying to monitor someone else's server, then you don't have that option.
Well, there ya go. Those were my thoughts on how you could accomplish what you want. Perhaps others will come up with some more methods, or improvements on my own. If you have any other questions, feel free to ask.
- LightWave Dave
Alex "IkoTikashi" Zappe
so here we go: qstat can be found at www.qstat.org/
as for the phpquery-script: didn't find it ! ;(
you might also want to take a look at David "Fulcrum" Wyand's Online GG Master Server Monitor Thread