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);
            }
        }
 public void SetData(ulong ullUid, uint dwLogicWorldId, byte result, FriendReserve.ReserveDataType type)
 {
     FriendReserve.Ent ent = this.Find(ullUid, dwLogicWorldId, type);
     if (ent != null)
     {
         ent.result = result;
     }
     else
     {
         ListView <FriendReserve.Ent> listView = this.dataList[(int)type];
         listView.Add(new FriendReserve.Ent(ullUid, dwLogicWorldId, result, string.Empty, string.Empty));
     }
 }
        public FriendReserve.Ent Find(ulong ullUid, uint dwLogicWorldId, FriendReserve.ReserveDataType type)
        {
            ListView <FriendReserve.Ent> listView = this.dataList[(int)type];

            for (int i = 0; i < listView.Count; i++)
            {
                FriendReserve.Ent ent = listView[i];
                if (ent != null && ent.ullUid == ullUid && ent.dwLogicWorldId == dwLogicWorldId)
                {
                    return(ent);
                }
            }
            return(null);
        }
        private static void SetFriendState(GameObject element, ref COMDT_FRIEND_INFO friend)
        {
            if (element == null || friend == null)
            {
                return;
            }
            CFriendModel model       = Singleton <CFriendContoller> .instance.model;
            GameObject   gameObject  = element.transform.FindChild("HeadBg").gameObject;
            GameObject   gameObject2 = element.transform.FindChild("InviteButton").gameObject;
            Text         component   = element.transform.FindChild("Online").GetComponent <Text>();
            Text         component2  = element.transform.FindChild("PlayerName").GetComponent <Text>();
            GameObject   obj         = Utility.FindChild(element, "HeadBg/AntiDisturbBits");

            obj.CustomSetActive(false);
            Text component3 = element.transform.FindChild("Time").GetComponent <Text>();
            bool flag       = false;

            if (component3 != null)
            {
                component3.gameObject.CustomSetActive(false);
            }
            if (component != null)
            {
                component.gameObject.CustomSetActive(true);
            }
            GameObject gameObject3 = Utility.FindChild(element, "ReserveButton");

            gameObject3.CustomSetActive(false);
            GameObject gameObject4 = Utility.FindChild(element, "ReserveText");

            gameObject4.CustomSetActive(false);
            CInviteView.SetListElementLadderInfo(element, friend);
            COM_ACNT_GAME_STATE cOM_ACNT_GAME_STATE = COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE;

            if (friend.bIsOnline == 1)
            {
                CFriendModel.FriendInGame friendInGaming = Singleton <CFriendContoller> .instance.model.GetFriendInGaming(friend.stUin.ullUid, friend.stUin.dwLogicWorldId);

                if (friendInGaming == null)
                {
                    cOM_ACNT_GAME_STATE = COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE;
                }
                else
                {
                    cOM_ACNT_GAME_STATE = friendInGaming.State;
                    flag = ((friendInGaming.antiDisturbBits & 1u) == 1u);
                }
                if (cOM_ACNT_GAME_STATE == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE)
                {
                    if (flag)
                    {
                        component.set_text(Singleton <CTextManager> .instance.GetText("Common_NotDisturb"));
                        obj.CustomSetActive(true);
                    }
                    else
                    {
                        component.set_text(Singleton <CInviteSystem> .instance.GetInviteStateStr(friend.stUin.ullUid, false));
                    }
                    if (friendInGaming != null && friendInGaming.IsUseTGA())
                    {
                        component.gameObject.CustomSetActive(true);
                        component.set_text(string.Format("<color=#ffff00>{0}</color>", Singleton <CTextManager> .instance.GetText("TGA_Friend_State")));
                    }
                    CUIEventScript component4 = gameObject2.GetComponent <CUIEventScript>();
                    component4.m_onClickEventParams.tag  = (int)Singleton <CInviteSystem> .instance.InviteType;
                    component4.m_onClickEventParams.tag2 = (int)friend.stUin.dwLogicWorldId;
                    component4.m_onClickEventParams.commonUInt64Param1 = friend.stUin.ullUid;
                }
                else if (cOM_ACNT_GAME_STATE == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_SINGLEGAME || cOM_ACNT_GAME_STATE == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_MULTIGAME || cOM_ACNT_GAME_STATE == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_WAITMULTIGAME)
                {
                    if (friendInGaming == null)
                    {
                        component.gameObject.CustomSetActive(true);
                        component.set_text("friendInGame is null");
                        return;
                    }
                    if (friendInGaming.startTime > 0u)
                    {
                        component.gameObject.CustomSetActive(false);
                        component3.gameObject.CustomSetActive(true);
                        component3.set_text(string.Format(Singleton <CTextManager> .instance.GetText("Common_Gaming_Time"), CInviteView.GetStartMinute(friendInGaming.startTime)));
                        Singleton <CInviteSystem> .instance.CheckInviteListGameTimer();

                        if (Singleton <CFriendContoller> .instance.model.friendReserve.BServerEnableReverse)
                        {
                            FriendReserve.Ent          ent = model.friendReserve.Find(friend.stUin.ullUid, friend.stUin.dwLogicWorldId, FriendReserve.ReserveDataType.Send);
                            ushort                     num;
                            CFriendModel.EIntimacyType eIntimacyType;
                            bool flag2;
                            model.GetFriendIntimacy(friend.stUin.ullUid, friend.stUin.dwLogicWorldId, out num, out eIntimacyType, out flag2);
                            if (ent == null)
                            {
                                bool flag3 = (friendInGaming.antiDisturbBits & 1u) > 0u;
                                bool flag4 = (friend.dwRefuseFriendBits & 16u) == 0u;
                                if (flag4 && !flag3 && num >= 100)
                                {
                                    gameObject3.CustomSetActive(true);
                                    gameObject4.CustomSetActive(false);
                                    if (gameObject3 != null)
                                    {
                                        CUIEventScript component5 = gameObject3.GetComponent <CUIEventScript>();
                                        component5.m_onClickEventParams.commonUInt64Param1 = friend.stUin.ullUid;
                                        component5.m_onClickEventParams.tagUInt            = friend.stUin.dwLogicWorldId;
                                        component5.m_onClickEventParams.tagStr             = Utility.UTF8Convert(friend.szUserName);
                                    }
                                }
                            }
                            else
                            {
                                gameObject3.CustomSetActive(false);
                                gameObject4.CustomSetActive(true);
                                if (gameObject4 != null)
                                {
                                    Text component6 = gameObject4.GetComponent <Text>();
                                    if (component6 != null)
                                    {
                                        if (ent != null && ent.result == 2)
                                        {
                                            component6.set_text(model.friendReserve.Reserve_Success);
                                        }
                                        else if (ent != null && ent.result == 1)
                                        {
                                            component6.set_text(model.friendReserve.Reserve_Failed);
                                        }
                                        else
                                        {
                                            component6.set_text(model.friendReserve.Reserve_Wait4Rsp);
                                        }
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        component.gameObject.CustomSetActive(true);
                        component.set_text(string.Format("<color=#ffff00>{0}</color>", Singleton <CTextManager> .instance.GetText("Common_Gaming_NoTime")));
                    }
                }
                else if (cOM_ACNT_GAME_STATE == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_TEAM)
                {
                    component.set_text(string.Format("<color=#ffff00>{0}</color>", Singleton <CTextManager> .instance.GetText("Common_Teaming")));
                }
                component2.set_color(CUIUtility.s_Color_White);
                CUIUtility.GetComponentInChildren <Image>(gameObject).set_color(CUIUtility.s_Color_White);
            }
            else
            {
                component.set_text(string.Format(Singleton <CTextManager> .instance.GetText("Common_Offline"), new object[0]));
                component2.set_color(CUIUtility.s_Color_Grey);
                CUIUtility.GetComponentInChildren <Image>(gameObject).set_color(CUIUtility.s_Color_GrayShader);
            }
            gameObject2.CustomSetActive(friend.bIsOnline == 1 && !flag && cOM_ACNT_GAME_STATE == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE);
        }
 public bool IsReservable(ulong ullUid, uint dwLogicWorldId, FriendReserve.ReserveDataType type)
 {
     FriendReserve.Ent ent = this.Find(ullUid, dwLogicWorldId, type);
     return(ent == null);
 }