2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00
This commit is contained in:
John Preston
2016-02-16 16:06:57 +03:00
14 changed files with 64 additions and 13 deletions

View File

@@ -230,6 +230,7 @@ struct SandboxDataStruct {
ConnectionProxy PreLaunchProxy;
};
SandboxDataStruct *SandboxData = 0;
uint64 SandboxUserTag = 0;
namespace Sandbox {
@@ -291,6 +292,27 @@ namespace Sandbox {
f.write("1");
}
}
srand((int32)time(NULL));
SandboxUserTag = 0;
QFile usertag(cWorkingDir() + qsl("tdata/usertag"));
if (usertag.open(QIODevice::ReadOnly)) {
if (usertag.read(reinterpret_cast<char*>(&SandboxUserTag), sizeof(uint64)) != sizeof(uint64)) {
SandboxUserTag = 0;
}
usertag.close();
}
if (!SandboxUserTag) {
do {
memsetrnd_bad(SandboxUserTag);
} while (!SandboxUserTag);
if (usertag.open(QIODevice::WriteOnly)) {
usertag.write(reinterpret_cast<char*>(&SandboxUserTag), sizeof(uint64));
usertag.close();
}
}
}
void start() {
@@ -305,8 +327,6 @@ namespace Sandbox {
break;
}
}
srand((int32)time(NULL));
}
void finish() {
@@ -314,6 +334,10 @@ namespace Sandbox {
SandboxData = 0;
}
uint64 UserTag() {
return SandboxUserTag;
}
DefineReadOnlyVar(Sandbox, QString, LangSystemISO);
DefineReadOnlyVar(Sandbox, int32, LangSystem);
DefineVar(Sandbox, QByteArray, LastCrashDump);