PazerOP / CastingEssentials

A Team Fortress 2 client plugin that enhances the experience of both casters and viewers.
https://Essentials.tf
BSD 2-Clause "Simplified" License
29 stars 12 forks source link

Need a way to reliably detect srctv+ #87

Closed PazerOP closed 6 years ago

dalegaard commented 6 years ago

I can add in a cvar or similar that can be detected, but obviously won't fix existing installations.

dalegaard commented 6 years ago

How do you want the output of this to be? A module with a callback when srctv+ is found? Something on module manager?

srctv+ is easily detected by the presence of player_hurt or player_healed events, but I haven't had time to look into other events being present that might be useful earlier.

Come to think of it, maybe trying to detect srctv+ is not really worthwhile - maybe a simple cvar will be easier to work with?

PazerOP commented 6 years ago

It would probably be best to just have a new module that handles checking/listening for srctv+. While HLTV is obviously the main use case for CastingEssentials, I would like to have as many features as possible, including this new srctv+ detection feature, function on listen servers so testing is easier. There are already so many CE-specific cvars that people are getting confused, unfortunately.

On listen servers you will still get player_hurt and player_healed events even if srctv+ isn't running. I'm thinking the best way to handle this will be to make changes in both srctv+ and CE. In srctv+, it would be nice if SendProxy_IncludeHLTV also checked IVEngineServer::IsDedicatedServer(), if false, it includes player index 1 (the listen server host apparently, see UTIL_GetListenServerHost()). Then, we just use a VariablePusher on RecvProp::m_ProxyFn for something like DT_TFPlayer.tflocaldata.m_angEyeAngles[0]. If we get an update in there and it's not for the local player, we'll know we have srctv+ installed.