Skip to content

Commit

Permalink
Filter all forms of chat, but don't filter command usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
UnknownShadow200 committed Jul 18, 2017
1 parent 26f5125 commit b3c2237
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions fCraft/Player/Chat.cs
Expand Up @@ -27,9 +27,6 @@ public static class Chat
public static bool SendGlobal([NotNull] Player player, [NotNull] string rawMessage) {
if (player == null) throw new ArgumentNullException("player");
if (rawMessage == null) throw new ArgumentNullException("rawMessage");

rawMessage = Filter(rawMessage, player);
if (rawMessage == null) return false;

var recipientList = Server.Players.NotIgnoring(player);

Expand Down Expand Up @@ -553,21 +550,20 @@ public static bool IRCSendStaff([NotNull] string player, [NotNull] string rawMes
static bool SendInternal([NotNull] ChatSendingEventArgs e)
{
if (e == null) throw new ArgumentNullException("e");

e.FormattedMessage = Filter(e.FormattedMessage, e.Player);
if (e.FormattedMessage == null) return false;
if (RaiseSendingEvent(e)) return false;

Player[] players = e.RecepientList.ToArray();
int packets = players.Message(e.FormattedMessage);

// Only increment the MessagesWritten count if someone other than
// the player was on the recepient list.
if (players.Length > 1 || (players.Length == 1 && players[0] != e.Player))
{
// Only increment MessagesWritten if someone other than the player was on the recepient list.
if (players.Length > 1 || (players.Length == 1 && players[0] != e.Player)) {
e.Player.Info.ProcessMessageWritten();
}

if (e.MessageType != ChatMessageType.SayStaff && e.MessageType != ChatMessageType.StaffSayOwner) {
RaiseSentEvent(e, packets);
}
RaiseSentEvent(e, packets);
return true;
}

Expand Down

0 comments on commit b3c2237

Please sign in to comment.