Fix OnStartRecording and OnStopRecording forwards on linux
CHLTVServer::StartRecording is called directly in tv_record on linux, ignoring the vtable. Add a detour on linux for these two functions, so we always notice when recording starts. Windows actually always uses the vtable to get the function address, so we don't need to detour anything on windows.
This commit is contained in:
@@ -261,6 +261,11 @@ void HLTVServerWrapperManager::InitHooks()
|
||||
|
||||
void HLTVServerWrapperManager::ShutdownHooks()
|
||||
{
|
||||
#ifndef WIN32
|
||||
g_pSTVForwards.RemoveStartRecordingDetour();
|
||||
g_pSTVForwards.RemoveStopRecordingDetour();
|
||||
#endif
|
||||
|
||||
#if SOURCE_ENGINE != SE_CSGO
|
||||
if (m_bSendNetMsgHooked)
|
||||
{
|
||||
@@ -272,6 +277,12 @@ void HLTVServerWrapperManager::ShutdownHooks()
|
||||
|
||||
void HLTVServerWrapperManager::AddServer(IHLTVServer *hltvserver)
|
||||
{
|
||||
#ifndef WIN32
|
||||
// Create the detours once the first sourcetv server is created.
|
||||
g_pSTVForwards.CreateStartRecordingDetour();
|
||||
g_pSTVForwards.CreateStopRecordingDetour();
|
||||
#endif
|
||||
|
||||
HLTVServerWrapper *wrapper = new HLTVServerWrapper(hltvserver);
|
||||
m_HLTVServers.append(wrapper);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user