2008-09-15 01:07:45 -05:00
|
|
|
|
//===== Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ======//
|
|
|
|
|
//
|
|
|
|
|
// Purpose:
|
|
|
|
|
//
|
|
|
|
|
//===========================================================================//
|
|
|
|
|
|
|
|
|
|
#ifndef ICVAR_H
|
|
|
|
|
#define ICVAR_H
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
#pragma once
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include "appframework/IAppSystem.h"
|
|
|
|
|
#include "tier1/iconvar.h"
|
|
|
|
|
|
|
|
|
|
class ConCommandBase;
|
|
|
|
|
class ConCommand;
|
|
|
|
|
class ConVar;
|
|
|
|
|
class Color;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
// ConVars/ComCommands are marked as having a particular DLL identifier
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
typedef int CVarDLLIdentifier_t;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
// Used to display console messages
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
abstract_class IConsoleDisplayFunc
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
virtual void ColorPrint( const Color& clr, const char *pMessage ) = 0;
|
|
|
|
|
virtual void Print( const char *pMessage ) = 0;
|
|
|
|
|
virtual void DPrint( const char *pMessage ) = 0;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
// Purpose: Applications can implement this to modify behavior in ICvar
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
#define CVAR_QUERY_INTERFACE_VERSION "VCvarQuery001"
|
|
|
|
|
abstract_class ICvarQuery : public IAppSystem
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
// Can these two convars be aliased?
|
|
|
|
|
virtual bool AreConVarsLinkable( const ConVar *child, const ConVar *parent ) = 0;
|
|
|
|
|
};
|
|
|
|
|
|
2008-11-09 22:21:58 -06:00
|
|
|
|
abstract_class ICvarIteratorInternal
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
virtual void SetFirst( void ) = 0;
|
|
|
|
|
virtual void Next( void ) = 0;
|
|
|
|
|
virtual bool IsValid( void ) = 0;
|
|
|
|
|
virtual ConCommandBase *Get( void ) = 0;
|
|
|
|
|
};
|
|
|
|
|
|
2008-09-15 01:07:45 -05:00
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
// Purpose: DLL interface to ConVars/ConCommands
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
abstract_class ICvar : public IAppSystem
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
// Allocate a unique DLL identifier
|
|
|
|
|
virtual CVarDLLIdentifier_t AllocateDLLIdentifier() = 0;
|
|
|
|
|
|
|
|
|
|
// Register, unregister commands
|
|
|
|
|
virtual void RegisterConCommand( ConCommandBase *pCommandBase ) = 0;
|
|
|
|
|
virtual void UnregisterConCommand( ConCommandBase *pCommandBase ) = 0;
|
|
|
|
|
virtual void UnregisterConCommands( CVarDLLIdentifier_t id ) = 0;
|
|
|
|
|
|
|
|
|
|
// If there is a +<varname> <value> on the command line, this returns the value.
|
|
|
|
|
// Otherwise, it returns NULL.
|
|
|
|
|
virtual const char* GetCommandLineValue( const char *pVariableName ) = 0;
|
|
|
|
|
|
|
|
|
|
// Try to find the cvar pointer by name
|
|
|
|
|
virtual ConCommandBase *FindCommandBase( const char *name ) = 0;
|
|
|
|
|
virtual const ConCommandBase *FindCommandBase( const char *name ) const = 0;
|
|
|
|
|
virtual ConVar *FindVar ( const char *var_name ) = 0;
|
|
|
|
|
virtual const ConVar *FindVar ( const char *var_name ) const = 0;
|
|
|
|
|
virtual ConCommand *FindCommand( const char *name ) = 0;
|
|
|
|
|
virtual const ConCommand *FindCommand( const char *name ) const = 0;
|
|
|
|
|
|
|
|
|
|
// Install a global change callback (to be called when any convar changes)
|
|
|
|
|
virtual void InstallGlobalChangeCallback( FnChangeCallback_t callback ) = 0;
|
|
|
|
|
virtual void RemoveGlobalChangeCallback( FnChangeCallback_t callback ) = 0;
|
|
|
|
|
virtual void CallGlobalChangeCallbacks( ConVar *var, const char *pOldString, float flOldValue ) = 0;
|
|
|
|
|
|
|
|
|
|
// Install a console printer
|
|
|
|
|
virtual void InstallConsoleDisplayFunc( IConsoleDisplayFunc* pDisplayFunc ) = 0;
|
|
|
|
|
virtual void RemoveConsoleDisplayFunc( IConsoleDisplayFunc* pDisplayFunc ) = 0;
|
|
|
|
|
virtual void ConsoleColorPrintf( const Color& clr, const char *pFormat, ... ) const = 0;
|
|
|
|
|
virtual void ConsolePrintf( const char *pFormat, ... ) const = 0;
|
|
|
|
|
virtual void ConsoleDPrintf( const char *pFormat, ... ) const = 0;
|
|
|
|
|
|
|
|
|
|
// Reverts cvars which contain a specific flag
|
|
|
|
|
virtual void RevertFlaggedConVars( int nFlag ) = 0;
|
|
|
|
|
|
|
|
|
|
// Method allowing the engine ICvarQuery interface to take over
|
|
|
|
|
// A little hacky, owing to the fact the engine is loaded
|
|
|
|
|
// well after ICVar, so we can't use the standard connect pattern
|
|
|
|
|
virtual void InstallCVarQuery( ICvarQuery *pQuery ) = 0;
|
|
|
|
|
|
|
|
|
|
#if defined( _X360 )
|
|
|
|
|
virtual void PublishToVXConsole( ) = 0;
|
|
|
|
|
#endif
|
Initial set of changes from reversed engineered l4d binaries
* Bumped IVEngineServer to version 022
* Bumped ICvar to version 007
* Added/Removed various functions to/from the following interfaces: IVEngineServer, ICvar, IServerGameDLL, IServerGameEnts, IServerGameClients, IFileSystem, IEngineSound, IEngineTrace, IClient, IConvar, and INetworkStringTableContainer
* Added unknown extra int ptr param to IGameEventManager2::CreateEvent
* Added GetDebugEventID to IGameEventListener2
* Added two new members of CGlobalVars: serverCount and baseEdict
* Added new functions to ConCommandBase and ConVar classes in tier1
* Recompiled tier1 static library for Windows
* Updated notes.txt to reflect the nature of this SDK
2008-11-09 02:40:03 -06:00
|
|
|
|
|
|
|
|
|
virtual void SetMaxSplitScreenSlots( int ) = 0;
|
|
|
|
|
virtual int GetMaxSplitScreenSlots() const = 0;
|
|
|
|
|
virtual void AddSplitScreenConVars() = 0;
|
|
|
|
|
virtual void RemoveSplitScreenConVars( int ) = 0;
|
|
|
|
|
virtual int GetConsoleDisplayFuncCount() const = 0;
|
|
|
|
|
virtual void GetConsoleText( int, char *, unsigned int ) const = 0;
|
|
|
|
|
virtual bool IsMaterialThreadSetAllowed() const = 0;
|
|
|
|
|
virtual void QueueMaterialThreadSetValue( ConVar *, const char * ) = 0;
|
|
|
|
|
virtual void QueueMaterialThreadSetValue( ConVar *, int ) = 0;
|
|
|
|
|
virtual void QueueMaterialThreadSetValue( ConVar *, float ) = 0;
|
|
|
|
|
virtual bool HasQueuedMaterialThreadConVarSets() const = 0;
|
|
|
|
|
virtual int ProcessQueuedMaterialThreadConVarSets() = 0;
|
2008-12-02 10:36:09 -06:00
|
|
|
|
|
|
|
|
|
// Returns a cvar iterator pointer.
|
|
|
|
|
//
|
|
|
|
|
// If memoverride is not used, use g_pMemAlloc->Free() to deallocate the memory
|
|
|
|
|
// used by these iterators.
|
|
|
|
|
//
|
|
|
|
|
// If memoverride is used, you can use the delete operator even though there
|
|
|
|
|
// is no virtual destructor. This can be done because memoverride overloads the
|
|
|
|
|
// delete operator so that it will call g_pMemAlloc-Free().
|
2008-11-09 22:21:58 -06:00
|
|
|
|
virtual ICvarIteratorInternal *FactoryInternalIterator() = 0;
|
2008-09-15 01:07:45 -05:00
|
|
|
|
};
|
|
|
|
|
|
Initial set of changes from reversed engineered l4d binaries
* Bumped IVEngineServer to version 022
* Bumped ICvar to version 007
* Added/Removed various functions to/from the following interfaces: IVEngineServer, ICvar, IServerGameDLL, IServerGameEnts, IServerGameClients, IFileSystem, IEngineSound, IEngineTrace, IClient, IConvar, and INetworkStringTableContainer
* Added unknown extra int ptr param to IGameEventManager2::CreateEvent
* Added GetDebugEventID to IGameEventListener2
* Added two new members of CGlobalVars: serverCount and baseEdict
* Added new functions to ConCommandBase and ConVar classes in tier1
* Recompiled tier1 static library for Windows
* Updated notes.txt to reflect the nature of this SDK
2008-11-09 02:40:03 -06:00
|
|
|
|
#define CVAR_INTERFACE_VERSION "VEngineCvar007"
|
2008-09-15 01:07:45 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
// These global names are defined by tier1.h, duplicated here so you
|
|
|
|
|
// don't have to include tier1.h
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
// These are marked DLL_EXPORT for Linux.
|
|
|
|
|
DLL_EXPORT ICvar *cvar;
|
|
|
|
|
DLL_EXPORT ICvar *g_pCVar;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif // ICVAR_H
|