public void ForwardChatsFeedback(byte[] feedback)
        {
            ForwardBattleChatS2C data = ProtobufUtils.Deserialize <ForwardBattleChatS2C>(feedback);

            if (data.battleChatType != BattleChatType.match)
            {
                DebugUtils.LogError(DebugUtils.Type.Chat, string.Format("This message type {0} is not match chat", data.battleChatType));
                return;
            }

            if (!string.IsNullOrEmpty(data.chatContent))
            {
                string str = string.Format(data.sendPlayerName + " : {0}", data.chatContent);

                view.RefreshMatchCahtShowEffect(str);
            }
        }
Beispiel #2
0
        public void ForwardChatsFeedback(byte[] feedback)
        {
            ForwardBattleChatS2C data = ProtobufUtils.Deserialize <ForwardBattleChatS2C>(feedback);

            if (data.battleChatType == BattleChatType.match)
            {
                DebugUtils.LogError(DebugUtils.Type.Chat, string.Format("This message type {0} is not battle chat", data.battleChatType));
                return;
            }

            if (!string.IsNullOrEmpty(data.chatContent))
            {
                string str     = string.Format(data.sendPlayerName + " : {0}", data.chatContent);
                bool   isEnemy = false;

                if (enemyNames.Contains(data.sendPlayerName))
                {
                    isEnemy = true;
                }

                _view.ShowChatMessage(str, isEnemy);
            }
        }