Actual version is v1.6 intended for newest Craftbukkit versions.
Basic information
This plugin sends data to custom .PHP file on your website using GET headers. The data is information about current server status, e.g. Online/Offline, number of online players etc.
On the first start of server with this plugin the plugin creates folder ServerStatus and the configuration file. Then you have set data in config and restart the server.
In configuration file config.yml you can set useSecurityKey (true or false), your security key and full path (adress) to the .PHP file.
Security key can be any expession you want, you will need to set it only in this config.yml file and then in .PHP file. Key will be sent by plugin in GET header, and the .PHP file will check if it is equal.
Then you can set connection timeout. It means how long time give you to plugin to connect to .PHP file. (in milliseconds)
(set -1 for default timeout)
And there is a ignore list. Players in ignore list will be ignored from counting and listing players (plugin won't send them to .PHP file).
Finally you can set refresh-rate to some number of seconds. It means that the plugin will send newest information every x seconds. (set -1 for disabling periodic call)
In this .PHP file is only easy script to read data from GET headers and to write it into .TXT file. You have to set the security key and if you are good .PHP programmer, you would be able to rewrite the code to whatever you want (e.g. write data to .HTML files, to MySQL database,...).
You can choose, if you want to have banner.png or some TXT file with server status.
Banner will look like this:
List of GET headers
sec - The security key
status - Status of the server, can be Online or Offline
name - Name of the server, loaded from server-properties file
motd - Server's message of the day from server-properties file
ip - IP adress of the server, loaded from server-properties file
port - Port of server behind the IP adress, loaded from server-properties file
plsnum - Number of online players
maxnum - Maximum number of players, loaded from server-properties file
players - List of online players
log - Reason why was the URL called (It can be "Starting up Minecraft server", "Stopping Minecraft server", "Player (name) has joined the game", "Player (name) has left the game")
plversion - Contains version number of this plugin
bkversion - Contains version number of used Bukkit version
server.properties
Don't forget to set correct information (server-ip, server-port, server-name, max-players) in server's file server.properties!
Commands & Permissions
serverstatus.reload - Allows you to use /serverstatus command, which reloads the config
serverstatus.ignore - Player with this permission will be ignored from counting and listing players
Changelog
v1.6
Added option to set refresh-rate to -1 for disabling periodic call or set it to any time in seconds
Added option to set connection-timeout to -1 for default timeout or set it to any time in milliseconds
(and no kidding, now is the java.lang.NullPointerException error really fixed! :))
I just installed the plugin and created the PHP file saved in C:\XAMPP\htdocs and pointed the config file to the PHP file, but I'm receiving these messages in the console..
Finally got around that, my protection recognized the request as a bot. Also, I was running into some problems with getting the IP. So I added this function:
function getRealIpAddr() { if (!empty($_SERVER['HTTP_CLIENT_IP'])) $currrentip=$_SERVER['HTTP_CLIENT_IP']; elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) // Check if IP is passed from a proxy $currentip=$_SERVER['HTTP_X_FORWARDED_FOR']; else $currentip=$_SERVER['REMOTE_ADDR']; return $currentip;}
Don't tell me that this plugin is causing it. I will look to code where could the error be, but I don't think that this plugin is wiping files and data.
After spending a few hours trying to sort server problems, I found out that this plugin seemed to of been deleting my server.properties everytime the server was trying to boot up causing it not to boot at all.
The status 'Online' is sended if the server is online. There's just an error in my code, but it isn't necessary to release a fix update. The 'Offline' message in status variable should be sended when you stop the server. But you can create some conditions in your PHP code to write this status message.
Error code 404 means that your file was not found on this URL. So the cause can be that this file doesn't exist, missing 'www' before your address, some error with RewriteBase in .htaccess file on your webserver,... you can find more information on wikipedia.
All other information seems to be correct. I changed the ServerName in de server.properties. This solved that issue. But still I'm getting 'Offline' as Status. And the server is up and running. Where do you get the Status from. I mean, in which file is it stored?
And do you receive all other information correctly?
I am not going to release fix update. Just write Status always responding to log message. And ServerName is Unknown if it isn't set in server.properties.
@smnanthny
Are you using 1.4.7?
Hi there, I wonder if someone could help me out.
I just installed the plugin and created the PHP file saved in C:\XAMPP\htdocs and pointed the config file to the PHP file, but I'm receiving these messages in the console..
@PerwinCZ
I didn't notice I had this problem
@VOWFallen
Fixed in v1.5.1.
Got an error that crashed my server:
Finally got around that, my protection recognized the request as a bot. Also, I was running into some problems with getting the IP. So I added this function:
and then replace $ip = $_GET["ip"]; with
$ip = getRealIpAddr();
My web page keeps responding 403, what could be the problem, I've tried making the files permissions 777.
@PerwinCZ
Well I'm just going by what i have found, only happened once I installed it and also I see someone else has had a similar problem.
Edit: Remove end sentance from previous post - felt it was unneccisary and not related.
@Phyore
Don't tell me that this plugin is causing it. I will look to code where could the error be, but I don't think that this plugin is wiping files and data.
After spending a few hours trying to sort server problems, I found out that this plugin seemed to of been deleting my server.properties everytime the server was trying to boot up causing it not to boot at all.
@PerwinCZ
Thank you for explaining. I already altered the PHP code to display the correct server status. Keep up the good work.
@PerwinCZ
I have the Same problem Jacob had, my server properties have been wiped!
Edit: Just to be clear my players haven't been wiped.
Edit 2: Players ranks and permimssions wiped.
Edit 3: Also banlist was wiped...
@Tredde
The status 'Online' is sended if the server is online. There's just an error in my code, but it isn't necessary to release a fix update. The 'Offline' message in status variable should be sended when you stop the server. But you can create some conditions in your PHP code to write this status message.
@Phyore
Error code 404 means that your file was not found on this URL. So the cause can be that this file doesn't exist, missing 'www' before your address, some error with RewriteBase in .htaccess file on your webserver,... you can find more information on wikipedia.
I'm getting an error in the consle log sating it can't connect. The url is http://phycraft.co.uk/getServerStatus.php
2013-02-08 01:54:54 [SEVERE] [ServerStatus] Problems with calling URL! Called URL responded with status 404!
@PerwinCZ
Thank you for responding.
All other information seems to be correct. I changed the ServerName in de server.properties. This solved that issue. But still I'm getting 'Offline' as Status. And the server is up and running. Where do you get the Status from. I mean, in which file is it stored?
@Tredde
And do you receive all other information correctly? I am not going to release fix update. Just write Status always responding to log message. And ServerName is Unknown if it isn't set in server.properties.
Plugin is working fine. I receive all information, but not correct.
Status is always 'Offline'
Server name is 'Unknown'
I am using Bukkit version 1.4.7-R1.0
@PerwinCZ
thanks for accepting the Future request
@flo110
is this a message in the Web browser?? if so post the php file so I can see if it is good!
@Frecyboy
seems that your image is too small! use a larger picture
sorry for my bad english
-------------------------trouble setting up the web-script? forum: http://forum.gezelligeserver.hostzi.com/index.php?topic=15
I configured everything and im getting this error:
Notice: Undefined index: sec in C:\xampp\htdocs\getServerStatus.php on line 19
WAT? This plugin reset my server.properties and players.