示例#1
0
        /// <summary>
        /// 删除好友
        /// </summary>
        /// <param name="buf">协议内容</param>
        private void OnDelFriendback(KProtoBuf buf)
        {
            S2C_DEL_FRIEND_BACK msg = buf as S2C_DEL_FRIEND_BACK;

            Debug.Log("接收del Friend========>>>>>" + msg.code);
            FriendProxy proxy = GameFacade.Instance.RetrieveProxy(ProxyName.FriendProxy) as FriendProxy;

            if (msg.code == 1)
            {
                var friend = proxy.DelFriend(msg.uid);
                if (friend != null)
                {
                    GameFacade.Instance.SendNotification(NotificationName.MSG_FRIEND_LIST_CHANGED, friend);
                }
                else
                {
                    var black = proxy.DelBlack(msg.uid);
                    if (black != null)
                    {
                        GameFacade.Instance.SendNotification(NotificationName.MSG_FRIEND_LIST_CHANGED, black);
                    }
                }
            }
            //Debugger.LogError("OnDelFriendback ");
        }
示例#2
0
        /// <summary>
        /// 添加黑名单
        /// </summary>
        /// <param name="buf">协议内容</param>
        private void OnAddBlackBack(KProtoBuf buf)
        {
            S2C_ADD_BLACK_BACK msg = buf as S2C_ADD_BLACK_BACK;

            FriendProxy proxy = GameFacade.Instance.RetrieveProxy(ProxyName.FriendProxy) as FriendProxy;

            if (msg.code == 1)
            {
                FriendInfoVO data = CreateFriendInfo(msg.friend_black);
                proxy.DelFriend(data.UID);
                proxy.DelBlack(data.UID);
                if (msg.friend_black.flag == 0)
                {
                    proxy.AddFriend(data);
                }
                else
                {
                    proxy.AddBlack(data);
                }
                GameFacade.Instance.SendNotification(NotificationName.MSG_FRIEND_LIST_CHANGED, data);
                //Debugger.LogError("add black");
            }
            //Debugger.LogError("OnAddBlackBack ");
        }