Bug 11605 - login command is b0rken when using script
Summary: login command is b0rken when using script
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: KoLmafia (show other bugs)
Version: unstable
Hardware: all Linux
: P2 blocker
Assignee: Nobody's working on this, feel free to take it
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-23 13:39 MSD by Sir Raorn
Modified: 2007-06-16 21:21 MSD (History)
0 users

See Also:


Attachments
KoLmafia-10.9-fix-logout.patch (567 bytes, patch)
2007-04-24 11:05 MSD, Sir Raorn
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sir Raorn 2007-04-23 13:39:03 MSD
$ KoLmafia --CLI daily.ash


KoLmafia v10.9
Running on Linux
Using Java 1.5.0_11


Validating login server...

...

Validating login server...
...
Concurrent logins detected.  Debug log printed.
java.lang.Exception


В скрипте первой строчкой:

cli_command("login username");

Проблема в коде:

if ( command.equals( "login" ) )
{
        executeCommand( "logout", "" );
        String password = getSaveState( parameters );

        if ( password != null )
                RequestThread.postRequest( new LoginRequest( parameters,
password ) );
        else
                updateDisplay( ERROR_STATE, "No password saved for that
username." );

        return;
}

// Next, handle any requests that request exiting.
// Note that a logout request should be sent in
// order to be friendlier to the server, if the
// character has already logged in.

if ( command.equals( "logout" ) )
{
    ...

        if ( StaticEntity.getClient() == DEFAULT_SHELL )
                DEFAULT_SHELL.attemptLogin();

        return;
}

Команда login зовёт logout, и потом логинится, а logout в свою очередь тоже
логинится.  В 10.9 release logout не выполнялся.
Comment 1 Damir Shayhutdinov 2007-04-23 14:32:48 MSD
Нужно просто откатить тот патч, который вносит это изменение?
Comment 2 Sir Raorn 2007-04-23 14:37:48 MSD
Ну наверно.

@@ -957,14 +966,11 @@ public class KoLmafiaCLI extends KoLmafia
 
                if ( command.equals( "login" ) )
                {
-                   RequestThread.postRequest( new LogoutRequest() );
-                   KoLRequest.chooseRandomServer();
-
+                     executeCommand( "logout", "" );
Comment 3 Sir Raorn 2007-04-24 11:05:43 MSD
Created attachment 1923 [details]
KoLmafia-10.9-fix-logout.patch

Проще задавить перелогинивание.
Comment 4 Damir Shayhutdinov 2007-06-16 13:34:04 MSD
Давно исправлено.
Comment 5 Sir Raorn 2007-06-16 21:21:20 MSD
Ага, в апстриме.