1. Guest, as per the stickied thread, this forum has not been in use since 2014. All bugs and feature requests should be posted to JIRA.

Accepted Get Disconnect Reason

Discussion in 'Bugs & Feature Requests' started by soliddanii, Jun 22, 2013.

Thread Status:
Not open for further replies.
  1. Hello. I'm the Administrator of a server:confused: , and I have made 2 plugins. One of the plugins is to detect players that disconnect while on pvp, and to punish them.
    The plugin its already finished. It stores the pvping players in a list during a given amount of seconds, and if the player disconnects while in the list, the plugin advices the server that the person is not playing fair. It also has a option to punish this players dropping all the inventory to the ground on disconnect.

    So the feature is: Bukkit does not have a method to get the reason of a disconnect (quitting, endOfStream, generic, unknown....) aside from the method in PlayerQuitEvent that only return the normal: "player" left the game o_O.
    I currently get it reading from the last 2 lines of the log file, but clearly I want a more efficient and direct method. So.. could you please add it to spigot? It is very important for my plugin because I need to detect IF possible the chances of the player loosing the connection, or doing it on purpose.

    Thanks a lot! :D
    • Agree Agree x 1
  2. well anyway you can make "genericReason" by just closing the client with [x] instead of quit button.
  3. if you close the client with [x] you get a endOfStream reason.
  4. joehot200


    If you press the [x] button on the client it takes about 10 seconds before the server says "hey, this guy isnt sending us packets any more, lets disconnect him!". This means that pressing the X button in a PVPLog situation wont work, as against a non-fighting-back enemy, 10 seconds is all you need to kill someone.
  5. It does not take so long, the server logs the reason almost instantlu. But anyway thats the reason why I'm asking for the feature, The server gets exactly when the player disconnects with the playerquitevent and if it was during a pvp with my plugin. I dont care evaluating if it was on purpose or not 1, 3, or 10 seconds later. Thats why I need the feature. Reading from the log is more expensive.
  6. looks like it depends of situation. I just closed it and after a second got
    "19:49:27 [INFO] rsod lost connection: disconnect.genericReason"
  7. It is easy for a client to fake generic disconnect.
  8. I know you can get various reasons when you press [X], but you always get quitting, when using the disconnect button. Then I can punish that players, and let the mods decide about the others, with the plugin advicing if it could be on purpose (for example with the number of hearts he had left.. and more stats...).
  9. joehot200


    md_5 has added this post as "accepted", this means it will be on his TODO list.
    • Agree Agree x 1
    • Useful Useful x 1
  10. @md_5 This feature request is still open, could you implement it?
Thread Status:
Not open for further replies.