From 097fe071043decb3a41a513ae4d96c15db98825d Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Fri, 25 Dec 2020 22:49:50 -0600 Subject: [PATCH] Add get char full name util --- scripts/server/subaccount.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/server/subaccount.js b/scripts/server/subaccount.js index b39b85f5..fdc1822a 100644 --- a/scripts/server/subaccount.js +++ b/scripts/server/subaccount.js @@ -9,8 +9,8 @@ // =========================================================================== function initSubAccountScript() { - console.log("[Asshat.SubAccount]: Initializing account script ..."); - console.log("[Asshat.SubAccount]: Account script initialized!"); + console.log("[Asshat.SubAccount]: Initializing subaccount script ..."); + console.log("[Asshat.SubAccount]: SubAccount script initialized!"); } // --------------------------------------------------------------------------- @@ -254,6 +254,7 @@ function selectCharacter(client, characterId = -1) { setPlayerVirtualWorld(client, tempSubAccount.dimension); }, client.ping+1000); } + addNetworkHandler("ag.selectCharacter", selectCharacter); // --------------------------------------------------------------------------- @@ -313,7 +314,13 @@ function getPlayerLastUsedSubAccount(client) { // --------------------------------------------------------------------------- function transferCharacterToServer(subAccountDatabaseId, newServerId) { - quickDatabaseQuery(`UPDATE sacct_main SET sacct_server = ${newServerId}, sacct_needs_setup = 1 WHERE sacct_id = ${subAccountDatabaseId} LIMIT 1;`); + quickDatabaseQuery(`UPDATE sacct_main SET sacct_server = ${newServerId}, sacct_skin = ${getConfigForServer(newServerId).newCharacter.skin} WHERE sacct_id = ${subAccountDatabaseId} LIMIT 1;`); +} + +// --------------------------------------------------------------------------- + +function getCharacterFullName(client) { + return `${getClientCurrentSubAccount(client).firstName} ${getClientCurrentSubAccount(client).lastName}`; } // --------------------------------------------------------------------------- \ No newline at end of file