Пример #1
0
        public static CChatEntity Build_4_SelectHero(COMDT_CHAT_MSG_BATTLE data)
        {
            CChatEntity entity = new CChatEntity {
                ullUid        = data.stFrom.ullUid,
                iLogicWorldID = (uint)data.stFrom.iLogicWorldID
            };

            if (entity.ullUid == Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().playerUllUID)
            {
                entity.type = EChaterType.Self;
            }
            else
            {
                entity.type = EChaterType.Strenger;
            }
            if (data.bChatType == 1)
            {
                CChatModel.HeroChatTemplateInfo info = Singleton <CChatController> .instance.model.Get_HeroSelect_ChatTemplate((int)data.stChatInfo.stContentID.dwTextID);

                if (info.isValid())
                {
                    entity.text = info.templateString;
                }
            }
            if (data.bChatType == 2)
            {
                entity.text = UT.Bytes2String(data.stChatInfo.stContentStr.szContent);
            }
            GetUser(entity.type, entity.ullUid, entity.iLogicWorldID, out entity.name, out entity.level, out entity.head_url, out entity.stGameVip);
            return(entity);
        }
Пример #2
0
        public void ShowLoudSpeaker(COMDT_CHAT_MSG_HORN data)
        {
            this.m_loudSpeakerCount = 0;
            this.m_timerLoudSpeaker = Singleton <CTimerManager> .instance.AddTimer(0x3e8, 0, new CTimer.OnTimeUpHandler(this.OnTimerLoudSpeaker));

            if (Singleton <BattleLogic> .instance.isRuning)
            {
                this.loudSpeakerList.Clear();
            }
            else
            {
                CUIFormScript form = Singleton <CUIManager> .instance.GetForm(LobbyForm.FORM_PATH);

                if (form != null)
                {
                    CUIAutoScroller component = form.GetWidget(5).GetComponent <CUIAutoScroller>();
                    if (component != null)
                    {
                        GameObject widget = form.GetWidget(6);
                        if (widget != null)
                        {
                            string rawText = UT.Bytes2String(data.szContent);
                            string str     = CChatUT.Build_4_LoudSpeaker_EntryString(data.stFrom.ullUid, (uint)data.stFrom.iLogicWorldID, rawText);
                            component.SetText(CUIUtility.RemoveEmoji(str));
                            component.gameObject.CustomSetActive(true);
                            widget.CustomSetActive(true);
                            component.StopAutoScroll();
                            component.StartAutoScroll(true);
                        }
                    }
                }
            }
        }
Пример #3
0
        private string QueryEliteName(ActorRoot inActor)
        {
            string str = null;

            if (inActor != null)
            {
                ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(inActor.TheActorMeta.ConfigId);
                if (dataCfgInfoByCurLevelDiff == null)
                {
                    return(str);
                }
                str = UT.Bytes2String(dataCfgInfoByCurLevelDiff.szName);
                if ((inActor.SkillControl == null) || (inActor.SkillControl.talentSystem == null))
                {
                    return(str);
                }
                string         str3       = string.Empty;
                PassiveSkill[] skillArray = inActor.SkillControl.talentSystem.QueryTalents();
                if (skillArray != null)
                {
                    foreach (PassiveSkill skill in skillArray)
                    {
                        if ((skill != null) && skill.bShowAsElite)
                        {
                            str3 = str3 + skill.PassiveSkillName + "之";
                        }
                    }
                }
                if (!string.IsNullOrEmpty(str3))
                {
                    str = str3 + str;
                }
            }
            return(str);
        }
