mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
General cleanup and improvements
Hook CPakFile::Unload() and track when mp_lobby is unloaded. Removed duplicate pointers for MOD_ProcessPakQueue(). Use DWORD for thread id comparison in MOD_ProcessPakQueue(). Use RPakHandle_t for all RPak handles.
This commit is contained in:
parent
ea3caa1a0b
commit
d1402a7465
@ -13,6 +13,7 @@
|
|||||||
#include "rtech/rtech_utils.h"
|
#include "rtech/rtech_utils.h"
|
||||||
#include "rtech/rtech_game.h"
|
#include "rtech/rtech_game.h"
|
||||||
#include "datacache/mdlcache.h"
|
#include "datacache/mdlcache.h"
|
||||||
|
#include "filesystem/filesystem.h"
|
||||||
|
|
||||||
string g_svLevelName;
|
string g_svLevelName;
|
||||||
bool s_bLevelResourceInitialized = false;
|
bool s_bLevelResourceInitialized = false;
|
||||||
@ -127,7 +128,7 @@ void MOD_ProcessPakQueue()
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((*(unsigned __int8(__fastcall**)(__int64))(*(_QWORD*)*g_FileSystem + 696i64))(*g_FileSystem) && !*dword_1634F445C)
|
if ((*(unsigned __int8(__fastcall**)(__int64))(*(_QWORD*)*(_QWORD*)g_pFileSystem_Stdio + 696i64))(*(_QWORD*)g_pFileSystem_Stdio) && !*dword_1634F445C)
|
||||||
{
|
{
|
||||||
v1 = &*off_141874660;
|
v1 = &*off_141874660;
|
||||||
for (i = 0; i < 5; ++i)
|
for (i = 0; i < 5; ++i)
|
||||||
@ -163,9 +164,9 @@ void MOD_ProcessPakQueue()
|
|||||||
v11 = *(_DWORD*)v10;
|
v11 = *(_DWORD*)v10;
|
||||||
v12 = *(_DWORD*)v10 & 0x1FF;
|
v12 = *(_DWORD*)v10 & 0x1FF;
|
||||||
v10[4] = 1;
|
v10[4] = 1;
|
||||||
if (*((_DWORD*)&*unk_167D40B70 + 46 * v12) == v11)
|
if (*((_DWORD*)&*g_pLoadedPakInfo + 46 * v12) == v11)
|
||||||
{
|
{
|
||||||
v13 = *((_DWORD*)&*unk_167D40B70 + 46 * v12 + 1);
|
v13 = *((_DWORD*)&*g_pLoadedPakInfo + 46 * v12 + 1);
|
||||||
v14 = v10[4];
|
v14 = v10[4];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -240,8 +241,8 @@ void MOD_ProcessPakQueue()
|
|||||||
JT_ReleaseFifoLock((JobFifoLock_s*)&*qword_167ED7BE0);
|
JT_ReleaseFifoLock((JobFifoLock_s*)&*qword_167ED7BE0);
|
||||||
v23 = *qword_1671061C8;
|
v23 = *qword_1671061C8;
|
||||||
}
|
}
|
||||||
(*(void(__fastcall**)(__int64, __int64))(*(_QWORD*)*g_FileSystem + 656i64))(*g_FileSystem, 256i64);
|
(*(void(__fastcall**)(__int64, __int64))(*(_QWORD*)*(_QWORD*)g_pFileSystem_Stdio + 656i64))(*(_QWORD*)g_pFileSystem_Stdio, 256i64);
|
||||||
(*(void(__fastcall**)(__int64, __int64))(*(_QWORD*)*g_FileSystem + 648i64))(*g_FileSystem, v23);
|
(*(void(__fastcall**)(__int64, __int64))(*(_QWORD*)*(_QWORD*)g_pFileSystem_Stdio + 648i64))(*(_QWORD*)g_pFileSystem_Stdio, v23);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -264,7 +265,7 @@ void MOD_ProcessPakQueue()
|
|||||||
if (*(_DWORD*)v15 != -1)
|
if (*(_DWORD*)v15 != -1)
|
||||||
{
|
{
|
||||||
v22 = 184i64 * (v21 & 0x1FF);
|
v22 = 184i64 * (v21 & 0x1FF);
|
||||||
if (*(_DWORD*)((char*)&*unk_167D40B70 + v22) != v21 || ((*(_DWORD*)((char*)&*unk_167D40B70 + v22 + 4) - 9) & 0xFFFFFFFB) != 0)
|
if (*(_DWORD*)((char*)&*g_pLoadedPakInfo + v22) != v21 || ((*(_DWORD*)((char*)&*g_pLoadedPakInfo + v22 + 4) - 9) & 0xFFFFFFFB) != 0)
|
||||||
{
|
{
|
||||||
*byte_16709DDDF = 0; return;
|
*byte_16709DDDF = 0; return;
|
||||||
}
|
}
|
||||||
@ -274,14 +275,14 @@ void MOD_ProcessPakQueue()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Purpose: load assets for level with fifolock (still not reliable enough).
|
// Purpose: load assets for level with fifolock.
|
||||||
// Input : *szLevelName -
|
// Input : *szLevelName -
|
||||||
// Output : true on success, false on failure
|
// Output : true on success, false on failure
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
bool MOD_LoadPakForMap(const char* szLevelName)
|
bool MOD_LoadPakForMap(const char* szLevelName)
|
||||||
{
|
{
|
||||||
if (MOD_LevelHasChanged(szLevelName))
|
if (MOD_LevelHasChanged(szLevelName))
|
||||||
s_bLevelResourceInitialized = false;
|
s_bLevelResourceInitialized = false;
|
||||||
|
|
||||||
g_svLevelName = szLevelName;
|
g_svLevelName = szLevelName;
|
||||||
return v_MOD_LoadPakForMap(szLevelName);
|
return v_MOD_LoadPakForMap(szLevelName);
|
||||||
|
@ -14,10 +14,8 @@ inline int32_t * dword_1634F445C;
|
|||||||
inline void** qword_167ED7BB8;
|
inline void** qword_167ED7BB8;
|
||||||
inline void** qword_14180A098;
|
inline void** qword_14180A098;
|
||||||
inline bool* byte_16709DDDF;
|
inline bool* byte_16709DDDF;
|
||||||
inline int64_t * g_FileSystem;
|
|
||||||
inline char** off_141874660;
|
inline char** off_141874660;
|
||||||
inline void** unk_141874555;
|
inline void** unk_141874555;
|
||||||
inline void** unk_167D40B70;
|
|
||||||
inline void** unk_1418749B0;
|
inline void** unk_1418749B0;
|
||||||
inline void** unk_141874550;
|
inline void** unk_141874550;
|
||||||
inline int64_t* qword_1671061C8;
|
inline int64_t* qword_1671061C8;
|
||||||
@ -25,7 +23,7 @@ inline int64_t* qword_167ED7BC0;
|
|||||||
inline int64_t* qword_167ED7C68;
|
inline int64_t* qword_167ED7C68;
|
||||||
inline int64_t* qword_167ED7BE0;
|
inline int64_t* qword_167ED7BE0;
|
||||||
inline int64_t* qword_14045C070;
|
inline int64_t* qword_14045C070;
|
||||||
inline int32_t* dword_1641E443C;
|
inline DWORD* dword_1641E443C;
|
||||||
inline bool* byte_167208B0C;
|
inline bool* byte_167208B0C;
|
||||||
|
|
||||||
inline auto sub_1401F9C10 = p_MOD_ProcessPakQueue.RCast<__int64(*)(char* a1, char* a2, __int64 a3)>();
|
inline auto sub_1401F9C10 = p_MOD_ProcessPakQueue.RCast<__int64(*)(char* a1, char* a2, __int64 a3)>();
|
||||||
@ -60,10 +58,8 @@ class VModel_BSP : public IDetour
|
|||||||
spdlog::debug("| VAR: qword_167ED7BB8 : {:#18x} |\n", reinterpret_cast<uintptr_t>(qword_167ED7BB8));
|
spdlog::debug("| VAR: qword_167ED7BB8 : {:#18x} |\n", reinterpret_cast<uintptr_t>(qword_167ED7BB8));
|
||||||
spdlog::debug("| VAR: qword_14180A098 : {:#18x} |\n", reinterpret_cast<uintptr_t>(qword_14180A098));
|
spdlog::debug("| VAR: qword_14180A098 : {:#18x} |\n", reinterpret_cast<uintptr_t>(qword_14180A098));
|
||||||
spdlog::debug("| VAR: byte_16709DDDF : {:#18x} |\n", reinterpret_cast<uintptr_t>(byte_16709DDDF));
|
spdlog::debug("| VAR: byte_16709DDDF : {:#18x} |\n", reinterpret_cast<uintptr_t>(byte_16709DDDF));
|
||||||
spdlog::debug("| VAR: g_FileSystem : {:#18x} |\n", reinterpret_cast<uintptr_t>(g_FileSystem));
|
|
||||||
spdlog::debug("| VAR: off_141874660 : {:#18x} |\n", reinterpret_cast<uintptr_t>(off_141874660));
|
spdlog::debug("| VAR: off_141874660 : {:#18x} |\n", reinterpret_cast<uintptr_t>(off_141874660));
|
||||||
spdlog::debug("| VAR: unk_141874555 : {:#18x} |\n", reinterpret_cast<uintptr_t>(unk_141874555));
|
spdlog::debug("| VAR: unk_141874555 : {:#18x} |\n", reinterpret_cast<uintptr_t>(unk_141874555));
|
||||||
spdlog::debug("| VAR: unk_167D40B70 : {:#18x} |\n", reinterpret_cast<uintptr_t>(unk_167D40B70));
|
|
||||||
spdlog::debug("| VAR: unk_1418749B0 : {:#18x} |\n", reinterpret_cast<uintptr_t>(unk_1418749B0));
|
spdlog::debug("| VAR: unk_1418749B0 : {:#18x} |\n", reinterpret_cast<uintptr_t>(unk_1418749B0));
|
||||||
spdlog::debug("| VAR: unk_141874550 : {:#18x} |\n", reinterpret_cast<uintptr_t>(unk_141874550));
|
spdlog::debug("| VAR: unk_141874550 : {:#18x} |\n", reinterpret_cast<uintptr_t>(unk_141874550));
|
||||||
spdlog::debug("| VAR: qword_1671061C8 : {:#18x} |\n", reinterpret_cast<uintptr_t>(qword_1671061C8));
|
spdlog::debug("| VAR: qword_1671061C8 : {:#18x} |\n", reinterpret_cast<uintptr_t>(qword_1671061C8));
|
||||||
@ -105,10 +101,8 @@ class VModel_BSP : public IDetour
|
|||||||
qword_167ED7BB8 = p_MOD_ProcessPakQueue.Offset(0x10).FindPattern("48 83").ResolveRelativeAddressSelf(0x3, 0x8).RCast<void**>();
|
qword_167ED7BB8 = p_MOD_ProcessPakQueue.Offset(0x10).FindPattern("48 83").ResolveRelativeAddressSelf(0x3, 0x8).RCast<void**>();
|
||||||
qword_14180A098 = p_MOD_ProcessPakQueue.Offset(0x20).FindPattern("83 3D").ResolveRelativeAddressSelf(0x2, 0x7).RCast<void**>();
|
qword_14180A098 = p_MOD_ProcessPakQueue.Offset(0x20).FindPattern("83 3D").ResolveRelativeAddressSelf(0x2, 0x7).RCast<void**>();
|
||||||
byte_16709DDDF = p_MOD_ProcessPakQueue.Offset(0x20).FindPattern("88 1D").ResolveRelativeAddressSelf(0x2, 0x6).RCast<bool*>();
|
byte_16709DDDF = p_MOD_ProcessPakQueue.Offset(0x20).FindPattern("88 1D").ResolveRelativeAddressSelf(0x2, 0x6).RCast<bool*>();
|
||||||
g_FileSystem = p_MOD_ProcessPakQueue.Offset(0x20).FindPattern("48 8B").ResolveRelativeAddressSelf(0x3, 0x7).RCast<int64_t*>();
|
|
||||||
off_141874660 = p_MOD_ProcessPakQueue.Offset(0x40).FindPattern("4C 8D 15").ResolveRelativeAddressSelf(0x3, 0x7).RCast<char**>();
|
off_141874660 = p_MOD_ProcessPakQueue.Offset(0x40).FindPattern("4C 8D 15").ResolveRelativeAddressSelf(0x3, 0x7).RCast<char**>();
|
||||||
unk_141874555 = p_MOD_ProcessPakQueue.Offset(0x40).FindPattern("4C 8D 1D").ResolveRelativeAddressSelf(0x3, 0x7).RCast<void**>();
|
unk_141874555 = p_MOD_ProcessPakQueue.Offset(0x40).FindPattern("4C 8D 1D").ResolveRelativeAddressSelf(0x3, 0x7).RCast<void**>();
|
||||||
unk_167D40B70 = p_MOD_ProcessPakQueue.Offset(0xA0).FindPattern("4C 8D 35").ResolveRelativeAddressSelf(0x3, 0x7).RCast<void**>();
|
|
||||||
unk_1418749B0 = p_MOD_ProcessPakQueue.Offset(0xA0).FindPattern("48 8D 1D").ResolveRelativeAddressSelf(0x3, 0x7).RCast<void**>();
|
unk_1418749B0 = p_MOD_ProcessPakQueue.Offset(0xA0).FindPattern("48 8D 1D").ResolveRelativeAddressSelf(0x3, 0x7).RCast<void**>();
|
||||||
unk_141874550 = p_MOD_ProcessPakQueue.Offset(0x150).FindPattern("48 8D 2D").ResolveRelativeAddressSelf(0x3, 0x7).RCast<void**>();
|
unk_141874550 = p_MOD_ProcessPakQueue.Offset(0x150).FindPattern("48 8D 2D").ResolveRelativeAddressSelf(0x3, 0x7).RCast<void**>();
|
||||||
qword_1671061C8 = p_MOD_ProcessPakQueue.Offset(0x200).FindPattern("48 8B 1D").ResolveRelativeAddressSelf(0x3, 0x7).RCast<int64_t*>();
|
qword_1671061C8 = p_MOD_ProcessPakQueue.Offset(0x200).FindPattern("48 8B 1D").ResolveRelativeAddressSelf(0x3, 0x7).RCast<int64_t*>();
|
||||||
@ -116,7 +110,7 @@ class VModel_BSP : public IDetour
|
|||||||
qword_167ED7C68 = p_MOD_ProcessPakQueue.Offset(0x200).FindPattern("0F B7 05").ResolveRelativeAddressSelf(0x3, 0x7).RCast<int64_t*>();
|
qword_167ED7C68 = p_MOD_ProcessPakQueue.Offset(0x200).FindPattern("0F B7 05").ResolveRelativeAddressSelf(0x3, 0x7).RCast<int64_t*>();
|
||||||
qword_167ED7BE0 = p_MOD_ProcessPakQueue.Offset(0x250).FindPattern("48 8D 0D").ResolveRelativeAddressSelf(0x3, 0x7).RCast<int64_t*>();
|
qword_167ED7BE0 = p_MOD_ProcessPakQueue.Offset(0x250).FindPattern("48 8D 0D").ResolveRelativeAddressSelf(0x3, 0x7).RCast<int64_t*>();
|
||||||
qword_14045C070 = p_MOD_ProcessPakQueue.Offset(0x2A0).FindPattern("48 8D 0D").ResolveRelativeAddressSelf(0x3, 0x7).RCast<int64_t*>();
|
qword_14045C070 = p_MOD_ProcessPakQueue.Offset(0x2A0).FindPattern("48 8D 0D").ResolveRelativeAddressSelf(0x3, 0x7).RCast<int64_t*>();
|
||||||
dword_1641E443C = p_MOD_ProcessPakQueue.Offset(0x2A0).FindPattern("3B 05").ResolveRelativeAddressSelf(0x2, 0x6).RCast<int32_t*>();
|
dword_1641E443C = p_MOD_ProcessPakQueue.Offset(0x2A0).FindPattern("3B 05").ResolveRelativeAddressSelf(0x2, 0x6).RCast<DWORD*>();
|
||||||
byte_167208B0C = p_MOD_ProcessPakQueue.Offset(0x2A0).FindPattern("C6 05").ResolveRelativeAddressSelf(0x2, 0x7).RCast<bool*>();
|
byte_167208B0C = p_MOD_ProcessPakQueue.Offset(0x2A0).FindPattern("C6 05").ResolveRelativeAddressSelf(0x2, 0x7).RCast<bool*>();
|
||||||
|
|
||||||
(*((char**)(&qword_167ED7C68))) -= 6;
|
(*((char**)(&qword_167ED7C68))) -= 6;
|
||||||
|
@ -372,14 +372,9 @@ void* HSys_LoadAssetHelper(const CHAR* lpFileName, std::int64_t a2, LARGE_INTEGE
|
|||||||
if (FileExists(mod_file.c_str()))
|
if (FileExists(mod_file.c_str()))
|
||||||
{
|
{
|
||||||
// Load decompressed pak files from 'mod_dir'.
|
// Load decompressed pak files from 'mod_dir'.
|
||||||
DevMsg(eDLL_T::RTECH, "Loading pak: '%s'\n", mod_file.c_str());
|
|
||||||
return Sys_LoadAssetHelper(mod_file.c_str(), a2, a3);
|
return Sys_LoadAssetHelper(mod_file.c_str(), a2, a3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (strstr(lpFileName, base_dir.c_str()))
|
|
||||||
{
|
|
||||||
DevMsg(eDLL_T::RTECH, "Loading pak: '%s'\n", lpFileName);
|
|
||||||
}
|
|
||||||
return Sys_LoadAssetHelper(lpFileName, a2, a3);
|
return Sys_LoadAssetHelper(lpFileName, a2, a3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,8 +43,8 @@ class VFileSystem_Stdio : public IDetour
|
|||||||
virtual void GetFun(void) const { }
|
virtual void GetFun(void) const { }
|
||||||
virtual void GetVar(void) const
|
virtual void GetVar(void) const
|
||||||
{
|
{
|
||||||
g_pFileSystem_Stdio = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x83\xEC\x20\x48\x8B\xD9\xFF\x15\x00\x00\x00\x00\x48\x8D\x05\x00\x00\x00\x00"),
|
g_pFileSystem_Stdio = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\x0D\x00\x00\x00\x00\x45\x33\xC0\x48\x83\xC1\x08\x48\x8B\x01"),
|
||||||
"xxxxxxxxxxx????xxx????").FindPatternSelf("48 8D", CMemory::Direction::DOWN).ResolveRelativeAddressSelf(0x3, 0x7).RCast<CFileSystem_Stdio*>();
|
"xxx????xxxxxxxxxx").ResolveRelativeAddressSelf(0x3, 0x7).RCast<CFileSystem_Stdio*>();
|
||||||
}
|
}
|
||||||
virtual void GetCon(void) const { }
|
virtual void GetCon(void) const { }
|
||||||
virtual void Attach(void) const { }
|
virtual void Attach(void) const { }
|
||||||
|
@ -47,6 +47,7 @@ RPakHandle_t CPakFile::AsyncLoad(const char* szPakFileName, uintptr_t pMalloc, i
|
|||||||
|
|
||||||
if (FileExists(svPakFilePathMod.c_str()) || FileExists(svPakFilePathBase.c_str()))
|
if (FileExists(svPakFilePathMod.c_str()) || FileExists(svPakFilePathBase.c_str()))
|
||||||
{
|
{
|
||||||
|
DevMsg(eDLL_T::RTECH, "Loading pak file: '%s'\n", szPakFileName);
|
||||||
pakHandle = CPakFile_AsyncLoad(szPakFileName, pMalloc, nIdx, bUnk);
|
pakHandle = CPakFile_AsyncLoad(szPakFileName, pMalloc, nIdx, bUnk);
|
||||||
|
|
||||||
if (pakHandle == -1)
|
if (pakHandle == -1)
|
||||||
@ -72,23 +73,25 @@ void CPakFile::Unload(RPakHandle_t handle)
|
|||||||
|
|
||||||
if (pakInfo.m_pszFileName)
|
if (pakInfo.m_pszFileName)
|
||||||
{
|
{
|
||||||
DevMsg(eDLL_T::RTECH, "%s - Unloading PakFile '%s'\n", __FUNCTION__, pakInfo.m_pszFileName);
|
DevMsg(eDLL_T::RTECH, "Unloading pak file: '%s'\n", pakInfo.m_pszFileName);
|
||||||
|
|
||||||
if (strcmp(pakInfo.m_pszFileName, "mp_lobby.rpak") == 0)
|
if (strcmp(pakInfo.m_pszFileName, "mp_lobby.rpak") == 0)
|
||||||
s_bBasePaksInitialized = false;
|
s_bBasePaksInitialized = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
CPakFile_UnloadPak(handle);
|
CPakFile_Unload(handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RTech_Game_Attach()
|
void RTech_Game_Attach()
|
||||||
{
|
{
|
||||||
DetourAttach((LPVOID*)&CPakFile_AsyncLoad, &CPakFile::AsyncLoad);
|
DetourAttach((LPVOID*)&CPakFile_AsyncLoad, &CPakFile::AsyncLoad);
|
||||||
|
DetourAttach((LPVOID*)&CPakFile_Unload, &CPakFile::Unload);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RTech_Game_Detach()
|
void RTech_Game_Detach()
|
||||||
{
|
{
|
||||||
DetourDetach((LPVOID*)&CPakFile_AsyncLoad, &CPakFile::AsyncLoad);
|
DetourDetach((LPVOID*)&CPakFile_AsyncLoad, &CPakFile::AsyncLoad);
|
||||||
|
DetourDetach((LPVOID*)&CPakFile_Unload, &CPakFile::Unload);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Symbols taken from R2 dll's.
|
// Symbols taken from R2 dll's.
|
||||||
|
@ -36,7 +36,7 @@ inline CMemory p_CPakFile_AsyncLoad;
|
|||||||
inline auto CPakFile_AsyncLoad = p_CPakFile_AsyncLoad.RCast<RPakHandle_t(*)(const char* svPakFileName, uintptr_t pMalloc, int nIdx, bool bUnk)>();
|
inline auto CPakFile_AsyncLoad = p_CPakFile_AsyncLoad.RCast<RPakHandle_t(*)(const char* svPakFileName, uintptr_t pMalloc, int nIdx, bool bUnk)>();
|
||||||
|
|
||||||
inline CMemory p_CPakFile_UnloadPak;
|
inline CMemory p_CPakFile_UnloadPak;
|
||||||
inline auto CPakFile_UnloadPak = p_CPakFile_UnloadPak.RCast<void (*)(RPakHandle_t handle)>();
|
inline auto CPakFile_Unload = p_CPakFile_UnloadPak.RCast<void (*)(RPakHandle_t handle)>();
|
||||||
|
|
||||||
class CPakFile
|
class CPakFile
|
||||||
{
|
{
|
||||||
@ -81,7 +81,7 @@ class VRTechGame : public IDetour
|
|||||||
CPakFile_AsyncLoad = p_CPakFile_AsyncLoad.RCast<RPakHandle_t(*)(const char*, uintptr_t, int, bool)>(); /*40 53 48 83 EC 40 48 89 6C 24 ? 41 0F B6 E9*/
|
CPakFile_AsyncLoad = p_CPakFile_AsyncLoad.RCast<RPakHandle_t(*)(const char*, uintptr_t, int, bool)>(); /*40 53 48 83 EC 40 48 89 6C 24 ? 41 0F B6 E9*/
|
||||||
#endif
|
#endif
|
||||||
p_CPakFile_UnloadPak = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x74\x24\x00\x57\x48\x83\xEC\x30\x8B\xC1"), "xxxx?xxxx?xxxxxxx");
|
p_CPakFile_UnloadPak = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x74\x24\x00\x57\x48\x83\xEC\x30\x8B\xC1"), "xxxx?xxxx?xxxxxxx");
|
||||||
CPakFile_UnloadPak = p_CPakFile_UnloadPak.RCast<void (*)(RPakHandle_t)>(); /*48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC 30 8B C1*/
|
CPakFile_Unload = p_CPakFile_UnloadPak.RCast<void (*)(RPakHandle_t)>(); /*48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC 30 8B C1*/
|
||||||
}
|
}
|
||||||
virtual void GetVar(void) const { }
|
virtual void GetVar(void) const { }
|
||||||
virtual void GetCon(void) const { }
|
virtual void GetCon(void) const { }
|
||||||
|
@ -366,7 +366,7 @@ void _Pak_RequestUnload_f_CompletionFunc(const CCommand& args)
|
|||||||
{
|
{
|
||||||
if (args.HasOnlyDigits(1))
|
if (args.HasOnlyDigits(1))
|
||||||
{
|
{
|
||||||
int nPakId = std::stoi(args.Arg(1));
|
RPakHandle_t nPakId = std::stoi(args.Arg(1));
|
||||||
RPakLoadedInfo_t pakInfo = g_pRTech->GetPakLoadedInfo(nPakId);
|
RPakLoadedInfo_t pakInfo = g_pRTech->GetPakLoadedInfo(nPakId);
|
||||||
pakInfo.m_pszFileName ? DevMsg(eDLL_T::RTECH, "Requested Pak Unload for '%s'\n", pakInfo.m_pszFileName) : DevMsg(eDLL_T::RTECH, "Requested Pak Unload for '%d'\n", nPakId);
|
pakInfo.m_pszFileName ? DevMsg(eDLL_T::RTECH, "Requested Pak Unload for '%s'\n", pakInfo.m_pszFileName) : DevMsg(eDLL_T::RTECH, "Requested Pak Unload for '%d'\n", nPakId);
|
||||||
g_pakLoadApi->Unload(nPakId);
|
g_pakLoadApi->Unload(nPakId);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user