summaryrefslogtreecommitdiff
path: root/engine/networkstringtablecontainerserver.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /engine/networkstringtablecontainerserver.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'engine/networkstringtablecontainerserver.h')
-rw-r--r--engine/networkstringtablecontainerserver.h70
1 files changed, 70 insertions, 0 deletions
diff --git a/engine/networkstringtablecontainerserver.h b/engine/networkstringtablecontainerserver.h
new file mode 100644
index 0000000..7f21546
--- /dev/null
+++ b/engine/networkstringtablecontainerserver.h
@@ -0,0 +1,70 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//=============================================================================//
+
+#ifndef NETWORKSTRINGTABLECONTAINERSERVER_H
+#define NETWORKSTRINGTABLECONTAINERSERVER_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include "inetworkstringtableserver.h"
+#include "utlvector.h"
+#include "bitbuf.h"
+
+class CNetworkStringTableServer;
+class client_t;
+class bf_write_t;
+
+//-----------------------------------------------------------------------------
+// Purpose: Implements game .dll string table interface
+//-----------------------------------------------------------------------------
+class CNetworkStringTableContainerServer : public INetworkStringTableServer
+{
+public:
+ // Contstruction
+ CNetworkStringTableContainerServer( void );
+ ~CNetworkStringTableContainerServer( void );
+
+ // Implement INetworkStringTableServer
+ virtual TABLEID CreateStringTable( const char *tableName, int maxentries );
+ virtual int GetNumStrings( TABLEID stringTable );
+ virtual int GetMaxStrings( TABLEID stringTable );
+
+ virtual int AddString( TABLEID stringTable, const char *value, int length = 0, const void *userdata = 0 );
+ virtual void SetString( TABLEID stringTable, int stringNumber, const char *value );
+ virtual void SetStringUserData( TABLEID stringTable, int stringNumber, int length = 0, const void *userdata = 0 );
+ virtual const char *GetString( TABLEID stringTable, int stringNumber );
+ virtual const void *GetStringUserData( TABLEID stringTable, int stringNumber, int *length = 0 );
+
+ virtual int FindStringIndex( TABLEID stringTable, char const *string );
+
+ virtual const char *GetTableName( TABLEID stringTable );
+
+ // Table accessors
+ TABLEID FindTable( const char *tableName );
+ CNetworkStringTableServer *GetTable( TABLEID stringTable );
+
+ // Delete all tables
+ void RemoveAllTables( void );
+
+ // Guards so game .dll can't create tables at the wrong time
+ void AllowCreation( void );
+ void DisallowCreation( void );
+
+ // Print table data to console
+ void Dump( void );
+
+private:
+ // Guard
+ bool m_bAllowCreation;
+
+ CUtlVector < CNetworkStringTableServer * > m_Tables;
+};
+
+extern CNetworkStringTableContainerServer *networkStringTableContainerServer;
+
+#endif // NETWORKSTRINGTABLECONTAINERSERVER_H