Ejemplo n.º 1
0
    void responseLogin(C_BasePacket eventData)
    {
#if DEBUGMODE
#endif
        if (eventData.m_basicType != BasePacketType.basePacketTypeLogin)
        {
            return;
        }
        C_LoginPacket data = (C_LoginPacket)eventData;
        if (data.m_loginType != LoginPacketType.loginPacketTypeLoginResponse)
        {
            return;
        }
        stopWaiting();

        C_LoginResponsePacket curData = (C_LoginResponsePacket)data;

        if (curData.m_bFlag == true) // 로그인 성공
        {
            S_UserAccessData accessData = new S_UserAccessData();
            accessData.m_accessID = m_idInputfield.text;
            accessData.m_accessPW = m_pwInputfield.text;
            GameManager.m_Instance.setAccessData(accessData);
            clearUserInfo(true);
            m_userNickNameText.text = curData.m_nickname;
        }
        else
        {
            openFailUI("<Size=40>로그인 실패!</Size>\n<size=30>아이디와 비밀번호를 다시 입력해주세요</size>");
            openUI((int)INDEX_LOGIN_UI.RESULT_UI);
        }

        m_idInputfield.text = "";
        m_pwInputfield.text = "";
    }
Ejemplo n.º 2
0
    public void tryLogin()
    {
#if NOTLOGINSERVER
        try
        {
            if (GameManager.m_Instance.connect_mainServer())
            {
                C_LoginResponsePacket userData   = new C_LoginResponsePacket();
                S_UserAccessData      accessData = new S_UserAccessData();
                accessData.m_accessID = m_idInputfield.text;
                accessData.m_accessPW = m_pwInputfield.text;
                GameManager.m_Instance.setAccessData(accessData);
                GameManager.m_Instance.disconnect_loginServer();
                // openMainMenu
                openMainMenuUI();
            }
        }
        catch (Exception ex)
        {
            GameManager.m_Instance.writeErrorLog("can not connect main server");
        }
        return;
#endif
#if DEBUGMODE
        //responseLogin(null);
        //return;
#endif
        if (GameManager.m_Instance.isConnectedLoginServer() == false)
        {
            return;
        }

        if (m_idInputfield.text.Length < 4 ||
            (m_pwInputfield.text.Length < 8))
        {
            openFailUI("<size=30>아이디나 \n비밀번호의 길이가\n너무 짧습니다</size>");
            return;
        }

        // 나중에는
        // 1. id, pw 유효성 검사
        string id = m_idInputfield.text;
        string pw = m_pwInputfield.text;
        startWaiting(responseLogin);

        C_LoginRequestPacket eventData = new C_LoginRequestPacket();
        eventData.m_accountID = id;
        eventData.m_accountPW = pw;
        GameManager.m_Instance.makePacket(eventData);
    }
Ejemplo n.º 3
0
 /// <summary>
 /// 로그인 서버에서 로그인 완료시 계정 정보를 세팅
 /// </summary>
 /// <param name="accessData"></param>
 public void setAccessData(S_UserAccessData accessData)
 {
     m_accessData = accessData;
     setLoginState(true);
 }