LCKB
Server Status shower - Printable Version

+- LCKB (https://lckb.dev/forum)
+-- Forum: ** OLD LCKB DATABASE ** (https://lckb.dev/forum/forumdisplay.php?fid=109)
+--- Forum: Off-Topic (The Outer World) (https://lckb.dev/forum/forumdisplay.php?fid=198)
+---- Forum: General Discussion (https://lckb.dev/forum/forumdisplay.php?fid=147)
+---- Thread: Server Status shower (/showthread.php?tid=251)

Pages: 1 2


- Darquise - 10-11-2011


I need a php programm that shows my user the serverstatus(if the login/gameserver is online or offline)

they only have to stand if the gameserver/loginserver is online:

gameserver:

online

loginserver:

online

And if an server is offline there should stand offline of course and the color in red.

 

I hope someone cane make this.

 

Thanks a lot

 

peace




- MonarC - 10-11-2011

Is your server a ep 1 or ep2 ?




- Jackster - 10-11-2011


Easy to do this with PHP.

 

I write something later.




- BashVendetta - 10-11-2011


$ServerIP = "SERVER IP HERE";

$ServerPort = "4110";

$Sockres = @FSockOpen($ServerIP, $ServerPort, $errno, $errstr, 1);

if (!$Sockres) {

$Count = 0;

$Status = "Offline";

}

else {

@FClose($Sockres);

$Status = "Online";

}




- Darquise - 10-12-2011

I use ep2




- joken - 10-12-2011


Hey,

 

i wrote a small Server Start+Stop Tool - and a upload function (uploads a textfile on your webspace with Login/Game-Server Status), is that enough? Ill publish it then.

 

Cheers




- Darquise - 10-12-2011


aSH' date=' post: 10848"']$ServerIP = "SERVER IP HERE"; $ServerPort = "4110";

$Sockres = @FSockOpen($ServerIP, $ServerPort, $errno, $errstr, 1);

if (!$Sockres) {

$Count = 0;

$Status = "Offline";

}

else {

@FClose($Sockres);

$Status = "Online";

}

 

this does not work for me




- Jackster - 10-12-2011


this does not work for me
 

It is not the full code.




- BashVendetta - 10-13-2011


Here is the exact coding I use for Server Status, Users Online, Accounts Created, also a small rates part as well and Castle Owner reader.

 

NOTE: I have done a db cleanup I no longer have newproject_db_auth as I have merged it to be more organised with coding, I also wont release the sql dump due to customised tables etc for security.

 

<?

$CountOnlineUsersQuery = MySQL_Query("SELECT a_zone_num FROM t_users WHERE a_zone_num > -1");

$CountUsers = Mysql_Num_Rows($CountOnlineUsersQuery);

$CountAccounts = 0;

$CountAccountsQuery = Mysql_Query("SELECT * from bg_user");

WHILE ($AccountRows = MySQL_Fetch_Array($CountAccountsQuery)) {

$CountAccounts++;

}

$ServerIP = "PUT SERVER IP HERE";

$ServerPort = "4110";

$Sockres = @FSockOpen($ServerIP, $ServerPort, $errno, $errstr, 1);

if (!$Sockres) {

$Status = "Offline";

}

else {

@FClose($Sockres);

$Status = "Online";

}

echo"

Server Status: $Status

 

Users Online: $CountUsers

 

Accounts: $CountAccounts

 

 

";

$GetMeracCastleOwnerQuery = Mysql_Query("SELECT a_owner_guild_name FROM t_castle WHERE a_zone_index = 7");

$GetMeracCastleOwnerFetch = Mysql_Fetch_Array($GetMeracCastleOwnerQuery);

$MeracOwner = $GetMeracCastleOwnerFetch[a_owner_guild_name];

$GetDratanCastleOwnerQuery = Mysql_Query("SELECT a_owner_guild_name FROM t_castle WHERE a_zone_index = 4");

$GetDratanCastleOwnerFetch = Mysql_Fetch_Array($GetDratanCastleOwnerQuery);

$DratanOwner = $GetDratanCastleOwnerFetch[a_owner_guild_name];

IF ($MeracOwner == NULL) {

$MeracOwner = "NO GUILD";

}

IF ($DratanOwner == NULL) {

$DratanOwner = "NO GUILD";

}

echo"

Merac Owner: $MeracOwner

 

Dratan Owner: $DratanOwner

 

 

 

Rates:

 

Exp: x1

 

SP: x1

 

Drop: x1

 

Gold: x1

";

?>




- Darquise - 10-15-2011

Nice but I only need the severstatus how can I delete all the other stuff?