removed 'WE' prefix from PlusROM id

This commit is contained in:
Thomas Jentzsch 2021-10-18 12:32:34 +02:00
parent 3394584aa8
commit 38449a9962
2 changed files with 8 additions and 11 deletions

View File

@ -514,18 +514,15 @@ string OSystem::createConsole(const FilesystemNode& rom, const string& md5sum,
settings().getString("plusroms.id") == EmptyString) settings().getString("plusroms.id") == EmptyString)
{ {
// Make sure there always is an id // Make sure there always is an id
if(settings().getString("plusroms.id") == EmptyString) constexpr int ID_LEN = 32;
{ const char* HEX_DIGITS = "0123456789ABCDEF";
constexpr int ID_LEN = 32 - 2; // WE prefix added later char id_chr[ID_LEN] = {0};
const char* HEX_DIGITS = "0123456789ABCDEF"; Random rnd;
char id_chr[ID_LEN] = {0};
Random rnd; for(char& c: id_chr)
for(char& c: id_chr) c = HEX_DIGITS[rnd.next() % 16];
c = HEX_DIGITS[rnd.next() % 16];
settings().setValue("plusroms.id", string(id_chr, ID_LEN)); settings().setValue("plusroms.id", string(id_chr, ID_LEN));
}
myEventHandler->changeStateByEvent(Event::PlusRomsSetupMode); myEventHandler->changeStateByEvent(Event::PlusRomsSetupMode);
} }

View File

@ -84,7 +84,7 @@ class PlusROMRequest {
ostringstream content; ostringstream content;
content << "agent=Stella; " content << "agent=Stella; "
<< "ver=" << STELLA_VERSION << "; " << "ver=" << STELLA_VERSION << "; "
<< "id=WE" << myId.id << "; " << "id=" << myId.id << "; "
<< "nick=" << myId.nick; << "nick=" << myId.nick;
httplib::Client client(myDestination.host); httplib::Client client(myDestination.host);