Ejemplo n.º 1
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);
        }
    }
Ejemplo n.º 2
0
    private void _onOK(object arg)
    {
        NrCharUser nrCharUser = NrTSingleton <NkCharManager> .Instance.GetChar(1) as NrCharUser;

        NrPersonInfoBase        personInfo = nrCharUser.GetPersonInfo();
        WS_CHANGE_CHAR_NAME_REQ wS_CHANGE_CHAR_NAME_REQ = new WS_CHANGE_CHAR_NAME_REQ();

        TKString.StringChar(this.m_originName, ref wS_CHANGE_CHAR_NAME_REQ.szCharName);
        TKString.StringChar(this.m_newName, ref wS_CHANGE_CHAR_NAME_REQ.szChangeName);
        wS_CHANGE_CHAR_NAME_REQ.nPersonID = personInfo.GetPersonID();
        SendPacket.GetInstance().SendObject(16777258, wS_CHANGE_CHAR_NAME_REQ);
        this.m_btOk.SetEnabled(false);
    }
Ejemplo n.º 3
0
    public override void SetPersonInfo(NrPersonInfoBase pkPersonInfo)
    {
        if (pkPersonInfo == null)
        {
            return;
        }
        base.SetPersonInfo(pkPersonInfo);
        NrPersonInfoUser nrPersonInfoUser = pkPersonInfo as NrPersonInfoUser;

        if (nrPersonInfoUser == null)
        {
            return;
        }
        if (this.m_kCharBasicPart == null)
        {
            return;
        }
        this.m_kCharBasicPart.SetData(nrPersonInfoUser.GetBasePart());
        this.m_kSubChar.Set(nrPersonInfoUser.m_kSubChar);
        this.m_i64LastLoginTime = nrPersonInfoUser.m_i64LastLoginTime;
    }
Ejemplo n.º 4
0
    public int SetChar(short charunique, short buid, int charkind, eCharKindType kindtype, NrPersonInfoBase kPersonInfo, float speed, ref NrCharPartInfo pkPartInfo, byte nsolidx)
    {
        int          num   = this.AddNewChar(charunique, buid);
        NkBattleChar @char = this.GetChar(num);

        if (@char != null)
        {
            @char.SetKindType(kindtype);
            @char.SetPersonInfo(kPersonInfo);
            NrCharBase char2 = NrTSingleton <NkCharManager> .Instance.GetChar(1);

            if (charunique == char2.GetCharUnique() && !NrTSingleton <NkBattleReplayManager> .Instance.IsReplay)
            {
                @char.MyChar = true;
                @char.SetSolIdx((short)nsolidx);
            }
            if (kindtype == eCharKindType.CKT_USER && charunique != char2.GetCharUnique())
            {
                @char.ChangeCharPartInfo(pkPartInfo, true, true);
                @char.SetReadyPartInfo();
            }
            if (speed > 0f)
            {
                NrPersonInfoBase personInfo = @char.GetPersonInfo();
                if (personInfo != null)
                {
                    personInfo.SetMoveSpeed(speed);
                }
            }
            if (kindtype == eCharKindType.CKT_NPC && @char.GetCurrentOrder() == eBATTLE_ORDER.eBATTLE_ORDER_MOVE)
            {
                @char.MoveTo(kPersonInfo.GetDirection().x, kPersonInfo.GetDirection().y, kPersonInfo.GetDirection().z, false);
            }
        }
        return(num);
    }
Ejemplo n.º 5
0
    public void LevelUpAlarmUpdate()
    {
        if (!CommonTasks.IsEndOfPrework)
        {
            return;
        }
        if (NrTSingleton <FormsManager> .Instance.GetForm(G_ID.EXPLORATION_PLAY_DLG) != null)
        {
            return;
        }
        if (NrTSingleton <FormsManager> .Instance.GetForm(G_ID.EXPLORATION_REWARD_DLG) != null)
        {
            return;
        }
        if (NrTSingleton <FormsManager> .Instance.GetForm(G_ID.EXPLORATION_DLG) != null)
        {
            return;
        }
        if (NrTSingleton <FormsManager> .Instance.GetForm(G_ID.SOLCOMPOSE_GRADE_UP_SUCCESS_DLG) != null)
        {
            return;
        }
        if (NrTSingleton <FormsManager> .Instance.GetForm(G_ID.SOLCOMPOSE_SUCCESS_DLG) != null)
        {
            return;
        }
        if (this.m_SolIDList.Count == 0 && this.m_lstEventType.Count == 0)
        {
            return;
        }
        if (!NrTSingleton <NkClientLogic> .Instance.IsEffectEnable())
        {
            return;
        }
        NrCharUser nrCharUser = NrTSingleton <NkCharManager> .Instance.GetChar(1) as NrCharUser;

        if (nrCharUser == null)
        {
            return;
        }
        if (this.startLevel == 0)
        {
            this.startLevel = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.GetLevel();
        }
        if (this.m_SolIDList.Count > 0)
        {
            if (NrTSingleton <FormsManager> .Instance.IsShow(G_ID.MAIN_UI_LEVELUP_ALARM_MONARCH) || NrTSingleton <FormsManager> .Instance.IsShow(G_ID.MAIN_UI_LEVELUP_ALARM_SOLDIER))
            {
                return;
            }
            this.m_SolIDList.Sort(new Comparison <long>(AlarmManager.CompareLevel));
            long             num        = this.m_SolIDList[0];
            NrPersonInfoBase personInfo = nrCharUser.GetPersonInfo();
            if (personInfo == null)
            {
                return;
            }
            NkSoldierInfo soldierInfoFromSolID = personInfo.GetSoldierInfoFromSolID(num);
            if (soldierInfoFromSolID == null)
            {
                return;
            }
            if (NrTSingleton <NrCharKindInfoManager> .Instance.GetCharKindInfo(soldierInfoFromSolID.GetCharKind()) == null)
            {
                return;
            }
            this.m_kSolInfo = soldierInfoFromSolID;
            if (num == nrCharUser.GetUserSoldierInfo().GetSolID())
            {
                this.ShowLevelUpAlarm1();
                this.m_SolIDList.RemoveAt(0);
                this.ShowLevelUpAlarm2();
            }
            else
            {
                this.ShowLevelUpSoldier();
                this.m_SolIDList.RemoveAt(0);
            }
        }
        if (this.m_SolIDList.Count == 0 && this.m_lstEventType.Count > 0)
        {
            if (NrTSingleton <FormsManager> .Instance.IsShow(G_ID.MAIN_UI_LEVELUP_ALARM_MONARCH) || NrTSingleton <FormsManager> .Instance.IsShow(G_ID.MAIN_UI_LEVELUP_ALARM_SOLDIER))
            {
                return;
            }
            this.m_nEventType        = this.m_lstEventType[0];
            this.m_nEventTitleText   = this.m_lstEventTitleText[0];
            this.m_nEventExplainText = this.m_lstEventExplainText[0];
            this.ShowEventAlarm();
            this.m_lstEventType.RemoveAt(0);
            this.m_lstEventTitleText.RemoveAt(0);
            this.m_lstEventExplainText.RemoveAt(0);
        }
    }
Ejemplo n.º 6
0
 public override void SetPersonInfo(NrPersonInfoBase pkPersonInfo)
 {
     base.SetPersonInfo(pkPersonInfo);
 }