Differentiate between logout and crash?

Discussion in 'Plugin Development' started by emikodo, Jan 28, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    emikodo

    How would I go about differentiating between whether a player logs out of the server, or has disconnected abnormally (i.e crashing). I think it has something to do with seeing if an end of stream exception is thrown, but I don't know how I would put that into code. Any help would be appreciated.
     
  2. Offline

    Tj3

    I don't think Bukkit has any way to get the reason for disconnect. If you're using Spout (just the plugin) you could check if they sent an 0xFF (Disconnect) packet first, indicating they intentionally disconnected.
     
  3. Offline

    emikodo

    How?
     
  4. Offline

    Tj3

    I'm not entirely sure, I've never used the packet manager (or most Spout features), although I know you can watch for and control incoming and outgoing packets. (See the plugin VanishNoPacket, it blocks packets via Spout) Although the vanilla client knows it, and bukkit knows internally, the best way to go would be to add this to Bukkit. I'll look into writing the code for it and submitting a pull-request later. :)
     
  5. Offline

    Milkywayz

Thread Status:
Not open for further replies.

Share This Page