The engine formats the chat message like "Name : Message" before sending
it through BroadcastLocalChat. Catch the message beforehand and pass
only that to plugins if possible.
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.
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