Пример #4
0
        public static void GetUser(EChaterType type, ulong ulluid, uint logicworld_id, out string name, out string level, out string head_url, out COMDT_GAME_VIP_CLIENT stGameVip)
        {
            name      = "error";
            level     = "-1";
            head_url  = string.Empty;
            stGameVip = null;
            if (type == EChaterType.Self)
            {
                CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .get_instance().GetMasterRoleInfo();

                if (masterRoleInfo != null)
                {
                    name      = masterRoleInfo.Name;
                    level     = masterRoleInfo.PvpLevel.ToString();
                    stGameVip = masterRoleInfo.GetNobeInfo().stGameVipClient;
                    head_url  = masterRoleInfo.HeadUrl.Substring(0, masterRoleInfo.HeadUrl.LastIndexOf("/"));
                }
            }
            else if (type == EChaterType.Friend)
            {
                COMDT_FRIEND_INFO gameOrSnsFriend = Singleton <CFriendContoller> .GetInstance().model.GetGameOrSnsFriend(ulluid, logicworld_id);

                if (gameOrSnsFriend != null)
                {
                    name = UT.Bytes2String(gameOrSnsFriend.szUserName);
                    int dwPvpLvl = (int)gameOrSnsFriend.dwPvpLvl;
                    level     = dwPvpLvl.ToString();
                    head_url  = UT.Bytes2String(gameOrSnsFriend.szHeadUrl);
                    stGameVip = gameOrSnsFriend.stGameVip;
                }
            }
            else if (type == EChaterType.Strenger)
            {
                COMDT_CHAT_PLAYER_INFO cOMDT_CHAT_PLAYER_INFO = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ulluid, logicworld_id);

                if (cOMDT_CHAT_PLAYER_INFO != null)
                {
                    name = UT.Bytes2String(cOMDT_CHAT_PLAYER_INFO.szName);
                    int dwLevel = (int)cOMDT_CHAT_PLAYER_INFO.dwLevel;
                    level     = dwLevel.ToString();
                    head_url  = UT.Bytes2String(cOMDT_CHAT_PLAYER_INFO.szHeadUrl);
                    stGameVip = cOMDT_CHAT_PLAYER_INFO.stVip;
                }
            }
            else if (type == EChaterType.Speaker || type == EChaterType.LoudSpeaker)
            {
                COMDT_CHAT_PLAYER_INFO cOMDT_CHAT_PLAYER_INFO2 = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ulluid, logicworld_id);

                if (cOMDT_CHAT_PLAYER_INFO2 != null)
                {
                    name = UT.Bytes2String(cOMDT_CHAT_PLAYER_INFO2.szName);
                    int dwLevel2 = (int)cOMDT_CHAT_PLAYER_INFO2.dwLevel;
                    level     = dwLevel2.ToString();
                    head_url  = UT.Bytes2String(cOMDT_CHAT_PLAYER_INFO2.szHeadUrl);
                    stGameVip = cOMDT_CHAT_PLAYER_INFO2.stVip;
                }
            }
        }
Пример #5
0
        public static string Build_4_EntryString(EChatChannel type, ulong ullUid, uint iLogicWorldID, string rawText)
        {
            string str = string.Empty;

            if (type == EChatChannel.Friend)
            {
                COMDT_FRIEND_INFO gameOrSnsFriend = Singleton <CFriendContoller> .GetInstance().model.GetGameOrSnsFriend(ullUid, iLogicWorldID);

                if (gameOrSnsFriend != null)
                {
                    str = string.Format(CChatController.fmt, UT.Bytes2String(gameOrSnsFriend.szUserName), rawText);
                }
                return(str);
            }
            if (type == EChatChannel.Lobby)
            {
                COMDT_CHAT_PLAYER_INFO comdt_chat_player_info = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ullUid, iLogicWorldID);

                if (comdt_chat_player_info != null)
                {
                    str = string.Format(CChatController.fmt, UT.Bytes2String(comdt_chat_player_info.szName), rawText);
                }
                return(str);
            }
            if (type == EChatChannel.Guild)
            {
                COMDT_CHAT_PLAYER_INFO comdt_chat_player_info2 = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ullUid, iLogicWorldID);

                if (comdt_chat_player_info2 != null)
                {
                    str = string.Format(CChatController.fmt, UT.Bytes2String(comdt_chat_player_info2.szName), rawText);
                }
                return(str);
            }
            if (type == EChatChannel.Room)
            {
                COMDT_CHAT_PLAYER_INFO comdt_chat_player_info3 = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ullUid, iLogicWorldID);

                if (comdt_chat_player_info3 != null)
                {
                    str = string.Format(CChatController.fmt, UT.Bytes2String(comdt_chat_player_info3.szName), rawText);
                }
                return(str);
            }
            if (type == EChatChannel.Team)
            {
                COMDT_CHAT_PLAYER_INFO comdt_chat_player_info4 = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ullUid, iLogicWorldID);

                if (comdt_chat_player_info4 != null)
                {
                    str = string.Format(CChatController.fmt, UT.Bytes2String(comdt_chat_player_info4.szName), rawText);
                }
                return(str);
            }
            return("ERROR, in Build_4_EntryString");
        }
