Add some debug logging
This commit is contained in:
@@ -1169,28 +1169,41 @@ function savePlayerToDatabase(client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initClient(client) {
|
function initClient(client) {
|
||||||
|
logToConsole(LOG_DEBUG, `[VRR.Account] Initializing client ${getPlayerDisplayForConsole(client)} ...`);
|
||||||
|
|
||||||
if(isConsole(client)) {
|
if(isConsole(client)) {
|
||||||
|
logToConsole(LOG_DEBUG|LOG_ERROR, `[VRR.Account] Client initialization failed for ${getPlayerDisplayForConsole(client)}! (is console client)`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doesEntityDataExist(client, "vrr.isInitialized") || getEntityData(client, "vrr.isInitialized") == true) {
|
logToConsole(LOG_DEBUG, `[VRR.Account] Initializing client ${getPlayerDisplayForConsole(client)} ...`);
|
||||||
|
|
||||||
|
if(playerInitialized[client.index] == true) {
|
||||||
|
logToConsole(LOG_DEBUG|LOG_ERROR, `[VRR.Account] Client initialization failed for ${getPlayerDisplayForConsole(client)}! (already initialized)`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
setEntityData(client, "vrr.isInitialized", true, false);
|
setEntityData(client, "vrr.isInitialized", true, false);
|
||||||
|
|
||||||
sendPlayerGUIColours(client);
|
sendPlayerGUIColours(client);
|
||||||
|
|
||||||
|
logToConsole(LOG_DEBUG, `[VRR.Account] Initializing GUI for ${getPlayerDisplayForConsole(client)} ...`);
|
||||||
sendPlayerGUIInit(client);
|
sendPlayerGUIInit(client);
|
||||||
updatePlayerSnowState(client);
|
updatePlayerSnowState(client);
|
||||||
|
|
||||||
|
logToConsole(LOG_DEBUG, `[VRR.Account] Showing connect camera to ${getPlayerDisplayForConsole(client)} ...`);
|
||||||
showConnectCameraToPlayer(client);
|
showConnectCameraToPlayer(client);
|
||||||
|
|
||||||
messageClient(`Please wait ...`, client, getColourByName("softGreen"));
|
messageClient(`Please wait ...`, client, getColourByName("softGreen"));
|
||||||
|
|
||||||
|
logToConsole(LOG_DEBUG, `[VRR.Account] Waiting for 2.5 seconds to prevent race attack ...`);
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
if(client != null) {
|
if(client != null) {
|
||||||
clearChatBox(client);
|
clearChatBox(client);
|
||||||
|
logToConsole(LOG_DEBUG, `[VRR.Account] Loading account for ${getPlayerDisplayForConsole(client)}`);
|
||||||
let tempAccountData = loadAccountFromName(getPlayerName(client), true);
|
let tempAccountData = loadAccountFromName(getPlayerName(client), true);
|
||||||
|
|
||||||
|
logToConsole(LOG_DEBUG, `[VRR.Account] Loading subaccounts for ${getPlayerDisplayForConsole(client)}`);
|
||||||
let tempSubAccounts = loadSubAccountsFromAccount(tempAccountData.databaseId);
|
let tempSubAccounts = loadSubAccountsFromAccount(tempAccountData.databaseId);
|
||||||
|
|
||||||
getServerData().clients[getPlayerId(client)] = new ClientData(client, tempAccountData, tempSubAccounts);
|
getServerData().clients[getPlayerId(client)] = new ClientData(client, tempAccountData, tempSubAccounts);
|
||||||
|
|||||||
Reference in New Issue
Block a user