From a02229631cd773f7980322901e97a2e1dfdd7638 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Fri, 25 Dec 2020 02:48:00 -0600 Subject: [PATCH] Change getClientData to getPlayerData --- scripts/server/keybind.js | 16 ++++++++-------- scripts/server/messaging.js | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/server/keybind.js b/scripts/server/keybind.js index 359e5f64..6121daa8 100644 --- a/scripts/server/keybind.js +++ b/scripts/server/keybind.js @@ -190,14 +190,14 @@ function removeKeyBindCommand(command, params, client) { function addPlayerKeyBind(client, keyId, tempCommand, tempParams) { let keyBindData = new serverClasses.keyBindData(keyId, `${tempCommand} ${tempParams}`); - getClientData(client).accountData.keyBinds.push(keyBindData); + getPlayerData(client).accountData.keyBinds.push(keyBindData); sendAccountKeyBindToClient(client, getPlayerKeyBindForKey(client, keyId)); } // --------------------------------------------------------------------------- function removePlayerKeyBind(client, keyId) { - quickDatabaseQuery(`DELETE FROM acct_hotkey WHERE acct_hotkey_acct = ${getClientData(client).accountData.databaseId} AND acct_hotkey_key = ${keyId}`); + quickDatabaseQuery(`DELETE FROM acct_hotkey WHERE acct_hotkey_acct = ${getPlayerData(client).accountData.databaseId} AND acct_hotkey_key = ${keyId}`); for(let i in accountKeyBinds) { if(accountKeyBinds[i].key == keyId) { accountKeyBinds.splice(i, 1); @@ -209,7 +209,7 @@ function removePlayerKeyBind(client, keyId) { // --------------------------------------------------------------------------- function doesPlayerHaveKeyBindForCommand(client, command) { - let accountKeyBinds = getClientData(client).accountData.keyBinds; + let accountKeyBinds = getPlayerData(client).accountData.keyBinds; for(let i in accountKeyBinds) { if(toLowerCase(accountKeyBinds[i].commandString.split(" ")[0]) == toLowerCase(command)) { return true; @@ -221,7 +221,7 @@ function doesPlayerHaveKeyBindForCommand(client, command) { // --------------------------------------------------------------------------- function getPlayerKeyBindForCommand(client, command) { - let accountKeyBinds = getClientData(client).accountData.keyBinds; + let accountKeyBinds = getPlayerData(client).accountData.keyBinds; for(let i in accountKeyBinds) { if(toLowerCase(accountKeyBinds[i].commandString.split(" ")[0]) == toLowerCase(command)) { return accountKeyBinds[i]; @@ -233,7 +233,7 @@ function getPlayerKeyBindForCommand(client, command) { // --------------------------------------------------------------------------- function doesPlayerHaveKeyBindForKey(client, key) { - let accountKeyBinds = getClientData(client).accountData.keyBinds; + let accountKeyBinds = getPlayerData(client).accountData.keyBinds; for(let i in accountKeyBinds) { if(accountKeyBinds[i].key == key) { return true; @@ -245,7 +245,7 @@ function doesPlayerHaveKeyBindForKey(client, key) { // --------------------------------------------------------------------------- function getPlayerKeyBindForKey(client, key) { - let accountKeyBinds = getClientData(client).accountData.keyBinds; + let accountKeyBinds = getPlayerData(client).accountData.keyBinds; for(let i in accountKeyBinds) { if(accountKeyBinds[i].key == key) { return accountKeyBinds[i]; @@ -277,8 +277,8 @@ addNetworkHandler("ag.keybind.trig", playerUsedKeyBind); // --------------------------------------------------------------------------- function sendAccountKeyBindsToClient(client) { - for(let i in getClientData(client).accountData.keyBinds) { - sendAccountKeyBindToClient(client, getClientData(client).accountData.keyBinds[i].key, getClientData(client).accountData.keyBinds[i].keyState); + for(let i in getPlayerData(client).accountData.keyBinds) { + sendAccountKeyBindToClient(client, getPlayerData(client).accountData.keyBinds[i].key, getPlayerData(client).accountData.keyBinds[i].keyState); } } diff --git a/scripts/server/messaging.js b/scripts/server/messaging.js index 1496f889..f506f1ca 100644 --- a/scripts/server/messaging.js +++ b/scripts/server/messaging.js @@ -180,7 +180,7 @@ function messageClientClanChat(client, clanChattingClient, messageText) { // --------------------------------------------------------------------------- function messageClientAdminChat(client, adminChattingClient, messageText) { - messageClientNormal(client, `[ADMIN CHAT] [#AAAAAA]${getClientData(adminChattingClient).accountData.staffTitle} [#CCCCCC]${getClientData(adminChattingClient).accountData.name}: [#FFFFFF]${messageText}`, getColourByType("orange")); + messageClientNormal(client, `[ADMIN CHAT] [#AAAAAA]${getPlayerData(adminChattingClient).accountData.staffTitle} [#CCCCCC]${getPlayerData(adminChattingClient).accountData.name}: [#FFFFFF]${messageText}`, getColourByType("orange")); } // --------------------------------------------------------------------------- \ No newline at end of file