Пример #6
0
        public static void ShowLBSUserData(CSDT_LBS_USER_INFO info, FriendShower com)
        {
            if (com == null)
            {
                return;
            }
            com.ullUid         = info.stLbsUserInfo.stUin.ullUid;
            com.dwLogicWorldID = info.stLbsUserInfo.stUin.dwLogicWorldId;
            if (info.stLbsUserInfo.szHeadUrl != null)
            {
                string url = UT.Bytes2String(info.stLbsUserInfo.szHeadUrl);
                com.HttpImage.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(url));
            }
            if (com.nobeIcon)
            {
                MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(com.nobeIcon.GetComponent <Image>(), (int)info.stLbsUserInfo.stGameVip.dwCurLevel, false);
            }
            if (com.HeadIconBack)
            {
                MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(com.HeadIconBack.GetComponent <Image>(), (int)info.stLbsUserInfo.stGameVip.dwHeadIconId);
            }
            if (com.QQVipImage)
            {
                MonoSingleton <NobeSys> .GetInstance().SetOtherQQVipHead(com.QQVipImage.GetComponent <Image>(), (int)info.stLbsUserInfo.dwQQVIPMask);
            }
            com.intimacyNode.CustomSetActive(false);
            com.SetFriendItemType(FriendShower.ItemType.LBS, true);
            com.ShowName(UT.Bytes2String(info.stLbsUserInfo.szUserName));
            com.ShowLevel(info.stLbsUserInfo.dwPvpLvl);
            com.ShowLastTime(true, UT.GetTimeString(info.stLbsUserInfo.dwLastLoginTime));
            com.ShowGenderType(info.stLbsUserInfo.bGender);
            com.ShowDistance(UT.GetDistance(info.dwDistance));
            com.SetBGray(info.stLbsUserInfo.bIsOnline != 1);
            if (com.platChannelIcon != null)
            {
                com.platChannelIcon.CustomSetActive(false);
            }
            if (com.lbsAddFriendBtn != null)
            {
                CFriendModel model = Singleton <CFriendContoller> .get_instance().model;

                if (model.IsSnsFriend(com.ullUid, com.dwLogicWorldID) || model.IsGameFriend(com.ullUid, com.dwLogicWorldID))
                {
                    CUICommonSystem.SetButtonEnable(com.lbsAddFriendBtn, false, false, true);
                }
                else
                {
                    CUICommonSystem.SetButtonEnable(com.lbsAddFriendBtn, true, true, true);
                }
            }
            GameObject gameObject  = com.gameObject.transform.Find("body/LBS/Rank").gameObject;
            GameObject gameObject2 = com.gameObject.transform.Find("body/LBS/HisRank").gameObject;

            UT.ShowRank(com.formScript, gameObject, info.bGradeOfRank, info.stLbsUserInfo.dwRankClass);
            UT.ShowRank(com.formScript, gameObject2, info.bMaxGradeOfRank, info.stLbsUserInfo.dwRankClass);
        }
Пример #7
0
        public static string Build_4_Speaker_EntryString(ulong ullUid, uint iLogicWorldID, string rawText)
        {
            COMDT_CHAT_PLAYER_INFO comdt_chat_player_info = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ullUid, iLogicWorldID);

            if (comdt_chat_player_info != null)
            {
                return(string.Format(CChatController.fmt, UT.Bytes2String(comdt_chat_player_info.szName), rawText));
            }
            return("ERROR, in Build_4_EntryString");
        }
Пример #8
0
        public static CChatEntity Build_4_Offline_Friend(COMDT_OFFLINE_CHAT_MSG data)
        {
            CChatEntity cChatEntity = new CChatEntity();

            cChatEntity.ullUid        = data.stChatMsg.stFrom.ullUid;
            cChatEntity.iLogicWorldID = (uint)data.stChatMsg.stFrom.iLogicWorldID;
            cChatEntity.text          = UT.Bytes2String(data.stChatMsg.szContent);
            cChatEntity.type          = EChaterType.Friend;
            CChatUT.GetUser(cChatEntity.type, cChatEntity.ullUid, cChatEntity.iLogicWorldID, out cChatEntity.name, out cChatEntity.openId, out cChatEntity.level, out cChatEntity.head_url, out cChatEntity.stGameVip);
            return(cChatEntity);
        }
Пример #9
0
        public static CChatEntity Build_4_Room(COMDT_CHAT_MSG_ROOM data)
        {
            CChatEntity cChatEntity = new CChatEntity();

            cChatEntity.ullUid        = data.stFrom.ullUid;
            cChatEntity.iLogicWorldID = (uint)data.stFrom.iLogicWorldID;
            cChatEntity.text          = UT.Bytes2String(data.szContent);
            cChatEntity.type          = EChaterType.Strenger;
            CChatUT.GetUser(cChatEntity.type, cChatEntity.ullUid, cChatEntity.iLogicWorldID, out cChatEntity.name, out cChatEntity.openId, out cChatEntity.level, out cChatEntity.head_url, out cChatEntity.stGameVip);
            return(cChatEntity);
        }
