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! :))
tell me. did you changed a lot in the update from 1.5.3 to 1.6?
the get commands are not send well enough to my webserver
and after some inspections is seems that it is coming out of the plugin-code
one difference is that the "?" (in 1.5.3) at the start is send as a "%3F" (in 1.6)
by changing this back to an "?" in the course code (under "Sender.class" line 26) it works
the second difference is that the space character is not replacet anymore by the "%20",
this means thet after the space the server thinks it is the explenation of the "get-version" but actually it is part of the get and not the version
last note: i tested on bukkit-build #2813 with no plugins
21:21:28 [SEVERE] Could not load 'plugins/ServerStatus.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: me/PerwinCZ/ServerStatus/Main : Unsupported major.minor version 51.0
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:184)
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:305)
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:230)
at org.bukkit.craftbukkit.v1_6_R2.CraftServer.loadPlugins(CraftServer.java:239)
at org.bukkit.craftbukkit.v1_6_R2.CraftServer.reload(CraftServer.java:603)
at org.bukkit.Bukkit.reload(Bukkit.java:275)
at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:23)
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:189)
at org.bukkit.craftbukkit.v1_6_R2.CraftServer.dispatchCommand(CraftServer.java:523)
at org.bukkit.craftbukkit.v1_6_R2.CraftServer.dispatchServerCommand(CraftServer.java:512)
at net.minecraft.server.v1_6_R2.DedicatedServer.ar(DedicatedServer.java:262)
at net.minecraft.server.v1_6_R2.DedicatedServer.t(DedicatedServer.java:227)
at net.minecraft.server.v1_6_R2.MinecraftServer.s(MinecraftServer.java:486)
at net.minecraft.server.v1_6_R2.MinecraftServer.run(MinecraftServer.java:419)
at net.minecraft.server.v1_6_R2.ThreadServerApplication.run(SourceFile:582)
Caused by: java.lang.UnsupportedClassVersionError: me/PerwinCZ/ServerStatus/Main : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at org.bukkit.plugin.java.PluginClassLoader.findClass0(PluginClassLoader.java:80)
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:53)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:249)
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:173)
... 14 more
This plugin seems to not be displaying the online users correctly. When I'm online, it still shows 0 players online. I'm using ServerStatus v1.5.3 and Craftbukkit #2815.
[SEVERE] Error occurred while disabling ServerStatus v1.5.3 (Is it up to date?)
java.lang.ArrayIndexOutOfBoundsException: 1
at me.PerwinCZ.ServerStatus.Sender.sendData(Sender.java:46)
at me.PerwinCZ.ServerStatus.Main.onDisable(Main.java:46)
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:219)
at org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(JavaPluginLoader.java:481)
at org.bukkit.plugin.SimplePluginManager.disablePlugin(SimplePluginManager.java:400)
at org.bukkit.plugin.SimplePluginManager.disablePlugins(SimplePluginManager.java:393)
at org.bukkit.craftbukkit.v1_5_R3.CraftServer.disablePlugins(CraftServer.java:277)
at net.minecraft.server.v1_5_R3.MinecraftServer.stop(MinecraftServer.java:334)
at net.minecraft.server.v1_5_R3.MinecraftServer.run(MinecraftServer.java:441)
at net.minecraft.server.v1_5_R3.ThreadServerApplication.run(SourceFile:573)
do you main that the plugin is opening a high number port to send data to the webserver and not closing the port, so next time it is opening a new port en after some time all ports are used and it can't find a closed port ??
or do you main that the plugin is opening a high number port to send data to the webserver and then closing the port, so next time it is opening a new port because his port is already closed ??
Plugin is failing somewhat,
After guessing and trying for some time we found out that the plugin is opening sockets on each and every port it can find that is unused!
See this small part of the log:
java 6512 minecraft 444u IPv6 891935 0t0 TCP *.*.nl:57339->*.*.nl:http (CLOSE_WAIT)
java 6512 minecraft 445u IPv6 891937 0t0 TCP *.*.nl:57340->*.*.nl:http (CLOSE_WAIT)
java 6512 minecraft 446u IPv6 891939 0t0 TCP *.*.nl:57341->*.*.nl:http (CLOSE_WAIT)
java 6512 minecraft 447u IPv6 891941 0t0 TCP *.*.nl:57342->*.*.nl:http (CLOSE_WAIT)
java 6512 minecraft 448u IPv6 891943 0t0 TCP *.*.nl:57343->*.*.nl:http (CLOSE_WAIT)
Keep in mind, this is just a VERY small part of the log.
I did some additional investigation. Basically, my refresh-rate was set to 0. This is the default value. So, if you have your refresh-rate set to default value of 0, your web server will get attacked. This is obviously a bug that should be fixed. Either 0 should default to 60 seconds (or some other value) or only update when changes happen.
I changed it to 60 seconds and it seems to be following that in the web logs and my best is the Socket Timeout issue will go away now.
I wouldn't be so fast to tell someone it's not your code.
I'm getting these timeout notices in the log as well. I was really surprised to see that your hitting my web server with 20 requests PER SECOND. Flooding a server like this is like a denial of service attack and no wonder why servers are getting sick and rejecting the requests.
In all honesty, the code should be written to only update when a status changes, like someone logs in or logs out.
In response to the person upset it doesn't report the Minecraft server as being down when it's down, it's because this plugin can't run when it's down, so the last known state before going down is what you will see.
Hi, Im having trouble showing the banner on my site, what am I doing wrong, I have my site including the php file when I look in my ftp it says theres a banner.png, but when I try to grab the image using <image src="banner.png"> it wont show up. Please Help!!
I love this plugin! I use it to store all players in a database with their join date, online time etc.
Could you maybe extend this plugin with another functionality? I would really like if this plugin could catch certain /commands and send them to the server via a php file.
Zdravím :D
Mám několik otázek, (neumím moc anglicky :D) takže zda by jsi neudělal český návod ... :) a za 2 jak to rozběhat :) Díky :)
@fizzyjoe
are you en "op" ore have the permission "serverstatus.ignore" because then you will be ignored from the list
edit:
ore are in the ignore list of the config
you can check this by the server not sending "players=nobody" but "players="
@PerwinCZ
tell me. did you changed a lot in the update from 1.5.3 to 1.6?
the get commands are not send well enough to my webserver and after some inspections is seems that it is coming out of the plugin-code
one difference is that the "?" (in 1.5.3) at the start is send as a "%3F" (in 1.6) by changing this back to an "?" in the course code (under "Sender.class" line 26) it works
the second difference is that the space character is not replacet anymore by the "%20", this means thet after the space the server thinks it is the explenation of the "get-version" but actually it is part of the get and not the version
last note: i tested on bukkit-build #2813 with no plugins
Doesn't work.
21:21:28 [SEVERE] Could not load 'plugins/ServerStatus.jar' in folder 'plugins' org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: me/PerwinCZ/ServerStatus/Main : Unsupported major.minor version 51.0 at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:184) at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:305) at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:230) at org.bukkit.craftbukkit.v1_6_R2.CraftServer.loadPlugins(CraftServer.java:239) at org.bukkit.craftbukkit.v1_6_R2.CraftServer.reload(CraftServer.java:603) at org.bukkit.Bukkit.reload(Bukkit.java:275) at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:23) at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:189) at org.bukkit.craftbukkit.v1_6_R2.CraftServer.dispatchCommand(CraftServer.java:523) at org.bukkit.craftbukkit.v1_6_R2.CraftServer.dispatchServerCommand(CraftServer.java:512) at net.minecraft.server.v1_6_R2.DedicatedServer.ar(DedicatedServer.java:262) at net.minecraft.server.v1_6_R2.DedicatedServer.t(DedicatedServer.java:227) at net.minecraft.server.v1_6_R2.MinecraftServer.s(MinecraftServer.java:486) at net.minecraft.server.v1_6_R2.MinecraftServer.run(MinecraftServer.java:419) at net.minecraft.server.v1_6_R2.ThreadServerApplication.run(SourceFile:582) Caused by: java.lang.UnsupportedClassVersionError: me/PerwinCZ/ServerStatus/Main : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) at java.lang.ClassLoader.defineClass(ClassLoader.java:615) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) at java.net.URLClassLoader.access$000(URLClassLoader.java:58) at java.net.URLClassLoader$1.run(URLClassLoader.java:197) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at org.bukkit.plugin.java.PluginClassLoader.findClass0(PluginClassLoader.java:80) at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:53) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:249) at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:173) ... 14 more
This plugin seems to not be displaying the online users correctly. When I'm online, it still shows 0 players online. I'm using ServerStatus v1.5.3 and Craftbukkit #2815.
@stevenmlittle123
That isn't caused by this plugin.
@stevenmlittle123
Should be fixed in v1.6
http://i.imgur.com/EJSiJXG.png Any way to fix it?
Getting this error on the 1.5.3
[SEVERE] Error occurred while disabling ServerStatus v1.5.3 (Is it up to date?) java.lang.ArrayIndexOutOfBoundsException: 1 at me.PerwinCZ.ServerStatus.Sender.sendData(Sender.java:46) at me.PerwinCZ.ServerStatus.Main.onDisable(Main.java:46) at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:219) at org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(JavaPluginLoader.java:481) at org.bukkit.plugin.SimplePluginManager.disablePlugin(SimplePluginManager.java:400) at org.bukkit.plugin.SimplePluginManager.disablePlugins(SimplePluginManager.java:393) at org.bukkit.craftbukkit.v1_5_R3.CraftServer.disablePlugins(CraftServer.java:277) at net.minecraft.server.v1_5_R3.MinecraftServer.stop(MinecraftServer.java:334) at net.minecraft.server.v1_5_R3.MinecraftServer.run(MinecraftServer.java:441) at net.minecraft.server.v1_5_R3.ThreadServerApplication.run(SourceFile:573)
@to175
I have two options for you:
1. "connection-timeout:" is too low (make it higher)
2. "refresh-rate:" is not present or too low (the result is a "DDoS attack" on your web server, and that refuses the connection)
sorry for my bad english
I'm getting a socket error too:
> [INFO] [ServerStatus] Plugin has been reloaded!
[SEVERE] [ServerStatus] IOException: java.net.ConnectException Connexion terminée par expiration du délai d'attente
[SEVERE] [ServerStatus] IOException: java.net.ConnectException Connexion terminée par expiration du délai d'attente
[SEVERE] [ServerStatus] IOException: java.net.ConnectException Connexion terminée par expiration du délai d'attente
[SEVERE] [ServerStatus] IOException: java.net.SocketTimeoutException connect timed out
[SEVERE] [ServerStatus] IOException: java.net.SocketTimeoutException connect timed out
[SEVERE] [ServerStatus] IOException: java.net.SocketTimeoutException connect timed out
[SEVERE] [ServerStatus] IOException: java.net.ConnectException Connexion terminée par expiration du délai d'attente
[SEVERE] [ServerStatus] IOException: java.net.SocketTimeoutException connect timed out
[SEVERE] [ServerStatus] IOException: java.net.ConnectException Connexion terminée par expiration du délai d'attente
[SEVERE] [ServerStatus] IOException: java.net.SocketTimeoutException connect timed out
[SEVERE] [ServerStatus] IOException: java.net.ConnectException Connexion terminée par expiration du délai d'attente
[SEVERE] [ServerStatus] IOException: java.net.SocketTimeoutException connect timed out
[SEVERE] [ServerStatus] IOException: java.net.ConnectException Connexion terminée par expiration du délai d'attente
[SEVERE] [ServerStatus] IOException: java.net.SocketTimeoutException connect timed out
I am getting a fsocket error so its not connect to the server.
@Leoninski
do you main that the plugin is opening a high number port to send data to the webserver and not closing the port, so next time it is opening a new port en after some time all ports are used and it can't find a closed port ??
or do you main that the plugin is opening a high number port to send data to the webserver and then closing the port, so next time it is opening a new port because his port is already closed ??
sorry for my bad english!
Plugin is failing somewhat, After guessing and trying for some time we found out that the plugin is opening sockets on each and every port it can find that is unused!
See this small part of the log: java 6512 minecraft 444u IPv6 891935 0t0 TCP *.*.nl:57339->*.*.nl:http (CLOSE_WAIT) java 6512 minecraft 445u IPv6 891937 0t0 TCP *.*.nl:57340->*.*.nl:http (CLOSE_WAIT) java 6512 minecraft 446u IPv6 891939 0t0 TCP *.*.nl:57341->*.*.nl:http (CLOSE_WAIT) java 6512 minecraft 447u IPv6 891941 0t0 TCP *.*.nl:57342->*.*.nl:http (CLOSE_WAIT) java 6512 minecraft 448u IPv6 891943 0t0 TCP *.*.nl:57343->*.*.nl:http (CLOSE_WAIT)
Keep in mind, this is just a VERY small part of the log.
@PerwinCZ
I did some additional investigation. Basically, my refresh-rate was set to 0. This is the default value. So, if you have your refresh-rate set to default value of 0, your web server will get attacked. This is obviously a bug that should be fixed. Either 0 should default to 60 seconds (or some other value) or only update when changes happen.
I changed it to 60 seconds and it seems to be following that in the web logs and my best is the Socket Timeout issue will go away now.
@PerwinCZ
I have disabled the plugin until it gets fixed.
In approx. 3 hours, I have 192,129 connections to my web server from this plugin.
@PerwinCZ
I wouldn't be so fast to tell someone it's not your code.
I'm getting these timeout notices in the log as well. I was really surprised to see that your hitting my web server with 20 requests PER SECOND. Flooding a server like this is like a denial of service attack and no wonder why servers are getting sick and rejecting the requests.
In all honesty, the code should be written to only update when a status changes, like someone logs in or logs out.
In response to the person upset it doesn't report the Minecraft server as being down when it's down, it's because this plugin can't run when it's down, so the last known state before going down is what you will see.
@SureShotM
Is the .Png in the same folder as your web-page?
Hi, Im having trouble showing the banner on my site, what am I doing wrong, I have my site including the php file when I look in my ftp it says theres a banner.png, but when I try to grab the image using <image src="banner.png"> it wont show up. Please Help!!
I love this plugin! I use it to store all players in a database with their join date, online time etc.
Could you maybe extend this plugin with another functionality? I would really like if this plugin could catch certain /commands and send them to the server via a php file.
Example: - player chat input: <wazoomie>: /register 1C16 F56E - php headers: player=wazoomie&command=register&args=1C16,F56E
This would allow players to register their website account from within the game or let them redeem gift codes.