mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Add remote function calls checksum for server
This commit is contained in:
parent
a156459419
commit
3be02f949b
@ -32,7 +32,7 @@ void KeepAliveToPylon()
|
||||
// BUG BUG: Checksum is null on dedi
|
||||
// ADDITIONAL NOTES: seems to be related to scripts, this also happens when the listen server is started but the client from the same process never connects.
|
||||
// Checksum only gets set on the server if the client from its own process connects to it.
|
||||
std::to_string(*g_nRemoteFunctionCallsChecksum),
|
||||
std::to_string(*g_nClientRemoteChecksum),
|
||||
std::string(),
|
||||
g_szNetKey.c_str()
|
||||
}
|
||||
|
@ -587,7 +587,7 @@ void IBrowser::UpdateHostingStatus()
|
||||
break;
|
||||
}
|
||||
|
||||
if (*g_nRemoteFunctionCallsChecksum == NULL) // Check if script checksum is valid yet.
|
||||
if (*g_nClientRemoteChecksum == NULL) // Check if script checksum is valid yet.
|
||||
{
|
||||
break;
|
||||
}
|
||||
@ -628,7 +628,7 @@ void IBrowser::SendHostingPostRequest()
|
||||
g_pCVar->FindVar("hostport")->GetString(),
|
||||
g_pCVar->FindVar("mp_gamemode")->GetString(),
|
||||
m_Server.bHidden,
|
||||
std::to_string(*g_nRemoteFunctionCallsChecksum),
|
||||
std::to_string(*g_nClientRemoteChecksum),
|
||||
|
||||
std::string(),
|
||||
g_szNetKey.c_str()
|
||||
|
@ -6,7 +6,11 @@ namespace
|
||||
ADDRESS p_Script_Remote_BeginRegisteringFunctions = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x83\xEC\x28\x83\x3D\x00\x00\x00\x00\x00\x74\x10", "xxxxxx?????xx");
|
||||
void* Script_Remote_BeginRegisteringFunctions = (void*)p_Script_Remote_BeginRegisteringFunctions.GetPtr(); /*48 83 EC 28 83 3D ?? ?? ?? ?? ?? 74 10*/
|
||||
|
||||
std::uint32_t* g_nRemoteFunctionCallsChecksum = reinterpret_cast<std::uint32_t*>(p_Script_Remote_BeginRegisteringFunctions.FindPatternSelf("89 05", ADDRESS::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x2, 0x6).GetPtr());
|
||||
ADDRESS p_RestoreRemoteChecksumsFromSaveGame = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x89\x4C\x24\x00\x41\x54\x48\x83\xEC\x40", "xxxx?xxxxxx");
|
||||
void* (*RestoreRemoteChecksumsFromSaveGame)(void* a1, void* a2) = (void* (*)(void*, void*))p_RestoreRemoteChecksumsFromSaveGame.GetPtr(); /*48 89 4C 24 ? 41 54 48 83 EC 40*/
|
||||
|
||||
std::uint32_t* g_nServerRemoteChecksum = reinterpret_cast<std::uint32_t*>(p_RestoreRemoteChecksumsFromSaveGame.Offset(0x1C0).FindPatternSelf("48 8D 15", ADDRESS::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x3, 0x7).GetPtr());
|
||||
std::uint32_t* g_nClientRemoteChecksum = reinterpret_cast<std::uint32_t*>(p_Script_Remote_BeginRegisteringFunctions.Offset(0x0).FindPatternSelf("89 05", ADDRESS::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x2, 0x6).GetPtr());
|
||||
}
|
||||
|
||||
namespace VSquirrel
|
||||
@ -46,7 +50,9 @@ class HSqInit : public IDetour
|
||||
virtual void debugp()
|
||||
{
|
||||
std::cout << "| FUN: Remote_BeginRegisteringFunctions : 0x" << std::hex << std::uppercase << p_Script_Remote_BeginRegisteringFunctions.GetPtr() << std::setw(npad) << " |" << std::endl;
|
||||
std::cout << "| VAR: g_nRemoteFunctionCallsChecksum : 0x" << std::hex << std::uppercase << g_nRemoteFunctionCallsChecksum << std::setw(0) << " |" << std::endl;
|
||||
std::cout << "| FUN: RestoreRemoteChecksumsFromSaveGame : 0x" << std::hex << std::uppercase << p_RestoreRemoteChecksumsFromSaveGame.GetPtr() << std::setw(npad) << " |" << std::endl;
|
||||
std::cout << "| VAR: g_nServerRemoteChecksum : 0x" << std::hex << std::uppercase << g_nServerRemoteChecksum << std::setw(0) << " |" << std::endl;
|
||||
std::cout << "| VAR: g_nClientRemoteChecksum : 0x" << std::hex << std::uppercase << g_nClientRemoteChecksum << std::setw(0) << " |" << std::endl;
|
||||
std::cout << "+----------------------------------------------------------------+" << std::endl;
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user