This is getting rediculous.
Our own native calls IClient::ClientPrintf to print stuff to the demo
console.
The engine's Host_Client_Printf uses the CGameClient vtable's
ClientPrintf. To catch the output of the "status" command, we have to
hook both vtables on linux...
Windows casts to IClient in Host_Client_Printf, so no need to do that
there.
We check if the demorecorder IsRecording a demo before calling the
forward to prevent it from being called while the sourcetv server
doesn't record. Need to pre hook StopRecording instead of post, to still
be able to check that.
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.
Keep the instances in seperate wrappers to clear up the hooks. This
allows for some OnServerStart and OnServerShutdown forwards.
To prepare support for relay servers, CHLTVServer::Shutdown is hooked to
detect shutdown instead of relying on the director unregistering the
instance.
CS:GO doesn't send the client name in plain text, but wraps it in some
protobuf construct.
Parse that list of client convars for the player name and use it in the
SourceTV_OnSpectatorPreConnect forward
CSS' CBaseClient::ClientPrintf tries to use the net channel directly
instead of going through the saner route using GameClient::SendNetMsg.
This introduces a stupid hack to work around the bots lack of a net
channel, so ClientPrintf's SVC_Print messages get included in the demo.