示例#1
0
    public void FrameMove(float fdt)
    {
        foreach (ProfessionRole p in m_mapOtherPlayer.Values)
        {
            p.FrameMove(fdt);
        }

        if (VIEW_PLAYER_TYPE == 0)
        {
            return;
        }

        if (GRMap.grmap_loading)
        {
            return;
        }

        foreach (ProfessionRole role in m_mapOtherPlayerUnsee.Values)
        {
            m_mapOtherPlayerUnsee.Remove(role.m_unIID);
            m_mapOtherPlayerSee.Add(role.m_unIID, role);
            FriendProxy.getInstance().addNearyByPeople(role.m_unIID);

            PlayerInfoProxy.getInstance().sendLoadPlayerDetailInfo(role.m_unCID);


            return;
        }
    }
示例#2
0
    public void RemoveOtherPlayer(uint iid)
    {
        if (!m_mapOtherPlayer.ContainsKey(iid))
        {
            return;
        }

        ProfessionRole pr = m_mapOtherPlayer[iid];

        if (m_mapOtherPlayerUnsee.ContainsKey(iid))
        {
            m_mapOtherPlayerUnsee.Remove(iid);
        }
        if (m_mapOtherPlayerSee.ContainsKey(iid))
        {
            m_mapOtherPlayerSee.Remove(iid);
        }
        FriendProxy.getInstance().removeNearyByLeave(pr.m_unCID);

        m_mapOtherPlayer.Remove(iid);
        if (a3_liteMiniBaseMap.instance != null)
        {
            a3_liteMiniBaseMap.instance.removeRoleInMiniMap(pr.strIID);
        }
        pr.dispose();

        if (SelfRole._inst.m_LockRole != null && SelfRole._inst.m_LockRole.m_unIID == iid)
        {
            SelfRole._inst.m_LockRole = null;
        }

        //dispatchEvent(GameEvent.Create(MonsterMgr.EVENT_MONSTER_REMOVED, this, d));
    }
示例#3
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 ");
        }
示例#4
0
    public override void Initialize()
    {
        base.Initialize();

        m_TeamProxy         = (TeamProxy)Facade.RetrieveProxy(ProxyName.TeamProxy);
        m_FriendProxy       = (FriendProxy)Facade.RetrieveProxy(ProxyName.FriendProxy);
        m_ServerListProxy   = (ServerListProxy)Facade.RetrieveProxy(ProxyName.ServerListProxy);
        m_TeamContentRoot   = FindComponent <Transform>("Content");
        m_TypeIsAlive       = new GameObject[m_TeamProxy.MEMBERCOUNTLIMIT];
        m_TypeOnLine        = new GameObject[m_TeamProxy.MEMBERCOUNTLIMIT];
        m_TeamContents      = new Transform[m_TeamProxy.MEMBERCOUNTLIMIT];
        m_TeamCanvasGroup   = new CanvasGroup[m_TeamProxy.MEMBERCOUNTLIMIT];
        m_TeamNameLabel     = new TextMeshProUGUI[m_TeamProxy.MEMBERCOUNTLIMIT];
        m_TeamDefenseSlider = new Slider[m_TeamProxy.MEMBERCOUNTLIMIT];
        m_TeamHPSlider      = new Slider[m_TeamProxy.MEMBERCOUNTLIMIT];
        for (int i = 0; i < m_TeamContentRoot.childCount; i++)
        {
            m_TeamContents[i]      = m_TeamContentRoot.GetChild(i).GetChild(0);
            m_TeamCanvasGroup[i]   = m_TeamContentRoot.GetChild(i).GetOrAddComponent <CanvasGroup>();
            m_TeamNameLabel[i]     = m_TeamContentRoot.GetChild(i).Find("Normal/Name/Name").GetComponent <TextMeshProUGUI>();
            m_TeamDefenseSlider[i] = m_TeamContentRoot.GetChild(i).Find("Normal/Slider/Slider_MP").GetComponent <Slider>();
            m_TeamHPSlider[i]      = m_TeamContentRoot.GetChild(i).Find("Normal/Slider/Slider_Hp").GetComponent <Slider>();
            m_TypeIsAlive[i]       = m_TeamContentRoot.GetChild(i).Find("Normal/Type1").gameObject;
            m_TypeOnLine[i]        = m_TeamContentRoot.GetChild(i).Find("Normal/Type2").gameObject;
            Debug.Log(m_TeamDefenseSlider[i]);
        }
    }
