Querying ConVars from Server DLL: Difference between revisions
m (minor tidy & categorized) |
Thunder4ik (talk | contribs) m (→top: clean up, added orphan, underlinked tags) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
{{Multiple issues| | |||
{{Underlinked|date=January 2024}} | |||
{{Orphan|date=January 2024}} | |||
}} | |||
With the Source Engine update on 11/29/2006 new functions were added to allow mod authors to query the values of particular [[ConVar|convars]] set on the client. Since this functionality is greatly desired by the mod community and we are not currently ready for an SDK update we have created this page in order to demonstrate how to use this new functionality. | With the Source Engine update on 11/29/2006 new functions were added to allow mod authors to query the values of particular [[ConVar|convars]] set on the client. Since this functionality is greatly desired by the mod community and we are not currently ready for an SDK update we have created this page in order to demonstrate how to use this new functionality. | ||
All of the required changes are in | All of the required changes are in <code>src\public\eiface.h</code>. | ||
If you have any questions about these new functions please feel free to contact [mailto:mdurand@valvesoftware.com mdurand@valvesoftware.com]. | |||
==Step 1 - Add new function declaration to bottom of IVEngineServer== | |||
Add the following lines to the end of the public: section of IVEngineServer | Add the following lines to the end of the public: section of IVEngineServer | ||
Line 16: | Line 23: | ||
virtual QueryCvarCookie_t StartQueryCvarValue( edict_t *pPlayerEntity, const char *pName ) = 0; | virtual QueryCvarCookie_t StartQueryCvarValue( edict_t *pPlayerEntity, const char *pName ) = 0; | ||
==Step 2 - Add and modify #define's== | |||
Add the following lines beneath the declaration of IVEngineServer. You will be changing the value of INTERFACEVERSION_SERVERGAMEDLL which was previously defined. | Add the following lines beneath the declaration of IVEngineServer. You will be changing the value of INTERFACEVERSION_SERVERGAMEDLL which was previously defined. | ||
Line 24: | Line 30: | ||
#define INTERFACEVERSION_SERVERGAMEDLL "ServerGameDLL006" | #define INTERFACEVERSION_SERVERGAMEDLL "ServerGameDLL006" | ||
==Step 3 - Add new function declaration to IServerGameDLL== | |||
Add the following four lines to the end of the public: section of IServerGameDLL | Add the following four lines to the end of the public: section of IServerGameDLL | ||
Line 36: | Line 41: | ||
virtual void OnQueryCvarValueFinished( QueryCvarCookie_t iCookie, edict_t *pPlayerEntity, EQueryCvarValueStatus eStatus, const char *pCvarName, const char *pCvarValue ) = 0; | virtual void OnQueryCvarValueFinished( QueryCvarCookie_t iCookie, edict_t *pPlayerEntity, EQueryCvarValueStatus eStatus, const char *pCvarName, const char *pCvarValue ) = 0; | ||
[[Category:Networking]] | |||
[[Category: | |||
[[Category:Tutorials]] | [[Category:Tutorials]] |
Latest revision as of 22:52, 21 January 2024





January 2024

You can help by

January 2024
With the Source Engine update on 11/29/2006 new functions were added to allow mod authors to query the values of particular convars set on the client. Since this functionality is greatly desired by the mod community and we are not currently ready for an SDK update we have created this page in order to demonstrate how to use this new functionality.
All of the required changes are in src\public\eiface.h
.
If you have any questions about these new functions please feel free to contact mdurand@valvesoftware.com.
Step 1 - Add new function declaration to bottom of IVEngineServer
Add the following lines to the end of the public: section of IVEngineServer
// Call this to find out the value of a cvar on the client. // // It is an asynchronous query, and it will call IServerGameDLL::OnQueryCvarValueFinished when // the value comes in from the client. // // Store the return value if you want to match this specific query to the OnQueryCvarValueFinished call. // Returns InvalidQueryCvarCookie if the entity is invalid. virtual QueryCvarCookie_t StartQueryCvarValue( edict_t *pPlayerEntity, const char *pName ) = 0;
Step 2 - Add and modify #define's
Add the following lines beneath the declaration of IVEngineServer. You will be changing the value of INTERFACEVERSION_SERVERGAMEDLL which was previously defined.
#define INTERFACEVERSION_SERVERGAMEDLL_VERSION_5 "ServerGameDLL005" #define INTERFACEVERSION_SERVERGAMEDLL "ServerGameDLL006"
Step 3 - Add new function declaration to IServerGameDLL
Add the following four lines to the end of the public: section of IServerGameDLL
// * This function is new with version 6 of the interface. // // This is called when a query from IServerPluginHelpers::StartQueryCvarValue is finished. // iCookie is the value returned by IServerPluginHelpers::StartQueryCvarValue. // Added with version 2 of the interface. virtual void OnQueryCvarValueFinished( QueryCvarCookie_t iCookie, edict_t *pPlayerEntity, EQueryCvarValueStatus eStatus, const char *pCvarName, const char *pCvarValue ) = 0;