1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2025-09-19 20:16:10 +08:00

Merge branch 'dota-2022' into dota

This commit is contained in:
Nick Hastings
2022-11-09 23:01:20 +00:00
42 changed files with 43 additions and 2605 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -39,7 +39,6 @@ LIB_OBJS= \
$(LIB_OBJ_DIR)/datamanager.o \ $(LIB_OBJ_DIR)/datamanager.o \
$(LIB_OBJ_DIR)/diff.o \ $(LIB_OBJ_DIR)/diff.o \
$(LIB_OBJ_DIR)/generichash.o \ $(LIB_OBJ_DIR)/generichash.o \
$(LIB_OBJ_DIR)/KeyValues.o \
$(LIB_OBJ_DIR)/mempool.o \ $(LIB_OBJ_DIR)/mempool.o \
$(LIB_OBJ_DIR)/memstack.o \ $(LIB_OBJ_DIR)/memstack.o \
$(LIB_OBJ_DIR)/NetAdr.o \ $(LIB_OBJ_DIR)/NetAdr.o \

View File

@ -1,4 +1,4 @@
//===== Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ======// //===== Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ======//
// //
// Purpose: // Purpose:
// //
@ -77,6 +77,7 @@ class ILoopModePrerequisiteRegistry;
struct URLArgument_t; struct URLArgument_t;
struct vis_info_t; struct vis_info_t;
class IHLTVServer; class IHLTVServer;
class CBufferString;
namespace google namespace google
{ {
@ -172,6 +173,7 @@ public:
virtual uint32 GetStatsAppID() const = 0; virtual uint32 GetStatsAppID() const = 0;
virtual void *UnknownFunc1(const char *pszFilename, void *pUnknown1, void *pUnknown2, void *pUnknown3) = 0; virtual void *UnknownFunc1(const char *pszFilename, void *pUnknown1, void *pUnknown2, void *pUnknown3) = 0;
virtual void UnknownFunc2() = 0;
}; };
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -206,6 +208,9 @@ public:
virtual int PrecacheDecal( const char *name, bool preload = false ) = 0; virtual int PrecacheDecal( const char *name, bool preload = false ) = 0;
virtual bool IsDecalPrecached( const char *s ) const = 0; virtual bool IsDecalPrecached( const char *s ) const = 0;
virtual int GetPrecachedDecalIndex ( const char *s ) const = 0; virtual int GetPrecachedDecalIndex ( const char *s ) const = 0;
virtual void UnknownFunc3() = 0;
virtual void UnknownFunc4() = 0;
virtual int PrecacheGeneric( const char *s, bool preload = false ) = 0; virtual int PrecacheGeneric( const char *s, bool preload = false ) = 0;
virtual bool IsGenericPrecached( char const *s ) const = 0; virtual bool IsGenericPrecached( char const *s ) const = 0;
@ -220,17 +225,6 @@ public:
virtual bool IsUserIDInUse( int userID ) = 0; // TERROR: used for transitioning virtual bool IsUserIDInUse( int userID ) = 0; // TERROR: used for transitioning
virtual int GetLoadingProgressForUserID( int userID ) = 0; // TERROR: used for transitioning virtual int GetLoadingProgressForUserID( int userID ) = 0; // TERROR: used for transitioning
// This returns which entities, to the best of the server's knowledge, the client currently knows about.
// This is really which entities were in the snapshot that this client last acked.
// This returns a bit vector with one bit for each entity.
//
// USE WITH CARE. Whatever tick the client is really currently on is subject to timing and
// ordering differences, so you should account for about a quarter-second discrepancy in here.
// Also, this will return NULL if the client doesn't exist or if this client hasn't acked any frames yet.
//
// iClientIndex is the CLIENT index, so if you use pPlayer->entindex(), subtract 1.
virtual const CBitVec<MAX_EDICTS>* GetEntityTransmitBitsForClient( CEntityIndex iClientIndex ) = 0;
// Given the current PVS(or PAS) and origin, determine which players should hear/receive the message // Given the current PVS(or PAS) and origin, determine which players should hear/receive the message
virtual void Message_DetermineMulticastRecipients( bool usepas, const Vector& origin, CPlayerBitVec& playerbits ) = 0; virtual void Message_DetermineMulticastRecipients( bool usepas, const Vector& origin, CPlayerBitVec& playerbits ) = 0;
@ -242,30 +236,16 @@ public:
// Set the lightstyle to the specified value and network the change to any connected clients. Note that val must not // Set the lightstyle to the specified value and network the change to any connected clients. Note that val must not
// change place in memory (use MAKE_STRING) for anything that's not compiled into your mod. // change place in memory (use MAKE_STRING) for anything that's not compiled into your mod.
virtual void LightStyle( int style, const char *val ) = 0; virtual void LightStyle( int style, const char *val ) = 0;
// Project a static decal onto the specified entity / model (for level placed decals in the .bsp)
virtual void StaticDecal( const Vector &originInEntitySpace, int decalIndex, CEntityIndex entityIndex, int modelIndex, bool lowpriority ) = 0;
// Print szMsg to the client console. // Print szMsg to the client console.
virtual void ClientPrintf( CEntityIndex playerIndex, const char *szMsg ) = 0; virtual void ClientPrintf( CEntityIndex playerIndex, const char *szMsg ) = 0;
// SINGLE PLAYER/LISTEN SERVER ONLY (just matching the client .dll api for this)
// Prints the formatted string to the notification area of the screen ( down the right hand edge
// numbered lines starting at position 0
virtual void Con_NPrintf( int pos, const char *fmt, ... ) = 0;
// SINGLE PLAYER/LISTEN SERVER ONLY(just matching the client .dll api for this)
// Similar to Con_NPrintf, but allows specifying custom text color and duration information
virtual void Con_NXPrintf( const struct con_nprint_s *info, const char *fmt, ... ) = 0;
virtual bool IsLowViolence() = 0; virtual bool IsLowViolence() = 0;
virtual bool SetHLTVChatBan( int tvslot, bool bBanned ) = 0; virtual bool SetHLTVChatBan( int tvslot, bool bBanned ) = 0;
virtual bool IsAnyClientLowViolence() = 0; virtual bool IsAnyClientLowViolence() = 0;
// Change a specified player's "view entity" (i.e., use the view entity position/orientation for rendering the client view)
virtual void SetView( CEntityIndex playerIndex, CEntityIndex viewEntIndex ) = 0;
// Get the current game directory (hl2, tf2, hl1, cstrike, etc.) // Get the current game directory (hl2, tf2, hl1, cstrike, etc.)
virtual void GetGameDir( char *szGetGameDir, int maxlength ) = 0; virtual void GetGameDir( CBufferString *pOut ) = 0;
// Create a bot with the given name. Player index is -1 if fake client can't be created // Create a bot with the given name. Player index is -1 if fake client can't be created
virtual CEntityIndex CreateFakeClient( const char *netname ) = 0; virtual CEntityIndex CreateFakeClient( const char *netname ) = 0;
@ -283,9 +263,7 @@ public:
virtual edict_t *GetSplitScreenPlayerForEdict( CEntityIndex ent_num, int nSlot ) = 0; virtual edict_t *GetSplitScreenPlayerForEdict( CEntityIndex ent_num, int nSlot ) = 0;
// Ret types might be all wrong for these. Haven't researched yet. // Ret types might be all wrong for these. Haven't researched yet.
virtual bool IsSpawnGroupLoadedOnClient( CEntityIndex ent_num, SpawnGroupHandle_t spawnGroup ) const = 0;
virtual void UnloadSpawnGroup( SpawnGroupHandle_t spawnGroup, /*ESpawnGroupUnloadOption*/ int) = 0; virtual void UnloadSpawnGroup( SpawnGroupHandle_t spawnGroup, /*ESpawnGroupUnloadOption*/ int) = 0;
virtual void LoadSpawnGroup( const SpawnGroupDesc_t & ) = 0;
virtual void SetSpawnGroupDescription( SpawnGroupHandle_t spawnGroup, const char *pszDescription ) = 0; virtual void SetSpawnGroupDescription( SpawnGroupHandle_t spawnGroup, const char *pszDescription ) = 0;
virtual bool IsSpawnGroupLoaded( SpawnGroupHandle_t spawnGroup ) const = 0; virtual bool IsSpawnGroupLoaded( SpawnGroupHandle_t spawnGroup ) const = 0;
virtual bool IsSpawnGroupLoading( SpawnGroupHandle_t spawnGroup ) const = 0; virtual bool IsSpawnGroupLoading( SpawnGroupHandle_t spawnGroup ) const = 0;
@ -294,26 +272,12 @@ public:
virtual void SynchronizeAndBlockUntilLoaded( SpawnGroupHandle_t spawnGroup ) = 0; virtual void SynchronizeAndBlockUntilLoaded( SpawnGroupHandle_t spawnGroup ) = 0;
virtual void SetTimescale( float flTimescale ) = 0; virtual void SetTimescale( float flTimescale ) = 0;
virtual CEntityIndex GetViewEntity( CEntityIndex ent ) = 0;
// Is the engine in Commentary mode?
virtual int IsInCommentaryMode( void ) = 0;
virtual uint32 GetAppID() = 0; virtual uint32 GetAppID() = 0;
// Returns the SteamID of the specified player. It'll be NULL if the player hasn't authenticated yet. // Returns the SteamID of the specified player. It'll be NULL if the player hasn't authenticated yet.
virtual const CSteamID *GetClientSteamID( CEntityIndex clientIndex ) = 0; virtual const CSteamID *GetClientSteamID( CEntityIndex clientIndex ) = 0;
virtual void ForceModelBounds( const char *s, const Vector &mins, const Vector &maxs ) = 0;
// Marks the material (vmt file) for consistency checking. If the client and server have different
// contents for the file, the client's vmt can only use the VertexLitGeneric shader, and can only
// contain $baseTexture and $bumpmap vars.
virtual void ForceSimpleMaterial( const char *s ) = 0;
// Marks the filename for consistency checking. This should be called after precaching the file.
virtual void ForceExactFile( const char *s ) = 0;
// Methods to set/get a gamestats data container so client & server running in same process can send combined data // Methods to set/get a gamestats data container so client & server running in same process can send combined data
virtual void SetGamestatsData( CGamestatsData *pGamestatsData ) = 0; virtual void SetGamestatsData( CGamestatsData *pGamestatsData ) = 0;
virtual CGamestatsData *GetGamestatsData() = 0; virtual CGamestatsData *GetGamestatsData() = 0;
@ -394,11 +358,6 @@ public:
virtual void PreWorldUpdate( bool simulating ) = 0; virtual void PreWorldUpdate( bool simulating ) = 0;
virtual CUtlMap<int, Entity2Networkable_t> *GetEntity2Networkables( void ) const = 0; virtual CUtlMap<int, Entity2Networkable_t> *GetEntity2Networkables( void ) const = 0;
virtual bool GetEntity2Networkable( CEntityIndex index, Entity2Networkable_t &out ) = 0;
virtual void ClearInstancedBaselineFromServerClasses( void ) = 0;
virtual void ClearSaveDirectory( void ) = 0;
virtual void *GetEntityInfo() = 0; virtual void *GetEntityInfo() = 0;
@ -409,8 +368,6 @@ public:
// One of these bools is 'simulating'... probably // One of these bools is 'simulating'... probably
virtual void GameFrame( bool, bool, bool ) = 0; virtual void GameFrame( bool, bool, bool ) = 0;
virtual void PreSaveGameLoaded( char const *pSaveName, bool bCurrentlyInGame ) = 0;
// Returns true if the game DLL wants the server not to be made public. // Returns true if the game DLL wants the server not to be made public.
// Used by commentary system to hide multiplayer commentary servers from the master. // Used by commentary system to hide multiplayer commentary servers from the master.
virtual bool ShouldHideFromMasterServer( bool ) = 0; virtual bool ShouldHideFromMasterServer( bool ) = 0;
@ -553,7 +510,7 @@ public:
virtual void GetConVarPrefixesToResetToDefaults( CUtlString &prefixes ) const = 0; virtual void GetConVarPrefixesToResetToDefaults( CUtlString &prefixes ) const = 0;
}; };
#define INTERFACEVERSION_SERVERGAMECLIENTS "Source2GameClients002" #define INTERFACEVERSION_SERVERGAMECLIENTS "Source2GameClients001"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Purpose: Player / Client related functions // Purpose: Player / Client related functions