Пример #10
0
 public static void SetHttpImage(CUIHttpImageScript HttpImage, byte[] szHeadUrl)
 {
     if (szHeadUrl == null)
     {
         UT.SetHttpImage(HttpImage, string.Empty);
     }
     else
     {
         UT.SetHttpImage(HttpImage, UT.Bytes2String(szHeadUrl));
     }
 }
        public static void OnSendReserveReq(CSPkg msg)
        {
            SCPKG_RESERVE_MSG_RSP stSvrReserveMsgRsp = msg.stPkgData.stSvrReserveMsgRsp;
            ulong             ullUid          = stSvrReserveMsgRsp.stFromUin.ullUid;
            uint              dwLogicWorldId  = stSvrReserveMsgRsp.stFromUin.dwLogicWorldId;
            CFriendModel      model           = Singleton <CFriendContoller> .instance.model;
            COMDT_FRIEND_INFO gameOrSnsFriend = model.GetGameOrSnsFriend(ullUid, dwLogicWorldId);
            string            text            = UT.Bytes2String(gameOrSnsFriend.szUserName);

            if (gameOrSnsFriend == null)
            {
                return;
            }
            if (stSvrReserveMsgRsp.bErrCode == 0)
            {
                string key;
                if (stSvrReserveMsgRsp.bResult == 2)
                {
                    key = "Reserve_Success_Tips";
                    if (!model.friendReserve.sendReserve_accepted.Contains(text))
                    {
                        model.friendReserve.sendReserve_accepted.Add(text);
                    }
                }
                else
                {
                    key = "Reserve_Failed_Tips";
                }
                if (!Singleton <BattleLogic> .GetInstance().isRuning)
                {
                    string strContent = string.Format(Singleton <CTextManager> .instance.GetText(key), text);
                    Singleton <CUIManager> .instance.OpenTips(strContent, false, 1.5f, null, new object[0]);
                }
                model.friendReserve.SetData(ullUid, dwLogicWorldId, stSvrReserveMsgRsp.bResult, FriendReserve.ReserveDataType.Send);
                Singleton <EventRouter> .instance.BroadCastEvent(EventID.Friend_Game_State_Change);
            }
            else if (stSvrReserveMsgRsp.bErrCode == 1 || stSvrReserveMsgRsp.bErrCode == 2)
            {
                CS_RESERVE_MSG_PROCESS_RESULT bErrCode = (CS_RESERVE_MSG_PROCESS_RESULT)stSvrReserveMsgRsp.bErrCode;
                string text2 = Singleton <CTextManager> .instance.GetText(bErrCode.ToString());

                string strContent2 = string.Format(text2, text);
                Singleton <CUIManager> .instance.OpenTips(strContent2, false, 1.5f, null, new object[0]);

                model.friendReserve.SetData(ullUid, dwLogicWorldId, 1, FriendReserve.ReserveDataType.Send);
            }
            else
            {
                CS_RESERVE_MSG_PROCESS_RESULT bErrCode2 = (CS_RESERVE_MSG_PROCESS_RESULT)stSvrReserveMsgRsp.bErrCode;
                Singleton <CUIManager> .instance.OpenTips(bErrCode2.ToString(), true, 1.5f, null, new object[0]);

                model.friendReserve.SetData(ullUid, dwLogicWorldId, 1, FriendReserve.ReserveDataType.Send);
            }
        }
Пример #12
0
        public static CChatEntity Build_4_Offline_Friend(COMDT_OFFLINE_CHAT_MSG data)
        {
            CChatEntity entity = new CChatEntity {
                ullUid        = data.stChatMsg.stFrom.ullUid,
                iLogicWorldID = (uint)data.stChatMsg.stFrom.iLogicWorldID,
                text          = UT.Bytes2String(data.stChatMsg.szContent),
                type          = EChaterType.Friend
            };

            GetUser(entity.type, entity.ullUid, entity.iLogicWorldID, out entity.name, out entity.level, out entity.head_url, out entity.stGameVip);
            return(entity);
        }
Пример #13
0
        public static CChatEntity Build_4_Friend(COMDT_CHAT_MSG_PRIVATE data)
        {
            CChatEntity cChatEntity = new CChatEntity();

            cChatEntity.ullUid        = data.stFrom.ullUid;
            cChatEntity.iLogicWorldID = (uint)data.stFrom.iLogicWorldID;
            cChatEntity.text          = UT.Bytes2String(data.szContent);
            cChatEntity.type          = EChaterType.Friend;
            CChatUT.GetUser(cChatEntity.type, cChatEntity.ullUid, cChatEntity.iLogicWorldID, out cChatEntity.name, out cChatEntity.level, out cChatEntity.head_url, out cChatEntity.stGameVip);
            cChatEntity.time = CRoleInfo.GetCurrentUTCTime();
            return(cChatEntity);
        }
Пример #14
0
        public static CChatEntity Build_4_Room(COMDT_CHAT_MSG_ROOM data)
        {
            CChatEntity entity = new CChatEntity {
                ullUid        = data.stFrom.ullUid,
                iLogicWorldID = (uint)data.stFrom.iLogicWorldID,
                text          = UT.Bytes2String(data.szContent),
                type          = EChaterType.Strenger
            };

            GetUser(entity.type, entity.ullUid, entity.iLogicWorldID, out entity.name, out entity.level, out entity.head_url, out entity.stGameVip);
            return(entity);
        }
