Preserve sanctity of SteamWorksGameServer::Reset(void) from ba825b9a6e.

This commit is contained in:
Kyle Sanderson
2016-04-25 15:38:13 -07:00
parent 401ee13b8f
commit 44430b167c
2 changed files with 27 additions and 19 deletions
+11 -10
View File
@@ -49,25 +49,26 @@ SteamWorksGSDetours::SteamWorksGSDetours()
{
const char *pLibSteamPath = g_SteamWorks.pSWGameServer->GetLibraryPath();
void *pSteamSafeInitAddress = NULL;
void *pSteamShutdownAddress = NULL;
const char *pInitSafeFuncName = "SteamGameServer_InitSafe";
const char *pShutdownFuncName = "SteamGameServer_Shutdown";
IGameConfig *pConfig = NULL;
if (g_SteamWorks.pSWGameData)
{
pConfig = g_SteamWorks.pSWGameData->GetGameData();
}
ILibrary *pLibrary = libsys->OpenLibrary(pLibSteamPath, NULL, 0);
void *pSteamSafeInitAddress = NULL;
void *pSteamShutdownAddress = NULL;
if (pLibrary != NULL)
{
const char *pInitSafeFuncName = "SteamGameServer_InitSafe";
const char *pShutdownFuncName = "SteamGameServer_Shutdown";
if (pConfig != NULL)
{
pConfig->GetMemSig(pShutdownFuncName, &pSteamShutdownAddress);
pConfig->GetMemSig(pInitSafeFuncName, &pSteamSafeInitAddress);
}
}
ILibrary *pLibrary = libsys->OpenLibrary(pLibSteamPath, NULL, 0);
if (pLibrary != NULL)
{
if (pSteamShutdownAddress == NULL)
{
pSteamShutdownAddress = pLibrary->GetSymbolAddress(pShutdownFuncName);