Bug 11605 - login command is b0rken when using script
: login command is b0rken when using script
Status: CLOSED FIXED
: Sisyphus
(All bugs in Sisyphus/KoLmafia)
: unstable
: all Linux
: P2 blocker
Assigned To:
:
:
:
:
:
  Show dependency tree
 
Reported: 2007-04-23 13:39 by
Modified: 2007-06-16 21:21 (History)


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


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2007-04-23 13:39:03
$ 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 From 2007-04-23 14:32:48 -------
Нужно просто откатить тот патч, который вносит это изменение?
------- Comment #2 From 2007-04-23 14:37:48 -------
Ну наверно.

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

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