diff options
author | Machiavelli <none@none> | 2009-06-20 14:16:42 +0200 |
---|---|---|
committer | Machiavelli <none@none> | 2009-06-20 14:16:42 +0200 |
commit | 1dd1f6db344c403fb6b90d6dff9b19cee73ffc0b (patch) | |
tree | 9dfc12049b134876985299432569c7da94c64318 | |
parent | eab85d9d6e55d66971ac5b816196510a26973d47 (diff) |
* Implement parameter 'reason' for mute command.
--HG--
branch : trunk
-rw-r--r-- | sql/updates/1588_world.sql | 9 | ||||
-rw-r--r-- | src/game/Level2.cpp | 8 |
2 files changed, 15 insertions, 2 deletions
diff --git a/sql/updates/1588_world.sql b/sql/updates/1588_world.sql new file mode 100644 index 00000000000..d7ccaeaf6d6 --- /dev/null +++ b/sql/updates/1588_world.sql @@ -0,0 +1,9 @@ +# 1588 +DELETE FROM `trinity_string` WHERE `entry` IN(301, 300); +INSERT INTO `trinity_string` (`entry`, `content_default`)VALUES +('300', 'Your chat has been disabled for %u minutes. Reason: %s.'), +('301', 'You have disabled %s\'s chat for %u minutes. Reason: %s.'); + +DELETE FROM `command` WHERE `name` = 'mute'; +INSERT INTO `command` (`name`, `security`, `help`) VALUES +('mute', 1 ,'Syntax: .mute [$playerName] $timeInMinutes [$reason]\r\n\r\nDisible chat messaging for any character from account of character $playerName (or currently selected) at $timeInMinutes minutes. Player can be offline.'); diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp index 4caa6f29578..4e80cfda1d7 100644 --- a/src/game/Level2.cpp +++ b/src/game/Level2.cpp @@ -69,6 +69,10 @@ bool ChatHandler::HandleMuteCommand(const char* args) if(!timetonotspeak) return false; + char *mutereason = strtok(NULL, " "); + if(!mutereason) + strcpy(mutereason, "No reason."); + uint32 notspeaktime = (uint32) atoi(timetonotspeak); if(!normalizePlayerName(cname)) @@ -118,9 +122,9 @@ bool ChatHandler::HandleMuteCommand(const char* args) LoginDatabase.PExecute("UPDATE account SET mutetime = " I64FMTD " WHERE id = '%u'",uint64(mutetime), account_id ); if(chr) - ChatHandler(chr).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notspeaktime); + ChatHandler(chr).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notspeaktime, mutereason); - PSendSysMessage(LANG_YOU_DISABLE_CHAT, cname.c_str(), notspeaktime); + PSendSysMessage(LANG_YOU_DISABLE_CHAT, cname.c_str(), notspeaktime, mutereason); return true; } |