Differentiating Between Player Logoff and Client Crash

Discussion in 'Plugin Development' started by r0306, Apr 21, 2012.

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

    r0306

    Is there any way to check the reason for a disconnection through a PlayerQuitEvent?
     
  2. Offline

    nala3

    Idk, but if it helps, when a client crashes the console usually lists the DC reason as something like EndOfStream. But when a player actually quits, it says the reason is Quitting so there must be a way somewhere
     
  3. Offline

    r0306

    Right now, I'm trying to get the disconnect message from the console and splitting the string into parts in order to retrieve the reason but the plugin's giving me an error. :\
     
  4. Offline

    VeryBIgCorp

    What's the error?
     
  5. Offline

    sambot1115

    There is a plugin called DCReason I use that works perfectly for me. It displays a different configurable message for different log off reasons. (crashing, quitting, ect.)
     
  6. Offline

    r0306

    sambot1115
    Lol. This was 3 months ago. I have the problem fixed now. For those who would like to know how I did it, I basically added a logger handler to the server log and listened for disconnect, then got the reason for disconnect. Disconnect.quit and end.of.stream are both called when the client quits, although quit is called when the leave game button is pressed. End of stream is a bit more complicated because it can either be called when the client crashes or when the X button is pressed. I listened to the other two reasons and classified these two as logging off manually.
     
Thread Status:
Not open for further replies.

Share This Page