altv-issues icon indicating copy to clipboard operation
altv-issues copied to clipboard

Add more reasons to playerDisconnect event

Open edgarasx opened this issue 3 years ago • 0 comments

Description of the problem

Currently the only reason provided to playerDisconnect event is "timed out". This doesn't really help, since it's always the same value. What if after updating the server players suddenly start to crash? We'll currently there is no way for server developer to know if they manually quit the game or crashed or lost connection to the server, except for contacting them directly and asking what happened.

Desired solution for the problem

It would be better if we had at least 4 different values:

  • "timed out" - Sudden loss of connection to client.
  • "crashed" - Client's game crashed.
  • "quit" - Client manually quit the game (Either by ESC > INFO > Exit Game, ALT+F4, F8 > typing "quit").
  • "kicked out" - Client was kicked out of the server with player.kick();

Even better if instead of a string we had an enum for simplicity and transparency:

export const enum DisconnectReason {
    TimedOut,
    Crashed,
    Quit,
    KickedOut,
}

Alternatives you considered

No response

Additional context

No response

Version

No response

edgarasx avatar Sep 23 '22 08:09 edgarasx