View File

@ -1,4 +1,4 @@
//===== Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ========// //===== Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ========//
// //
// Purpose: // Purpose:
// //
@ -252,7 +252,7 @@ inline void Error( const tchar* pMsg, ... )
va_start(params, pMsg); va_start(params, pMsg);
V_vsnprintf(szBuffer, sizeof(szBuffer), pMsg, params); V_vsnprintf(szBuffer, sizeof(szBuffer), pMsg, params);
va_end(params); va_end(params);
LoggingSystem_LogDirect(LOG_GENERAL, LS_ERROR, szBuffer); Plat_FatalErrorFunc( "%s", szBuffer );
} }
// @TODO: these callstack spew functions are currently disabled in the new logging system. Need to add support for these if desired. // @TODO: these callstack spew functions are currently disabled in the new logging system. Need to add support for these if desired.

View File

@ -1129,6 +1129,8 @@ PLATFORM_INTERFACE void Plat_ExitProcess( int nCode );
PLATFORM_INTERFACE bool Plat_ShouldCollectMiniDumpsForFatalErrors(); PLATFORM_INTERFACE bool Plat_ShouldCollectMiniDumpsForFatalErrors();
PLATFORM_INTERFACE void Plat_FatalErrorFunc( const tchar* pMsg, ... ) FMTFUNCTION( 1, 2 );
// b/w compatibility // b/w compatibility
#define Sys_FloatTime Plat_FloatTime #define Sys_FloatTime Plat_FloatTime
@ -1227,6 +1229,8 @@ PLATFORM_INTERFACE bool Plat_FastVerifyHardwareKey();
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
PLATFORM_INTERFACE void* Plat_SimpleLog( const tchar* file, int line ); PLATFORM_INTERFACE void* Plat_SimpleLog( const tchar* file, int line );
PLATFORM_INTERFACE const char *Plat_GetGameDirectory( int unknown=0 );
#if _X360 #if _X360
#define Plat_FastMemset XMemSet #define Plat_FastMemset XMemSet

