Added UUID for game sessions
Allows the SavegameManager to destroy all saves related to the current UUID session so hardcore mods can enforce this safely instead of needing to go nuclear.
This commit is contained in:
parent
443e899759
commit
66c5beccbd
8 changed files with 52 additions and 0 deletions
|
|
@ -6,6 +6,7 @@
|
|||
#include "gstrings.h"
|
||||
#include "version.h"
|
||||
#include "m_argv.h"
|
||||
#include "m_random.h"
|
||||
|
||||
static_assert(sizeof(void*) == 8,
|
||||
"Only LP64/LLP64 builds are officially supported. "
|
||||
|
|
@ -182,3 +183,12 @@ int FStartupSelectionInfo::SaveInfo()
|
|||
return DefaultIWAD;
|
||||
}
|
||||
|
||||
FString GameUUID;
|
||||
static FRandom pr_uuid("GameUUID");
|
||||
|
||||
FString GenerateUUID()
|
||||
{
|
||||
FString uuid;
|
||||
uuid.AppendFormat("%08X-%04X-4%03X-9%03X-%08X%04X", pr_uuid.GenRand32(), pr_uuid(UINT16_MAX), pr_uuid(4095), pr_uuid(4095), pr_uuid.GenRand32(), pr_uuid(UINT16_MAX));
|
||||
return uuid;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue