( search forums )
How get server status show on a site?
Soldat Forums - Server Talk - Server discussion
Ken the Great
September 29, 2005, 6:55 pm
Hey, I wonder how you get it to say on a site that if ur (clan) server is up or not.
Like, if the server is down, the text says something like 'blabla Server is down at the moment' and when it is up 'blabla Server is up at the moment (and maybe: click here to join)' Also it would be nice if you could somehow display a bit stats about it, like players, gamemode and so on...

If I'm posting in wrong topic blame me and move it to the right.. ;)

Thanks for future help. :-)

-[ETA] Ken the Great

FliesLikeABrick
September 29, 2005, 8:16 pm
the u13sss stats package has the scripts to do this. There was also something else that someone released that was specifically to do this.

The next release of U13SSS, release 5, will have better scripts for this, but i'm not sure when it'll be out

PureGrain
September 29, 2005, 9:19 pm
Soldat Status is a simple script that will do this in PHP on your site.

www.soldatserver.com

:)

Ken the Great
September 30, 2005, 3:58 pm
okay thank you guys ^.^

mar77a
September 30, 2005, 10:57 pm
There is another way of retrieving the status in PHP.

<?

$ip = "24.24.24.24";
$port = "23073";

$f = file_get_contents("http://$ip:$port/");

if(!$f){

echo "Offline";

}else{

echo "Online";

}

?>

This should work if im not wrong.


FliesLikeABrick
October 1, 2005, 12:42 am
mar77a, that only works if they have the tcp opened for tcp as well, not all servers do

that is why you can't always use fsockopen with tcp to tell if the server is up

PureGrain
October 1, 2005, 2:02 pm
The script I wrote is very simple, and it adds the additional 10 to the port number to ping. Not the best way to do it but it works. :P

Ken the Great
October 3, 2005, 12:03 pm
umm, I can't get the script to work... I uploaded the soldat_status folder to my webhost and added those lines to the site, but they are just showing as plain text, when it was .htm. I tried with a php program too but it did just show the first entry as plain text, the second was invicible, in .php.

this is how the .php looks inside:


[code]include ("soldat_status/server.php");
<html>

<head>
<title></title>
</head>

<body>

<?php


echo ("$status");

?>

</body>

</html>[/code]

I'm almost sure I have in my low knowledge of php wrote something wrong, but I don't know what. Could someone help me? =)

-Ken the Great

FliesLikeABrick
October 3, 2005, 12:08 pm
are yo usure your webserver supports php?

PureGrain
October 3, 2005, 12:30 pm
quote:Originally posted by FliesLikeABrickare yo usure your webserver supports php?
That is what I am thinking.

Deleted User
October 3, 2005, 12:35 pm
You need to put 'include ("soldat_status/server.php");' inside the <?php ?> tags aswell :)

Ken the Great
October 3, 2005, 1:14 pm
it should.. I can't get on it right now but as far as I remember it supports php...


www.cjb.cc is the webhost

FliesLikeABrick
October 3, 2005, 2:54 pm
yeah, that host does support php, i missed what php had said:

and yeah, enesce is right, you need to move the include() line to inside the php.