View File

@ -25,11 +25,12 @@
#include "exprevaluator.h" #include "exprevaluator.h"
#include <vstdlib/IKeyValuesSystem.h> #include <vstdlib/IKeyValuesSystem.h>
class IBaseFileSystem; class IFileSystem;
class CUtlBuffer; class CUtlBuffer;
class Color; class Color;
class KeyValues; class KeyValues;
class IKeyValuesDumpContext; class IKeyValuesDumpContext;
class IKeyValuesErrorSpew;
typedef void * FileHandle_t; typedef void * FileHandle_t;
// single byte identifies a xbox kv file in binary format // single byte identifies a xbox kv file in binary format
@ -84,7 +85,7 @@ public:
public: public:
explicit inline AutoDelete( KeyValues *pKeyValues ) : m_pKeyValues( pKeyValues ) {} explicit inline AutoDelete( KeyValues *pKeyValues ) : m_pKeyValues( pKeyValues ) {}
explicit inline AutoDelete( const char *pchKVName ) : m_pKeyValues( new KeyValues( pchKVName ) ) {} explicit inline AutoDelete( const char *pchKVName ) : m_pKeyValues( new KeyValues( pchKVName ) ) {}
inline ~AutoDelete( void ) { if( m_pKeyValues ) m_pKeyValues->deleteThis(); } inline ~AutoDelete( void ) { if( m_pKeyValues ) delete m_pKeyValues; }
inline void Assign( KeyValues *pKeyValues ) { m_pKeyValues = pKeyValues; } inline void Assign( KeyValues *pKeyValues ) { m_pKeyValues = pKeyValues; }
KeyValues *operator->() { return m_pKeyValues; } KeyValues *operator->() { return m_pKeyValues; }
operator KeyValues *() { return m_pKeyValues; } operator KeyValues *() { return m_pKeyValues; }
@ -126,14 +127,14 @@ public:
// File access. Set UsesEscapeSequences true, if resource file/buffer uses Escape Sequences (eg \n, \t) // File access. Set UsesEscapeSequences true, if resource file/buffer uses Escape Sequences (eg \n, \t)
void UsesEscapeSequences(bool state); // default false void UsesEscapeSequences(bool state); // default false
bool LoadFromFile( IBaseFileSystem *filesystem, const char *resourceName, const char *pathID = NULL, GetSymbolProc_t pfnEvaluateSymbolProc = NULL); bool LoadFromFile( IFileSystem *filesystem, const char *resourceName, const char *pathID = NULL, GetSymbolProc_t pfnEvaluateSymbolProc = NULL, void *pUnkonwn1 = NULL, const char *pUnknown2 = NULL );
bool SaveToFile( IBaseFileSystem *filesystem, const char *resourceName, const char *pathID = NULL); bool SaveToFile( IFileSystem *filesystem, const char *resourceName, const char *pathID = NULL);
// Read from a buffer... Note that the buffer must be null terminated // Read from a buffer... Note that the buffer must be null terminated
bool LoadFromBuffer( char const *resourceName, const char *pBuffer, IBaseFileSystem* pFileSystem = NULL, const char *pPathID = NULL, GetSymbolProc_t pfnEvaluateSymbolProc = NULL ); bool LoadFromBuffer( char const *resourceName, const char *pBuffer, IFileSystem* pFileSystem = NULL, const char *pPathID = NULL, GetSymbolProc_t pfnEvaluateSymbolProc = NULL, IKeyValuesErrorSpew *pErrorSpew = NULL, void *pUnkonwn1 = NULL, const char *pUnknown2 = NULL );
// Read from a utlbuffer... // Read from a utlbuffer...
bool LoadFromBuffer( char const *resourceName, CUtlBuffer &buf, IBaseFileSystem* pFileSystem = NULL, const char *pPathID = NULL, GetSymbolProc_t pfnEvaluateSymbolProc = NULL ); bool LoadFromBuffer( char const *resourceName, CUtlBuffer &buf, IFileSystem* pFileSystem = NULL, const char *pPathID = NULL, GetSymbolProc_t pfnEvaluateSymbolProc = NULL, IKeyValuesErrorSpew *pErrorSpew = NULL, void *pUnkonwn1 = NULL, const char *pUnknown2 = NULL );
// Find a keyValue, create it if it is not found. // Find a keyValue, create it if it is not found.
// Set bCreate to true to create the key if it doesn't already exist (which ensures a valid pointer will be returned) // Set bCreate to true to create the key if it doesn't already exist (which ensures a valid pointer will be returned)
@ -180,7 +181,13 @@ public:
int GetInt( const char *keyName = NULL, int defaultValue = 0 ); int GetInt( const char *keyName = NULL, int defaultValue = 0 );
uint64 GetUint64( const char *keyName = NULL, uint64 defaultValue = 0 ); uint64 GetUint64( const char *keyName = NULL, uint64 defaultValue = 0 );
float GetFloat( const char *keyName = NULL, float defaultValue = 0.0f ); float GetFloat( const char *keyName = NULL, float defaultValue = 0.0f );
const char *GetString( const char *keyName = NULL, const char *defaultValue = "" ); inline const char *GetString( const char *keyName = NULL, const char *defaultValue = "" )
{
static char buf[ 64 ];
GetString(keyName, defaultValue, &buf[0], sizeof(buf) );
return &buf[0];
}
const char *GetString( const char *keyName, const char *defaultValue, char *pszOut, uint64 maxlen );
const wchar_t *GetWString( const char *keyName = NULL, const wchar_t *defaultValue = L"" ); const wchar_t *GetWString( const char *keyName = NULL, const wchar_t *defaultValue = L"" );
void *GetPtr( const char *keyName = NULL, void *defaultValue = (void*)0 ); void *GetPtr( const char *keyName = NULL, void *defaultValue = (void*)0 );
Color GetColor( const char *keyName = NULL , const Color &defaultColor = Color( 0, 0, 0, 0 ) ); Color GetColor( const char *keyName = NULL , const Color &defaultColor = Color( 0, 0, 0, 0 ) );
@ -208,13 +215,11 @@ public:
void SetColor( const char *keyName, Color value); void SetColor( const char *keyName, Color value);
void SetBool( const char *keyName, bool value ) { SetInt( keyName, value ? 1 : 0 ); } void SetBool( const char *keyName, bool value ) { SetInt( keyName, value ? 1 : 0 ); }
#if 0
// Memory allocation (optimized) // Memory allocation (optimized)
void *operator new( size_t iAllocSize ); void *operator new( size_t iAllocSize );
void *operator new( size_t iAllocSize, int nBlockUse, const char *pFileName, int nLine ); void *operator new( size_t iAllocSize, int nBlockUse, const char *pFileName, int nLine );
void operator delete( void *pMem ); void operator delete( void *pMem );
void operator delete( void *pMem, int nBlockUse, const char *pFileName, int nLine ); void operator delete( void *pMem, int nBlockUse, const char *pFileName, int nLine );
#endif
KeyValues& operator=( KeyValues& src ); KeyValues& operator=( KeyValues& src );
@ -254,9 +259,6 @@ public:
}; };
types_t GetDataType(const char *keyName = NULL); types_t GetDataType(const char *keyName = NULL);
// Virtual deletion function - ensures that KeyValues object is deleted from correct heap
void deleteThis();
void SetStringValue( char const *strValue ); void SetStringValue( char const *strValue );
// unpack a key values list into a structure // unpack a key values list into a structure
@ -280,31 +282,30 @@ public:
// Assign keyvalues from a string // Assign keyvalues from a string
static KeyValues * FromString( char const *szName, char const *szStringVal, char const **ppEndOfParse = NULL ); static KeyValues * FromString( char const *szName, char const *szStringVal, char const **ppEndOfParse = NULL );
~KeyValues();
private: private:
KeyValues( KeyValues& ); // prevent copy constructor being used KeyValues( KeyValues& ); // prevent copy constructor being used
// prevent delete being called except through deleteThis()
~KeyValues();
KeyValues* CreateKey( const char *keyName ); KeyValues* CreateKey( const char *keyName );
void RecursiveCopyKeyValues( KeyValues& src ); void RecursiveCopyKeyValues( KeyValues& src );
void RemoveEverything(); void RemoveEverything();
// void RecursiveSaveToFile( IBaseFileSystem *filesystem, CUtlBuffer &buffer, int indentLevel ); // void RecursiveSaveToFile( IFileSystem *filesystem, CUtlBuffer &buffer, int indentLevel );
// void WriteConvertedString( CUtlBuffer &buffer, const char *pszString ); // void WriteConvertedString( CUtlBuffer &buffer, const char *pszString );
// NOTE: If both filesystem and pBuf are non-null, it'll save to both of them. // NOTE: If both filesystem and pBuf are non-null, it'll save to both of them.
// If filesystem is null, it'll ignore f. // If filesystem is null, it'll ignore f.
void RecursiveSaveToFile( IBaseFileSystem *filesystem, FileHandle_t f, CUtlBuffer *pBuf, int indentLevel ); void RecursiveSaveToFile( IFileSystem *filesystem, FileHandle_t f, CUtlBuffer *pBuf, int indentLevel );
void WriteConvertedString( IBaseFileSystem *filesystem, FileHandle_t f, CUtlBuffer *pBuf, const char *pszString ); void WriteConvertedString( IFileSystem *filesystem, FileHandle_t f, CUtlBuffer *pBuf, const char *pszString );
void RecursiveLoadFromBuffer( char const *resourceName, CUtlBuffer &buf, GetSymbolProc_t pfnEvaluateSymbolProc ); void RecursiveLoadFromBuffer( char const *resourceName, CUtlBuffer &buf, GetSymbolProc_t pfnEvaluateSymbolProc );
// for handling #include "filename" // for handling #include "filename"
void AppendIncludedKeys( CUtlVector< KeyValues * >& includedKeys ); void AppendIncludedKeys( CUtlVector< KeyValues * >& includedKeys );
void ParseIncludedKeys( char const *resourceName, const char *filetoinclude, void ParseIncludedKeys( char const *resourceName, const char *filetoinclude,
IBaseFileSystem* pFileSystem, const char *pPathID, CUtlVector< KeyValues * >& includedKeys, GetSymbolProc_t pfnEvaluateSymbolProc ); IFileSystem* pFileSystem, const char *pPathID, CUtlVector< KeyValues * >& includedKeys, GetSymbolProc_t pfnEvaluateSymbolProc );
// For handling #base "filename" // For handling #base "filename"
void MergeBaseKeys( CUtlVector< KeyValues * >& baseKeys ); void MergeBaseKeys( CUtlVector< KeyValues * >& baseKeys );
@ -312,16 +313,16 @@ private:
// NOTE: If both filesystem and pBuf are non-null, it'll save to both of them. // NOTE: If both filesystem and pBuf are non-null, it'll save to both of them.
// If filesystem is null, it'll ignore f. // If filesystem is null, it'll ignore f.
void InternalWrite( IBaseFileSystem *filesystem, FileHandle_t f, CUtlBuffer *pBuf, const void *pData, int len ); void InternalWrite( IFileSystem *filesystem, FileHandle_t f, CUtlBuffer *pBuf, const void *pData, int len );
void Init(); void Init();
const char * ReadToken( CUtlBuffer &buf, bool &wasQuoted, bool &wasConditional ); const char * ReadToken( CUtlBuffer &buf, bool &wasQuoted, bool &wasConditional );
void WriteIndents( IBaseFileSystem *filesystem, FileHandle_t f, CUtlBuffer *pBuf, int indentLevel ); void WriteIndents( IFileSystem *filesystem, FileHandle_t f, CUtlBuffer *pBuf, int indentLevel );
void FreeAllocatedValue(); void FreeAllocatedValue();
void AllocateValueBlock(int size); void AllocateValueBlock(int size);
bool ReadAsBinaryPooledFormat( CUtlBuffer &buf, IBaseFileSystem *pFileSystem, unsigned int poolKey, GetSymbolProc_t pfnEvaluateSymbolProc ); bool ReadAsBinaryPooledFormat( CUtlBuffer &buf, IFileSystem *pFileSystem, unsigned int poolKey, GetSymbolProc_t pfnEvaluateSymbolProc );
bool EvaluateConditional( const char *pExpressionString, GetSymbolProc_t pfnEvaluateSymbolProc ); bool EvaluateConditional( const char *pExpressionString, GetSymbolProc_t pfnEvaluateSymbolProc );
@ -377,6 +378,7 @@ struct KeyValuesUnpackStructure
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// inline methods // inline methods
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#if 0
inline int KeyValues::GetInt( HKeySymbol keySymbol, int defaultValue ) inline int KeyValues::GetInt( HKeySymbol keySymbol, int defaultValue )
{ {
KeyValues *dat = FindKey( keySymbol ); KeyValues *dat = FindKey( keySymbol );
@ -425,6 +427,7 @@ inline bool KeyValues::IsEmpty(HKeySymbol keySymbol)
KeyValues *dat = FindKey( keySymbol ); KeyValues *dat = FindKey( keySymbol );
return dat ? dat->IsEmpty( ) : true; return dat ? dat->IsEmpty( ) : true;
} }
#endif
// //

