示例#1
0
        /// <summary>
        /// 获取好友数据
        /// </summary>
        /// <param name="buf">协议内容</param>
        private void OnResetFriend(KProtoBuf buf)
        {
            S2C_RESET_FRIEND msg   = buf as S2C_RESET_FRIEND;
            FriendProxy      proxy = GameFacade.Instance.RetrieveProxy(ProxyName.FriendProxy) as FriendProxy;

            proxy.Clear();
            proxy.m_Status = (FriendInfoVO.FriendState)msg.status;
            proxy.SetFirendListSize(msg.friendMaxCount);
            proxy.SetBlackListSize(msg.blackMaxCount);
            //Debugger.LogError("OnResetFriend "+proxy.m_FirendListSize+","+proxy.m_BlackListSize);
        }
示例#2
0
        /// <summary>
        /// 构造函数
        /// </summary>
        public FriendController() : base()
        {
            // ListenGameServer(KS2C_Protocol.s2c_reset_friend, OnResetFriend, typeof(S2C_RESET_FRIEND));
            FriendProxy proxy = GameFacade.Instance.RetrieveProxy(ProxyName.FriendProxy) as FriendProxy;

            proxy.Clear();
            NetworkManager.Instance.ListenGameServer(KS2C_Protocol.s2c_add_friend_back, OnAddFriendBack, typeof(S2C_ADD_FRIEND_BACK));
            NetworkManager.Instance.ListenGameServer(KS2C_Protocol.s2c_del_friend_back, OnDelFriendback, typeof(S2C_DEL_FRIEND_BACK));
            NetworkManager.Instance.ListenGameServer(KS2C_Protocol.s2c_add_black_back, OnAddBlackBack, typeof(S2C_ADD_BLACK_BACK));
            NetworkManager.Instance.ListenGameServer(KS2C_Protocol.s2c_del_black_back, OnDelBlackBack, typeof(S2C_DEL_BLACK_BACK));
            NetworkManager.Instance.ListenGameServer(KS2C_Protocol.s2c_sync_friendlist, OnFriendList, typeof(S2C_SYNC_FRIENDLIST));
            NetworkManager.Instance.ListenGameServer(KS2C_Protocol.s2c_sync_togetherlist, OnTogetherList, typeof(S2C_SYNC_TOGETHERLIST));
            NetworkManager.Instance.ListenGameServer(KS2C_Protocol.s2c_sync_friend, OnSyncFriend, typeof(S2C_SYNC_FRIEND));

            NetworkManager.Instance.ListenGameServer(KS2C_Protocol.s2c_sync_playerinfo, OnSyncPlayerInfoBack, typeof(S2C_SYNC_PLAYERINFO));

            NetworkManager.Instance.ListenGameServer(KS2C_Protocol.s2c_set_status_back, OnSetStatusBack, typeof(S2C_SET_STATUS_BACK));
            NetworkManager.Instance.ListenGameServer(KS2C_Protocol.s2c_sync_friend_invite, OnSyncFriendInvite, typeof(S2C_SYNC_FRIEND_INVITE));
            NetworkManager.Instance.ListenGameServer(KS2C_Protocol.s2c_add_friend_invite, OnAddFriendInvite, typeof(S2C_ADD_FRIEND_INVITE));
            NetworkManager.Instance.ListenGameServer(KS2C_Protocol.s2c_del_friend_invite, OnDelFriendInvite, typeof(S2C_DEL_FRIEND_INVITE));
        }