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.

86 lines
1.9 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. //
  8. //-----------------------------------------------------------------------------
  9. // $Log: $
  10. //
  11. // $NoKeywords: $
  12. //=============================================================================//
  13. #if !defined( EVENT_SYSTEM_H )
  14. #define EVENT_SYSTEM_H
  15. #ifdef _WIN32
  16. #pragma once
  17. #endif
  18. #include "event_flags.h"
  19. #include "common.h"
  20. #include "enginesingleuserfilter.h"
  21. #include "ents_shared.h"
  22. class SendTable;
  23. class ClientClass;
  24. //-----------------------------------------------------------------------------
  25. // Purpose:
  26. //-----------------------------------------------------------------------------
  27. class CEventInfo
  28. {
  29. public:
  30. enum
  31. {
  32. EVENT_INDEX_BITS = 8,
  33. EVENT_DATA_LEN_BITS = 11,
  34. MAX_EVENT_DATA = 192, // ( 1<<8 bits == 256, but only using 192 below )
  35. };
  36. inline CEventInfo()
  37. {
  38. classID = 0;
  39. fire_delay = 0.0f;
  40. flags = 0;
  41. pSendTable = NULL;
  42. pClientClass = NULL;
  43. m_Packed = SERIALIZED_ENTITY_HANDLE_INVALID;
  44. }
  45. ~CEventInfo()
  46. {
  47. g_pSerializedEntities->ReleaseSerializedEntity( m_Packed );
  48. }
  49. CEventInfo( const CEventInfo& src )
  50. {
  51. m_Packed = g_pSerializedEntities->CopySerializedEntity( src.m_Packed, __FILE__, __LINE__ );
  52. classID = src.classID;
  53. fire_delay = src.fire_delay;
  54. flags = src.flags;
  55. pSendTable = src.pSendTable;
  56. pClientClass = src.pClientClass;
  57. filter.AddPlayersFromFilter( &src.filter );
  58. }
  59. // 0 implies not in use
  60. short classID;
  61. // If non-zero, the delay time when the event should be fired ( fixed up on the client )
  62. float fire_delay;
  63. // send table pointer or NULL if send as full update
  64. const SendTable *pSendTable;
  65. const ClientClass *pClientClass;
  66. SerializedEntityHandle_t m_Packed;
  67. // CLIENT ONLY Reliable or not, etc.
  68. int flags;
  69. // clients that see that event
  70. CEngineRecipientFilter filter;
  71. };
  72. #endif // EVENT_SYSTEM_H