Posts: 163
Threads: 16
Thanks Received:
0 in 0 posts
Thanks Given: 0
Joined: Sep 2011
Reputation:
0
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
Is your server a ep 1 or ep2 ?
Easy to do this with PHP.
I write something later.
Posts: 88
Threads: 15
Thanks Received:
0 in 0 posts
Thanks Given: 0
Joined: May 2011
Reputation:
0
$ServerIP = "SERVER IP HERE";
$ServerPort = "4110";
$Sockres = @FSockOpen($ServerIP, $ServerPort, $errno, $errstr, 1);
if (!$Sockres) {
$Count = 0;
$Status = "Offline";
}
else {
@FClose($Sockres);
$Status = "Online";
}
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
Posts: 163
Threads: 16
Thanks Received:
0 in 0 posts
Thanks Given: 0
Joined: Sep 2011
Reputation:
0
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
this does not work for me
It is not the full code.
Posts: 88
Threads: 15
Thanks Received:
0 in 0 posts
Thanks Given: 0
Joined: May 2011
Reputation:
0
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
";
?>
Posts: 163
Threads: 16
Thanks Received:
0 in 0 posts
Thanks Given: 0
Joined: Sep 2011
Reputation:
0
Nice but I only need the severstatus how can I delete all the other stuff?