SendGlobal() public static method

Sends a global (white) chat.
public static SendGlobal ( [ player, [ rawMessage ) : bool
player [ Player writing the message.
rawMessage [ Message text.
return bool
Esempio n. 1
0
        void HandleChatMessage([NotNull] string rawMessage)
        {
            if (rawMessage == null)
            {
                throw new ArgumentNullException("rawMessage");
            }
            if (!Can(Permission.Chat))
            {
                return;
            }

            if (Info.IsMuted)
            {
                MessageMuted();
                return;
            }

            if (DetectChatSpam())
            {
                return;
            }

            // Escaped slash removed AFTER logging, to avoid confusion with real commands
            if (rawMessage.StartsWith("//"))
            {
                rawMessage = rawMessage.Substring(1);
            }

            if (rawMessage.EndsWith("//"))
            {
                rawMessage = rawMessage.Substring(0, rawMessage.Length - 1);
            }

            Chat.SendGlobal(this, rawMessage);
        }