Results 1 to 5 of 5

Thread: Proxy records persist across logins

  1. #1
    Junior Member
    Join Date
    Dec 2010
    Posts
    5

    Default Proxy records persist across logins

    If I cast a skill with a skill in one account, log out and log into another the timescast proxy record remains the same for both accounts.

    Ran into this when a second account's breakfast script was misbehaving, as daily skills were being cast based on whether the timescast was lower than the dailylimit. As the timescast was carried over from the first account, none of the skills were cast.

    This behaviour is present for me on v18.11 r19274.


    Edit 2019/06/14:
    Found out that the behaviour only exists for when you use the 'Logout of KoL' button and then log back in as someone else. When you 'Exit KoL mafia' and restart, it is fine.
    Last edited by damion117; 06-14-2019 at 09:25 AM.

  2. #2
    Senior Member
    Join Date
    Apr 2018
    Posts
    358

    Default

    On a possibly related note, the number of times that you have visited a location does not persist across logins of the same account.

  3. #3
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,937

    Default

    ProxyRecordValue:

    Code:
    		public int get_timescast()
    		{
    			return SkillDatabase.getCasts( (int) this.contentLong );
    		}
    (Slight termonology nit: a "proxy record" is conceptually a set of disparate named data elements - like a record - which you access from an "item", "effect", "skill", etc using the same syntax as you access the fields of a record object. Therefore, I would call "timescast" an "item proxy field" or something.)

    SkillsDatabase:

    Code:
    	private static final Map<Integer, Integer> castsById = new HashMap<Integer, Integer>();
    That map is not cleared when you log in a new character without restarting KoLmafia.

    Code:
    		public int get_turns_spent()
    		{
    			return AdventureSpentDatabase.getTurns( (KoLAdventure) this.content );
    		}
    AdventuresSpentDatabase:

    Code:
    	private static Map<String, Integer> TURNS = new TreeMap<String, Integer>();
    Supposedly, that structure is serialized into "USERNAME_turns.ser" in LogoutManager and deserialized in LoginManager.

    In other words, it is certainly intended to persist across logins.

    Both of the reported behaviors seem like bugs, but they are actually not "related". I suggest you move the second one into its own bug report.

  4. #4
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,937

    Default

    Bumping from page 11

  5. #5
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,937

    Default

    Revision 19902 resets SKILL.turnscast when you log in as a new user.
    t also actually increments that when you cast a skill.
    I don't see how the code as it existed worked.
    Something must have changed.

    Regarding LOCATION.turns_spent, that works just fine for me.

    When I log in, it loads the serialized file.
    When I visit a location, it increments the value
    When I log out, it writes the serialized file.
    And when I log in again, it has the last value, exactly as expected.

    Perhaps you are bypassing "logout" by exiting or ^C-ing or something.
    Don't do that.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •