public ChatMessage CreateOutgoingMessage(string text)
        {
            ChatMessage message = new ChatMessage(text);
            KeyValuePair <LocalizedText, ChatCommandId> keyValuePair1 = this._localizedCommands.FirstOrDefault <KeyValuePair <LocalizedText, ChatCommandId> >((Func <KeyValuePair <LocalizedText, ChatCommandId>, bool>)(pair => ChatCommandProcessor.HasLocalizedCommand(message, pair.Key)));
            ChatCommandId commandId = keyValuePair1.Value;

            if (keyValuePair1.Key != null)
            {
                message.SetCommand(commandId);
                message.Text = ChatCommandProcessor.RemoveCommandPrefix(message.Text, keyValuePair1.Key);
                this._commands[commandId].ProcessOutgoingMessage(message);
            }
            else
            {
                bool flag = false;
                for (KeyValuePair <LocalizedText, NetworkText> keyValuePair2 = this._aliases.FirstOrDefault <KeyValuePair <LocalizedText, NetworkText> >((Func <KeyValuePair <LocalizedText, NetworkText>, bool>)(pair => ChatCommandProcessor.HasLocalizedCommand(message, pair.Key))); keyValuePair2.Key != null; keyValuePair2 = this._aliases.FirstOrDefault <KeyValuePair <LocalizedText, NetworkText> >((Func <KeyValuePair <LocalizedText, NetworkText>, bool>)(pair => ChatCommandProcessor.HasLocalizedCommand(message, pair.Key))))
                {
                    flag    = true;
                    message = new ChatMessage(keyValuePair2.Value.ToString());
                }
                if (flag)
                {
                    return(this.CreateOutgoingMessage(message.Text));
                }
            }
            return(message);
        }
Exemple #2
0
        // Token: 0x0600134B RID: 4939 RVA: 0x0041B508 File Offset: 0x00419708
        public bool ProcessOutgoingMessage(ChatMessage message)
        {
            KeyValuePair <LocalizedText, ChatCommandId> keyValuePair = this._localizedCommands.FirstOrDefault((KeyValuePair <LocalizedText, ChatCommandId> pair) => ChatCommandProcessor.HasLocalizedCommand(message, pair.Key));
            ChatCommandId value = keyValuePair.Value;

            if (keyValuePair.Key != null)
            {
                message.SetCommand(value);
                message.Text = ChatCommandProcessor.RemoveCommandPrefix(message.Text, keyValuePair.Key);
                return(true);
            }
            return(false);
        }
Exemple #3
0
        public bool ProcessOutgoingMessage(ChatMessage message)
        {
            KeyValuePair <LocalizedText, ChatCommandId> keyValuePair = this._localizedCommands.FirstOrDefault <KeyValuePair <LocalizedText, ChatCommandId> >((Func <KeyValuePair <LocalizedText, ChatCommandId>, bool>)(pair => ChatCommandProcessor.HasLocalizedCommand(message, pair.Key)));
            ChatCommandId commandId = keyValuePair.Value;

            if (keyValuePair.Key == null)
            {
                return(false);
            }
            message.SetCommand(commandId);
            message.Text = ChatCommandProcessor.RemoveCommandPrefix(message.Text, keyValuePair.Key);
            return(true);
        }
        public bool ProcessOutgoingMessage(ChatMessage message)
        {
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            ChatCommandProcessor.\u003C\u003Ec__DisplayClass5 cDisplayClass5 = new ChatCommandProcessor.\u003C\u003Ec__DisplayClass5();
            // ISSUE: reference to a compiler-generated field
            cDisplayClass5.message = message;
            // ISSUE: reference to a compiler-generated field
            cDisplayClass5.\u003C\u003E4__this = this;
            // ISSUE: method pointer
            KeyValuePair <LocalizedText, ChatCommandId> keyValuePair = (KeyValuePair <LocalizedText, ChatCommandId>)Enumerable.FirstOrDefault <KeyValuePair <LocalizedText, ChatCommandId> >((IEnumerable <M0>) this._localizedCommands, (Func <M0, bool>) new Func <KeyValuePair <LocalizedText, ChatCommandId>, bool>((object)cDisplayClass5, __methodptr(\u003CProcessOutgoingMessage\u003Eb__4)));
            ChatCommandId commandId = keyValuePair.Value;

            if (keyValuePair.Key == null)
            {
                return(false);
            }
            // ISSUE: reference to a compiler-generated field
            cDisplayClass5.message.SetCommand(commandId);
            // ISSUE: reference to a compiler-generated field
            // ISSUE: reference to a compiler-generated field
            cDisplayClass5.message.Text = ChatCommandProcessor.RemoveCommandPrefix(cDisplayClass5.message.Text, keyValuePair.Key);
            return(true);
        }