fix(Core/Chat): Fix muteTime for players that were muted when offline.

This commit is contained in:
lineagedr
2021-08-16 16:36:59 +03:00
parent 28a7646414
commit c15d98aa64

View File

@@ -540,6 +540,17 @@ void WorldSocket::HandleAuthSessionCallback(std::shared_ptr<AuthSession> 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);