View File

@ -1,4 +1,4 @@
//===== Copyright <20> 1996-2006, Valve Corporation, All rights reserved. ======// //===== Copyright <20> 1996-2006, Valve Corporation, All rights reserved. ======//
// //
// Purpose: ExprSimplifier builds a binary tree from an infix expression (in the // Purpose: ExprSimplifier builds a binary tree from an infix expression (in the
// form of a character array). // form of a character array).
@ -34,7 +34,7 @@ struct ExprNode
typedef ExprNode *ExprTree; typedef ExprNode *ExprTree;
// callback to evaluate a $<symbol> during evaluation, return true or false // callback to evaluate a $<symbol> during evaluation, return true or false
typedef bool (*GetSymbolProc_t)( const char *pKey ); typedef bool (*GetSymbolProc_t)( const char *pKey, void *pUnknown );
typedef void (*SyntaxErrorProc_t)( const char *pReason ); typedef void (*SyntaxErrorProc_t)( const char *pReason );
class CExpressionEvaluator class CExpressionEvaluator

File diff suppressed because it is too large Load Diff

View File

@ -30,7 +30,7 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v120</PlatformToolset> <PlatformToolset>v140</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
@ -327,7 +327,6 @@
<ClCompile Include="datamanager.cpp" /> <ClCompile Include="datamanager.cpp" />
<ClCompile Include="diff.cpp" /> <ClCompile Include="diff.cpp" />
<ClCompile Include="generichash.cpp" /> <ClCompile Include="generichash.cpp" />
<ClCompile Include="KeyValues.cpp" />
<ClCompile Include="mempool.cpp" /> <ClCompile Include="mempool.cpp" />
<ClCompile Include="memstack.cpp" /> <ClCompile Include="memstack.cpp" />
<ClCompile Include="NetAdr.cpp" /> <ClCompile Include="NetAdr.cpp" />

View File

@ -41,9 +41,6 @@
<ClCompile Include="generichash.cpp"> <ClCompile Include="generichash.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="KeyValues.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mempool.cpp"> <ClCompile Include="mempool.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>