Beispiel #1
0
        public void ProcessOutgoingMessage(ChatMessage message)
        {
            int num = Main.rand.NextFromList <int>(37, 38, 36);

            if (Main.netMode == 0)
            {
                EmoteBubble.NewBubble(num, new WorldUIAnchor(Main.LocalPlayer), 360);
                EmoteBubble.CheckForNPCsToReactToEmoteBubble(num, Main.LocalPlayer);
            }
            else
            {
                NetMessage.SendData(120, -1, -1, null, Main.myPlayer, num);
            }
            message.Consume();
        }
Beispiel #2
0
        public void ProcessOutgoingMessage(ChatMessage message)
        {
            int result = -1;

            if (int.TryParse(message.Text, out result))
            {
                if (result < 0 || result >= 145)
                {
                    return;
                }
            }
            else
            {
                result = -1;
            }
            if (result == -1)
            {
                foreach (LocalizedText key in this._byName.Keys)
                {
                    if (message.Text == key.Value)
                    {
                        result = this._byName[key];
                        break;
                    }
                }
            }
            if (result != -1)
            {
                if (Main.netMode == 0)
                {
                    EmoteBubble.NewBubble(result, new WorldUIAnchor((Entity)Main.LocalPlayer), 360);
                    EmoteBubble.CheckForNPCsToReactToEmoteBubble(result, Main.LocalPlayer);
                }
                else
                {
                    NetMessage.SendData(120, -1, -1, (NetworkText)null, Main.myPlayer, (float)result, 0.0f, 0.0f, 0, 0, 0);
                }
            }
            message.Consume();
        }