* Implement parameter 'reason' for mute command.
--HG-- branch : trunk
This commit is contained in:
@@ -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.');
|
||||||
+6
-2
@@ -69,6 +69,10 @@ bool ChatHandler::HandleMuteCommand(const char* args)
|
|||||||
if(!timetonotspeak)
|
if(!timetonotspeak)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
char *mutereason = strtok(NULL, " ");
|
||||||
|
if(!mutereason)
|
||||||
|
strcpy(mutereason, "No reason.");
|
||||||
|
|
||||||
uint32 notspeaktime = (uint32) atoi(timetonotspeak);
|
uint32 notspeaktime = (uint32) atoi(timetonotspeak);
|
||||||
|
|
||||||
if(!normalizePlayerName(cname))
|
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 );
|
LoginDatabase.PExecute("UPDATE account SET mutetime = " I64FMTD " WHERE id = '%u'",uint64(mutetime), account_id );
|
||||||
|
|
||||||
if(chr)
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user