Send job labels and keybinds on login
This commit is contained in:
@@ -436,8 +436,10 @@ function loginSuccess(client) {
|
|||||||
sendRemovedWorldObjectsToPlayer(client);
|
sendRemovedWorldObjectsToPlayer(client);
|
||||||
sendAllBusinessLabelsToPlayer(client);
|
sendAllBusinessLabelsToPlayer(client);
|
||||||
sendAllHouseLabelsToPlayer(client);
|
sendAllHouseLabelsToPlayer(client);
|
||||||
|
sendAllJobLabelsToPlayer(client);
|
||||||
|
sendAccountKeyBindsToClient(client);
|
||||||
|
|
||||||
message(`👋 ${client.name} has joined the server`, getColourByName("softYellow"));
|
//message(`👋 ${client.name} has joined the server`, getColourByName("softYellow"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
@@ -727,14 +729,16 @@ function savePlayerToDatabase(client) {
|
|||||||
console.log(`[Asshat.Account]: Saving client ${client.name} to database ...`);
|
console.log(`[Asshat.Account]: Saving client ${client.name} to database ...`);
|
||||||
saveAccountToDatabase(getPlayerData(client).accountData);
|
saveAccountToDatabase(getPlayerData(client).accountData);
|
||||||
|
|
||||||
let subAccountData = getClientCurrentSubAccount(client);
|
if(getPlayerData(client).currentSubAccount != -1) {
|
||||||
|
let subAccountData = getClientCurrentSubAccount(client);
|
||||||
|
|
||||||
if(client.player != null) {
|
if(client.player != null) {
|
||||||
subAccountData.spawnPosition = getPlayerPosition(client);
|
subAccountData.spawnPosition = getPlayerPosition(client);
|
||||||
subAccountData.spawnHeading = getPlayerHeading(client);
|
subAccountData.spawnHeading = getPlayerHeading(client);
|
||||||
|
}
|
||||||
|
|
||||||
|
saveSubAccountToDatabase(subAccountData);
|
||||||
}
|
}
|
||||||
|
|
||||||
saveSubAccountToDatabase(subAccountData);
|
|
||||||
console.log(`[Asshat.Account]: Saved client ${getClientDisplayForConsole(client)} to database successfully!`);
|
console.log(`[Asshat.Account]: Saved client ${getClientDisplayForConsole(client)} to database successfully!`);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -795,7 +799,10 @@ function saveSessionToDatabase(client) {
|
|||||||
|
|
||||||
function createDefaultKeybindsForAccount(accountDatabaseId) {
|
function createDefaultKeybindsForAccount(accountDatabaseId) {
|
||||||
for(let i in getGlobalConfig().defaultKeybinds) {
|
for(let i in getGlobalConfig().defaultKeybinds) {
|
||||||
quickDatabaseQuery(`INSERT INTO acct_hotkey (acct_hotkey_acct, acct_hotkey_key, acct_hotkey_cmdstr, acct_hotkey_when_added) VALUES (${accountDatabaseId}, ${getGlobalConfig().defaultKeybinds[i].key}, '${getGlobalConfig().defaultKeybinds[i].commandString}', UNIX_TIMESTAMP())`);
|
console.log(i);
|
||||||
|
let dbQueryString = `INSERT INTO acct_hotkey (acct_hotkey_acct, acct_hotkey_key, acct_hotkey_cmdstr, acct_hotkey_when_added, acct_hotkey_down) VALUES (${accountDatabaseId}, ${getGlobalConfig().defaultKeybinds[i].key}, '${getGlobalConfig().defaultKeybinds[i].commandString}', UNIX_TIMESTAMP(), ${boolToInt(getGlobalConfig().defaultKeybinds[i].keyState)})`;
|
||||||
|
console.log(dbQueryString);
|
||||||
|
quickDatabaseQuery(dbQueryString);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -964,3 +971,7 @@ function doesPlayerHaveAutoSelectLastCharacterEnabled(client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
function getPlayerStaffTitle(client) {
|
||||||
|
return getPlayerData(client).accountData.staffTitle;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user