GLOBAL_prefs.txt recreate

dapanda

Member
Hi,

Will the GLOBAL_prefs.txt recreate itself with all the proper settings if it is deleted or is it possible that it will miss important settings that may have been added over time? If the file is removed, is all I have to do is reconfirm the settings through Preferences in Mafia? Currently there is a difference of 108 additional entries, between a fresh install and the one I have had for 11 years.

The personal preference file, when removing the playername_prefs.txt file it breaks a lot of things, like total pool skills and a ton of the IoTM records.

So is the following link the only values that are currently used in the GLOBAL_prefs file?


Or could particular scripts make an adjustment to that file?

The whole reason I ask, is it looks like there is some depreciated settings in my file that may be causing issues with the KoLmafia.jar file. (I am not actually sure that is the case but this post had an issue with KoLmafia failing because of a setting: https://kolmafia.us/threads/kolmafia-wont-run.25922/ )
 
I either don't quite understand the question or you have some misunderstanding about how things work or we use different vocabulary.

Nevertheless this might be helpful or at least bridge the gap.

KoLmafia maintains two preference files, GLOBAL and user. The mechanics are basically the same but they are both expected to be there for KoLmafia to behave "normally" and remember things.

Some preferences are managed by KoLmafia but others are created and managed by scripts.

As a general rule, if KoLmafia created (and manages) the preference KoLmafia will do what it can to make sure the preference is correct. If a specific managed preference is absent or wrong and KoLmafia does not detect that fix it then that is almost certainly a legitimate KoLmafia bug. I personally would trust KoLmafia to rebuild things but only as a last resort and I would back up the previous file and have a good text diff comparison utility available first.

What happens to a preference that is managed by a script is determined by the script.

Two tools that might be of interest.

The first is @Veracity 's props script. I can't find her posting of it here so I have attached my copy, which may have had local modifications but I am not sure. It will clean up orphaned GLOBAL properties, delete obsolete user properties as defined by the script and display custom user properties. If you delete the user file these are the things that KoLmafia won't know how to reset or rebuild. If I am cleaning the file and don't know which script is using a property I will usually risk deleting the property. You could derive the same information from the difference between a file as newly created by KoLmafia and the "old" file but sometimes this is easier.

The second is @zarqon 's PrefRefPlus. My install was from SourceForge using the entry in the Scripts Menu. There are no indications I mad local changes but zarqon has pretty much stopped working on scripts so there may be some light edits that need to happen.

You can go to https://kolmafia.us/threads/prefref...olmafia-properties-manager.22101/#post-144551 to read what it is expected to do but User preferences with no defaults are candidates for things KoLmafia will not set.
 

Attachments

Thanks, sorry I didn't explain it better.

I think Veracity's prop script will actually do what I need. I first want to fix the Global file and then I will see about the personal user file. I have been having a problem where mafia's relay browser gets stuck in mobile mode (I opened that bug report) and I am hoping that some invalid prefs are the cause.
 
I won't dash your hope but would be surprised if the issues are related. I've been wrong before
:)

PrefRefPlus does some type checking and it has helped me debug cases where a preference is of the wrong type. The reason for the corruption is not always clear but the preference system tries to coerce what it read into something that makes sense. That sometimes produces unexpected results from a script.
 
Back
Top