Merge pull request #9099 from Bezo/mutenew
Add Mute reason and mute by to the db so you can get this info from the ...
This commit is contained in:
commit
6d8a69d640
7 files changed
+31
-7
No files matched your search
@@ -1550,6 +1550,8 @@ public:
|
||||
|
||||
std::string userName = handler->GetTrinityString(LANG_ERROR);
|
||||
std::string eMail = handler->GetTrinityString(LANG_ERROR);
|
||||
std::string muteReason = "";
|
||||
std::string muteBy = "";
|
||||
std::string lastIp = handler->GetTrinityString(LANG_ERROR);
|
||||
uint32 security = 0;
|
||||
std::string lastLogin = handler->GetTrinityString(LANG_ERROR);
|
||||
@@ -1566,6 +1568,8 @@ public:
|
||||
security = fields[1].GetUInt8();
|
||||
eMail = fields[2].GetString();
|
||||
muteTime = fields[5].GetUInt64();
|
||||
muteReason = fields[6].GetString();
|
||||
muteBy = fields[7].GetString();
|
||||
|
||||
if (eMail.empty())
|
||||
eMail = "-";
|
||||
@@ -1627,7 +1631,7 @@ public:
|
||||
}
|
||||
|
||||
if (muteTime > 0)
|
||||
handler->PSendSysMessage(LANG_PINFO_MUTE, secsToTimeString(muteTime - time(NULL), true).c_str());
|
||||
handler->PSendSysMessage(LANG_PINFO_MUTE, secsToTimeString(muteTime - time(NULL), true).c_str(), muteBy.c_str(), muteReason.c_str());
|
||||
|
||||
if (banTime >= 0)
|
||||
handler->PSendSysMessage(LANG_PINFO_BAN, banTime > 0 ? secsToTimeString(banTime - time(NULL), true).c_str() : "permanently", bannedby.c_str(), banreason.c_str());
|
||||
@@ -1820,6 +1824,11 @@ public:
|
||||
return false;
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME);
|
||||
std::string muteBy = "";
|
||||
if (handler->GetSession())
|
||||
muteBy = handler->GetSession()->GetPlayerName();
|
||||
else
|
||||
muteBy = "Console";
|
||||
|
||||
if (target)
|
||||
{
|
||||
@@ -1827,7 +1836,7 @@ public:
|
||||
int64 muteTime = time(NULL) + notSpeakTime * MINUTE;
|
||||
target->GetSession()->m_muteTime = muteTime;
|
||||
stmt->setInt64(0, muteTime);
|
||||
ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notSpeakTime, muteReasonStr.c_str());
|
||||
ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notSpeakTime, muteBy.c_str(), muteReasonStr.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1836,7 +1845,9 @@ public:
|
||||
stmt->setInt64(0, muteTime);
|
||||
}
|
||||
|
||||
stmt->setUInt32(1, accountId);
|
||||
stmt->setString(1, muteReasonStr.c_str());
|
||||
stmt->setString(2, muteBy.c_str());
|
||||
stmt->setUInt32(3, accountId);
|
||||
LoginDatabase.Execute(stmt);
|
||||
std::string nameLink = handler->playerLink(targetName);
|
||||
|
||||
@@ -1879,7 +1890,9 @@ public:
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME);
|
||||
stmt->setInt64(0, 0);
|
||||
stmt->setUInt32(1, accountId);
|
||||
stmt->setString(1, "");
|
||||
stmt->setString(2, "");
|
||||
stmt->setUInt32(3, accountId);
|
||||
LoginDatabase.Execute(stmt);
|
||||
|
||||
if (target)
|
||||
|
||||
Reference in new issue
Block a user