[INACTIVE][ADMIN/DEV] MinecraftCheck v1.0 - Check Minecraft.net Status [440]

Discussion in 'Inactive/Unsupported Plugins' started by Amagineer, Feb 27, 2011.

  1. Offline

    Amagineer

    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.
     
  2. Offline

    BigBlueGER

    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?
     
  3. Offline

    Amagineer

    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.
     
  4. Offline

    SunShe

    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.
     
  5. Offline

    Amagineer

    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.
     
  6. Offline

    Kevin

    Thanks for making this, Amagineer!
     
  7. Offline

    Dutchy

    Very interesting, I could definitely use your custom event to relay the up/down status to IRC (using my plugin, ServerIRC)
     
  8. Offline

    Amagineer

    That's exactly the kind of thing that I want everyone to do :D
     
  9. Offline

    IIGoldII

    Totally off topic,but aren't Disney Engineers called Amagineers?
    :D

    I'll try the plugin out shortly.
     
  10. Offline

    ScottSpittle

    Thanks Bro
     
  11. Offline

    Amagineer

    No, they're called Imagineers

    :p


    Also, to anyone who happens to be following this, today I'm going to start work on the compainion plugin(s)
     
  12. Offline

    ScottSpittle

    companion plugins?
     
  13. Offline

    Amagineer

    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
     
  14. Offline

    IIGoldII

    Curse my poor memory and the fact that I can't spell things :D

    Tried this on b441,seems like its working flawlessly.

    Thanks!
     
  15. Offline

    Dutchy

    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
     
  16. Offline

    Amagineer

    Whoopsies, though I nabbed timeouts. I'll fix it tomorrow, as I'm just going to bed now.
     

Share This Page