[RCon]: Address rare crash (#834)
This commit is contained in:
parent
0266d8aa2d
commit
e3c86dfd7e
@ -35,6 +35,24 @@ namespace Components
|
||||
Game::FS_FreeFile(file);
|
||||
}
|
||||
|
||||
int NetworkDebug::I_stricmp_Stub(const char* s0, const char* s1)
|
||||
{
|
||||
assert(s0);
|
||||
assert(s1);
|
||||
|
||||
if (!s0)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!s1)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
return Utils::Hook::Call<int(const char*, const char*, int)>(0x426080)(s0, s1, std::numeric_limits<int>::max()); // I_strnicmp
|
||||
}
|
||||
|
||||
NetworkDebug::NetworkDebug()
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
@ -42,6 +60,9 @@ namespace Components
|
||||
Command::Add("parseBadPacket", CL_ParseBadPacket_f);
|
||||
#endif
|
||||
|
||||
// Address "race" condition where commands received from RCon can be null
|
||||
Utils::Hook(0x6094DA, I_stricmp_Stub, HOOK_CALL).install()->quick(); // Cmd_ExecuteServerString
|
||||
|
||||
// Backport updates from IW5
|
||||
Utils::Hook::Set<const char*>(0x45D112, "CL_PacketEvent - ignoring illegible message\n");
|
||||
}
|
||||
|
@ -11,5 +11,7 @@ namespace Components
|
||||
static void CL_ParseServerMessage_Hk(Game::msg_t* msg);
|
||||
|
||||
static void CL_ParseBadPacket_f();
|
||||
|
||||
static int I_stricmp_Stub(const char* s0, const char* s1);
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user