Ejemplo n.º 1
0
        private void HandleRelationApplicationFeedback(byte[] data)
        {
            RelationApplicationS2C feedback = ProtobufUtils.Deserialize <RelationApplicationS2C>(data);

            if (feedback.result)
            {
                switch (feedback.applciationType)
                {
                case RelationApplicationType.ApplyingRelation:

                    MessageDispatcher.PostMessage(Constants.MessageType.OpenAlertWindow, null, UI.AlertType.ConfirmAlone, "好友申请已经发送,请耐心等待对方确认", "提示");

                    break;

                case RelationApplicationType.BlockList:

                    for (int i = 0; i < worldChatDataList.Count; i++)
                    {
                        ChatDataStruct chatData = worldChatDataList [i];
                        if (chatData.chatPlayerInfo.playerId == feedback.friendId)
                        {
                            worldChatDataList.Remove(chatData);
                            i--;
                        }
                    }

                    MessageDispatcher.PostMessage(Constants.MessageType.OpenAlertWindow, null, UI.AlertType.ConfirmAlone, "已将该玩家拉入黑名单", "提示");

                    break;
                }
            }
        }
Ejemplo n.º 2
0
        private void HandleRelationApplicationFeedback(byte[] data)
        {
            RelationApplicationS2C feedback = ProtobufUtils.Deserialize <RelationApplicationS2C>(data);

            if (feedback.result)
            {
                switch (feedback.applciationType)
                {
                case RelationApplicationType.AcceptRelation:
                    FriendListDataStruct acceptRelationData = applicationPlayerDataList.Find(p => p.playerUID == feedback.friendId);
                    applicationPlayerDataList.Remove(acceptRelationData);
                    friendListPlayerDataList.Add(acceptRelationData);
                    view.RefreshApplicationInfomationPlayerList();
                    DataManager.GetInstance().SetRedBubbleNum(CaptionType.RelationApplicationCaption, DataManager.GetInstance().GetRedBubbleNum(CaptionType.EmailCaption) - 1);
                    view.RefresRedBubble();

                    break;

                case RelationApplicationType.BlockList:
                    FriendListDataStruct blockData = friendListPlayerDataList.Find(p => p.playerUID == feedback.friendId);
                    friendListPlayerDataList.Remove(blockData);
                    view.RefreshFriendList();
                    break;

                case RelationApplicationType.Unblock:
                    FriendListDataStruct unblockData = blackListPlayerDataList.Find(p => p.playerUID == feedback.friendId);
                    blackListPlayerDataList.Remove(unblockData);
                    view.RefreshBlackList();
                    break;

                case RelationApplicationType.RefuseRelation:
                    FriendListDataStruct refuseRelationData = applicationPlayerDataList.Find(p => p.playerUID == feedback.friendId);
                    applicationPlayerDataList.Remove(refuseRelationData);
                    view.RefreshApplicationInfomationPlayerList();
                    DataManager.GetInstance().SetRedBubbleNum(CaptionType.RelationApplicationCaption, DataManager.GetInstance().GetRedBubbleNum(CaptionType.EmailCaption) - 1);
                    view.RefresRedBubble();
                    break;

                case RelationApplicationType.RemoveRelation:
                    FriendListDataStruct removeRelationData = friendListPlayerDataList.Find(p => p.playerUID == feedback.friendId);
                    friendListPlayerDataList.Remove(removeRelationData);
                    view.RefreshFriendList();
                    break;
                }
            }
        }