Team Fortress 2 Source Code as on 22/4/2020
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.

93 lines
2.9 KiB

  1. //========= Copyright 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. //-----------------------------------------------------------------------------
  16. // Purpose: Player specific data ( sent only to local player, too )
  17. //-----------------------------------------------------------------------------
  18. class CPlayerLocalData
  19. {
  20. public:
  21. // Save/restore
  22. DECLARE_SIMPLE_DATADESC();
  23. // Prediction data copying
  24. DECLARE_CLASS_NOBASE( CPlayerLocalData );
  25. DECLARE_EMBEDDED_NETWORKVAR();
  26. CPlayerLocalData();
  27. void UpdateAreaBits( CBasePlayer *pl, unsigned char chAreaPortalBits[MAX_AREA_PORTAL_STATE_BYTES] );
  28. public:
  29. CNetworkArray( unsigned char, m_chAreaBits, MAX_AREA_STATE_BYTES ); // Which areas are potentially visible to the client?
  30. CNetworkArray( unsigned char, m_chAreaPortalBits, MAX_AREA_PORTAL_STATE_BYTES ); // Which area portals are open?
  31. CNetworkVar( int, m_iHideHUD ); // bitfields containing sections of the HUD to hide
  32. CNetworkVar( float, m_flFOVRate ); // rate at which the FOV changes (defaults to 0)
  33. Vector m_vecOverViewpoint; // Viewpoint overriding the real player's viewpoint
  34. // Fully ducked
  35. CNetworkVar( bool, m_bDucked );
  36. // In process of ducking
  37. CNetworkVar( bool, m_bDucking );
  38. // In process of duck-jumping
  39. CNetworkVar( bool, m_bInDuckJump );
  40. // During ducking process, amount of time before full duc
  41. CNetworkVar( float, m_flDucktime );
  42. CNetworkVar( float, m_flDuckJumpTime );
  43. // Jump time, time to auto unduck (since we auto crouch jump now).
  44. CNetworkVar( float, m_flJumpTime );
  45. // Step sound side flip/flip
  46. int m_nStepside;;
  47. // Velocity at time when we hit ground
  48. CNetworkVar( float, m_flFallVelocity );
  49. // Previous button state
  50. int m_nOldButtons;
  51. float m_flOldForwardMove;
  52. class CSkyCamera *m_pOldSkyCamera;
  53. // Base velocity that was passed in to server physics so
  54. // client can predict conveyors correctly. Server zeroes it, so we need to store here, too.
  55. // auto-decaying view angle adjustment
  56. CNetworkQAngle( m_vecPunchAngle );
  57. CNetworkQAngle( m_vecPunchAngleVel );
  58. // Draw view model for the player
  59. CNetworkVar( bool, m_bDrawViewmodel );
  60. // Is the player wearing the HEV suit
  61. CNetworkVar( bool, m_bWearingSuit );
  62. CNetworkVar( bool, m_bPoisoned );
  63. CNetworkVar( float, m_flStepSize );
  64. CNetworkVar( bool, m_bAllowAutoMovement );
  65. // 3d skybox
  66. CNetworkVarEmbedded( sky3dparams_t, m_skybox3d );
  67. // world fog
  68. CNetworkVarEmbedded( fogplayerparams_t, m_PlayerFog );
  69. fogparams_t m_fog;
  70. // audio environment
  71. CNetworkVarEmbedded( audioparams_t, m_audio );
  72. CNetworkVar( bool, m_bSlowMovement );
  73. };
  74. EXTERN_SEND_TABLE(DT_Local);
  75. #endif // PLAYERLOCALDATA_H