Пример #15
0
        public static CChatEntity Build_4_GuildMatchTeam(COMDT_CHAT_MSG_GUILD_TEAM data)
        {
            CChatEntity cChatEntity = new CChatEntity();

            cChatEntity.ullUid        = data.stFrom.ullUid;
            cChatEntity.iLogicWorldID = (uint)data.stFrom.iLogicWorldID;
            cChatEntity.text          = UT.Bytes2String(data.szContent);
            cChatEntity.type          = EChaterType.Strenger;
            CChatUT.GetUser(cChatEntity.type, cChatEntity.ullUid, cChatEntity.iLogicWorldID, out cChatEntity.name, out cChatEntity.openId, out cChatEntity.level, out cChatEntity.head_url, out cChatEntity.stGameVip);
            cChatEntity.time = CRoleInfo.GetCurrentUTCTime();
            return(cChatEntity);
        }
Пример #16
0
        public static CChatEntity Build_4_Speaker(COMDT_CHAT_MSG_HORN data)
        {
            CChatEntity entity = new CChatEntity {
                ullUid        = data.stFrom.ullUid,
                iLogicWorldID = (uint)data.stFrom.iLogicWorldID,
                text          = UT.Bytes2String(data.szContent),
                type          = EChaterType.Speaker
            };

            GetUser(entity.type, entity.ullUid, entity.iLogicWorldID, out entity.name, out entity.level, out entity.head_url, out entity.stGameVip);
            entity.time = CRoleInfo.GetCurrentUTCTime();
            return(entity);
        }
        public void AddReceiveReservieData(ulong ullUid, uint dwLogicWorldId)
        {
            COMDT_FRIEND_INFO gameOrSnsFriend = Singleton <CFriendContoller> .instance.model.GetGameOrSnsFriend(ullUid, dwLogicWorldId);

            if (gameOrSnsFriend != null)
            {
                string            text            = UT.Bytes2String(gameOrSnsFriend.szUserName);
                string            inBattleContent = string.Format(this.Receive_Reserve_Tip, text);
                FriendReserve.Ent item            = new FriendReserve.Ent(ullUid, dwLogicWorldId, 0, inBattleContent, text);
                this.dataList[0].Add(item);
                Singleton <EventRouter> .GetInstance().BroadCastEvent(EventID.RECEIVE_RESERVE_DATA_CHANGE);
            }
        }
Пример #18
0
        public static void ShowSNSFriendData(COMDT_SNS_FRIEND_INFO info, FriendShower com)
        {
            com.ullUid         = info.ullUid;
            com.dwLogicWorldID = info.dwLogicWorldId;
            string url = UT.Bytes2String(info.szHeadUrl);

            com.HttpImage.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(url));
            com.SetFriendItemType(FriendShower.ItemType.Add, true);
            com.SetBGray(false);
            com.ShowName(string.Format("{0}({1})", UT.Bytes2String(info.szRoleName), UT.Bytes2String(info.szNickName)));
            com.ShowLevel(info.dwPvpLvl);
            com.ShowVipLevel(info.dwPvpLvl);
            com.ShowLastTime(true, UT.GetTimeString(info.dwLastLoginTime));
        }
Пример #19
0
        public static CChatEntity Build_4_Friend(COMDT_CHAT_MSG_PRIVATE data)
        {
            CChatEntity entity = new CChatEntity {
                ullUid        = data.stFrom.ullUid,
                iLogicWorldID = (uint)data.stFrom.iLogicWorldID,
                text          = UT.Bytes2String(data.szContent),
                type          = EChaterType.Friend
            };

            GetUser(entity.type, entity.ullUid, entity.iLogicWorldID, out entity.name, out entity.level, out entity.head_url, out entity.stGameVip);
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo();

            entity.time = (masterRoleInfo != null) ? masterRoleInfo.getCurrentTimeSinceLogin() : 0;
            return(entity);
        }
Пример #20
0
 private void SetBossIcon(ActorRoot inActor)
 {
     if (inActor != null)
     {
         string str = UT.Bytes2String(MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(inActor.TheActorMeta.ConfigId).szBossIcon);
         if (!string.IsNullOrEmpty(str))
         {
             this.boss_icon.SetSprite(str, this.map_fromScript, true, false, false);
         }
         else
         {
             this.boss_icon.SetSprite("UGUI/Sprite/Dynamic/BustCircle/50001", this.map_fromScript, true, false, false);
         }
     }
 }
