diff options
| author | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:31:46 -0800 |
|---|---|---|
| committer | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:46:31 -0800 |
| commit | f56bb35301836e56582a575a75864392a0177875 (patch) | |
| tree | de61ddd39de3e7df52759711950b4c288592f0dc /mp/src/public/networkstringtabledefs.h | |
| parent | Mark some more files as text. (diff) | |
| download | source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.tar.xz source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.zip | |
Fix line endings. WHAMMY.
Diffstat (limited to 'mp/src/public/networkstringtabledefs.h')
| -rw-r--r-- | mp/src/public/networkstringtabledefs.h | 160 |
1 files changed, 80 insertions, 80 deletions
diff --git a/mp/src/public/networkstringtabledefs.h b/mp/src/public/networkstringtabledefs.h index 3b0f4be6..d82df2ef 100644 --- a/mp/src/public/networkstringtabledefs.h +++ b/mp/src/public/networkstringtabledefs.h @@ -1,80 +1,80 @@ -//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
-#ifndef NETWORKSTRINGTABLEDEFS_H
-#define NETWORKSTRINGTABLEDEFS_H
-#ifdef _WIN32
-#pragma once
-#endif
-
-typedef int TABLEID;
-
-#define INVALID_STRING_TABLE -1
-const unsigned short INVALID_STRING_INDEX = (unsigned short )-1;
-
-// table index is sent in log2(MAX_TABLES) bits
-#define MAX_TABLES 32 // Table id is 4 bits
-
-#define INTERFACENAME_NETWORKSTRINGTABLESERVER "VEngineServerStringTable001"
-#define INTERFACENAME_NETWORKSTRINGTABLECLIENT "VEngineClientStringTable001"
-
-class INetworkStringTable;
-
-typedef void (*pfnStringChanged)( void *object, INetworkStringTable *stringTable, int stringNumber, char const *newString, void const *newData );
-
-//-----------------------------------------------------------------------------
-// Purpose: Game .dll shared string table interfaces
-//-----------------------------------------------------------------------------
-class INetworkStringTable
-{
-public:
-
- virtual ~INetworkStringTable( void ) {};
-
- // Table Info
- virtual const char *GetTableName( void ) const = 0;
- virtual TABLEID GetTableId( void ) const = 0;
- virtual int GetNumStrings( void ) const = 0;
- virtual int GetMaxStrings( void ) const = 0;
- virtual int GetEntryBits( void ) const = 0;
-
- // Networking
- virtual void SetTick( int tick ) = 0;
- virtual bool ChangedSinceTick( int tick ) const = 0;
-
- // Accessors (length -1 means don't change user data if string already exits)
- virtual int AddString( bool bIsServer, const char *value, int length = -1, const void *userdata = 0 ) = 0;
-
- virtual const char *GetString( int stringNumber ) = 0;
- virtual void SetStringUserData( int stringNumber, int length, const void *userdata ) = 0;
- virtual const void *GetStringUserData( int stringNumber, int *length ) = 0;
- virtual int FindStringIndex( char const *string ) = 0; // returns INVALID_STRING_INDEX if not found
-
- // Callbacks
- virtual void SetStringChangedCallback( void *object, pfnStringChanged changeFunc ) = 0;
-};
-
-class INetworkStringTableContainer
-{
-public:
-
- virtual ~INetworkStringTableContainer( void ) {};
-
- // table creation/destruction
- virtual INetworkStringTable *CreateStringTable( const char *tableName, int maxentries, int userdatafixedsize = 0, int userdatanetworkbits = 0 ) = 0;
- virtual void RemoveAllTables( void ) = 0;
-
- // table infos
- virtual INetworkStringTable *FindTable( const char *tableName ) const = 0;
- virtual INetworkStringTable *GetTable( TABLEID stringTable ) const = 0;
- virtual int GetNumTables( void ) const = 0;
-
- virtual INetworkStringTable *CreateStringTableEx( const char *tableName, int maxentries, int userdatafixedsize = 0, int userdatanetworkbits = 0, bool bIsFilenames = false ) = 0;
- virtual void SetAllowClientSideAddString( INetworkStringTable *table, bool bAllowClientSideAddString ) = 0;
-};
-
-#endif // NETWORKSTRINGTABLEDEFS_H
+//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//=============================================================================// + +#ifndef NETWORKSTRINGTABLEDEFS_H +#define NETWORKSTRINGTABLEDEFS_H +#ifdef _WIN32 +#pragma once +#endif + +typedef int TABLEID; + +#define INVALID_STRING_TABLE -1 +const unsigned short INVALID_STRING_INDEX = (unsigned short )-1; + +// table index is sent in log2(MAX_TABLES) bits +#define MAX_TABLES 32 // Table id is 4 bits + +#define INTERFACENAME_NETWORKSTRINGTABLESERVER "VEngineServerStringTable001" +#define INTERFACENAME_NETWORKSTRINGTABLECLIENT "VEngineClientStringTable001" + +class INetworkStringTable; + +typedef void (*pfnStringChanged)( void *object, INetworkStringTable *stringTable, int stringNumber, char const *newString, void const *newData ); + +//----------------------------------------------------------------------------- +// Purpose: Game .dll shared string table interfaces +//----------------------------------------------------------------------------- +class INetworkStringTable +{ +public: + + virtual ~INetworkStringTable( void ) {}; + + // Table Info + virtual const char *GetTableName( void ) const = 0; + virtual TABLEID GetTableId( void ) const = 0; + virtual int GetNumStrings( void ) const = 0; + virtual int GetMaxStrings( void ) const = 0; + virtual int GetEntryBits( void ) const = 0; + + // Networking + virtual void SetTick( int tick ) = 0; + virtual bool ChangedSinceTick( int tick ) const = 0; + + // Accessors (length -1 means don't change user data if string already exits) + virtual int AddString( bool bIsServer, const char *value, int length = -1, const void *userdata = 0 ) = 0; + + virtual const char *GetString( int stringNumber ) = 0; + virtual void SetStringUserData( int stringNumber, int length, const void *userdata ) = 0; + virtual const void *GetStringUserData( int stringNumber, int *length ) = 0; + virtual int FindStringIndex( char const *string ) = 0; // returns INVALID_STRING_INDEX if not found + + // Callbacks + virtual void SetStringChangedCallback( void *object, pfnStringChanged changeFunc ) = 0; +}; + +class INetworkStringTableContainer +{ +public: + + virtual ~INetworkStringTableContainer( void ) {}; + + // table creation/destruction + virtual INetworkStringTable *CreateStringTable( const char *tableName, int maxentries, int userdatafixedsize = 0, int userdatanetworkbits = 0 ) = 0; + virtual void RemoveAllTables( void ) = 0; + + // table infos + virtual INetworkStringTable *FindTable( const char *tableName ) const = 0; + virtual INetworkStringTable *GetTable( TABLEID stringTable ) const = 0; + virtual int GetNumTables( void ) const = 0; + + virtual INetworkStringTable *CreateStringTableEx( const char *tableName, int maxentries, int userdatafixedsize = 0, int userdatanetworkbits = 0, bool bIsFilenames = false ) = 0; + virtual void SetAllowClientSideAddString( INetworkStringTable *table, bool bAllowClientSideAddString ) = 0; +}; + +#endif // NETWORKSTRINGTABLEDEFS_H |