void ShowItemInfo()
    {
        if (m_QueryInfo != null)
        {
            m_PlayerID        = m_QueryInfo.GetUserID();
            m_NickName.text   = m_QueryInfo.GetNickName();
            m_LevelLabel.text = string.Format("Lv." + m_QueryInfo.GetLevel().ToString());
            m_Address.text    = m_QueryInfo.GetIPAddress();;
            ShowQueryGender();
            //显示头像
            if (m_QueryInfo.GetFaceID() < ConstValue.CUSTOM_HEADER)
            {
                m_FaceTexture.mainTexture = GlobalHallUIMgr.Instance.m_HeadTextureUI[m_QueryInfo.GetFaceID()];
            }
            else
            {
                HeaderManager.Instance.GetPlayerHeader(m_QueryInfo.GetUserID(), m_QueryInfo.GetFaceID(), HeaderOptType.HEADER_FIND, null);
            }
        }
        else if (m_BlacklistInfo != null)
        {
            m_PlayerID        = m_BlacklistInfo.GetUserID();
            m_NickName.text   = m_BlacklistInfo.GetNickName();
            m_LevelLabel.text = string.Format("Lv." + m_BlacklistInfo.GetLevel().ToString());
            m_Address.text    = m_BlacklistInfo.GetIPAddress();
            ShowBlacklistGender();
            //显示头像
            if (m_BlacklistInfo.GetFaceID() < ConstValue.CUSTOM_HEADER)
            {
                m_FaceTexture.mainTexture = GlobalHallUIMgr.Instance.m_HeadTextureUI[m_BlacklistInfo.GetFaceID()];
            }
            else
            {
                HeaderManager.Instance.GetPlayerHeader(m_BlacklistInfo.GetUserID(), m_BlacklistInfo.GetFaceID(), HeaderOptType.HEADER_BLACK, null);
            }
        }


        //如果该玩家已经是好友了则添加好友按纽变灰
        if (PlayerRole.Instance.RelationManager.GetFriendMap() != null &&
            PlayerRole.Instance.RelationManager.GetFriendMap().ContainsKey(m_PlayerID) == true)
        {
            m_UIButton.isEnabled = false;
        }
    }
Exemple #2
0
    bool HandGetRoleRelation(NetCmdBase obj)
    {
        LC_Cmd_GetUserRelation ncb = (LC_Cmd_GetUserRelation)obj;

        //向客户端添加关系集合
        if ((ncb.States & FishDataInfo.MsgBegin) != 0)
        {
            FriendMap.Clear();
            BlackListMap.Clear();
        }
        for (UInt16 i = 0; i < ncb.Sum; ++i)
        {
            RelationRole pBase = new RelationRole(ncb.Array[i]);
            if (ncb.Array[i].bRelationType == 1)
            {
                if (FriendMap.ContainsKey(pBase.GetUserID()))
                {
                    return(false);
                }
                FriendMap.Add(pBase.GetUserID(), pBase);
            }
            else if (ncb.Array[i].bRelationType == 2)
            {
                if (BlackListMap.ContainsKey(pBase.GetUserID()))
                {
                    return(false);
                }
                BlackListMap.Add(pBase.GetUserID(), pBase);
            }
        }
        if ((ncb.States & FishDataInfo.MsgEnd) != 0)
        {
            m_IsLoad = true;

            tagFriendLoadEvent pFirendEvent = new tagFriendLoadEvent();
            MsgEventHandle.HandleMsg(pFirendEvent);

            tagBlackLoadEvent pBlackEvent = new tagBlackLoadEvent();
            MsgEventHandle.HandleMsg(pBlackEvent);
        }
        return(true);
    }
