private void On_Friend_GAME_STATE_NTF(CSPkg msg)
        {
            SCPKG_CMD_NTF_FRIEND_GAME_STATE stNtfFriendGameState = msg.stPkgData.stNtfFriendGameState;

            this.model.SetFriendGameState(stNtfFriendGameState.stAcntUniq.ullUid, stNtfFriendGameState.stAcntUniq.dwLogicWorldId, (COM_ACNT_GAME_STATE)stNtfFriendGameState.bGameState, string.Empty, false);
            if ((this.view != null) && this.view.IsActive())
            {
                this.view.Refresh();
            }
            Singleton <EventRouter> .instance.BroadCastEvent(EventID.Friend_Game_State_Change);
        }
Beispiel #2
0
        private void On_Friend_GAME_STATE_NTF(CSPkg msg)
        {
            stOBFriend friend;
            SCPKG_CMD_NTF_FRIEND_GAME_STATE stNtfFriendGameState = msg.stPkgData.stNtfFriendGameState;

            for (int i = 0; i < this.OBFriendList.Count; i++)
            {
                stOBFriend friend2 = this.OBFriendList[i];
                if (friend2.uin.ullUid == stNtfFriendGameState.stAcntUniq.ullUid)
                {
                    if (stNtfFriendGameState.bVideoState == 0)
                    {
                        this.OBFriendList.RemoveAt(i);
                    }
                    else if (stNtfFriendGameState.bVideoState == 1)
                    {
                        friend               = this.OBFriendList[i];
                        friend.gameDetail    = stNtfFriendGameState.stGameInfo.stDetail;
                        this.OBFriendList[i] = friend;
                    }
                    this.UpdateView();
                    return;
                }
            }
            if (stNtfFriendGameState.bVideoState != 0)
            {
                if (stNtfFriendGameState.stGameInfo.stDetail == null)
                {
                    DebugHelper.Assert(false, "SCPKG_CMD_NTF_FRIEND_GAME_STATE [bMultGameSubState == COM_ACNT_MULTIGAME_GAMING] and  [stGameInfo.stDetail == null] , this is sever' guo!");
                }
                else
                {
                    COMDT_FRIEND_INFO comdt_friend_info = Singleton <CFriendContoller> .instance.model.getFriendByUid(stNtfFriendGameState.stAcntUniq.ullUid, CFriendModel.FriendType.GameFriend);

                    if (comdt_friend_info == null)
                    {
                        comdt_friend_info = Singleton <CFriendContoller> .instance.model.getFriendByUid(stNtfFriendGameState.stAcntUniq.ullUid, CFriendModel.FriendType.SNS);
                    }
                    if (comdt_friend_info != null)
                    {
                        friend = new stOBFriend {
                            uin        = stNtfFriendGameState.stAcntUniq,
                            friendName = Utility.UTF8Convert(comdt_friend_info.szUserName),
                            headUrl    = Utility.UTF8Convert(comdt_friend_info.szHeadUrl),
                            gameDetail = stNtfFriendGameState.stGameInfo.stDetail
                        };
                        this.OBFriendList.Add(friend);
                        this.UpdateView();
                    }
                }
            }
        }
Beispiel #3
0
        private void On_Friend_GAME_STATE_NTF(CSPkg msg)
        {
            SCPKG_CMD_NTF_FRIEND_GAME_STATE stNtfFriendGameState = msg.stPkgData.get_stNtfFriendGameState();

            COBSystem.stOBFriend stOBFriend;
            for (int i = 0; i < this.OBFriendList.get_Count(); i++)
            {
                if (this.OBFriendList.get_Item(i).uin.ullUid == stNtfFriendGameState.stAcntUniq.ullUid)
                {
                    if (stNtfFriendGameState.bVideoState == 0)
                    {
                        this.OBFriendList.RemoveAt(i);
                    }
                    else if (stNtfFriendGameState.bVideoState == 1)
                    {
                        stOBFriend            = this.OBFriendList.get_Item(i);
                        stOBFriend.gameDetail = stNtfFriendGameState.stGameInfo.get_stDetail();
                        this.OBFriendList.set_Item(i, stOBFriend);
                    }
                    this.UpdateView();
                    return;
                }
            }
            if (stNtfFriendGameState.bVideoState == 0)
            {
                return;
            }
            if (stNtfFriendGameState.stGameInfo.get_stDetail() == null)
            {
                DebugHelper.Assert(false, "SCPKG_CMD_NTF_FRIEND_GAME_STATE [bMultGameSubState == COM_ACNT_MULTIGAME_GAMING] and  [stGameInfo.stDetail == null] , this is sever' guo!");
                return;
            }
            COMDT_FRIEND_INFO friendByUid = Singleton <CFriendContoller> .get_instance().model.getFriendByUid(stNtfFriendGameState.stAcntUniq.ullUid, CFriendModel.FriendType.GameFriend, 0u);

            if (friendByUid == null)
            {
                friendByUid = Singleton <CFriendContoller> .get_instance().model.getFriendByUid(stNtfFriendGameState.stAcntUniq.ullUid, CFriendModel.FriendType.SNS, 0u);
            }
            if (friendByUid == null)
            {
                return;
            }
            stOBFriend            = default(COBSystem.stOBFriend);
            stOBFriend.uin        = stNtfFriendGameState.stAcntUniq;
            stOBFriend.friendName = Utility.UTF8Convert(friendByUid.szUserName);
            stOBFriend.headUrl    = Utility.UTF8Convert(friendByUid.szHeadUrl);
            stOBFriend.gameDetail = stNtfFriendGameState.stGameInfo.get_stDetail();
            this.OBFriendList.Add(stOBFriend);
            this.UpdateView();
        }