Lunarpages Web Hosting Forum

Author Topic: HLStats - Is it possible to run it?  (Read 1315 times)

Offline Xioustic

  • Newbie
  • *
  • Posts: 4
    • http://www.xioustic.com/
HLStats - Is it possible to run it?
« on: August 24, 2004, 06:52:33 PM »
I've had a ticket open and have been discussing with support how to get this script running. We're still not sure how.

HLStats is pretty simple in essence. HLStats stands for Half-Life Stats, and keeps track of all the players and their scores on Half-Life game servers. This works with several games, including Natural Selection and Counter-Strike, both Half-Life engine based games/mods. The website is http://www.hlstats.org/

HLStats works as follows as far as I know: First, it sets up a large mySQL table to keep track of players and kills and deaths and scores, etc. This table is displayed all pretty-like via the hlstats.php file. Everyone has access to this file and can see their score and rank compared to other players.

However, in order to receive these stats, the servers that the script is collecting stats from connects to hlstats.pl (a file that nobody can access except the server itself). hlstats.pl is normally run in the background, leaving port 27025 or something similar open listening for specified servers.

Now this poses a problem. Because we are hosted at LunarPages, we cannot run perl scripts in the background, especially ones that leave ports open. I completely understand this. However, I've searched this forum and found another post about the same problem (search the forums for the string hlstats).

That thread and a response from a support tech (Steven Priest) pointed to this solution: "You could run this via a cron job or on demand via a link on your webpage".

Now for this all to connect, the half-life server runs a command that dumps the log to the server at a specified time, usually midnight server-time. This log command connects to the web host IP address at the specified port and dumps it all into hlstats.pl. This hlstats.pl parses the log file into kills and deaths, and does a bit of math, and updates the tables.

I am wondering how it would be possible to run this through a cron job, or an on demand link...?

I would imagine someone else has encountered this problem and would be absolutely thrilled if I could get this script working on my LunarPages account. Perhaps there would be a way to edit the script or something?

Offline Xioustic

  • Newbie
  • *
  • Posts: 4
    • http://www.xioustic.com/
HLStats - Is it possible to run it?
« Reply #1 on: August 24, 2004, 06:57:40 PM »
Now normally, HLStats requires one to have shell access and to be able to run hlstats.pl using a command such as:
Quote
shell> nohup ./hlstats.pl &

or
Quote
shell> while true; do nohup ./hlstats.pl; sleep 5; done &


However, this cannot be the case with LunarPages because they do not allow such a script or shell access.

The command on the Half-Life server that sends the log to the webserver looks like such:
Quote
log on
logaddress 216.54.23.98 27500


I'm hoping someone has a solution........ :-?