示例#5
0
        /// <summary>
        /// 删除好友邀请列表
        /// </summary>
        /// <param name="buf">协议内容</param>
        private void OnDelFriendInvite(KProtoBuf buf)
        {
            S2C_DEL_FRIEND_INVITE msg   = buf as S2C_DEL_FRIEND_INVITE;
            FriendProxy           proxy = GameFacade.Instance.RetrieveProxy(ProxyName.FriendProxy) as FriendProxy;

            proxy.DelFriendInvite(msg.id);
            GameFacade.Instance.SendNotification(NotificationName.MSG_FRIEND_INVITE_LIST_CHANGED);
        }
示例#6
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);
        }
示例#7
0
        /// <summary>
        /// 同频好友邀请数据
        /// </summary>
        /// <param name="buf">协议内容</param>
        private void OnSyncFriendInvite(KProtoBuf buf)
        {
            S2C_SYNC_FRIEND_INVITE msg   = buf as S2C_SYNC_FRIEND_INVITE;
            FriendProxy            proxy = GameFacade.Instance.RetrieveProxy(ProxyName.FriendProxy) as FriendProxy;
            FriendInviteInfoVO     m_Req = new FriendInviteInfoVO();

            m_Req.ID      = msg.data.id;
            m_Req.UID     = msg.data.uid;
            m_Req.Name    = msg.data.name;
            m_Req.Level   = msg.data.level;
            m_Req.AddTime = msg.data.addTime;
            proxy.AddFriendInvite(m_Req);
        }
示例#8
0
 /// <summary>
 /// 视图打开时调用
 /// </summary>
 /// <param name="owner">父视图</param>
 public override void OnShow(object msg)
 {
     base.OnShow(msg);
     m_FriendProxy             = GameFacade.Instance.RetrieveProxy(ProxyName.FriendProxy) as FriendProxy;
     m_TeamProxy               = GameFacade.Instance.RetrieveProxy(ProxyName.TeamProxy) as TeamProxy;
     m_CfgEternityProxy        = GameFacade.Instance.RetrieveProxy(ProxyName.CfgEternityProxy) as CfgEternityProxy;
     m_ServerListProxy         = GameFacade.Instance.RetrieveProxy(ProxyName.ServerListProxy) as ServerListProxy;
     m_OldVoUid                = 2;
     m_SelectVoUid             = 0;
     State.OnSelectionChanged -= OnSelectionDataChanged;
     State.OnSelectionChanged += OnSelectionDataChanged;
     State.SetActionCompareEnabled(false);
 }
示例#9
0
        /// <summary>
        /// 请求添加指定玩家到好友列表
        /// </summary>
        /// <param name="uid">玩家uid</param>
        public void RequestAddToFriendList(ulong uid)
        {
            FriendProxy proxy = GameFacade.Instance.RetrieveProxy(ProxyName.FriendProxy) as FriendProxy;

            if (proxy.GetBlack(uid) != null)
            {
                RequestDeleteFromBlackList(uid);
            }
            C2S_ADD_FRIEND msg = new C2S_ADD_FRIEND();

            msg.protocolID = (ushort)KC2S_Protocol.c2s_add_friend;
            msg.uid        = uid;
            NetworkManager.Instance.SendToGameServer(msg);
        }
示例#10
0
        /// <summary>
        /// 添加好友邀请列表
        /// </summary>
        /// <param name="buf">协议内容</param>
        private void OnAddFriendInvite(KProtoBuf buf)
        {
            S2C_ADD_FRIEND_INVITE msg   = buf as S2C_ADD_FRIEND_INVITE;
            FriendProxy           proxy = GameFacade.Instance.RetrieveProxy(ProxyName.FriendProxy) as FriendProxy;
            FriendInviteInfoVO    m_Req = new FriendInviteInfoVO();

            m_Req.ID      = msg.data.id;
            m_Req.UID     = msg.data.uid;
            m_Req.Name    = msg.data.name;
            m_Req.Level   = msg.data.level;
            m_Req.AddTime = msg.data.addTime;
            proxy.AddFriendInvite(m_Req);
            GameFacade.Instance.SendNotification(NotificationName.MSG_FRIEND_INVITE_LIST_CHANGED);
        }