Exemple #3
0
    bool HandleAddRelation(NetCmdBase obj)
    {
        LC_Cmd_AddUserRelation ncb = (LC_Cmd_AddUserRelation)obj;

        tagUserOperationEvent pUOM = new tagUserOperationEvent((ncb.Result ? UserOperateMessage.UOM_Relation_AddRelation_Sucess : UserOperateMessage.UOM_Relation_AddRelation_Failed_4));

        MsgEventHandle.HandleMsg(pUOM);

        if (ncb.Result == false)
        {
            return(false);
        }
        RelationRole pBase = new RelationRole(ncb.RelationInfo);

        if (ncb.RelationInfo.bRelationType == 1)
        {
            FriendMap.Add(pBase.GetUserID(), pBase);

            //FriendSysManager.Instance.OnAddFriend(ncb.RelationInfo.dwDestRoleID);
            //tagFriendChangeEvent pFirendEvent = new tagFriendChangeEvent();
            //MsgEventHandle.HandleMsg(pFirendEvent);
            tagFriendAddEvent pFriendEvent = new tagFriendAddEvent(ncb.RelationInfo.dwDestRoleID);
            MsgEventHandle.HandleMsg(pFriendEvent);
        }
        else if (ncb.RelationInfo.bRelationType == 2)
        {
            BlackListMap.Add(pBase.GetUserID(), pBase);

            //tagBlackChangeEvent pBlackEvent = new tagBlackChangeEvent();
            //MsgEventHandle.HandleMsg(pBlackEvent);

            tagBlackAddEvent pBlackEvent = new tagBlackAddEvent(ncb.RelationInfo.dwDestRoleID);
            MsgEventHandle.HandleMsg(pBlackEvent);
        }
        return(true);
    }
Exemple #4
0
    void ShowListItemInfo()
    {
        //头像显示
        //if (m_FriendItemInfo.GetFaceID() < ConstValue.CUSTOM_HEADER)
        //    m_FaceTexture.mainTexture = GlobalHallUIMgr.Instance.m_HeadTextureUI[m_FriendItemInfo.GetFaceID()];
        //else
        //    HeaderManager.Instance.GetPlayerHeader(m_FriendItemInfo.GetUserID(), m_FriendItemInfo.GetFaceID(), HeaderOptType.HEADER_FRIEND,
        //        (byte)WndType.Friend_Wnd);
        uint faceID   = m_FriendItemInfo.GetFaceID();
        uint playerID = m_FriendItemInfo.GetUserID();

        HeaderManager.Instance.SetHead(m_FaceTexture, faceID, playerID, faceID, HeaderOptType.HEADER_FRIEND, (byte)WndType.Friend_Wnd);

        m_NickName.text = m_FriendItemInfo.GetNickName();
        m_Level.text    = m_FriendItemInfo.GetLevel().ToString();

        if (m_FriendItemInfo.GetLeaveOnlineDay() == 255)
        {
            m_OnLineLast.text = StringTable.GetString("Relation_Online");
        }
        else
        {
            m_OnLineLast.text = StringTable.GetString("Relation_Offline");
        }

        if (m_FriendItemInfo.GetLeaveOnlineDay() != 255)
        {
            m_GenderSprite.spriteName = "offline";
        }
        //性别
        else if (!m_FriendItemInfo.GetGender())
        {
            m_GenderSprite.spriteName = "male";
        }
        else
        {
            m_GenderSprite.spriteName = "female";
        }

        //IP地址
        m_IPAddress.text = m_FriendItemInfo.GetIPAddress();

        //VIP
        if (m_FriendItemInfo.GetVipLevel() > 0)
        {
            m_VipIcon.gameObject.SetActive(true);
            m_VipIcon.spriteName = string.Format("Vip_Icon_0{0}", m_FriendItemInfo.GetVipLevel());
        }

        //检查该好友是否已经送赠送过了
        if (PlayerRole.Instance.GiffManager.GetNowDaySendGiffInfo() != null)
        {
            if (PlayerRole.Instance.GiffManager.GetNowDaySendGiffInfo().ContainsKey(m_FriendItemInfo.GetUserID()))
            {
                SetPressentBtn();
            }
            //m_UIPresentBtn.enabled = false;
        }
        //检查是否有新消息
        if (PlayerRole.Instance.RoleChar.GetCharList() != null)
        {
            if (PlayerRole.Instance.RoleChar.GetCharList().ContainsKey(m_FriendItemInfo.GetUserID()))
            {
                SetNewMsgSate();
            }
        }
    }