Multiple inheritance is killing me:(
The engine calls CGameClient::Disconnect, but we've only hooked
IClient::Disconnect, which uses a seperate vtable.
Our own SourceTV_KickClient native calls the IClient variant though, so
we need to hook both on linux to catch all cases.
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.
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.
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.