示例#11
0
        /// <summary>
        /// 获取共同玩过的列表
        /// </summary>
        /// <param name="buf"></param>
        private void OnTogetherList(KProtoBuf buf)
        {
            S2C_SYNC_TOGETHERLIST msg = buf as S2C_SYNC_TOGETHERLIST;
            //	Debug.Log("ssssssssssssss");
            FriendProxy proxy = GameFacade.Instance.RetrieveProxy(ProxyName.FriendProxy) as FriendProxy;

            for (int i = 0; i < msg.togetherlist.Count; i++)
            {
                FriendInfoVO data = CreateFriendInfo(msg.togetherlist[i]);
                proxy.AddRecent(data);
            }

            GameFacade.Instance.SendNotification(NotificationName.MSG_FRIEND_LIST_CHANGED);
        }
示例#12
0
        public List <FriendGroupProxy> Friend_GetFriendGroupsWithFriends(int userID)
        {
            if (!CheckClient())
            {
                return(null);
            }
            List <FriendGroupProxy> groups     = new List <FriendGroupProxy>();
            FriendGroupCollection   temp       = FriendBO.Instance.GetFriendGroups(userID);
            FriendGroupProxy        blackGroup = new FriendGroupProxy();

            blackGroup.GroupID = -1;
            blackGroup.Name    = "#black list";



            FriendCollection friends = FriendBO.Instance.GetFriendAndBlackList(userID);

            foreach (BlacklistItem b in friends.Blacklist)
            {
                FriendProxy fItem = new FriendProxy();
                fItem.GroupID = b.GroupID;
                fItem.UserID  = b.UserID;
                blackGroup.Friends.Add(fItem);
            }

            foreach (FriendGroup fg in temp)
            {
                groups.Add(ProxyConverter.GetFriendGroupProxy(fg));
            }

            while (friends.Count > 0)
            {
                Friend      friend = friends[friends.Count - 1];
                FriendProxy fp     = ProxyConverter.GetFriendProxy(friend);

                foreach (FriendGroupProxy proxy in groups)
                {
                    if (proxy.GroupID == friend.GroupID)
                    {
                        proxy.Friends.Add(fp);
                    }
                }

                friends.Remove(friend);
            }
            groups.Add(blackGroup);

            return(groups);
        }
示例#13
0
        public static FriendProxy GetFriendProxy(MaxLabs.bbsMax.Entities.Friend friend)
        {
            if (friend == null)
            {
                return(null);
            }

            FriendProxy friendProxy = new FriendProxy();

            friendProxy.UserID     = friend.UserID;
            friendProxy.OwnerID    = friend.OwnerID;
            friendProxy.Hot        = friend.Hot;
            friendProxy.GroupID    = friend.GroupID;
            friendProxy.CreateDate = friend.CreateDate.AddHours(-DateTimeUtil.DatabaseTimeDifference);
            return(friendProxy);
        }
示例#14
0
        /// <summary>
        /// 好友或黑名单数据变化
        /// </summary>
        /// <param name="buf">协议内容</param>
        private void OnSyncFriend(KProtoBuf buf)
        {
            S2C_SYNC_FRIEND msg   = buf as S2C_SYNC_FRIEND;
            FriendProxy     proxy = GameFacade.Instance.RetrieveProxy(ProxyName.FriendProxy) as FriendProxy;
            FriendInfoVO    data  = CreateFriendInfo(msg.friend_syc);

            if (msg.friend_syc.flag == 0)
            {
                proxy.AddFriend(data);
            }
            else
            {
                proxy.AddBlack(data);
            }
            GameFacade.Instance.SendNotification(NotificationName.MSG_FRIEND_LIST_CHANGED, data);
            //Debugger.LogError("OnSyncFriend 1 >" + data.UID + "." + data.Name);
        }
示例#15
0
        /// <summary>
        /// 获取好友列表
        /// </summary>
        /// <param name="buf"></param>
        private void OnFriendList(KProtoBuf buf)
        {
            S2C_SYNC_FRIENDLIST msg   = buf as S2C_SYNC_FRIENDLIST;
            FriendProxy         proxy = GameFacade.Instance.RetrieveProxy(ProxyName.FriendProxy) as FriendProxy;

            for (int i = 0; i < msg.friendlist.Count; i++)
            {
                FriendInfoVO data = CreateFriendInfo(msg.friendlist[i]);
                if (msg.friendlist[i].flag == 0)
                {
                    proxy.AddFriend(data);
                }
                else
                {
                    proxy.AddBlack(data);
                }
            }
            GameFacade.Instance.SendNotification(NotificationName.MSG_FRIEND_LIST_CHANGED);
            //Debugger.LogError("OnSyncFriend 1 >" + data.UID + "." + data.Name);
        }