Пример #21
0
        public static void On_NTF_CHG_INTIMACY_DENY(CSPkg msg)
        {
            SCPKG_CMD_NTF_CHG_INTIMACY_DENY stNtfChgIntimacyDeny = msg.stPkgData.stNtfChgIntimacyDeny;

            if (stNtfChgIntimacyDeny == null)
            {
                return;
            }
            COMDT_FRIEND_INFO gameOrSnsFriend = Singleton <CFriendContoller> .instance.model.GetGameOrSnsFriend(stNtfChgIntimacyDeny.stUin.ullUid, stNtfChgIntimacyDeny.stUin.dwLogicWorldId);

            string text = string.Empty;

            if (stNtfChgIntimacyDeny.bRelationChgType == 1)
            {
                string         text2       = string.Empty;
                RelationConfig relaTextCfg = CFriendRelationship.FRData.GetRelaTextCfg(stNtfChgIntimacyDeny.bIntimacyState);
                if (relaTextCfg != null)
                {
                    text2 = relaTextCfg.IntimRela_Tips_DenyYourRequest;
                }
                if (!string.IsNullOrEmpty(text2) && gameOrSnsFriend != null)
                {
                    text = string.Format(text2, UT.Bytes2String(gameOrSnsFriend.szUserName));
                    CFriendRelationship.FRData.Add(stNtfChgIntimacyDeny.stUin.ullUid, stNtfChgIntimacyDeny.stUin.dwLogicWorldId, COM_INTIMACY_STATE.COM_INTIMACY_STATE_VALUE_FULL, COM_INTIMACY_RELATION_CHG_TYPE.COM_INTIMACY_RELATION_NULL, 0u, false);
                }
            }
            if (stNtfChgIntimacyDeny.bRelationChgType == 2)
            {
                if (!IntimacyRelationViewUT.IsRelaState(stNtfChgIntimacyDeny.bIntimacyState))
                {
                    return;
                }
                RelationConfig relaTextCfg2 = CFriendRelationship.FRData.GetRelaTextCfg(stNtfChgIntimacyDeny.bIntimacyState);
                if (relaTextCfg2 == null)
                {
                    return;
                }
                if (gameOrSnsFriend != null)
                {
                    text = string.Format(relaTextCfg2.IntimRela_Tips_DenyYourDel, UT.Bytes2String(gameOrSnsFriend.szUserName));
                }
                CFriendRelationship.FRData.Add(stNtfChgIntimacyDeny.stUin.ullUid, stNtfChgIntimacyDeny.stUin.dwLogicWorldId, (COM_INTIMACY_STATE)stNtfChgIntimacyDeny.bIntimacyState, COM_INTIMACY_RELATION_CHG_TYPE.COM_INTIMACY_RELATION_NULL, 0u, false);
            }
            if (string.IsNullOrEmpty(text))
            {
                Singleton <CUIManager> .GetInstance().OpenTips(text, false, 1.5f, null, new object[0]);
            }
        }
Пример #22
0
        public static string Build_4_LoudSpeaker_EntryString(ulong ullUid, uint iLogicWorldID, string rawText)
        {
            COMDT_CHAT_PLAYER_INFO cOMDT_CHAT_PLAYER_INFO = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ullUid, iLogicWorldID);

            string result;

            if (cOMDT_CHAT_PLAYER_INFO != null)
            {
                result = string.Format(CChatController.fmt_gold_name, UT.Bytes2String(cOMDT_CHAT_PLAYER_INFO.szName), rawText);
            }
            else
            {
                result = "ERROR, in Build_4_EntryString";
            }
            return(result);
        }
Пример #23
0
        public string GetName(ulong ullUid, uint dwLogicWorldId)
        {
            COMDT_FRIEND_INFO      comdt_friend_info;
            COMDT_CHAT_PLAYER_INFO comdt_chat_player_info;

            this.GetUser(ullUid, dwLogicWorldId, out comdt_friend_info, out comdt_chat_player_info);
            if (comdt_friend_info != null)
            {
                return(UT.Bytes2String(comdt_friend_info.szUserName));
            }
            if (comdt_chat_player_info != null)
            {
                return(UT.Bytes2String(comdt_chat_player_info.szName));
            }
            return(string.Empty);
        }
