mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Remove 'SVC_PlaylistOverrides' patch
Only block 'CLC_SetPlaylistVarOverride' messages when cheats are disabled. The server still needs to be able to override client playlist vars (using 'SVC_PlaylistOverrides'). This isn't a problem, as on any disconnect, the client will reload its own bundled copy.
This commit is contained in:
parent
8d78b3a7e8
commit
f6650df951
r5dev/common
@ -65,30 +65,10 @@ bool SVC_UserMessage::ProcessImpl()
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Below functions are hooked as 'SVC_PlaylistOverrides' can be abused from the
|
||||
// client. The client could basically manage the server's playlists. Only allow
|
||||
// reading/writing when cheats are enabled.
|
||||
// Below functions are hooked as playlist overrides can be abused from the client.
|
||||
// The client could basically manage the server's playlists. Only allow read/write
|
||||
// when cheats are enabled.
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
bool SVC_PlaylistOverrides::ReadFromBufferImpl(SVC_PlaylistOverrides* thisptr, bf_read* buffer)
|
||||
{
|
||||
// Abusable netmsg; only allow if cheats are enabled.
|
||||
if (!sv_cheats->GetBool())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return SVC_PlaylistOverrides_ReadFromBuffer(thisptr, buffer);
|
||||
}
|
||||
bool SVC_PlaylistOverrides::WriteToBufferImpl(SVC_PlaylistOverrides* thisptr, bf_write* buffer)
|
||||
{
|
||||
// Abusable netmsg; only allow if cheats are enabled.
|
||||
if (!sv_cheats->GetBool())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return SVC_PlaylistOverrides_WriteToBuffer(thisptr, buffer);
|
||||
}
|
||||
bool CLC_SetPlaylistVarOverride::ReadFromBufferImpl(CLC_SetPlaylistVarOverride* thisptr, bf_read* buffer)
|
||||
{
|
||||
// Abusable netmsg; only allow if cheats are enabled.
|
||||
@ -189,8 +169,6 @@ void V_NetMessages::Attach() const
|
||||
CMemory::HookVirtualMethod((uintptr_t)g_pSVC_UserMessage_VFTable, (LPVOID&)hk_SVCUserMessage_Process, NetMessageVtbl::Process, (LPVOID*)&SVC_UserMessage_Process);
|
||||
CMemory::HookVirtualMethod((uintptr_t)g_pBase_CmdKeyValues_VFTable, (LPVOID*)&Base_CmdKeyValues::ReadFromBufferImpl, NetMessageVtbl::ReadFromBuffer, (LPVOID*)&Base_CmdKeyValues_ReadFromBuffer);
|
||||
CMemory::HookVirtualMethod((uintptr_t)g_pBase_CmdKeyValues_VFTable, (LPVOID*)&Base_CmdKeyValues::WriteToBufferImpl, NetMessageVtbl::WriteToBuffer, (LPVOID*)&Base_CmdKeyValues_WriteToBuffer);
|
||||
CMemory::HookVirtualMethod((uintptr_t)g_pSVC_PlaylistOverrides_VFTable, (LPVOID*)&SVC_PlaylistOverrides::ReadFromBufferImpl, NetMessageVtbl::ReadFromBuffer, (LPVOID*)&SVC_PlaylistOverrides_ReadFromBuffer);
|
||||
CMemory::HookVirtualMethod((uintptr_t)g_pSVC_PlaylistOverrides_VFTable, (LPVOID*)&SVC_PlaylistOverrides::WriteToBufferImpl, NetMessageVtbl::WriteToBuffer, (LPVOID*)&SVC_PlaylistOverrides_WriteToBuffer);
|
||||
CMemory::HookVirtualMethod((uintptr_t)g_pCLC_SetPlaylistVarOverride_VFTable, (LPVOID*)&CLC_SetPlaylistVarOverride::ReadFromBufferImpl, NetMessageVtbl::ReadFromBuffer, (LPVOID*)&CLC_SetPlaylistVarOverride_ReadFromBuffer);
|
||||
CMemory::HookVirtualMethod((uintptr_t)g_pCLC_SetPlaylistVarOverride_VFTable, (LPVOID*)&CLC_SetPlaylistVarOverride::WriteToBufferImpl, NetMessageVtbl::WriteToBuffer, (LPVOID*)&CLC_SetPlaylistVarOverride_WriteToBuffer);
|
||||
}
|
||||
@ -202,8 +180,6 @@ void V_NetMessages::Detach() const
|
||||
CMemory::HookVirtualMethod((uintptr_t)g_pSVC_UserMessage_VFTable, (LPVOID)SVC_UserMessage_Process, NetMessageVtbl::Process, (LPVOID*)&hkRestore);
|
||||
CMemory::HookVirtualMethod((uintptr_t)g_pBase_CmdKeyValues_VFTable, (LPVOID)Base_CmdKeyValues_ReadFromBuffer, NetMessageVtbl::ReadFromBuffer, (LPVOID*)&hkRestore);
|
||||
CMemory::HookVirtualMethod((uintptr_t)g_pBase_CmdKeyValues_VFTable, (LPVOID)Base_CmdKeyValues_WriteToBuffer, NetMessageVtbl::WriteToBuffer, (LPVOID*)&hkRestore);
|
||||
CMemory::HookVirtualMethod((uintptr_t)g_pSVC_PlaylistOverrides_VFTable, (LPVOID)SVC_PlaylistOverrides_ReadFromBuffer, NetMessageVtbl::ReadFromBuffer, (LPVOID*)&hkRestore);
|
||||
CMemory::HookVirtualMethod((uintptr_t)g_pSVC_PlaylistOverrides_VFTable, (LPVOID)SVC_PlaylistOverrides_WriteToBuffer, NetMessageVtbl::WriteToBuffer, (LPVOID*)&hkRestore);
|
||||
CMemory::HookVirtualMethod((uintptr_t)g_pCLC_SetPlaylistVarOverride_VFTable, (LPVOID)CLC_SetPlaylistVarOverride_ReadFromBuffer, NetMessageVtbl::ReadFromBuffer, (LPVOID*)&hkRestore);
|
||||
CMemory::HookVirtualMethod((uintptr_t)g_pCLC_SetPlaylistVarOverride_VFTable, (LPVOID)CLC_SetPlaylistVarOverride_WriteToBuffer, NetMessageVtbl::WriteToBuffer, (LPVOID*)&hkRestore);
|
||||
}
|
||||
|
@ -56,8 +56,6 @@ inline void* g_pSVC_VoiceData_VFTable = nullptr;
|
||||
//-------------------------------------------------------------------------
|
||||
// SVC_PlaylistOverrides
|
||||
//-------------------------------------------------------------------------
|
||||
inline bool(*SVC_PlaylistOverrides_ReadFromBuffer)(SVC_PlaylistOverrides* thisptr, bf_read* buffer);
|
||||
inline bool(*SVC_PlaylistOverrides_WriteToBuffer)(SVC_PlaylistOverrides* thisptr, bf_write* buffer);
|
||||
inline void* g_pSVC_PlaylistOverrides_VFTable = nullptr;
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
@ -357,10 +355,6 @@ public:
|
||||
|
||||
class SVC_PlaylistOverrides : public CNetMessage
|
||||
{
|
||||
public:
|
||||
static bool ReadFromBufferImpl(SVC_PlaylistOverrides* thisptr, bf_read* buffer);
|
||||
static bool WriteToBufferImpl(SVC_PlaylistOverrides* thisptr, bf_write* buffer);
|
||||
|
||||
private:
|
||||
int m_nMsgType;
|
||||
int m_nLength; // data length in bits
|
||||
|
Loading…
x
Reference in New Issue
Block a user