made PlusROMs command line ID temporary

This commit is contained in:
Thomas Jentzsch 2021-10-20 20:28:35 +02:00
parent 48dd48c110
commit 7be3a3b18e
4 changed files with 12 additions and 7 deletions

View File

@ -3289,7 +3289,7 @@
<tr>
<td><pre>-plusroms.id &lt;id&gt;</pre></td>
<td>Define an ID for the PlusROM backends (30 chars, hex)</td>
<td>Define a temporary ID for the PlusROM backends (32 chars, hex)</td>
</tr>
<tr>

View File

@ -511,7 +511,7 @@ string OSystem::createConsole(const FilesystemNode& rom, const string& md5sum,
}
// Check for first PlusROM start
if(myConsole->cartridge().isPlusROM() &&
settings().getString("plusroms.id") == EmptyString)
settings().getString("plusroms.fixedid") == EmptyString)
{
// Make sure there always is an id
constexpr int ID_LEN = 32;
@ -522,7 +522,7 @@ string OSystem::createConsole(const FilesystemNode& rom, const string& md5sum,
for(char& c: id_chr)
c = HEX_DIGITS[rnd.next() % 16];
settings().setValue("plusroms.id", string(id_chr, ID_LEN));
settings().setValue("plusroms.fixedid", string(id_chr, ID_LEN));
myEventHandler->changeStateByEvent(Event::PlusRomsSetupMode);
}

View File

@ -389,7 +389,11 @@ void PlusROM::send()
return;
}
const string id = mySettings.getString("plusroms.id");
string id = mySettings.getString("plusroms.id");
if(id == EmptyString)
id = mySettings.getString("plusroms.fixedid");
if(id != EmptyString)
{
const string nick = mySettings.getString("plusroms.nick");

View File

@ -185,7 +185,8 @@ Settings::Settings()
setPermanent("initials", "");
setTemporary("turbo", "0");
setPermanent("plusroms.nick", "");
setPermanent("plusroms.id", "");
setTemporary("plusroms.id", "");
setPermanent("plusroms.fixedid", "");
#ifdef DEBUGGER_SUPPORT
// Debugger/disassembly options
@ -617,8 +618,8 @@ void Settings::usage() const
<< " -basedir <path> Override the base directory for all config files\n"
<< " -baseinappdir Override the base directory for all config files\n"
<< " by attempting to use the application directory\n"
<< " -plusroms.nick <nick> Define a nickname for the PlusROMs store.\n"
<< " -plusroms.id <id> Define an ID for the PlusROMs store.\n"
<< " -plusroms.nick <nick> Define a nickname for the PlusROMs backends.\n"
<< " -plusroms.id <id> Define a temporary ID for the PlusROMs backends.\n"
<< " -help Show the text you're now reading\n"
#ifdef DEBUGGER_SUPPORT
<< endl