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.

65 lines
1.6 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef NETWORKSTRINGTABLEITEM_H
  8. #define NETWORKSTRINGTABLEITEM_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "utlsymbol.h"
  13. #include "utlvector.h"
  14. //-----------------------------------------------------------------------------
  15. // Purpose:
  16. //-----------------------------------------------------------------------------
  17. class CNetworkStringTableItem
  18. {
  19. public:
  20. enum
  21. {
  22. MAX_USERDATA_BITS = 14,
  23. MAX_USERDATA_SIZE = (1 << MAX_USERDATA_BITS)
  24. };
  25. struct itemchange_s {
  26. int tick;
  27. int length;
  28. unsigned char *data;
  29. };
  30. CNetworkStringTableItem( void );
  31. ~CNetworkStringTableItem( void );
  32. #ifndef SHARED_NET_STRING_TABLES
  33. void EnableChangeHistory( void );
  34. void UpdateChangeList( int tick, int length, const void *userData );
  35. int RestoreTick( int tick );
  36. inline int GetTickCreated( void ) const { return m_nTickCreated; }
  37. #endif
  38. bool SetUserData( int tick, int length, const void *userdata );
  39. const void *GetUserData( int *length=0 );
  40. inline int GetUserDataLength() const { return m_nUserDataLength; }
  41. // Used by server only
  42. // void SetTickCount( int count ) ;
  43. inline int GetTickChanged( void ) const { return m_nTickChanged; }
  44. public:
  45. unsigned char *m_pUserData;
  46. int m_nUserDataLength;
  47. int m_nTickChanged;
  48. #ifndef SHARED_NET_STRING_TABLES
  49. int m_nTickCreated;
  50. CUtlVector< itemchange_s > *m_pChangeList;
  51. #endif
  52. };
  53. #endif // NETWORKSTRINGTABLEITEM_H