Rename some utils to align with code style

This commit is contained in:
Vortrex
2022-04-23 15:13:34 -05:00
parent b355c2093f
commit 56bae04e0f
5 changed files with 44 additions and 27 deletions

View File

@@ -60,7 +60,13 @@ function onPlayerJoin(event, client) {
fadeCamera(client, true, 1.0);
}
messageDiscordEventChannel(`👋 ${getPlayerName(client)} is connecting to the server ...`);
let messageText = `👋 ${getPlayerName(client)} is connecting to the server ...`;
messageDiscordEventChannel(messageText);
for(let i in clients) {
messagePlayerNormal(clients[i], getLocaleString(clients[i], "PlayerConnecting"));
}
//messageDiscordEventChannel(`👋 ${getPlayerDisplayForConsole(client)} has joined the server.`);
}
@@ -97,19 +103,18 @@ function onPlayerQuit(event, client, quitReasonId) {
logToConsole(LOG_INFO, `👋 Client ${getPlayerDisplayForConsole(client)} disconnected (${disconnectReasons[quitReasonId]}[${quitReasonId}])`);
updateConnectionLogOnQuit(client, quitReasonId);
let reasonText = disconnectReasons[quitReasonId];
if(getPlayerData(client).customDisconnectReason != "") {
reasonText = getPlayerData(client).customDisconnectReason;
}
messageDiscordEventChannel(`👋 ${getPlayerName(client)} has left the server (${reasonText})`);
messagePlayerNormal(null, `👋 ${getPlayerName(client)} has left the server (${reasonText})`, getColourByName("softYellow"));
if(isPlayerLoggedIn(client)) {
let reasonText = disconnectReasons[quitReasonId];
if(getPlayerData(client).customDisconnectReason != "") {
reasonText = getPlayerData(client).customDisconnectReason;
}
messagePlayerNormal(null, `👋 ${getPlayerName(client)} has left the server (${reasonText})`, getColourByName("softYellow"));
messageDiscordEventChannel(`👋 ${getPlayerName(client)} has left the server (${reasonText})`);
savePlayerToDatabase(client);
resetClientStuff(client);
getServerData().clients[getPlayerId(client)] = null;
} else {
messageDiscordEventChannel(`👋 ${getPlayerName(client)} has left the server (${disconnectReasons[quitReasonId]}[${quitReasonId}])`);
}
clearTemporaryVehicles();