Skip to content

Commit dd97286

Browse files
Synchronize changes from 1.6 master branch [ci skip]
c7b54b6 Load AddDllDirectory on demand f75e75b Add missing newline characters to log lines
2 parents d81e73b + c7b54b6 commit dd97286

File tree

5 files changed

+22
-7
lines changed

5 files changed

+22
-7
lines changed

Client/core/CSteamClient.cpp

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,9 +377,24 @@ bool CSteamClient::Load()
377377
return false;
378378
}
379379

380+
static auto pAddDllDirectory = ([]() -> decltype(&AddDllDirectory) {
381+
if (const HMODULE kernel32 = GetModuleHandleW(L"kernel32.dll"); kernel32 != nullptr)
382+
{
383+
return reinterpret_cast<decltype(&AddDllDirectory)>(static_cast<void*>(GetProcAddress(kernel32, "AddDllDirectory")));
384+
}
385+
386+
return nullptr;
387+
})();
388+
389+
if (pAddDllDirectory == nullptr)
390+
{
391+
WriteErrorEvent("Your operating system is outdated and is missing the KB2533623 update package for AddDllDirectory");
392+
return false;
393+
}
394+
380395
WriteDebugEvent(SString("Using steamclient.dll: %s", *ToUTF8(steamClientPath.value())));
381396
SetEnvironmentVariableW(L"SteamAppId", L"" STEAM_GTASA_APP_ID);
382-
AddDllDirectory(steamDirPath.c_str());
397+
pAddDllDirectory(steamDirPath.c_str());
383398
{
384399
static wchar_t pathBuffer[65536];
385400
GetEnvironmentVariableW(L"PATH", pathBuffer, sizeof(pathBuffer) / sizeof(wchar_t));
@@ -425,7 +440,7 @@ bool CSteamClient::Load()
425440

426441
releaseLibraryLock.reset();
427442

428-
Native::CreateInterface = reinterpret_cast<decltype(Native::CreateInterface)>(GetProcAddress(dll, "CreateInterface"));
443+
Native::CreateInterface = reinterpret_cast<decltype(Native::CreateInterface)>(static_cast<void*>(GetProcAddress(dll, "CreateInterface")));
429444

430445
if (!Native::CreateInterface)
431446
{

Client/mods/deathmatch/logic/CResource.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ void CResource::Load()
258258
m_pResourceTXDRoot->SetParent(m_pResourceEntity);
259259
}
260260

261-
CLogger::LogPrintf("> Starting resource '%s'", *m_strResourceName);
261+
CLogger::LogPrintf("> Starting resource '%s'\n", *m_strResourceName);
262262

263263
// Flag resource files as readable
264264
for (std::list<CResourceConfigItem*>::iterator iter = m_ConfigFiles.begin(); iter != m_ConfigFiles.end(); ++iter)

Server/mods/deathmatch/logic/CResource.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2248,15 +2248,15 @@ bool CResource::RemoveFile(const char* szName)
22482248
m_ResourceFiles.remove(pFileFound);
22492249
}
22502250
else
2251-
CLogger::LogPrintf("WARNING: Problems removing resource file from memory");
2251+
CLogger::LogPrintf("WARNING: Problems removing resource file from memory\n");
22522252
}
22532253

22542254
// Delete the file
22552255
char szFullFilepath[MAX_PATH + 1];
22562256
snprintf(szFullFilepath, MAX_PATH, "%s%s", m_strResourceDirectoryPath.c_str(), szName);
22572257

22582258
if (File::Delete(szFullFilepath) != 0)
2259-
CLogger::LogPrintf("WARNING: Problems deleting the actual file, but was removed from resource");
2259+
CLogger::LogPrintf("WARNING: Problems deleting the actual file, but was removed from resource\n");
22602260

22612261
// Delete the metafile
22622262
pMetaFile->Write();

Server/mods/deathmatch/logic/luadefs/CLuaResourceDefs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ int CLuaResourceDefs::addResourceConfig(lua_State* luaVM)
339339
iType = CResourceFile::RESOURCE_FILE_TYPE_CONFIG;
340340
if (strType != "server")
341341
{
342-
CLogger::LogPrintf("WARNING: Unknown config file type specified for %s. Defaulting to 'server'", lua_tostring(luaVM, lua_upvalueindex(1)));
342+
CLogger::LogPrintf("WARNING: Unknown config file type specified for %s. Defaulting to 'server'\n", lua_tostring(luaVM, lua_upvalueindex(1)));
343343
}
344344
}
345345

Server/mods/deathmatch/logic/packets/CUnoccupiedVehicleSyncPacket.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ bool CUnoccupiedVehicleSyncPacket::Read(NetBitStreamInterface& BitStream)
2727
{
2828
if (i > uiMaxCount)
2929
{
30-
CLogger::LogPrintf("WARN: Received excess unoccupied vehicle sync data (%d bytes)", BitStream.GetNumberOfUnreadBits() / 8);
30+
CLogger::LogPrintf("WARN: Received excess unoccupied vehicle sync data (%d bytes)\n", BitStream.GetNumberOfUnreadBits() / 8);
3131
break;
3232
}
3333

0 commit comments

Comments
 (0)