From 47dbc6d35e47666ddebc4b9c45aa1876a1d0ae62 Mon Sep 17 00:00:00 2001 From: gsemaj Date: Sun, 23 Jun 2024 18:41:43 -0700 Subject: [PATCH] Notify if player must log out and back in for access change --- src/CustomCommands.cpp | 5 ++++- src/PlayerManager.cpp | 6 +----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/CustomCommands.cpp b/src/CustomCommands.cpp index 368b8e0..693485d 100644 --- a/src/CustomCommands.cpp +++ b/src/CustomCommands.cpp @@ -150,7 +150,10 @@ static void accessCommand(std::string full, std::vector& args, CNSo int accountId = Database::getAccountIdForPlayer(player->iID); Database::updateAccountLevel(accountId, newAccess); - Chat::sendServerMessage(sock, "Changed access level for " + playerName + " from " + std::to_string(currentAccess) + " to " + std::to_string(newAccess)); + std::string msg = "Changed access level for " + playerName + " from " + std::to_string(currentAccess) + " to " + std::to_string(newAccess); + if (newAccess <= 50 && currentAccess > 50) + msg += " (they must log out and back in for some commands to be enabled)"; + Chat::sendServerMessage(sock, msg); } static void populationCommand(std::string full, std::vector& args, CNSocket* sock) { diff --git a/src/PlayerManager.cpp b/src/PlayerManager.cpp index e646b1e..1171a07 100644 --- a/src/PlayerManager.cpp +++ b/src/PlayerManager.cpp @@ -213,11 +213,7 @@ static void enterPlayer(CNSocket* sock, CNPacketData* data) { response.iID = plr->iID; response.uiSvrTime = getTime(); - // The only client-side use of the account level is to block - // the sending of GM packets. Since account level can be changed - // at runtime and we validate it serverside, we can leave this at 0. - response.PCLoadData2CL.iUserLevel = 0; // plr->accountLevel; - + response.PCLoadData2CL.iUserLevel = plr->accountLevel; response.PCLoadData2CL.iHP = plr->HP; response.PCLoadData2CL.iLevel = plr->level; response.PCLoadData2CL.iCandy = plr->money;