Ejemplo n.º 1
0
    public static void LinkTextProcessorRightClick(LinkText.TYPE linkTextType, string strText, string strTextKey, object objData)
    {
        if (linkTextType == LinkText.TYPE.PLAYER)
        {
            int startIndex = strText.IndexOf('[') + 1;
            int num        = strText.LastIndexOf(']') - 1;
            if (num < 0)
            {
                num = strText.Length;
            }
            string     text       = strText.Substring(startIndex, num);
            NrCharUser nrCharUser = NrTSingleton <NkCharManager> .Instance.GetChar(1) as NrCharUser;

            if (nrCharUser == null)
            {
                return;
            }
            NrPersonInfoBase personInfo = nrCharUser.GetPersonInfo();
            if (personInfo == null)
            {
                return;
            }
            string charName = personInfo.GetCharName();
            if (string.IsNullOrEmpty(charName))
            {
                return;
            }
            if (text.Equals(charName))
            {
                return;
            }
            NrTSingleton <CRightClickMenu> .Instance.CreateUI(0L, 0, text, CRightClickMenu.KIND.CHAT_USER_LINK_TEXT, CRightClickMenu.TYPE.NAME_SECTION_2, false);
        }
    }
Ejemplo n.º 2
0
    private static void PlayerLinkFunc(string strText)
    {
        if (strText.Contains("[#"))
        {
            strText = strText.Remove(0, 11);
        }
        int startIndex = strText.IndexOf('[') + 1;
        int num        = strText.LastIndexOf(']') - 1;

        if (num < 0)
        {
            num = strText.Length;
        }
        string     text       = strText.Substring(startIndex, num);
        NrCharUser nrCharUser = NrTSingleton <NkCharManager> .Instance.GetChar(1) as NrCharUser;

        if (nrCharUser == null)
        {
            return;
        }
        NrPersonInfoBase personInfo = nrCharUser.GetPersonInfo();

        if (personInfo == null)
        {
            return;
        }
        string charName = personInfo.GetCharName();

        if (string.IsNullOrEmpty(charName))
        {
            return;
        }
        if (text.Equals(charName))
        {
            return;
        }
        int charKindByName = NrTSingleton <NrCharKindInfoManager> .Instance.GetCharKindByName(strText);

        if (0 < charKindByName)
        {
            return;
        }
        if (TsPlatform.IsMobile)
        {
            NrTSingleton <CRightClickMenu> .Instance.CreateUI(0L, 0, text, CRightClickMenu.KIND.CHAT_USER_LINK_TEXT, CRightClickMenu.TYPE.NAME_SECTION_2, false);
        }
        else
        {
            GS_WHISPER_REQ gS_WHISPER_REQ = new GS_WHISPER_REQ();
            gS_WHISPER_REQ.RoomUnique = 0;
            TKString.StringChar(text, ref gS_WHISPER_REQ.Name);
            SendPacket.GetInstance().SendObject(eGAME_PACKET_ID.GS_WHISPER_REQ, gS_WHISPER_REQ);
        }
    }