MinecraftCheck - Check Minecraft.net status Version: 0.7 Download: MinecraftCheck-0_7.zip Source: MinecraftCheck-0_7-src.zip All: MinecraftCheck This plugin checks the entire Player authentication process to ensure that no part of it fails. It then fires a custom MinecraftStatusEvent allowing any other plugin to receive notifications when the minecraft.net authentication stuff breaks. For now, in addition to firing its custom event, this plugin broadcasts a configurable message to the server. In the near future, I will release a series of companion plugins that will add additional functionality, like enabling/disabling specific plugins when minecraft is up/down, and broadcasting messages to the server. Note that this plugin uses an active username/password. This username/password is stored in plaintext, and only ever sent to the login.minecraft server. This plugin is open source so that you can verify this for yourself. While a valid username/password is not required, I cannot guarantee that this plugin will function properly (although it should). I have yet to do extensive testing in this regard, as minecraft.net has yet to go down. Configuring: Code: #Enter a valid username and password so that the login/auth process can be stepped through completely #Delay controls how long between checks. This value is in ticks, where 1 tick ~ 1/20 seconds username: 'YourUsername' password: 'YourPassword' delay: 6000 #Five Minutes #You can use "&colorcode" to colorize your message #You can use "%m" to insert an error message in your message (eg Server returned HTTP response code: 500 for URL: https://login.minecraft.net/) #Note that the message when minecraft.net comes back up is always "Unspecified" downmessage: '&4minecraft.net has gone down! %m' upmessage: '&10minecraft.net is back up! The above is the default config file (Should be bukkitroot/plugins/MinecraftCheck/config.yml) The username and password fields are for a valid Minecraft Username and Password. As mentioned before, the password is only sent to login.minecraft.net. Any suggestions are more than welcome.
Wow, this looks (sadly) very useful... Looking at the server stability atm that's worth alot. Just a question: Does the provided username + password needs to be a premium account?
Yes, it will, as it needs to pass the Beta Auth test (Which requires a premium account). An account MIGHT not be necessary, as I still check the joinserver.jsp and the checkserver.jsp scripts, however they may not error when provided with incorrect information, but may error when provided with real info.
is that run in a timer it's not really a good idea, because if 100, 500 or same 1000 players/servers gona use that, it will contribute to overflow the minecraft.net of useless requests then private 1000 players ot etc... enter in the game. but im not exactly how that work or you coded that.
I use the Bukkit Scheduler to schedule an asynchronous repeating event. The delay between checks is configurable (Default is 5 minutes) and I don't think that the increase in load caused by this plugin will be terribly dramatic.
Very interesting, I could definitely use your custom event to relay the up/down status to IRC (using my plugin, ServerIRC)
No, they're called Imagineers Also, to anyone who happens to be following this, today I'm going to start work on the compainion plugin(s)
I'm splitting out the plugin that does stuff when the minecraft.net server changes status from the plugin that fires the MinecraftStatusEvent. That way players aren't forced to load more than they need
Curse my poor memory and the fact that I can't spell things Tried this on b441,seems like its working flawlessly. Thanks!
When I manually firewall mc.net to test your code, I get ConnectExceptions, can you catch these? Code: 2011-03-01 02:22:12 [SEVERE] java.net.ConnectException: Connection timed out 2011-03-01 02:22:12 [SEVERE] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 2011-03-01 02:22:12 [SEVERE] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) 2011-03-01 02:22:12 [SEVERE] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 2011-03-01 02:22:12 [SEVERE] at java.lang.reflect.Constructor.newInstance(Constructor.java:532) 2011-03-01 02:22:12 [SEVERE] at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1458) 2011-03-01 02:22:12 [SEVERE] at java.security.AccessController.doPrivileged(Native Method) 2011-03-01 02:22:12 [SEVERE] at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1452) 2011-03-01 02:22:12 [SEVERE] at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1106) 2011-03-01 02:22:12 [SEVERE] at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:397) 2011-03-01 02:22:12 [SEVERE] at com.amagineer.bukkit.minecraftchecker.MinecraftChecker.httpGet(MinecraftChecker.java:123) 2011-03-01 02:22:12 [SEVERE] at com.amagineer.bukkit.minecraftchecker.MinecraftChecker.run(MinecraftChecker.java:69) 2011-03-01 02:22:12 [SEVERE] at org.bukkit.craftbukkit.scheduler.CraftWorker.run(CraftWorker.java:33) 2011-03-01 02:22:12 [SEVERE] at java.lang.Thread.run(Thread.java:636) 2011-03-01 02:22:12 [SEVERE] Caused by: java.net.ConnectException: Connection timed out 2011-03-01 02:22:12 [SEVERE] at java.net.PlainSocketImpl.socketConnect(Native Method) 2011-03-01 02:22:12 [SEVERE] at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:310) 2011-03-01 02:22:12 [SEVERE] at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:176) 2011-03-01 02:22:12 [SEVERE] at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:163) 2011-03-01 02:22:12 [SEVERE] at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384) 2011-03-01 02:22:12 [SEVERE] at java.net.Socket.connect(Socket.java:546) 2011-03-01 02:22:12 [SEVERE] at java.net.Socket.connect(Socket.java:495) 2011-03-01 02:22:12 [SEVERE] at sun.net.NetworkClient.doConnect(NetworkClient.java:178) 2011-03-01 02:22:12 [SEVERE] at sun.net.www.http.HttpClient.openServer(HttpClient.java:409) 2011-03-01 02:22:12 [SEVERE] at sun.net.www.http.HttpClient.openServer(HttpClient.java:530) 2011-03-01 02:22:12 [SEVERE] at sun.net.www.http.HttpClient.<init>(HttpClient.java:240) 2011-03-01 02:22:12 [SEVERE] at sun.net.www.http.HttpClient.New(HttpClient.java:321) 2011-03-01 02:22:12 [SEVERE] at sun.net.www.http.HttpClient.New(HttpClient.java:338) 2011-03-01 02:22:12 [SEVERE] at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:935) 2011-03-01 02:22:12 [SEVERE] at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:876) 2011-03-01 02:22:12 [SEVERE] at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:801) 2011-03-01 02:22:12 [SEVERE] at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1139) 2011-03-01 02:22:12 [SEVERE] at com.amagineer.bukkit.minecraftchecker.MinecraftChecker.httpGet(MinecraftChecker.java:104) 2011-03-01 02:22:12 [SEVERE] ... 3 more If you're using linux, you can test it using: sudo iptables -I INPUT -s login.minecraft.net -j DROP