Exemplo n.º 1
0
        private void AddMessage(EB.Sparx.ChatMessage msg)
        {
            if (msg == null)
            {
                return;
            }

            ChatUIMessage uimsg   = new ChatUIMessage(msg);
            var           channel = ChatRule.STR2CHANNEL[msg.channelType];

            uimsg.ChannelSpriteName = ChatRule.CHANNEL2ICON.ContainsKey(channel) ? ChatRule.CHANNEL2ICON[channel] : "";
            uimsg.Channel           = channel;
        }
Exemplo n.º 2
0
        public EB.Sparx.ChatMessage NewChatMessage(ChatRule.CHAT_CHANNEL _eChannel, string _content)
        {
            EB.Sparx.ChatMessage msg = new EB.Sparx.ChatMessage();

            msg.channel     = FullChannelStringForSend(_eChannel);
            msg.channelType = ChatRule.CHANNEL2STR[_eChannel];
            msg.name        = LoginManager.Instance.LocalUser.Name;
            msg.vipLevel    = LoginManager.Instance.LocalUser.Vip;
            msg.icon        = LTMainHudManager.Instance.UserHeadIcon;     // LoginManager.Instance.LocalUser.Icon;
            msg.frame       = LTMainHudManager.Instance.UserLeaderHeadFrameStr;
            msg.uid         = LoginManager.Instance.LocalUser.Id.Value;

            msg.text = _content;

            msg.monthVipType = 0;
            bool isSilverVip = LTChargeManager.Instance.IsSilverVIP();
            bool isGoldVip   = LTChargeManager.Instance.IsGoldVIP();

            if (isSilverVip && !isGoldVip)
            {
                msg.monthVipType = 1;
            }
            else if (!isSilverVip && isGoldVip)
            {
                msg.monthVipType = 2;
            }
            else if (isSilverVip && isGoldVip)
            {
                msg.monthVipType = 3;
            }

            string templateId;

            DataLookupsCache.Instance.SearchDataByID("playstate.MainLand.template_id", out templateId);
            //Hotfix_LT.Data.HeroStatTemplate charTpl = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroStat(templateId);

            msg.quality      = 0;       //charTpl.quality_level;
            msg.allianceName = AlliancesManager.Instance.Detail.Name;

            //string teamIdDataId = string.Format("userTeam.current_team");
            //string teamId = string.Empty;
            //if (DataLookupsCache.Instance.SearchDataByID(teamIdDataId, out teamId))
            //{
            //	msg.battleRating = AttributesManager.CalcTeamFightWithEquipedEquipment(teamId);
            //}
            msg.battleRating = 0;

            DataLookupsCache.Instance.SearchDataByID("level", out msg.level);

            return(msg);
        }
Exemplo n.º 3
0
 public ChatUIMessage(EB.Sparx.ChatMessage msg)
 {
     Message = msg;
 }