aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Commands
diff options
context:
space:
mode:
authorAokromes <jipr@hotmail.com>2013-02-04 06:55:26 -0800
committerAokromes <jipr@hotmail.com>2013-02-04 06:55:26 -0800
commit6d8a69d64039f8a8e03fd83a0dd1ab08f50e8455 (patch)
tree5ef8668b0ff6625b2ecf1abf01e76dd58b7a58fb /src/server/scripts/Commands
parent67f686106d7d372d1ed652800582df15999d099c (diff)
parent83e3bf6d6d76156f36f3eaec28ef2244f9826fdf (diff)
Merge pull request #9099 from Bezo/mutenew
Add Mute reason and mute by to the db so you can get this info from the ...
Diffstat (limited to 'src/server/scripts/Commands')
-rw-r--r--src/server/scripts/Commands/cs_misc.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp
index cc1b62ea99d..cacefea7b85 100644
--- a/src/server/scripts/Commands/cs_misc.cpp
+++ b/src/server/scripts/Commands/cs_misc.cpp
@@ -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)