示例#16
0
 public void Initialize()
 {
     m_FriendProxy       = (FriendProxy)GameFacade.Instance.RetrieveProxy(ProxyName.FriendProxy);
     m_TeamProxy         = (TeamProxy)GameFacade.Instance.RetrieveProxy(ProxyName.TeamProxy);
     m_CfgEternityProxy  = (CfgEternityProxy)GameFacade.Instance.RetrieveProxy(ProxyName.CfgEternityProxy);
     m_HeardImage        = TransformUtil.FindUIObject <Image>(transform, "Content/Image_Head");
     m_OnLineImage       = TransformUtil.FindUIObject <Image>(transform, "Content/Image_State");
     m_TeamHeardImage    = TransformUtil.FindUIObject <Image>(transform, "Content/Image_Head2");
     m_TeamOnLineImage   = TransformUtil.FindUIObject <Image>(transform, "Content/Image_State2");
     m_PlayerName        = TransformUtil.FindUIObject <TextMeshProUGUI>(transform, "Content/Mask/Label_Name");
     m_LevelText         = TransformUtil.FindUIObject <TextMeshProUGUI>(transform, "Content/Mask/Label_LV");
     m_DanText           = TransformUtil.FindUIObject <TextMeshProUGUI>(transform, "Content/Mask/Label_Rank");
     m_TeamPosImage      = TransformUtil.FindUIObject <Image>(transform, "Content/Image_Number");
     m_TeamHeaderImage   = TransformUtil.FindUIObject <Image>(transform, "Content/Icon/Image_Mark1");
     m_TeamVoiceImage    = TransformUtil.FindUIObject <Image>(transform, "Content/Icon/Image_Mark3");
     m_TeamFriendImage   = TransformUtil.FindUIObject <Image>(transform, "Content/Icon/Image_Mark2");
     m_TeamIamgeSignRoot = TransformUtil.FindUIObject <Transform>(transform, "Content/Icon");
     m_NullElelment      = TransformUtil.FindUIObject <Transform>(transform, "Image_Empty");
     m_Elelment          = TransformUtil.FindUIObject <Transform>(transform, "Content");
     m_TeamPosIcons      = new int[] { 40005, 40006, 40007, 40008, 40009 };
 }
示例#17
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));
        }
示例#18
0
        public void OnClickToggleHandler(Toggle toggle)
        {
            //if(_currentToggle == toggle)
            //return;
            if (toggle.isOn)
            {
                FriendProxy   friendProxy = FriendProxy.instance;
                ToggleContent tc          = toggle.GetComponent <ToggleContent>();
                _currentToggleId = tc.id;

                if (_currentToggleId == 1 && friendProxy.NewFriendListComing)
                {
                    FriendController.instance.CLIENT2LOBBY_FriendListReq_REQ();
                }
                else if (_currentToggleId == 3 && friendProxy.NewFriendRequestComing)
                {
                    FriendController.instance.CLIENT2LOBBY_FriendMsgListReq_REQ();
                }
                else
                {
                    Refresh(true);
                }
                if (_currentToggleId == 1)
                {
                    FriendProxy.instance.NewFriendListComing = false;
                }
                else if (_currentToggleId == 3)
                {
                    FriendProxy.instance.NewFriendRequestComing = false;
                }
                for (int i = 0; i < bottomBtnRoot.Length; i++)
                {
                    bottomBtnRoot[i].SetActive(i == (_currentToggleId - 1));
                }
                _currentToggle = toggle;
            }
        }
示例#19
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 ");
        }
示例#20
0
 /// <summary>
 /// 好友当前状态
 /// </summary>
 /// <param name="buf">协议内容</param>
 private void OnSetStatusBack(KProtoBuf buf)
 {
     S2C_SET_STATUS_BACK msg   = buf as S2C_SET_STATUS_BACK;
     FriendProxy         proxy = GameFacade.Instance.RetrieveProxy(ProxyName.FriendProxy) as FriendProxy;
     //proxy.SetMember(msg.);
 }