Skip to content
Permalink
Browse files

Filter all forms of chat, but don't filter command usage.

  • Loading branch information...
UnknownShadow200 committed Jul 18, 2017
1 parent 26f5125 commit b3c2237f1012c6192b2870511807598e0fac4b83
Showing with 6 additions and 10 deletions.
  1. +6 −10 fCraft/Player/Chat.cs
@@ -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);

@@ -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;
}

0 comments on commit b3c2237

Please sign in to comment.
You can’t perform that action at this time.