Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
2.3 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef NETWORKSTRINGTABLECONTAINERSERVER_H
  8. #define NETWORKSTRINGTABLECONTAINERSERVER_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "inetworkstringtableserver.h"
  13. #include "utlvector.h"
  14. #include "bitbuf.h"
  15. class CNetworkStringTableServer;
  16. class client_t;
  17. class bf_write_t;
  18. //-----------------------------------------------------------------------------
  19. // Purpose: Implements game .dll string table interface
  20. //-----------------------------------------------------------------------------
  21. class CNetworkStringTableContainerServer : public INetworkStringTableServer
  22. {
  23. public:
  24. // Contstruction
  25. CNetworkStringTableContainerServer( void );
  26. ~CNetworkStringTableContainerServer( void );
  27. // Implement INetworkStringTableServer
  28. virtual TABLEID CreateStringTable( const char *tableName, int maxentries );
  29. virtual int GetNumStrings( TABLEID stringTable );
  30. virtual int GetMaxStrings( TABLEID stringTable );
  31. virtual int AddString( TABLEID stringTable, const char *value, int length = 0, const void *userdata = 0 );
  32. virtual void SetString( TABLEID stringTable, int stringNumber, const char *value );
  33. virtual void SetStringUserData( TABLEID stringTable, int stringNumber, int length = 0, const void *userdata = 0 );
  34. virtual const char *GetString( TABLEID stringTable, int stringNumber );
  35. virtual const void *GetStringUserData( TABLEID stringTable, int stringNumber, int *length = 0 );
  36. virtual int FindStringIndex( TABLEID stringTable, char const *string );
  37. virtual const char *GetTableName( TABLEID stringTable );
  38. // Table accessors
  39. TABLEID FindTable( const char *tableName );
  40. CNetworkStringTableServer *GetTable( TABLEID stringTable );
  41. // Delete all tables
  42. void RemoveAllTables( void );
  43. // Guards so game .dll can't create tables at the wrong time
  44. void AllowCreation( void );
  45. void DisallowCreation( void );
  46. // Print table data to console
  47. void Dump( void );
  48. private:
  49. // Guard
  50. bool m_bAllowCreation;
  51. CUtlVector < CNetworkStringTableServer * > m_Tables;
  52. };
  53. extern CNetworkStringTableContainerServer *networkStringTableContainerServer;
  54. #endif // NETWORKSTRINGTABLECONTAINERSERVER_H