Add get char full name util

This commit is contained in:
Vortrex
2020-12-25 22:49:50 -06:00
parent fe67afb2b9
commit 097fe07104

View File

@@ -9,8 +9,8 @@
// =========================================================================== // ===========================================================================
function initSubAccountScript() { function initSubAccountScript() {
console.log("[Asshat.SubAccount]: Initializing account script ..."); console.log("[Asshat.SubAccount]: Initializing subaccount script ...");
console.log("[Asshat.SubAccount]: Account script initialized!"); console.log("[Asshat.SubAccount]: SubAccount script initialized!");
} }
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
@@ -254,6 +254,7 @@ function selectCharacter(client, characterId = -1) {
setPlayerVirtualWorld(client, tempSubAccount.dimension); setPlayerVirtualWorld(client, tempSubAccount.dimension);
}, client.ping+1000); }, client.ping+1000);
} }
addNetworkHandler("ag.selectCharacter", selectCharacter); addNetworkHandler("ag.selectCharacter", selectCharacter);
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
@@ -313,7 +314,13 @@ function getPlayerLastUsedSubAccount(client) {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
function transferCharacterToServer(subAccountDatabaseId, newServerId) { 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}`;
} }
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------