示例#1
0
void ConsoleSocket::AuthCallback(bool result)
{
    ConsoleAuthMgr::getSingleton().SetRequest(m_requestNo, NULL);
    m_requestNo = 0;

    if (!result)
    {
        m_pConsole->Write("Authentication failed.\r\n\r\n");
        m_failedLogins++;
        if (m_failedLogins < 3)
        {
            m_pConsole->Write("login: "******"User `%s` authenticated.\r\n\r\n", m_username.c_str());
        Log.Notice("RemoteConsole", "User `%s` authenticated.", m_username.c_str());
        const char* argv[1];
        HandleInfoCommand(m_pConsole, 1, argv);
        m_pConsole->Write("Type ? to see commands, quit to end session.\r\n");
        m_state = STATE_LOGGED;
    }
}
void ConsoleSocket::AuthCallback(bool result)
{
    ConsoleAuthMgr::getSingleton().SetRequest(m_requestNo, NULL);
    m_requestNo = 0;

    if( !result )
    {
        m_pConsole->Write("Authentication failed.\r\n\r\n");
        Disconnect();
    }
    else
    {
        m_pConsole->Write("Authentication passed.\r\n");
        m_pConsole->Write("You are now logged in under user `%s`.\r\n\r\n", m_username.c_str());
        const char * argv[1];
        HandleInfoCommand(m_pConsole,1, argv);
        m_pConsole->Write("Type ? to see commands, quit to end session.\r\n");
        m_state = STATE_LOGGED;
    }
}