From e6bbfa78df9843d99973c202373d7241c6f8a9c8 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sun, 18 Apr 2021 23:11:11 -0500 Subject: [PATCH] Save player data on quit --- scripts/server/event.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/server/event.js b/scripts/server/event.js index 48a031db..11c82c52 100644 --- a/scripts/server/event.js +++ b/scripts/server/event.js @@ -60,7 +60,7 @@ function onPlayerJoined(event, client) { function onPlayerQuit(event, client, quitReasonId) { logToConsole(LOG_DEBUG, `[Asshat.Event] ${getPlayerDisplayForConsole(client)} disconnected (${disconnectReasons[quitReasonId]}[${quitReasonId}])`); - //savePlayerToDatabase(client); + savePlayerToDatabase(client); resetClientStuff(client); getServerData().clients[client.index] = null; @@ -405,6 +405,9 @@ function onPlayerSpawn(client) { logToConsole(LOG_DEBUG, `[Asshat.Event] Syncing ${getPlayerDisplayForConsole(client)}'s hotbar`); updatePlayerHotBar(client); + logToConsole(LOG_DEBUG, `[Asshat.Event] Sending custom keybinds to ${getPlayerDisplayForConsole(client)}`); + sendAccountKeyBindsToClient(client); + logToConsole(LOG_DEBUG, `[Asshat.Event] Setting ${getPlayerDisplayForConsole(client)}'s switchchar state to false`); getPlayerData(client).switchingCharacter = false;