Pastebin

New pastes are no longer accepted · Stats

Latest Pastes

bool EODroid::Login()
{
    LoginReply login_reply = eoclient.Login(config.entries["Username"], config.entries["Password"]);
    switch (login_reply)
    {
        case LOGIN_OK: break;
        case LOGIN_WRONG_USER:     printf("Login failed: Wrong username\n"); return false;
        case LOGIN_WRONG_USERPASS: printf("Login failed: Wrong username/password\n"); return false;
        case LOGIN_LOGGEDIN:       printf("Login failed: Account in use\n"); return false;
        case LOGIN_BUSY:           printf("Login failed: Server is busy\n"); return false;
        case 0: return false;
        default:                   printf("Login failed: Unknown error code (%i)\n", static_cast<int>(login_reply)); return false;
    }

    eoclient.state = EOClient::LoggedIn;

    // uncomment this if you want your program do automatic selection of the character
    /*if(!eoclient.SelectCharacter(config.entries["Character"]))
    {
        print_fatal("Login failed: Character selection failed");
        return false;
    }*/

    printf("Login successful\n");

    return true;
}