SRCDS Steam group


Simple online/offline script?
#1
Hi,

I've got a php script that allows to start and stop my server. I'm looking for a simple "online/offline" script. Text preferred. Anyone know please?
Reply
#2
Why not try http://www.opengamepanel.org/news.php? With simple php, you are going to need ssh which is a MAJOR security issue
[Image: b_350x20_C002748-004880-FFFFFF-000000.png]
Reply
#3
pengy Wrote:Why not try http://www.opengamepanel.org/news.php? With simple php, you are going to need ssh which is a MAJOR security issue

Don't worry, it's all secured =)
Thanks
Reply
#4
Just looking for a simple script that checks the server status... here is a perfect one for teamspeak:

Code:
<?php
function check_ts($ip, $tcp, $udp, $timeout=1) { //Function for the Check
$fp = @fsockopen($ip, $tcp, $errno, $errstr, $timeout);
if (!$fp) {
  $stat = false;
} else {
  if (fgets($fp) == "[TS]\r\n") {
fputs($fp, "SEL $udp\r\n");
if (fgets($fp) == "OK\r\n") {
   $stat = true;
} else {
   $stat = false;
}
  } else {
$stat = false;
  }
  if (is_resource($fp))
@fclose($fp);
  return $stat;
}
}

if (check_ts("localhost", 51234, 8767)) { //Change IP, Query-Port and TS-Port
echo "<FONT COLOR=#00DD00><B>ONLINE</B></FONT>";
} else {
echo "<FONT COLOR=#DD0000><B>OFFLINE</B></FONT>";
}
?>

I want this but for my source server Sad
Reply
#5
http://forums.srcds.com/viewtopic/9654

If you have knowledge of PHP you should easily be able to adapt this.
~ trewq
Reply
#6
A question outof intrest:

karimali831 Wrote:I've got a php script that allows to start and stop my server.

Do you have your php plugin running on a webserver started by your own user? or does it run on the global apache that is started by www-data?

I tried writing a restart script that is activated from within php, but it failed to launch the game. So I quickly set up a rails-mongrel webserver and did the job in ruby.

Could you tell me more about the setup of your webserver etc as I'd prefer sticking to php to make an admin page as most of the the scripts are written in php to send commands to srcds servers.
Reply
#7
bennit please share this knowledge sounds like you are a coding god, us noobs would appreciate how you did it please.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)