Example #1
0
        private void On_FriendSys_Friend_List(CSPkg msg)
        {
            SCPKG_CMD_LIST_FRIEND stFriendListRsp = msg.stPkgData.get_stFriendListRsp();
            int i = 0;

            while ((long)i < (long)((ulong)stFriendListRsp.dwFriendNum))
            {
                CSDT_FRIEND_INFO cSDT_FRIEND_INFO = stFriendListRsp.astFrindList[i];
                if (cSDT_FRIEND_INFO != null)
                {
                    if (cSDT_FRIEND_INFO.bVideoState != 0)
                    {
                        if (cSDT_FRIEND_INFO.stGameInfo.get_stDetail() == null)
                        {
                            DebugHelper.Assert(false, "CSDT_FRIEND_INFO [bMultGameSubState == COM_ACNT_MULTIGAME_GAMING] and  [stGameInfo.stDetail == null] , this is sever' guo!");
                        }
                        else
                        {
                            bool flag = false;
                            int  num  = 0;
                            while (i < this.OBFriendList.get_Count())
                            {
                                if (stFriendListRsp.astFrindList[i].stFriendInfo.stUin.ullUid == this.OBFriendList.get_Item(num).uin.ullUid)
                                {
                                    COBSystem.stOBFriend stOBFriend = this.OBFriendList.get_Item(num);
                                    stOBFriend.gameDetail = stFriendListRsp.astFrindList[i].stGameInfo.get_stDetail();
                                    this.OBFriendList.set_Item(num, stOBFriend);
                                    flag = true;
                                    break;
                                }
                                num++;
                            }
                            if (!flag)
                            {
                                COBSystem.stOBFriend stOBFriend = default(COBSystem.stOBFriend);
                                stOBFriend.uin        = stFriendListRsp.astFrindList[i].stFriendInfo.stUin;
                                stOBFriend.friendName = Utility.UTF8Convert(stFriendListRsp.astFrindList[i].stFriendInfo.szUserName);
                                stOBFriend.headUrl    = Utility.UTF8Convert(stFriendListRsp.astFrindList[i].stFriendInfo.szHeadUrl);
                                stOBFriend.gameDetail = stFriendListRsp.astFrindList[i].stGameInfo.get_stDetail();
                                this.OBFriendList.Add(stOBFriend);
                            }
                        }
                    }
                }
                i++;
            }
            this.UpdateView();
        }
Example #2
0
        private void On_FriendSys_Friend_List(CSPkg msg)
        {
            SCPKG_CMD_LIST_FRIEND stFriendListRsp = msg.stPkgData.stFriendListRsp;

            for (int i = 0; i < stFriendListRsp.dwFriendNum; i++)
            {
                CSDT_FRIEND_INFO csdt_friend_info = stFriendListRsp.astFrindList[i];
                if ((csdt_friend_info != null) && (csdt_friend_info.bVideoState != 0))
                {
                    stOBFriend friend;
                    if (csdt_friend_info.stGameInfo.stDetail == null)
                    {
                        DebugHelper.Assert(false, "CSDT_FRIEND_INFO [bMultGameSubState == COM_ACNT_MULTIGAME_GAMING] and  [stGameInfo.stDetail == null] , this is sever' guo!");
                        continue;
                    }
                    bool flag = false;
                    for (int j = 0; i < this.OBFriendList.Count; j++)
                    {
                        stOBFriend friend2 = this.OBFriendList[j];
                        if (stFriendListRsp.astFrindList[i].stFriendInfo.stUin.ullUid == friend2.uin.ullUid)
                        {
                            friend               = this.OBFriendList[j];
                            friend.gameDetail    = stFriendListRsp.astFrindList[i].stGameInfo.stDetail;
                            this.OBFriendList[j] = friend;
                            flag = true;
                            break;
                        }
                    }
                    if (!flag)
                    {
                        friend = new stOBFriend {
                            uin        = stFriendListRsp.astFrindList[i].stFriendInfo.stUin,
                            friendName = Utility.UTF8Convert(stFriendListRsp.astFrindList[i].stFriendInfo.szUserName),
                            headUrl    = Utility.UTF8Convert(stFriendListRsp.astFrindList[i].stFriendInfo.szHeadUrl),
                            gameDetail = stFriendListRsp.astFrindList[i].stGameInfo.stDetail
                        };
                        this.OBFriendList.Add(friend);
                    }
                }
            }
            this.UpdateView();
        }
Example #3
0
        private void On_FriendSys_Friend_List(CSPkg msg)
        {
            SCPKG_CMD_LIST_FRIEND stFriendListRsp = msg.stPkgData.stFriendListRsp;

            if (stFriendListRsp != null)
            {
                int num = Mathf.Min(stFriendListRsp.astFrindList.Length, (int)stFriendListRsp.dwFriendNum);
                for (int i = 0; i < num; i++)
                {
                    CSDT_FRIEND_INFO info = stFriendListRsp.astFrindList[i];
                    this.model.Add(CFriendModel.FriendType.GameFriend, info.stFriendInfo, false);
                    this.Handle_CoinSend_Data(info);
                }
                Singleton <CFriendContoller> .GetInstance().model.SortGameFriend();

                if ((this.view != null) && this.view.IsActive())
                {
                    this.view.Refresh();
                }
                Singleton <EventRouter> .GetInstance().BroadCastEvent("Rank_Friend_List");
            }
        }
Example #4
0
 private void Handle_CoinSend_Data(CSDT_FRIEND_INFO info)
 {
     this.Update_Send_Coin_Data(info.stFriendInfo.stUin, info.ullDonateAPSec, COM_FRIEND_TYPE.COM_FRIEND_TYPE_GAME);
 }