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.

105 lines
3.3 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef PLAYERLOCALDATA_H
  8. #define PLAYERLOCALDATA_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "playernet_vars.h"
  13. #include "networkvar.h"
  14. #include "fogcontroller.h"
  15. #include "postprocesscontroller.h"
  16. #include "colorcorrection.h"
  17. //-----------------------------------------------------------------------------
  18. // Purpose: Player specific data ( sent only to local player, too )
  19. //-----------------------------------------------------------------------------
  20. class CPlayerLocalData
  21. {
  22. public:
  23. // Save/restore
  24. DECLARE_SIMPLE_DATADESC();
  25. // Prediction data copying
  26. DECLARE_CLASS_NOBASE( CPlayerLocalData );
  27. DECLARE_EMBEDDED_NETWORKVAR();
  28. CPlayerLocalData();
  29. void UpdateAreaBits( CBasePlayer *pl, unsigned char chAreaPortalBits[MAX_AREA_PORTAL_STATE_BYTES] );
  30. public:
  31. CNetworkArray( unsigned char, m_chAreaBits, MAX_AREA_STATE_BYTES ); // Which areas are potentially visible to the client?
  32. CNetworkArray( unsigned char, m_chAreaPortalBits, MAX_AREA_PORTAL_STATE_BYTES ); // Which area portals are open?
  33. CNetworkVar( int, m_iHideHUD ); // bitfields containing sections of the HUD to hide
  34. CNetworkVar( float, m_flFOVRate ); // rate at which the FOV changes (defaults to 0)
  35. Vector m_vecOverViewpoint; // Viewpoint overriding the real player's viewpoint
  36. // Fully ducked
  37. CNetworkVar( bool, m_bDucked );
  38. // In process of ducking
  39. CNetworkVar( bool, m_bDucking );
  40. // Last time the user pressed duck (to handle duck-spam)
  41. CNetworkVar( float, m_flLastDuckTime );
  42. // In process of duck-jumping
  43. CNetworkVar( bool, m_bInDuckJump );
  44. // During ducking process, amount of time before full duc
  45. CNetworkVar( int, m_nDuckTimeMsecs );
  46. CNetworkVar( int, m_nDuckJumpTimeMsecs );
  47. // Jump time, time to auto unduck (since we auto crouch jump now).
  48. CNetworkVar( int, m_nJumpTimeMsecs );
  49. // Step sound side flip/flip
  50. int m_nStepside;
  51. // Velocity at time when we hit ground
  52. CNetworkVar( float, m_flFallVelocity );
  53. // Previous button state
  54. int m_nOldButtons;
  55. class CSkyCamera *m_pOldSkyCamera;
  56. // Base velocity that was passed in to server physics so
  57. // client can predict conveyors correctly. Server zeroes it, so we need to store here, too.
  58. // auto-decaying view angle adjustment
  59. #if PREDICTION_ERROR_CHECK_LEVEL > 1
  60. CNetworkQAngleXYZ( m_viewPunchAngle );
  61. CNetworkQAngleXYZ( m_aimPunchAngle );
  62. CNetworkQAngleXYZ( m_aimPunchAngleVel );
  63. #else
  64. CNetworkQAngle( m_viewPunchAngle );
  65. CNetworkQAngle( m_aimPunchAngle );
  66. CNetworkQAngle( m_aimPunchAngleVel );
  67. #endif
  68. // Draw view model for the player
  69. CNetworkVar( bool, m_bDrawViewmodel );
  70. // Is the player wearing the HEV suit
  71. CNetworkVar( bool, m_bWearingSuit );
  72. CNetworkVar( bool, m_bPoisoned );
  73. CNetworkVar( float, m_flStepSize );
  74. CNetworkVar( bool, m_bAllowAutoMovement );
  75. // Autoaim
  76. CNetworkVar( bool, m_bAutoAimTarget );
  77. // 3d skybox
  78. CNetworkVarEmbedded( sky3dparams_t, m_skybox3d );
  79. // world fog
  80. CNetworkVarEmbedded( fogplayerparams_t, m_PlayerFog );
  81. fogparams_t m_fog;
  82. // audio environment
  83. CNetworkVarEmbedded( audioparams_t, m_audio );
  84. CNetworkVar( bool, m_bSlowMovement );
  85. CNetworkVar( float, m_fTBeamEndTime );
  86. };
  87. EXTERN_SEND_TABLE(DT_Local);
  88. #endif // PLAYERLOCALDATA_H