Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
https://developer.valvesoftware.com/wiki/Querying_ConVars_from_Server_Plugins
I want to do the same but only in SERVER code:
https://developer.valvesoftware.com/wiki/Querying_ConVars_from_Server_DLL
But I can not. I'm looking for solution/workaround of this issue. My CServerGameDLL::OnQueryCvarValueFinished member does not call and I don't know why.
Please, have a look at starting post again. I need to catch values of convars like mat_wireframe, but using engine->StartQueryCvarValue method. The point is in that I cannot use GetClientConVarValue to getting mat_wireframe value, only StartQueryCvarValue.
But anyway, I tested out OnQueryCvarValueFinished() myself, and it's definitely not getting called from StartQueryCvarValue().
I even tried doing while ( true ) {} just to see if I could lock the game, because it's sometimes possible that Warning() and Msg() calls just flat out don't work for some odd reason. Nothing. Game continues like nothing happened.
So my only guess is that it's an engine bug and the ony way you'd be able to get the value is by modifying the client code.
I have coded some tests.
I found out engine->GetClientConVarValue() only returns the value for convars declared on Client, and marked with flag FCVAR_USERINFO. This is because convars with this flag are sent through the network with a StringTable ("userinfo") when client connects or value changes.
On the other hand, I tried few engine->StartQueryCvarValue() calls without luck.
You should use first method, since it does not use network on each call unlike second. Instead, it retrieves the convar values from the mentioned StringTable. By the way, some examples of userinfo convars whose value you can retrieve are: cl_playermodel, cl_language.
Test code for you:
As a side note, there is a GitHub repo containing old leaked SourceEngine2007 codebase. This helps a lot to learn about specific flows or even allow you to send netmessages with a bit of buffer hacks. For instance, here you can check what engine->GetClientConvarValue() does:
https://github.com/LestaD/SourceEngine2007/blob/43a5c90a5ada1e69ca044595383be67f40b33c61/se2007/engine/vengineserver_impl.cpp#L1255
I hope it helps. Regards.
Thanks from the future, I was scratching my head as to why a FCVAR_USERINFO flagged ConVar would not propagate its value change to server through GetClientConVarValue (it kept returning default value); turned out it indeed needed to be declared only on clientside code to work.