Add login timeout (60 seconds)

This commit is contained in:
Vortrex
2022-07-07 22:16:50 -05:00
parent 2587ee6cdf
commit eb582a666d
4 changed files with 65 additions and 10 deletions

View File

@@ -32,7 +32,6 @@ class ClientData {
this.index = -1;
this.connectTime = 0;
this.clientVersion = "0.0.0";
this.loginAttemptsRemaining = 3;
this.afk = false;
this.spawned = false;
this.sessionId = 0;
@@ -42,6 +41,8 @@ class ClientData {
this.passwordResetCode = "";
this.twoFactorAuthenticationState = AGRP_2FA_STATE_NONE;
this.twoFactorAuthenticationCode = 0;
this.loginTimeout = null;
this.loginAttemptsRemaining = 3;
// Job Stuff
this.jobEquipmentCache = [];
@@ -145,4 +146,37 @@ function initClientScript() {
logToConsole(LOG_DEBUG, "[VRR.Client]: Client script initialized!");
}
// ===========================================================================
function resetClientStuff(client) {
logToConsole(LOG_DEBUG, `[VRR.Utilities] Resetting client data for ${getPlayerDisplayForConsole(client)}`);
if (!getPlayerData(client)) {
return false;
}
if (isPlayerOnJobRoute(client)) {
stopJobRoute(client, false, false);
}
if (getPlayerData(client).rentingVehicle) {
stopRentingVehicle(client);
}
deleteJobItems(client);
deletePaintBallItems(client);
//deletePlayerTemporaryLockerItems(client);
getPlayerData(client).lastVehicle = null;
}
// ===========================================================================
function kickAllClients() {
getClients().forEach((client) => {
getPlayerData(client).customDisconnectReason = `Kicked - All clients are being disconnected`;
disconnectPlayer(client);
})
}
// ===========================================================================