Fix mutex and dedi guid
This commit is contained in:
parent
55c9ddb63b
commit
9adca57b1a
@ -13,7 +13,7 @@ namespace Components
|
||||
{
|
||||
if (Dedicated::IsDedicated()) return;
|
||||
|
||||
Singleton::FirstInstance = !(CreateMutex(NULL, FALSE, "iw4x_mutex") && GetLastError() == ERROR_ALREADY_EXISTS);
|
||||
Singleton::FirstInstance = (CreateMutex(NULL, FALSE, "iw4x_mutex") && GetLastError() != ERROR_ALREADY_EXISTS);
|
||||
|
||||
if (!Singleton::FirstInstance && MessageBoxA(0, "Do you want to start a second instance?", "Game already running", MB_ICONEXCLAMATION | MB_YESNO) == IDNO)
|
||||
{
|
||||
|
@ -20,11 +20,11 @@ namespace Steam
|
||||
|
||||
if (!subId)
|
||||
{
|
||||
if (Components::Dedicated::IsDedicated())
|
||||
if (Components::Dedicated::IsDedicated()) // Dedi guid
|
||||
{
|
||||
subId = 0xDED1CADE;
|
||||
subId = -0xDED1CADE;
|
||||
}
|
||||
else if (Components::Singleton::IsFirstInstance())
|
||||
else if (Components::Singleton::IsFirstInstance()) // Hardware guid
|
||||
{
|
||||
DATA_BLOB Data[2];
|
||||
Data[0].pbData = (BYTE *)"AAAAAAAAAA";
|
||||
@ -34,7 +34,7 @@ namespace Steam
|
||||
|
||||
subId = ::Utils::OneAtATime((char*)Data[1].pbData, 52);
|
||||
}
|
||||
else
|
||||
else // Random guid
|
||||
{
|
||||
subId = (Game::Com_Milliseconds() + timeGetTime());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user