mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-05-05 21:17:43 -05:00
New command API sendModCommand
Does the same thing as privateModCommand, but without logging it
This commit is contained in:
parent
480b416d2d
commit
b1cd4e81dc
|
|
@ -236,16 +236,19 @@ var parse = exports.parse = function (message, room, user, connection, levelsDee
|
|||
send: function (data) {
|
||||
room.send(data);
|
||||
},
|
||||
privateModCommand: function (data) {
|
||||
privateModCommand: function (data, noLog) {
|
||||
this.sendModCommand(data);
|
||||
this.logEntry(data);
|
||||
this.logModCommand(data);
|
||||
},
|
||||
sendModCommand: function (data) {
|
||||
for (var i in room.users) {
|
||||
var user = room.users[i];
|
||||
// hardcoded for performance reasonss (this is an inner loop)
|
||||
// hardcoded for performance reasons (this is an inner loop)
|
||||
if (user.isStaff || (room.auth && (room.auth[user.userid] || '+') !== '+')) {
|
||||
user.sendTo(room, data);
|
||||
}
|
||||
}
|
||||
this.logEntry(data);
|
||||
this.logModCommand(data);
|
||||
},
|
||||
logEntry: function (data) {
|
||||
room.logEntry(data);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user