Пример #24
0
        public void ShowZhaomuZhe_Item(GameObject com, CFriendRecruit.RecruitData info)
        {
            if (info.userInfo != null)
            {
                com.transform.FindChild("user/hasData").gameObject.CustomSetActive(true);
                com.transform.FindChild("user/null").gameObject.CustomSetActive(false);
                com.transform.FindChild("user/hasData/Level").gameObject.CustomSetActive(true);
                CUIHttpImageScript component = com.transform.FindChild("user/hasData/pnlSnsHead/HttpImage").GetComponent <CUIHttpImageScript>();
                UT.SetHttpImage(component, info.userInfo.szHeadUrl);
                Text component2 = com.transform.FindChild("user/hasData/Level").GetComponent <Text>();
                component2.text = string.Format("Lv.{0}", info.userInfo.dwPvpLvl);
                GameObject gameObject = com.transform.FindChild("user/hasData/pnlSnsHead/HttpImage/NobeIcon").gameObject;
                if (gameObject)
                {
                    MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(gameObject.GetComponent <Image>(), (int)info.userInfo.stGameVip.dwCurLevel, false);
                }
                Text   component3 = com.transform.FindChild("user/hasData/NameGroup/Name").GetComponent <Text>();
                string text       = UT.Bytes2String(info.userInfo.szUserName);
                if (component3 != null)
                {
                    component3.text = text;
                }
                GameObject gameObject2 = com.transform.FindChild("user/hasData/NameGroup/Gender").gameObject;
                FriendShower.ShowGender(gameObject2, info.userInfo.bGender);
            }
            else
            {
                com.transform.FindChild("user/hasData").gameObject.CustomSetActive(false);
                com.transform.FindChild("user/null").gameObject.CustomSetActive(true);
            }
            CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CFriendContoller.FriendFormPath);

            int num = Math.Min(this.zhaomuzheRewardCount, info.RewardList.get_Count());

            for (int i = 0; i < num; i++)
            {
                Transform transform = com.transform.FindChild(string.Format("reward_{0}", i));
                DebugHelper.Assert(transform != null, "rewardNodeTS not null...");
                if (!(transform == null))
                {
                    CFriendRecruit.RecruitReward recruitReward = info.RewardList.get_Item(i);
                    this.Show_Award(transform.gameObject, info.ullUid, info.dwLogicWorldId, 1, recruitReward.rewardID, recruitReward.state, form, true);
                }
            }
        }
Пример #25
0
        private string QueryEliteName(ActorRoot inActor)
        {
            string text = null;

            if (inActor == null)
            {
                return(text);
            }
            ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(inActor.TheActorMeta.ConfigId);

            if (dataCfgInfoByCurLevelDiff == null)
            {
                return(text);
            }
            string text2 = UT.Bytes2String(dataCfgInfoByCurLevelDiff.szName);

            text = text2;
            if (inActor.SkillControl == null || inActor.SkillControl.talentSystem == null)
            {
                return(text);
            }
            string text3 = string.Empty;

            PassiveSkill[] array = inActor.SkillControl.talentSystem.QueryTalents();
            if (array != null)
            {
                PassiveSkill[] array2 = array;
                for (int i = 0; i < array2.Length; i++)
                {
                    PassiveSkill passiveSkill = array2[i];
                    if (passiveSkill != null && passiveSkill.bShowAsElite)
                    {
                        text3 += passiveSkill.PassiveSkillName;
                        text3 += "之";
                    }
                }
            }
            if (!string.IsNullOrEmpty(text3))
            {
                text = text3 + text;
            }
            return(text);
        }
Пример #26
0
        public static void OnMatchTeamDestroyNtf(CSPkg msg)
        {
            byte bReason = msg.stPkgData.stMatchTeamDestroyNtf.stDetail.bReason;

            if (bReason == 20)
            {
                string text  = UT.Bytes2String(msg.stPkgData.stMatchTeamDestroyNtf.stDetail.stReasonDetail.szLeaveAcntName);
                string text2 = Singleton <CTextManager> .instance.GetText("Err_Invite_Result_3", new string[]
                {
                    text
                });

                Singleton <CUIManager> .instance.OpenTips(text2, false, 1.5f, null, new object[0]);

                Singleton <EventRouter> .instance.BroadCastEvent <byte, string>(EventID.INVITE_TEAM_ERRCODE_NTF, bReason, string.Empty);
            }
            else
            {
                Singleton <CUIManager> .instance.OpenTips(string.Format("CSProtocolMacros.SCID_MATCHTEAM_DESTROY_NTF bReason = {0} ", bReason), false, 1.5f, null, new object[0]);
            }
        }
		public static void Show_Item_Top(CUIComponent com, CFR frData, CUIFormScript uiFrom)
		{
			Image componetInChild = Utility.GetComponetInChild<Image>(com.gameObject, "Image");
			IntimacyRelationViewUT.SetRelationBGImg(componetInChild, frData.state);
			IntimacyRelationViewUT.SetButtonParam(com.m_widgets[19], frData);
			if (IntimacyRelationViewUT.IsRelaState(frData.state))
			{
				com.m_widgets[19].CustomSetActive(true);
			}
			else
			{
				com.m_widgets[19].CustomSetActive(false);
			}
			COMDT_FRIEND_INFO friendInfo = frData.friendInfo;
			if (friendInfo == null)
			{
				return;
			}
			CUIHttpImageScript component = com.m_widgets[1].GetComponent<CUIHttpImageScript>();
			UT.SetHttpImage(component, friendInfo.szHeadUrl);
			Image componetInChild2 = Utility.GetComponetInChild<Image>(component.gameObject, "NobeImag");
			if (componetInChild2 && uiFrom != null)
			{
				MonoSingleton<NobeSys>.GetInstance().SetHeadIconBk(componetInChild2, (int)friendInfo.stGameVip.dwHeadIconId);
				MonoSingleton<NobeSys>.GetInstance().SetHeadIconBkEffect(componetInChild2, (int)friendInfo.stGameVip.dwHeadIconId, uiFrom, 1f, true);
			}
			GameObject gameObject = com.m_widgets[2];
			if (gameObject)
			{
				MonoSingleton<NobeSys>.GetInstance().SetNobeIcon(gameObject.GetComponent<Image>(), (int)friendInfo.stGameVip.dwCurLevel, false, false, friendInfo.ullUserPrivacyBits);
			}
			Text component2 = com.m_widgets[3].GetComponent<Text>();
			string text = UT.Bytes2String(friendInfo.szUserName);
			if (component2 != null)
			{
				component2.set_text(text);
			}
			GameObject genderImage = com.m_widgets[4];
			FriendShower.ShowGender(genderImage, (COM_SNSGENDER)friendInfo.bGender);
		}
