From c15d98aa6453b5cbcb3abe5e0b8e4f21a796415c Mon Sep 17 00:00:00 2001 From: lineagedr Date: Mon, 16 Aug 2021 16:36:59 +0300 Subject: [PATCH] fix(Core/Chat): Fix muteTime for players that were muted when offline. --- src/server/game/Server/WorldSocket.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 733c711fe8..93e438cda8 100644 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -540,6 +540,17 @@ void WorldSocket::HandleAuthSessionCallback(std::shared_ptr authSes } } + //! Negative mutetime indicates amount of minutes to be muted effective on next login - which is now. + if (account.MuteTime < 0) + { + account.MuteTime = time(nullptr) + llabs(account.MuteTime); + + auto* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME_LOGIN); + stmt->setInt64(0, account.MuteTime); + stmt->setUInt32(1, account.Id); + LoginDatabase.Execute(stmt); + } + if (account.IsBanned) { SendAuthResponseError(AUTH_BANNED);