Пример #28
0
        public static string Build_4_ChatEntry(bool bFriend, CChatEntity ent)
        {
            string str = !bFriend ? Singleton <CTextManager> .instance.GetText("chat_title_total") : Singleton <CTextManager> .instance.GetText("chat_title_friend");

            if (bFriend)
            {
                COMDT_FRIEND_INFO gameOrSnsFriend = Singleton <CFriendContoller> .GetInstance().model.GetGameOrSnsFriend(ent.ullUid, ent.iLogicWorldID);

                if (gameOrSnsFriend != null)
                {
                    str = str + ColorString(0, UT.Bytes2String(gameOrSnsFriend.szUserName)) + ":" + ent.text;
                }
                return(str);
            }
            COMDT_CHAT_PLAYER_INFO comdt_chat_player_info = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ent.ullUid, ent.iLogicWorldID);

            if ((str != null) && (comdt_chat_player_info != null))
            {
                str = str + ColorString(0, UT.Bytes2String(comdt_chat_player_info.szName)) + ":" + ent.text;
            }
            return(str);
        }
        public static void Show_Item_Top(CUIComponent com, CFR frData)
        {
            IntimacyRelationViewUT.SetButtonParam(com.m_widgets[19], frData);
            if (frData.state == 1 || frData.state == 2)
            {
                com.m_widgets[19].CustomSetActive(true);
            }
            else
            {
                com.m_widgets[19].CustomSetActive(false);
            }
            COMDT_FRIEND_INFO friendInfo = frData.friendInfo;

            if (friendInfo == null)
            {
                return;
            }
            CUIHttpImageScript component = com.m_widgets[1].GetComponent <CUIHttpImageScript>();

            UT.SetHttpImage(component, friendInfo.szHeadUrl);
            GameObject gameObject = com.m_widgets[2];

            if (gameObject)
            {
                MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(gameObject.GetComponent <Image>(), (int)friendInfo.stGameVip.dwCurLevel, false);
            }
            Text   component2 = com.m_widgets[3].GetComponent <Text>();
            string text       = UT.Bytes2String(friendInfo.szUserName);

            if (component2 != null)
            {
                component2.text = text;
            }
            GameObject genderImage = com.m_widgets[4];

            FriendShower.ShowGender(genderImage, friendInfo.bGender);
        }
Пример #30
0
        public static string Build_4_ChatEntry(bool bFriend, CChatEntity ent)
        {
            string text = bFriend ? Singleton <CTextManager> .instance.GetText("chat_title_friend") : Singleton <CTextManager> .instance.GetText("chat_title_total");

            if (bFriend)
            {
                COMDT_FRIEND_INFO gameOrSnsFriend = Singleton <CFriendContoller> .GetInstance().model.GetGameOrSnsFriend(ent.ullUid, ent.iLogicWorldID);

                if (gameOrSnsFriend != null)
                {
                    text = text + CChatUT.ColorString(0u, UT.Bytes2String(gameOrSnsFriend.szUserName)) + ":" + ent.text;
                }
            }
            else
            {
                COMDT_CHAT_PLAYER_INFO cOMDT_CHAT_PLAYER_INFO = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ent.ullUid, ent.iLogicWorldID);

                if (text != null && cOMDT_CHAT_PLAYER_INFO != null)
                {
                    text = text + CChatUT.ColorString(0u, UT.Bytes2String(cOMDT_CHAT_PLAYER_INFO.szName)) + ":" + ent.text;
                }
            }
            return(text);
        }