PRooFPS-dd Dev Doc 1.0
PRooFPS-dd Developer Documentation
Loading...
Searching...
No Matches
proofps_dd::Player Class Reference

Detailed Description

Definition at line 46 of file Player.h.

#include <Player.h>

Public Member Functions

CConsole & getConsole () const
 
 Player (pge_audio::PgeAudio &audio, PGEcfgProfiles &cfgProfiles, PgeObjectPool< PooledBullet > &bullets, EventLister<> &eventsItemPickup, EventLister<> &eventsInventoryChange, EventLister<> &eventsAmmoChange, PR00FsUltimateRenderingEngine &gfx, pge_network::PgeINetwork &network, const pge_network::PgeNetworkConnectionHandle &connHandle, const std::string &sIpAddress)
 
 ~Player ()
 
 Player (const Player &)
 
Playeroperator= (const Player &)=delete
 
 Player (Player &&)=delete
 
Playeroperator= (Player &&)=delete
 
const std::chrono::time_point< std::chrono::steady_clock > & getTimeConstructed () const
 
const std::chrono::time_point< std::chrono::steady_clock > & getTimeBootedUp () const
 
void setTimeBootedUp ()
 Based on PRooFPS v0.5 network protocol, this is set when MsgUserNameChangeAndBootupDone is processed.
 
bool hasBootedUp () const
 
bool isExpectingAfterBootUpDelayedUpdate () const
 
void setExpectingAfterBootUpDelayedUpdate (bool b)
 
const pge_network::PgeNetworkConnectionHandle & getServerSideConnectionHandle () const
 
const std::string & getIpAddress () const
 
const std::string & getName () const
 
void setName (const std::string &sName)
 
bool & isInSpectatorMode ()
 
const bool & isInSpectatorMode () const
 
const bool & isForcedSpectating () const
 
void setForcedSpectating (bool value)
 
void updateAudioVisuals (const proofps_dd::Config &config, bool bServer, bool bAllowedForGameplay)
 Invoked in every frame.
 
void show ()
 
void hide ()
 
void setVisibilityState (bool state)
 Sets visibility state for BOTH the player object and the current weapon.
 
bool isVisible () const
 
WeaponManager & getWeaponManager ()
 
const WeaponManager & getWeaponManager () const
 
bool isDirty () const
 Check if there is any old-new value pending to be committed.
 
void updateOldValues ()
 Invokes commit() for all maintained old-new values.
 
bool isNetDirty () const
 Check if there was any old-new value updated in recent updateOldValues() call(s) since the last call to clearNetDirty().
 
void clearNetDirty ()
 Clears the isNetDirty() flag.
 
const PgeOldNewValue< int > & getArmor () const
 
void setArmor (int value)
 
const PgeOldNewValue< int > & getHealth () const
 
void setHealth (int value)
 
void doDamage (int dmgAP, int dmgHP)
 Input can be the calculated damage caused by bullet, or falling from high, etc.
 
PureVector & getImpactForce ()
 
void die (bool bMe, bool bServer)
 
const std::chrono::time_point< std::chrono::steady_clock > & getTimeDied () const
 
void moveTimeDiedEarlier (std::chrono::milliseconds::rep byMillisecs)
 
PgeOldNewValue< int > & getDeaths ()
 
const PgeOldNewValue< int > & getDeaths () const
 
PgeOldNewValue< unsigned int > & getSuicides ()
 
const PgeOldNewValue< unsigned int > & getSuicides () const
 
PgeOldNewValue< float > & getFiringAccuracy ()
 
const PgeOldNewValue< float > & getFiringAccuracy () const
 
PgeOldNewValue< unsigned int > & getShotsFiredCount ()
 
const PgeOldNewValue< unsigned int > & getShotsFiredCount () const
 
unsigned int & getShotsHitTarget ()
 
const unsigned int & getShotsHitTarget () const
 
bool & getRespawnFlag ()
 
void respawn (bool bMe, const Weapon &wpnDefaultAvailable, bool bServer)
 
bool & getResettlingFlag ()
 
void resettleAndRespawnShared ()
 
const PgeOldNewValue< bool > & getInvulnerability () const
 
void setInvulnerability (const bool &bState, const unsigned int &nSeconds=0)
 Both server and client use this function.
 
const unsigned int & getInvulnerabilityDurationSeconds () const
 
const std::chrono::time_point< std::chrono::steady_clock > & getTimeInvulnerabilityStarted () const
 
PgeOldNewValue< PureVector > & getPos ()
 
const PgeOldNewValue< PureVector > & getPos () const
 
bool isJustCreatedAndExpectingStartPos () const
 
void setJustCreatedAndExpectingStartPos (bool b)
 
PgeOldNewValue< TPureFloat > & getAngleY ()
 
const PgeOldNewValue< TPureFloat > & getAngleY () const
 
PgeOldNewValue< TPureFloat > & getAngleZ ()
 
const PgeOldNewValue< TPureFloat > & getAngleZ () const
 
PgeOldNewValue< PureVector > & getWeaponAngle ()
 
PureObject3D * getObject3D () const
 
float getGravity () const
 
void setGravity (float value)
 Physics class is required to invoke this in every physics tick.
 
PgeOldNewValue< bool > & getJumpInput ()
 
bool isJumping () const
 
bool canFall () const
 
void setCanFall (bool state)
 To be invoked by Physics class whenever it detects change in the status of falling.
 
bool isInAir () const
 
bool getHasJustStartedFallingNaturallyInThisTick () const
 
void setHasJustStartedFallingNaturallyInThisTick (bool val)
 Physics class is required to invoke this whenever the gravity pulling force actually manages to decrease the altitude of the player in a physics tick, after it was not yet possible in the previous tick.
 
bool getHasJustStartedFallingAfterJumpingStoppedInThisTick () const
 
void setHasJustStartedFallingAfterJumpingStoppedInThisTick (bool val)
 Physics class is required to invoke this whenever a player-induced jump has just been finished its upward movement.
 
bool isFalling () const
 Unlike canFall(), this returns a more useful value about falling actually confirmed by the physics engine.
 
bool isFallingNaturally () const
 
bool isFallingAfterJumpingStopped () const
 
const std::chrono::time_point< std::chrono::steady_clock > & getTimeStartedFalling () const
 The timestamp of the moment Physics class invoked:
 
const float getHeightStartedFalling () const
 The vertical position of the player in the moment of Physics class invoked:
 
bool & getHasJustStoppedJumpingInThisTick ()
 
bool jumpAllowed () const
 
void setJumpAllowed (bool b)
 Physics class is required to invoke this in every physics tick based on different conditions.
 
void jump (const float &fRunSpeedPerTickForJumppadHorizontalForce=0.f)
 Triggers a jump.
 
void stopJumping ()
 
float getWillJumpXInNextTick () const
 
float getWillJumpYInNextTick () const
 
void setWillJumpInNextTick (float factorY, float factorX)
 Sets the multipliers for jump force that will be used for the next jump.
 
const std::chrono::time_point< std::chrono::steady_clock > & getTimeLastSetWillJump () const
 
float getHeightJumpInitiated () const
 
PureVector & getJumpForce ()
 
bool getWillWallJumpInNextTick () const
 
void setWillWallJumpInNextTick ()
 Sets the multipliers for jump force that will be used for the next wall jump.
 
void cancelWillWallJump ()
 Resets getWillWallJumpInNextTick().
 
void wallJump ()
 
int & getTicksSinceLastHorizontalCollision ()
 
bool hasJetLax () const
 
void setHasJetLax (bool state)
 
bool hasAntiGravityActive () const
 
void setHasAntiGravityActive (bool state)
 
PureVector & getAntiGravityForce ()
 
void setCurrentInventoryItemPower (const float &newValue)
 Unlike with other PgeOldNewValue functions, we do not define a non-const version of getCurrentInventoryItemPower(), so this way we force that both server- and client instances must call this function for updating inventory item power.
 
const PgeOldNewValue< float > & getCurrentInventoryItemPower () const
 
void updateCurrentInventoryItemPowerAudioVisualsShared (const proofps_dd::Config &config, PgeObjectPool< Smoke > &smokes)
 For this audio-visual control to work properly, this function shall be invoked MAX 1 time per frame!
 
void forceDeactivateCurrentInventoryItem ()
 
PgeOldNewValue< bool > & getCrouchInput ()
 
bool & getCrouchStateCurrent ()
 
const bool & getCrouchStateCurrent () const
 
const bool & isJumpingInitiatedFromCrouching () const
 
const bool & isJumpInitiatedByJumppad () const
 
bool & getWantToStandup ()
 
float getProposedNewPosYforStandup () const
 
void doCrouchServer ()
 Changing player properties for physics.
 
void doCrouchShared ()
 
void doStandupServer ()
 Changing player properties for physics.
 
void doStandupShared ()
 
PgeOldNewValue< bool > & getDescentInput ()
 
bool getWillSomersaultInNextTick () const
 
void setWillSomersaultInNextTick (bool flag)
 
void startSomersaultServer (bool bJumpInduced)
 Salto/somersault aka front-/backflip.
 
void setSomersaultClient (float angleZ)
 Since server calculates somersault angle, client just receives the angle periodically from server.
 
bool isSomersaulting () const
 
float getSomersaultAngle () const
 
void stepSomersaultAngleServer (float angle)
 Stepping the somersault angle i.e.
 
void resetSomersaultServer ()
 
bool isRunning () const
 
void setRun (bool state)
 
const std::chrono::time_point< std::chrono::steady_clock > & getTimeLastToggleRun () const
 
const std::chrono::time_point< std::chrono::steady_clock > & getTimeLastToggleUseItem () const
 
const proofps_dd::StrafegetStrafe () const
 
void setStrafe (const proofps_dd::Strafe &strafe)
 
const proofps_dd::StrafegetPreviousActualStrafe () const
 Gets previous non-NONE strafe value registered before the last NONE strafe value and the current non-NONE strafe state.
 
const std::chrono::time_point< std::chrono::steady_clock > & getTimeLastActualStrafe () const
 
float & getStrafeSpeed ()
 
const PgeOldNewValue< bool > & getActuallyRunningOnGround () const
 
PgeOldNewValue< bool > & getActuallyRunningOnGround ()
 
bool isMoving () const
 Tells if the player is stationary or not.
 
bool & getAttack ()
 
bool attack ()
 
const PgeOldNewValue< float > & getWeaponMomentaryAccuracy () const
 
void setWeaponMomentaryAccuracy (float value)
 This is just for server sending momentary weapon accuracy to all players, so they can scale their xhair accordingly.
 
PgeOldNewValue< int > & getFrags ()
 
const PgeOldNewValue< int > & getFrags () const
 
PgeOldNewValue< unsigned int > & getTeamId ()
 
const PgeOldNewValue< unsigned int > & getTeamId () const
 
bool canTakeItem (const MapItem &item) const
 
void takeItem (MapItem &item, pge_network::PgePacket &pktWpnUpdate, bool &bHasJustBecomeAvailable)
 
const Weapon * getWeaponInstanceByMapItemType (const MapItemType &mapItemType) const
 
Weapon * getWeaponInstanceByMapItemType (const MapItemType &mapItemType)
 
void updateImpactForceByBulletImpactOrRecoil (bool bRecoil, Bullet &bullet, Weapon &wpn)
 
void handleFallingFromHigh (int iServerScream)
 
void handleLanded (const float &fFallHeight, bool bDamageTaken, bool bDied, PureVector &vecCamShakeForce, const bool &bMe)
 
void handleActuallyRunningOnGround ()
 
void handleTakeNonWeaponItem (const proofps_dd::MapItemType &eMapItemType, const bool &bMe)
 
void handleToggleInventoryItem (const proofps_dd::MapItemType &eMapItemType, const bool &bSyncHistory)
 
void handleUntakeInventoryItem (const proofps_dd::MapItemType &eMapItemType)
 
void handleTakeWeaponItem (const proofps_dd::MapItemType &eMapItemType, const Weapon &wpnTaken, const bool &bJustBecameAvailable, const int &nAmmoIncrease)
 
void handleJumppadActivated ()
 
void handleTeamIdChanged (const unsigned int &iTeamId)
 
void handleToggleSpectatorMode ()
 

Static Public Member Functions

static const char * getLoggerModuleName ()
 
static void genUniqueUserName (char szNewUserName[proofps_dd::MsgUserNameChangeAndBootupDone::nUserNameBufferLength], const std::string &sNameFromConfig, const std::map< pge_network::PgeNetworkConnectionHandle, proofps_dd::Player > &m_mapPlayers)
 

Static Public Attributes

static constexpr auto smokeEmitOperValuesLowPowerThrust
 See explanation of this at Smoke::smokeEmitOperValues.
 
static constexpr auto smokeEmitOperValuesHighPowerThrust
 See explanation of this at Smoke::smokeEmitOperValues.
 
static constexpr char * szCVarClName = "cl_name"
 
static constexpr float fObjWidth = 0.95f
 
static constexpr float fObjHeightStanding = 1.88f
 
static constexpr float fObjHeightCrouchScaling = 0.48f
 
static constexpr float fHeightLastJumpWhenPlayerIsOnGround = 999999.f
 
static constexpr float fBaseSpeedWalk = 2.f
 
static constexpr float fBaseSpeedRun = 4.f
 
static constexpr float fBaseSpeedCrouch = 1.5f
 
static constexpr float fJumpGravityStartFromStanding = 19.f
 
static constexpr float fJumpGravityStartFromCrouching = 15.f
 
static constexpr char * szCVarSvMovingAffectsAim = "sv_moving_affects_aim"
 
static constexpr char * szCVarSvSomersaultMidAirAutoCrouch = "sv_somersault_mid_air_auto_crouch"
 
static constexpr char * szCVarSvSomersaultMidAirJumpForceMultiplier = "sv_somersault_mid_air_jump_force_multiplier"
 
static constexpr unsigned int nSomersaultTargetDurationMillisecs = 300
 
static constexpr float fSomersaultMidAirJumpForceMultiplierMin = 1.f
 
static constexpr float fSomersaultMidAirJumpForceMultiplierMax = 2.f
 
static constexpr float fSomersaultMidAirJumpForceMultiplierDef = Player::fSomersaultMidAirJumpForceMultiplierMax
 
static constexpr float fSomersaultGroundImpactForceX = 15.f
 
static constexpr unsigned int nSvDmRespawnDelaySecsDef = 3
 
static constexpr char * szCVarSvDmRespawnDelaySecs = "sv_dm_respawn_delay"
 
static constexpr unsigned int nSvDmRespawnInvulnerabilityDelaySecsDef = 3
 
static constexpr char * szCVarSvDmRespawnInvulnerabilityDelaySecs = "sv_dm_respawn_invulnerability_delay"
 
static constexpr unsigned int nPlayersMax = 15
 
static constexpr char * szCVarPlayersMax = "players_max"
 

Private Types

enum class  OldNewValueName {
  OvArmor , OvHealth , OvFrags , OvDeaths ,
  OvSuicides , OvFiringAccuracy , OvShotsFired , OvPos ,
  OvAngleY , OvAngleZ , OvWpnAngle , OvWpnMomentaryAccuracy ,
  OvCrouchInput , OvDescentInput , OvActuallyRunningOnGround , OvInvulnerability ,
  OvJumpInput , OvCurrentInventoryItemPower
}
 

Private Member Functions

void BuildPlayerObject (bool blend)
 
int & getParticleEmitPerNthPhysicsIterationCntr ()
 
const int & getParticleEmitPerNthPhysicsIterationCntr () const
 
void emitParticles (const proofps_dd::Config &config, PgeObjectPool< Smoke > &smokes, const bool &bHighPowerThrust)
 
PgeOldNewValue< int > & getArmor ()
 
PgeOldNewValue< int > & getHealth ()
 
PgeOldNewValue< float > & getWeaponMomentaryAccuracy ()
 

Private Attributes

pge_network::PgeNetworkConnectionHandle m_connHandleServerSide
 Used by both server and clients to identify the connection.
 
std::string m_sIpAddress
 
std::string m_sName
 
std::chrono::time_point< std::chrono::steady_clock > m_timeCtor
 
std::chrono::time_point< std::chrono::steady_clock > m_timeBootedUp
 Timestamp of server-side processing of UserNameChangeAndBootupDone (after MsgUserConnectedServerSelf and MsgUserSetupFromServer is already processed.
 
bool m_bExpectingAfterBootUpDelayedUpdate = true
 
bool m_bSpectatorMode = true
 
bool m_bForcedSpectating = false
 
std::map< OldNewValueName, std::variant< PgeOldNewValue< int >, PgeOldNewValue< unsigned int >, PgeOldNewValue< bool >, PgeOldNewValue< TPureFloat >, PgeOldNewValue< PureVector > > > m_vecOldNewValues
 
PgeOldNewValue< unsigned int > m_iTeamId {0}
 Which team this player belongs to.
 
bool m_bNetDirty = false
 
std::chrono::time_point< std::chrono::steady_clock > m_timeDied
 
bool m_bRespawn = false
 
bool m_bResettle = false
 
std::chrono::time_point< std::chrono::steady_clock > m_timeStartedInvulnerability
 
unsigned int m_nInvulnerabilityDurationSecs = 0
 
unsigned int m_nShotsHitTarget = 0
 
PureVector m_vecImpactForce
 
PureVector m_vecAntiGravityForce
 
PureObject3D * m_pObj = nullptr
 
PureTexture * m_pTexPlayerStand = nullptr
 
PureTexture * m_pTexPlayerCrouch = nullptr
 
WeaponManager m_wpnMgr
 
pge_audio::PgeAudio & m_audio
 
PGEcfgProfiles & m_cfgProfiles
 
PgeObjectPool< PooledBullet > & m_bullets
 
EventListerm_eventsItemPickup
 
EventListerm_eventsInventoryChange
 
EventListerm_eventsAmmoChange
 
PR00FsUltimateRenderingEngine & m_gfx
 
pge_network::PgeINetwork & m_network
 
PureVector m_vecJumpForce
 
float m_fGravity = 0.f
 
bool m_bJumping = false
 
bool m_bAllowJump = false
 
float m_fWillJumpMultFactorX = 0.f
 Since v0.2.6 we also record horizontal jump factor which is non-0 for jumppads triggering horizontal force.
 
float m_fWillJumpMultFactorY = 0.f
 Before v0.2.6 this was a boolean value, but then I changed it to float so it also means how strong the jump will be.
 
float m_fJumpInitiatedHeight = fHeightLastJumpWhenPlayerIsOnGround
 
bool m_bWillWallJump = false
 
int m_nConsecutiveWallJump = 0
 
int m_nTicksSinceLastHorizontalCollision = 0
 
PureVector m_angleSavedForWallJump
 
std::chrono::time_point< std::chrono::steady_clock > m_timeLastWillJump
 
bool m_bCanFall = true
 
bool m_bFalling = true
 
bool m_bHasJustStartedFallingNaturally = true
 
bool m_bHasJustStartedFallingAfterJumpingStopped = false
 
bool m_bFallingNaturally = true
 
bool m_bFallingAfterJumpingStopped = false
 
std::chrono::time_point< std::chrono::steady_clock > m_timeStartedFalling
 
float m_fHeightStartedFalling = 0.f
 
bool m_bHasJustStoppedJumping = false
 
bool m_bFallingHighTriggered = false
 This flag is set by handleFallingFromHigh(), we need to use this flag to make sure the actions are triggered only once when the player is falling from high.
 
SoLoud::handle m_handleSndPlayerItemDeactivateAntiGravity = 0
 
SoLoud::handle m_handleSndPlayerItemLowThrustAntiGravity = 0
 
bool m_bSndPlayerItemLowThrustAntiGravityLoopingStarted = false
 
SoLoud::handle m_handleSndPlayerItemHighThrustAntiGravity = 0
 
bool m_bSndPlayerItemHighThrustAntiGravityLoopingStarted = false
 
SoLoud::handle m_handleFallYell = 0
 
SoLoud::handle m_handleSndPlayerLandSmallFall = 0
 
SoLoud::handle m_handleSndPlayerLandBigFall = 0
 
SoLoud::handle m_handleSndPlayerDamage = 0
 
SoLoud::handle m_handleSndPlayerFootstep = 0
 
std::chrono::time_point< std::chrono::steady_clock > m_timeLastSndPlayerFootstepPlayed
 
bool m_bCrouchingStateCurrent = false
 True when player is crouching currently, regardless of current input (OvCrouchInput).
 
bool m_bCrouchingWasActiveWhenInitiatedJump = false
 We need to save current crouching state at the moment of initiating jump-up, so that we can check in any later moment of jumping up if somersaulting can be initiated: it must not be initiated when player was already crouching at the moment of jump-up.
 
bool m_bJumpWasInitiatedByJumppad = false
 We need to save if jumping was initiated by jumppad because we should not allow mid-air somersaulting in such case.
 
bool m_bWantToStandup = true
 True when player wants standing position as per input, regardless of currently crouching or not.
 
bool m_bWillSomersault = false
 
float m_fSomersaultAngleZ = 0.f
 If non-zero, there is ongoing somersaulting handled by physics.
 
bool m_bRunning = true
 
std::chrono::time_point< std::chrono::steady_clock > m_timeLastToggleRun
 
std::chrono::time_point< std::chrono::steady_clock > m_timeLastToggleUseItem
 
bool m_bJustCreatedAndExpectingStartPos = true
 
proofps_dd::Strafe m_strafe = Strafe::NONE
 
proofps_dd::Strafe m_prevActualStrafe = Strafe::NONE
 
std::chrono::time_point< std::chrono::steady_clock > m_timeLastStrafe
 
float m_strafeSpeed = 0.f
 
bool m_bAttack = false
 
bool m_bHasJetLax = false
 
bool m_bHasAntiGravityActive = false
 
PgeOldNewValue< float > m_fCurrentInventoryItemPower { 0.f }
 
int m_nParticleEmitPerNthPhysicsIterCntr { 0 }
 Counter to be used by particle emitter logic.
 

Static Private Attributes

static const std::map< MapItemType, std::string > m_mapItemTypeToWeaponFilename
 
static uint32_t m_nPlayerInstanceCntr = 0
 
static SoLoud::Wav * m_sndWpnAmmo = nullptr
 
static SoLoud::Wav * m_sndWpnNew = nullptr
 
static SoLoud::Wav * m_sndArmor = nullptr
 
static SoLoud::Wav * m_sndMedkit = nullptr
 
static SoLoud::Wav * m_sndJetlax = nullptr
 
static SoLoud::Wav * m_sndJumppad = nullptr
 
static SoLoud::Wav * m_sndPlayerItemActivateAntiGravity = nullptr
 
static SoLoud::Wav * m_sndPlayerItemDeactivateAntiGravity = nullptr
 
static SoLoud::Wav * m_sndPlayerItemLowThrustAntiGravity = nullptr
 
static SoLoud::Wav * m_sndPlayerItemHighThrustAntiGravity = nullptr
 
static SoLoud::Wav * m_sndFallYell_1 = nullptr
 
static SoLoud::Wav * m_sndFallYell_2 = nullptr
 
static SoLoud::Wav * m_sndPlayerLandSmallFall = nullptr
 
static SoLoud::Wav * m_sndPlayerLandBigFall = nullptr
 
static SoLoud::Wav * m_sndPlayerDamage = nullptr
 
static SoLoud::Wav * m_sndPlayerFootstep [4] = { nullptr }
 
static SoLoud::Wav * m_sndPlayerFunnyLaughDiedByLanding = nullptr
 
static std::chrono::milliseconds::rep m_nMaxSndPlayerFootstepDurationMillisecs = 0
 
static std::chrono::milliseconds::rep m_nMinTimeBetweenPlayerWalkSoundsMillisecs = 0
 

Member Enumeration Documentation

◆ OldNewValueName

enum class proofps_dd::Player::OldNewValueName
strongprivate
Enumerator
OvArmor 
OvHealth 
OvFrags 
OvDeaths 
OvSuicides 
OvFiringAccuracy 
OvShotsFired 
OvPos 
OvAngleY 
OvAngleZ 
OvWpnAngle 
OvWpnMomentaryAccuracy 
OvCrouchInput 
OvDescentInput 
OvActuallyRunningOnGround 
OvInvulnerability 
OvJumpInput 
OvCurrentInventoryItemPower 

Definition at line 387 of file Player.h.

Constructor & Destructor Documentation

◆ Player() [1/3]

proofps_dd::Player::Player ( pge_audio::PgeAudio & audio,
PGEcfgProfiles & cfgProfiles,
PgeObjectPool< PooledBullet > & bullets,
EventLister<> & eventsItemPickup,
EventLister<> & eventsInventoryChange,
EventLister<> & eventsAmmoChange,
PR00FsUltimateRenderingEngine & gfx,
pge_network::PgeINetwork & network,
const pge_network::PgeNetworkConnectionHandle & connHandle,
const std::string & sIpAddress )
explicit

Definition at line 86 of file Player.cpp.

◆ ~Player()

proofps_dd::Player::~Player ( )

Definition at line 293 of file Player.cpp.

◆ Player() [2/3]

proofps_dd::Player::Player ( const Player & other)

Definition at line 234 of file Player.cpp.

◆ Player() [3/3]

proofps_dd::Player::Player ( Player && )
delete

Member Function Documentation

◆ attack()

bool proofps_dd::Player::attack ( )

Definition at line 1887 of file Player.cpp.

◆ BuildPlayerObject()

void proofps_dd::Player::BuildPlayerObject ( bool blend)
private

Definition at line 2789 of file Player.cpp.

◆ cancelWillWallJump()

void proofps_dd::Player::cancelWillWallJump ( )

Resets getWillWallJumpInNextTick().

In some case, a triggered wall jump should be cancelled. Since wall jumping is triggered by player in input handling, but actually triggered in physics, we have to cancel the player-triggered wall jump in physics if we detect no actual horizontal wall collision. Otherwise, the wall jump would be really triggered by physics later due to the set flag.

Definition at line 1289 of file Player.cpp.

◆ canFall()

bool proofps_dd::Player::canFall ( ) const
Returns
True if player is NOT jumping upwards. True can have a lot of meaning, depending on where are we in the physics tick. Gravity sets it to true when jumping has finished. This means true might mean the player is on ground, or either floating in the air in this moment (just hit the ceiling) or actually falling down. False has more explicit meaning: the player is either jumping upwards or vertically hit something from above.

Definition at line 928 of file Player.cpp.

◆ canTakeItem()

bool proofps_dd::Player::canTakeItem ( const MapItem & item) const

Definition at line 1981 of file Player.cpp.

◆ clearNetDirty()

void proofps_dd::Player::clearNetDirty ( )

Clears the isNetDirty() flag.

The idea is that this should be called by the game only after sending out updates to clients.

Definition at line 582 of file Player.cpp.

◆ die()

void proofps_dd::Player::die ( bool bMe,
bool bServer )

Definition at line 646 of file Player.cpp.

◆ doCrouchServer()

void proofps_dd::Player::doCrouchServer ( )

Changing player properties for physics.

Invokes getPos().commit() too so not be called careless from anywhere. Should be invoked only by server physics at the beginning of physics calculations.

Parameters
bPullUpLegsTrue will result in the top Y position of the object won't change thus it will shrink upwards (should be used mid-air). False will result in both the top and bottom Y positions of the object will change thus it will shrink towards center (should be used on ground).

Definition at line 1538 of file Player.cpp.

◆ doCrouchShared()

void proofps_dd::Player::doCrouchShared ( )

Definition at line 1567 of file Player.cpp.

◆ doDamage()

void proofps_dd::Player::doDamage ( int dmgAP,
int dmgHP )

Input can be the calculated damage caused by bullet, or falling from high, etc.

AP is able to decrease the suffered HP damage, but not vice versa. This means a player can die even if AP stays positive.

Parameters
dmgAPThe input damage that will be applied to AP. It simply decreases AP by this value.
dmgHPThe input damage that will be applied to HP. This damage is decreased by the decreased AP before being applied to HP.

Definition at line 622 of file Player.cpp.

◆ doStandupServer()

void proofps_dd::Player::doStandupServer ( )

Changing player properties for physics.

Invokes getPos().set() too so not be called careless from anywhere. Should be invoked only by server physics during physics calculations.

Definition at line 1582 of file Player.cpp.

◆ doStandupShared()

void proofps_dd::Player::doStandupShared ( )

Definition at line 1604 of file Player.cpp.

◆ emitParticles()

void proofps_dd::Player::emitParticles ( const proofps_dd::Config & config,
PgeObjectPool< Smoke > & smokes,
const bool & bHighPowerThrust )
private

Definition at line 2824 of file Player.cpp.

◆ forceDeactivateCurrentInventoryItem()

void proofps_dd::Player::forceDeactivateCurrentInventoryItem ( )

Definition at line 1467 of file Player.cpp.

◆ genUniqueUserName()

void proofps_dd::Player::genUniqueUserName ( char szNewUserName[proofps_dd::MsgUserNameChangeAndBootupDone::nUserNameBufferLength],
const std::string & sNameFromConfig,
const std::map< pge_network::PgeNetworkConnectionHandle, proofps_dd::Player > & m_mapPlayers )
static

Definition at line 43 of file Player.cpp.

◆ getActuallyRunningOnGround() [1/2]

PgeOldNewValue< bool > & proofps_dd::Player::getActuallyRunningOnGround ( )

Definition at line 1855 of file Player.cpp.

◆ getActuallyRunningOnGround() [2/2]

const PgeOldNewValue< bool > & proofps_dd::Player::getActuallyRunningOnGround ( ) const

Definition at line 1849 of file Player.cpp.

◆ getAngleY() [1/2]

PgeOldNewValue< TPureFloat > & proofps_dd::Player::getAngleY ( )

Definition at line 853 of file Player.cpp.

◆ getAngleY() [2/2]

const PgeOldNewValue< TPureFloat > & proofps_dd::Player::getAngleY ( ) const

Definition at line 859 of file Player.cpp.

◆ getAngleZ() [1/2]

PgeOldNewValue< TPureFloat > & proofps_dd::Player::getAngleZ ( )

Definition at line 865 of file Player.cpp.

◆ getAngleZ() [2/2]

const PgeOldNewValue< TPureFloat > & proofps_dd::Player::getAngleZ ( ) const

Definition at line 871 of file Player.cpp.

◆ getAntiGravityForce()

PureVector & proofps_dd::Player::getAntiGravityForce ( )

Definition at line 1368 of file Player.cpp.

◆ getArmor() [1/2]

PgeOldNewValue< int > & proofps_dd::Player::getArmor ( )
private

Definition at line 2857 of file Player.cpp.

◆ getArmor() [2/2]

const PgeOldNewValue< int > & proofps_dd::Player::getArmor ( ) const

Definition at line 592 of file Player.cpp.

◆ getAttack()

bool & proofps_dd::Player::getAttack ( )

Definition at line 1882 of file Player.cpp.

◆ getConsole()

CConsole & proofps_dd::Player::getConsole ( ) const

Definition at line 587 of file Player.cpp.

◆ getCrouchInput()

PgeOldNewValue< bool > & proofps_dd::Player::getCrouchInput ( )

Definition at line 1489 of file Player.cpp.

◆ getCrouchStateCurrent() [1/2]

bool & proofps_dd::Player::getCrouchStateCurrent ( )

Definition at line 1495 of file Player.cpp.

◆ getCrouchStateCurrent() [2/2]

const bool & proofps_dd::Player::getCrouchStateCurrent ( ) const

Definition at line 1500 of file Player.cpp.

◆ getCurrentInventoryItemPower()

const PgeOldNewValue< float > & proofps_dd::Player::getCurrentInventoryItemPower ( ) const

Definition at line 1392 of file Player.cpp.

◆ getDeaths() [1/2]

PgeOldNewValue< int > & proofps_dd::Player::getDeaths ( )

Definition at line 699 of file Player.cpp.

◆ getDeaths() [2/2]

const PgeOldNewValue< int > & proofps_dd::Player::getDeaths ( ) const

Definition at line 705 of file Player.cpp.

◆ getDescentInput()

PgeOldNewValue< bool > & proofps_dd::Player::getDescentInput ( )

Definition at line 1614 of file Player.cpp.

◆ getFiringAccuracy() [1/2]

PgeOldNewValue< float > & proofps_dd::Player::getFiringAccuracy ( )

Definition at line 723 of file Player.cpp.

◆ getFiringAccuracy() [2/2]

const PgeOldNewValue< float > & proofps_dd::Player::getFiringAccuracy ( ) const

Definition at line 729 of file Player.cpp.

◆ getFrags() [1/2]

PgeOldNewValue< int > & proofps_dd::Player::getFrags ( )

Definition at line 1959 of file Player.cpp.

◆ getFrags() [2/2]

const PgeOldNewValue< int > & proofps_dd::Player::getFrags ( ) const

Definition at line 1965 of file Player.cpp.

◆ getGravity()

float proofps_dd::Player::getGravity ( ) const

Definition at line 888 of file Player.cpp.

◆ getHasJustStartedFallingAfterJumpingStoppedInThisTick()

bool proofps_dd::Player::getHasJustStartedFallingAfterJumpingStoppedInThisTick ( ) const
Returns
True if the player is falling now due to the jump-induced upward movement has just stopped, false otherwise.

Definition at line 987 of file Player.cpp.

◆ getHasJustStartedFallingNaturallyInThisTick()

bool proofps_dd::Player::getHasJustStartedFallingNaturallyInThisTick ( ) const
Returns
True if the player has just started falling naturally in this tick i.e. in previous tick there was still ground under its feet but now in this tick the

Definition at line 961 of file Player.cpp.

◆ getHasJustStoppedJumpingInThisTick()

bool & proofps_dd::Player::getHasJustStoppedJumpingInThisTick ( )
Returns
True if the upward movement due to a player-induced jump has just ended in the current physics tick i.e. we are floating in this moment but will start to fall in the next physics tick. False in any other moment.

Definition at line 1064 of file Player.cpp.

◆ getHealth() [1/2]

PgeOldNewValue< int > & proofps_dd::Player::getHealth ( )
private

Definition at line 2863 of file Player.cpp.

◆ getHealth() [2/2]

const PgeOldNewValue< int > & proofps_dd::Player::getHealth ( ) const

Definition at line 602 of file Player.cpp.

◆ getHeightJumpInitiated()

float proofps_dd::Player::getHeightJumpInitiated ( ) const

Definition at line 1195 of file Player.cpp.

◆ getHeightStartedFalling()

const float proofps_dd::Player::getHeightStartedFalling ( ) const

The vertical position of the player in the moment of Physics class invoked:

Definition at line 1055 of file Player.cpp.

◆ getImpactForce()

PureVector & proofps_dd::Player::getImpactForce ( )

Definition at line 641 of file Player.cpp.

◆ getInvulnerability()

const PgeOldNewValue< bool > & proofps_dd::Player::getInvulnerability ( ) const

Definition at line 395 of file Player.cpp.

◆ getInvulnerabilityDurationSeconds()

const unsigned int & proofps_dd::Player::getInvulnerabilityDurationSeconds ( ) const

Definition at line 417 of file Player.cpp.

◆ getIpAddress()

const std::string & proofps_dd::Player::getIpAddress ( ) const

Definition at line 356 of file Player.cpp.

◆ getJumpForce()

PureVector & proofps_dd::Player::getJumpForce ( )

Definition at line 1200 of file Player.cpp.

◆ getJumpInput()

PgeOldNewValue< bool > & proofps_dd::Player::getJumpInput ( )

Definition at line 910 of file Player.cpp.

◆ getLoggerModuleName()

const char * proofps_dd::Player::getLoggerModuleName ( )
static

Definition at line 38 of file Player.cpp.

◆ getName()

const std::string & proofps_dd::Player::getName ( ) const

Definition at line 361 of file Player.cpp.

◆ getObject3D()

PureObject3D * proofps_dd::Player::getObject3D ( ) const

Definition at line 883 of file Player.cpp.

◆ getParticleEmitPerNthPhysicsIterationCntr() [1/2]

int & proofps_dd::Player::getParticleEmitPerNthPhysicsIterationCntr ( )
private

Definition at line 2814 of file Player.cpp.

◆ getParticleEmitPerNthPhysicsIterationCntr() [2/2]

const int & proofps_dd::Player::getParticleEmitPerNthPhysicsIterationCntr ( ) const
private

Definition at line 2819 of file Player.cpp.

◆ getPos() [1/2]

PgeOldNewValue< PureVector > & proofps_dd::Player::getPos ( )

Definition at line 831 of file Player.cpp.

◆ getPos() [2/2]

const PgeOldNewValue< PureVector > & proofps_dd::Player::getPos ( ) const

Definition at line 837 of file Player.cpp.

◆ getPreviousActualStrafe()

const proofps_dd::Strafe & proofps_dd::Player::getPreviousActualStrafe ( ) const

Gets previous non-NONE strafe value registered before the last NONE strafe value and the current non-NONE strafe state.

It is Strafe::NONE only right after constructing the Player object or after respawn().

Definition at line 1834 of file Player.cpp.

◆ getProposedNewPosYforStandup()

float proofps_dd::Player::getProposedNewPosYforStandup ( ) const

Definition at line 1520 of file Player.cpp.

◆ getResettlingFlag()

bool & proofps_dd::Player::getResettlingFlag ( )

Definition at line 806 of file Player.cpp.

◆ getRespawnFlag()

bool & proofps_dd::Player::getRespawnFlag ( )

Definition at line 757 of file Player.cpp.

◆ getServerSideConnectionHandle()

const pge_network::PgeNetworkConnectionHandle & proofps_dd::Player::getServerSideConnectionHandle ( ) const

Definition at line 351 of file Player.cpp.

◆ getShotsFiredCount() [1/2]

PgeOldNewValue< unsigned int > & proofps_dd::Player::getShotsFiredCount ( )

Definition at line 735 of file Player.cpp.

◆ getShotsFiredCount() [2/2]

const PgeOldNewValue< unsigned int > & proofps_dd::Player::getShotsFiredCount ( ) const

Definition at line 741 of file Player.cpp.

◆ getShotsHitTarget() [1/2]

unsigned int & proofps_dd::Player::getShotsHitTarget ( )

Definition at line 747 of file Player.cpp.

◆ getShotsHitTarget() [2/2]

const unsigned int & proofps_dd::Player::getShotsHitTarget ( ) const

Definition at line 752 of file Player.cpp.

◆ getSomersaultAngle()

float proofps_dd::Player::getSomersaultAngle ( ) const

Definition at line 1737 of file Player.cpp.

◆ getStrafe()

const proofps_dd::Strafe & proofps_dd::Player::getStrafe ( ) const

Definition at line 1808 of file Player.cpp.

◆ getStrafeSpeed()

float & proofps_dd::Player::getStrafeSpeed ( )

Definition at line 1844 of file Player.cpp.

◆ getSuicides() [1/2]

PgeOldNewValue< unsigned int > & proofps_dd::Player::getSuicides ( )

Definition at line 711 of file Player.cpp.

◆ getSuicides() [2/2]

const PgeOldNewValue< unsigned int > & proofps_dd::Player::getSuicides ( ) const

Definition at line 717 of file Player.cpp.

◆ getTeamId() [1/2]

PgeOldNewValue< unsigned int > & proofps_dd::Player::getTeamId ( )

Definition at line 1971 of file Player.cpp.

◆ getTeamId() [2/2]

const PgeOldNewValue< unsigned int > & proofps_dd::Player::getTeamId ( ) const

Definition at line 1976 of file Player.cpp.

◆ getTicksSinceLastHorizontalCollision()

int & proofps_dd::Player::getTicksSinceLastHorizontalCollision ( )

Definition at line 1336 of file Player.cpp.

◆ getTimeBootedUp()

const std::chrono::time_point< std::chrono::steady_clock > & proofps_dd::Player::getTimeBootedUp ( ) const
Returns
The timestamp when this player has been marked as "booted up". See setTimeBootedUp() doc for more details.

Definition at line 318 of file Player.cpp.

◆ getTimeConstructed()

const std::chrono::time_point< std::chrono::steady_clock > & proofps_dd::Player::getTimeConstructed ( ) const

Definition at line 309 of file Player.cpp.

◆ getTimeDied()

const std::chrono::time_point< std::chrono::steady_clock > & proofps_dd::Player::getTimeDied ( ) const

Definition at line 682 of file Player.cpp.

◆ getTimeInvulnerabilityStarted()

const std::chrono::time_point< std::chrono::steady_clock > & proofps_dd::Player::getTimeInvulnerabilityStarted ( ) const

Definition at line 422 of file Player.cpp.

◆ getTimeLastActualStrafe()

const std::chrono::time_point< std::chrono::steady_clock > & proofps_dd::Player::getTimeLastActualStrafe ( ) const

Definition at line 1839 of file Player.cpp.

◆ getTimeLastSetWillJump()

const std::chrono::time_point< std::chrono::steady_clock > & proofps_dd::Player::getTimeLastSetWillJump ( ) const

Definition at line 1190 of file Player.cpp.

◆ getTimeLastToggleRun()

const std::chrono::time_point< std::chrono::steady_clock > & proofps_dd::Player::getTimeLastToggleRun ( ) const

Definition at line 1798 of file Player.cpp.

◆ getTimeLastToggleUseItem()

const std::chrono::time_point< std::chrono::steady_clock > & proofps_dd::Player::getTimeLastToggleUseItem ( ) const

Definition at line 1803 of file Player.cpp.

◆ getTimeStartedFalling()

const std::chrono::time_point< std::chrono::steady_clock > & proofps_dd::Player::getTimeStartedFalling ( ) const

The timestamp of the moment Physics class invoked:

Definition at line 1045 of file Player.cpp.

◆ getWantToStandup()

bool & proofps_dd::Player::getWantToStandup ( )

Definition at line 1515 of file Player.cpp.

◆ getWeaponAngle()

PgeOldNewValue< PureVector > & proofps_dd::Player::getWeaponAngle ( )

Definition at line 877 of file Player.cpp.

◆ getWeaponInstanceByMapItemType() [1/2]

Weapon * proofps_dd::Player::getWeaponInstanceByMapItemType ( const MapItemType & mapItemType)

Definition at line 2142 of file Player.cpp.

◆ getWeaponInstanceByMapItemType() [2/2]

const Weapon * proofps_dd::Player::getWeaponInstanceByMapItemType ( const MapItemType & mapItemType) const

Definition at line 2108 of file Player.cpp.

◆ getWeaponManager() [1/2]

WeaponManager & proofps_dd::Player::getWeaponManager ( )

Definition at line 515 of file Player.cpp.

◆ getWeaponManager() [2/2]

const WeaponManager & proofps_dd::Player::getWeaponManager ( ) const

Definition at line 520 of file Player.cpp.

◆ getWeaponMomentaryAccuracy() [1/2]

PgeOldNewValue< float > & proofps_dd::Player::getWeaponMomentaryAccuracy ( )
private

Definition at line 2869 of file Player.cpp.

◆ getWeaponMomentaryAccuracy() [2/2]

const PgeOldNewValue< float > & proofps_dd::Player::getWeaponMomentaryAccuracy ( ) const

Definition at line 1942 of file Player.cpp.

◆ getWillJumpXInNextTick()

float proofps_dd::Player::getWillJumpXInNextTick ( ) const

Definition at line 1158 of file Player.cpp.

◆ getWillJumpYInNextTick()

float proofps_dd::Player::getWillJumpYInNextTick ( ) const

Definition at line 1163 of file Player.cpp.

◆ getWillSomersaultInNextTick()

bool proofps_dd::Player::getWillSomersaultInNextTick ( ) const

Definition at line 1620 of file Player.cpp.

◆ getWillWallJumpInNextTick()

bool proofps_dd::Player::getWillWallJumpInNextTick ( ) const

Definition at line 1205 of file Player.cpp.

◆ handleActuallyRunningOnGround()

void proofps_dd::Player::handleActuallyRunningOnGround ( )

Definition at line 2339 of file Player.cpp.

◆ handleFallingFromHigh()

void proofps_dd::Player::handleFallingFromHigh ( int iServerScream)

Definition at line 2200 of file Player.cpp.

◆ handleJumppadActivated()

void proofps_dd::Player::handleJumppadActivated ( )

Definition at line 2650 of file Player.cpp.

◆ handleLanded()

void proofps_dd::Player::handleLanded ( const float & fFallHeight,
bool bDamageTaken,
bool bDied,
PureVector & vecCamShakeForce,
const bool & bMe )

Definition at line 2264 of file Player.cpp.

◆ handleTakeNonWeaponItem()

void proofps_dd::Player::handleTakeNonWeaponItem ( const proofps_dd::MapItemType & eMapItemType,
const bool & bMe )

Definition at line 2375 of file Player.cpp.

◆ handleTakeWeaponItem()

void proofps_dd::Player::handleTakeWeaponItem ( const proofps_dd::MapItemType & eMapItemType,
const Weapon & wpnTaken,
const bool & bJustBecameAvailable,
const int & nAmmoIncrease )

Definition at line 2617 of file Player.cpp.

◆ handleTeamIdChanged()

void proofps_dd::Player::handleTeamIdChanged ( const unsigned int & iTeamId)

Definition at line 2675 of file Player.cpp.

◆ handleToggleInventoryItem()

void proofps_dd::Player::handleToggleInventoryItem ( const proofps_dd::MapItemType & eMapItemType,
const bool & bSyncHistory )

Definition at line 2460 of file Player.cpp.

◆ handleToggleSpectatorMode()

void proofps_dd::Player::handleToggleSpectatorMode ( )

Definition at line 2710 of file Player.cpp.

◆ handleUntakeInventoryItem()

void proofps_dd::Player::handleUntakeInventoryItem ( const proofps_dd::MapItemType & eMapItemType)

Definition at line 2582 of file Player.cpp.

◆ hasAntiGravityActive()

bool proofps_dd::Player::hasAntiGravityActive ( ) const

Definition at line 1351 of file Player.cpp.

◆ hasBootedUp()

bool proofps_dd::Player::hasBootedUp ( ) const
Returns
True if there is a valid timestamp set for bootup for this player, false otherwise. See setTimeBootedUp() doc for more details.

Definition at line 336 of file Player.cpp.

◆ hasJetLax()

bool proofps_dd::Player::hasJetLax ( ) const

Definition at line 1341 of file Player.cpp.

◆ hide()

void proofps_dd::Player::hide ( )

Definition at line 484 of file Player.cpp.

◆ isDirty()

bool proofps_dd::Player::isDirty ( ) const

Check if there is any old-new value pending to be committed.

Returns
True if there is something to be committed, false otherwise.

Definition at line 529 of file Player.cpp.

◆ isExpectingAfterBootUpDelayedUpdate()

bool proofps_dd::Player::isExpectingAfterBootUpDelayedUpdate ( ) const

Definition at line 341 of file Player.cpp.

◆ isFalling()

bool proofps_dd::Player::isFalling ( ) const

Unlike canFall(), this returns a more useful value about falling actually confirmed by the physics engine.

The falling can be "natural" or when the last jump-induced upward movement has stopped. See:

Returns
True if the player is actually falling now, false otherwise.

Definition at line 1019 of file Player.cpp.

◆ isFallingAfterJumpingStopped()

bool proofps_dd::Player::isFallingAfterJumpingStopped ( ) const
Returns
True if the player is falling now due to the jump-induced upward movement stopped some ticks ago and we still not yet hit ground, false otherwise.

Definition at line 1035 of file Player.cpp.

◆ isFallingNaturally()

bool proofps_dd::Player::isFallingNaturally ( ) const
Returns
True if the player is falling now "naturally" i.e. the ground has disappeared from below its feet a few ticks ago and we still not yet hit ground, false otherwise.

Definition at line 1027 of file Player.cpp.

◆ isForcedSpectating()

const bool & proofps_dd::Player::isForcedSpectating ( ) const

Definition at line 381 of file Player.cpp.

◆ isInAir()

bool proofps_dd::Player::isInAir ( ) const
Returns
True if player is in the air, false otherwise. Since it depends on isJumping() and canFall(), it is reliable only after the relevant physics calculations in the current physics tick have been finished since physics implementation controls both isJumping() and canFall().

Definition at line 952 of file Player.cpp.

◆ isInSpectatorMode() [1/2]

bool & proofps_dd::Player::isInSpectatorMode ( )

Definition at line 371 of file Player.cpp.

◆ isInSpectatorMode() [2/2]

const bool & proofps_dd::Player::isInSpectatorMode ( ) const

Definition at line 376 of file Player.cpp.

◆ isJumping()

bool proofps_dd::Player::isJumping ( ) const

Definition at line 916 of file Player.cpp.

◆ isJumpingInitiatedFromCrouching()

const bool & proofps_dd::Player::isJumpingInitiatedFromCrouching ( ) const

Definition at line 1505 of file Player.cpp.

◆ isJumpInitiatedByJumppad()

const bool & proofps_dd::Player::isJumpInitiatedByJumppad ( ) const

Definition at line 1510 of file Player.cpp.

◆ isJustCreatedAndExpectingStartPos()

bool proofps_dd::Player::isJustCreatedAndExpectingStartPos ( ) const

Definition at line 843 of file Player.cpp.

◆ isMoving()

bool proofps_dd::Player::isMoving ( ) const

Tells if the player is stationary or not.

This function was created to be used in any phase of a frame. There are some situations when checking (getPos().getOld() == getPos().getNew()) won't work, for example, if we are checking that condition before the next physics tick in the current frame. It might use previous frame's data, so it should be used only if the truth of the returned value being false for or late by 1 frame is not a problem.

Can be used only on server instance, as client returns false info due to lack of some data.

Returns
True if player is considered to be moving based on previous or current frame data, false otherwise. True also if player cannot strafe due to being blocked but based on the input it tries to strafe.

Definition at line 1874 of file Player.cpp.

◆ isNetDirty()

bool proofps_dd::Player::isNetDirty ( ) const

Check if there was any old-new value updated in recent updateOldValues() call(s) since the last call to clearNetDirty().

The idea is that the game should invoke updateOldValues() in every tick/physics iteration, and the game should later check the isNetDirty() flag to decide if it should send out updates to clients or not. Thus the isNetDirty() flag cannot be set by the game itself, it is always set by the updateOldValues(), and the game is expected to clear it using clearNetDirty() after sending out updates to clients.

Returns
True if there is something to be sent to clients, false otherwise.

Definition at line 573 of file Player.cpp.

◆ isRunning()

bool proofps_dd::Player::isRunning ( ) const

Definition at line 1787 of file Player.cpp.

◆ isSomersaulting()

bool proofps_dd::Player::isSomersaulting ( ) const

Definition at line 1732 of file Player.cpp.

◆ isVisible()

bool proofps_dd::Player::isVisible ( ) const
Returns
True if either the player object or the current weapon is visible. False if neither the player object nor the current weapon is visible.

Definition at line 505 of file Player.cpp.

◆ jump()

void proofps_dd::Player::jump ( const float & fRunSpeedPerTickForJumppadHorizontalForce = 0.f)

Triggers a jump.

Prior calling to setWillJumpInNextTick() is mandatory for setting up jump multiplier factors for calculating forces.

Cannot trigger another jump if already jumping or somersaulting.

Since jump() is also used to trigger jumppad-induced jumps, that could also trigger horizontal force, we have fRunSpeedPerTickForJumppadHorizontalForce optional argument for such calculation.

Parameters
fRunSpeedPerTickForJumppadHorizontalForceOptional, only used in case of jumppad-induced jumps to calculate horizontal jump force.

Definition at line 1096 of file Player.cpp.

◆ jumpAllowed()

bool proofps_dd::Player::jumpAllowed ( ) const
Returns
True if jump is allowed for the player in the current physics tick, false otherwise.

Definition at line 1072 of file Player.cpp.

◆ moveTimeDiedEarlier()

void proofps_dd::Player::moveTimeDiedEarlier ( std::chrono::milliseconds::rep byMillisecs)

Definition at line 687 of file Player.cpp.

◆ operator=() [1/2]

Player & proofps_dd::Player::operator= ( const Player & )
delete

◆ operator=() [2/2]

Player & proofps_dd::Player::operator= ( Player && )
delete

◆ resetSomersaultServer()

void proofps_dd::Player::resetSomersaultServer ( )

Definition at line 1781 of file Player.cpp.

◆ resettleAndRespawnShared()

void proofps_dd::Player::resettleAndRespawnShared ( )

Definition at line 811 of file Player.cpp.

◆ respawn()

void proofps_dd::Player::respawn ( bool bMe,
const Weapon & wpnDefaultAvailable,
bool bServer )

Definition at line 762 of file Player.cpp.

◆ setArmor()

void proofps_dd::Player::setArmor ( int value)

Definition at line 598 of file Player.cpp.

◆ setCanFall()

void proofps_dd::Player::setCanFall ( bool state)

To be invoked by Physics class whenever it detects change in the status of falling.

See canFall() for details.

Definition at line 937 of file Player.cpp.

◆ setCurrentInventoryItemPower()

void proofps_dd::Player::setCurrentInventoryItemPower ( const float & newValue)

Unlike with other PgeOldNewValue functions, we do not define a non-const version of getCurrentInventoryItemPower(), so this way we force that both server- and client instances must call this function for updating inventory item power.

Reason: originally we wanted to use this as a convenient and reliable way to control the inventory item sound based on power drop (low drop vs high drop) at a single location. But the server still invokes this 2 times per frame, from Physics' serverUpdateAntiGravityForce() and that messed up this plan. So we now control sound in a separate function: updateCurrentInventoryItemPowerAudioVisualsShared().

Definition at line 1383 of file Player.cpp.

◆ setExpectingAfterBootUpDelayedUpdate()

void proofps_dd::Player::setExpectingAfterBootUpDelayedUpdate ( bool b)

Definition at line 346 of file Player.cpp.

◆ setForcedSpectating()

void proofps_dd::Player::setForcedSpectating ( bool value)

Definition at line 386 of file Player.cpp.

◆ setGravity()

void proofps_dd::Player::setGravity ( float value)

Physics class is required to invoke this in every physics tick.

The gravity that is constantly pulling down objects in the game is constant but we maintain a momentary value for each dynamic object, derived from the constant gravity. This momentary value is being changed in each physics tick using this function. Detecting "natural" or "post-jump" falling also depends on this.

Definition at line 900 of file Player.cpp.

◆ setHasAntiGravityActive()

void proofps_dd::Player::setHasAntiGravityActive ( bool state)

Definition at line 1356 of file Player.cpp.

◆ setHasJetLax()

void proofps_dd::Player::setHasJetLax ( bool state)

Definition at line 1346 of file Player.cpp.

◆ setHasJustStartedFallingAfterJumpingStoppedInThisTick()

void proofps_dd::Player::setHasJustStartedFallingAfterJumpingStoppedInThisTick ( bool val)

Physics class is required to invoke this whenever a player-induced jump has just been finished its upward movement.

Definition at line 995 of file Player.cpp.

◆ setHasJustStartedFallingNaturallyInThisTick()

void proofps_dd::Player::setHasJustStartedFallingNaturallyInThisTick ( bool val)

Physics class is required to invoke this whenever the gravity pulling force actually manages to decrease the altitude of the player in a physics tick, after it was not yet possible in the previous tick.

Definition at line 970 of file Player.cpp.

◆ setHealth()

void proofps_dd::Player::setHealth ( int value)

Definition at line 608 of file Player.cpp.

◆ setInvulnerability()

void proofps_dd::Player::setInvulnerability ( const bool & bState,
const unsigned int & nSeconds = 0 )

Both server and client use this function.

However, only server actually uses the nSeconds argument. Client never knows the duration of invulnerability, it just always sets the state received from server. Server is responsible for managing invulnerability durations and explicitly notifying clients about invulnerability ending.

Parameters
bStateTrue for activating player invulnerability, false to reset it.
nSecondsDuration of invulnerability. Used by server instance only.

Definition at line 410 of file Player.cpp.

◆ setJumpAllowed()

void proofps_dd::Player::setJumpAllowed ( bool b)

Physics class is required to invoke this in every physics tick based on different conditions.

Definition at line 1080 of file Player.cpp.

◆ setJustCreatedAndExpectingStartPos()

void proofps_dd::Player::setJustCreatedAndExpectingStartPos ( bool b)

Definition at line 848 of file Player.cpp.

◆ setName()

void proofps_dd::Player::setName ( const std::string & sName)

Definition at line 366 of file Player.cpp.

◆ setRun()

void proofps_dd::Player::setRun ( bool state)

Definition at line 1792 of file Player.cpp.

◆ setSomersaultClient()

void proofps_dd::Player::setSomersaultClient ( float angleZ)

Since server calculates somersault angle, client just receives the angle periodically from server.

This function is for that case when server sends the updated angle.

Definition at line 1727 of file Player.cpp.

◆ setStrafe()

void proofps_dd::Player::setStrafe ( const proofps_dd::Strafe & strafe)

Definition at line 1813 of file Player.cpp.

◆ setTimeBootedUp()

void proofps_dd::Player::setTimeBootedUp ( )

Based on PRooFPS v0.5 network protocol, this is set when MsgUserNameChangeAndBootupDone is processed.

This is processed by all network instances on their side, therefore expected to be valid in every network instance for every player.

Definition at line 327 of file Player.cpp.

◆ setVisibilityState()

void proofps_dd::Player::setVisibilityState ( bool state)

Sets visibility state for BOTH the player object and the current weapon.

Definition at line 492 of file Player.cpp.

◆ setWeaponMomentaryAccuracy()

void proofps_dd::Player::setWeaponMomentaryAccuracy ( float value)

This is just for server sending momentary weapon accuracy to all players, so they can scale their xhair accordingly.

Only server is able to calculate players' aim accuracy, it is easier to simply send it to them.

Definition at line 1952 of file Player.cpp.

◆ setWillJumpInNextTick()

void proofps_dd::Player::setWillJumpInNextTick ( float factorY,
float factorX )

Sets the multipliers for jump force that will be used for the next jump.

The jump will actually happen in the current or in the next tick, depending on WHEN this function is called. See Physics code for details.

Parameters
factorYMultiplier for Player::fJumpGravityStartFromStanding. Use 1.0 to trigger a regular jump from standing position. Any value that is not 0 or 1.0 is considered to be a jumppad-induced jump when jump() is invoked. Use 0 to cancel the jump triggering in the current or in the next tick.

Definition at line 1177 of file Player.cpp.

◆ setWillSomersaultInNextTick()

void proofps_dd::Player::setWillSomersaultInNextTick ( bool flag)

Definition at line 1625 of file Player.cpp.

◆ setWillWallJumpInNextTick()

void proofps_dd::Player::setWillWallJumpInNextTick ( )

Sets the multipliers for jump force that will be used for the next wall jump.

The wall jump will actually happen in the current or in the next tick, depending on WHEN this function is called. See Physics code for details.

Unlike a regular jump, wall jump can be initiated only if the player has already initiated a regular jump before, and the player is still "in" that regular jump i.e. not yet started to fall down or already on ground. Additional requirement is that the player must look in the opposite direction of the wall they are strafing against. So if player is strafing towards left wall, they shall look to the right when triggering wall jump.

Definition at line 1225 of file Player.cpp.

◆ show()

void proofps_dd::Player::show ( )

Definition at line 479 of file Player.cpp.

◆ startSomersaultServer()

void proofps_dd::Player::startSomersaultServer ( bool bJumpInduced)

Salto/somersault aka front-/backflip.

The idea is this function sets an initial positive or negative value for the angle based on strafe direction, and then Physics class will take care of the full somersaulting by periodic calls to stepSomersaultAngleServer().

Parameters
bJumpInducedSet it to true if somersault is initiated during jump-up so it will be a mid-air salto/somersault. Set it to false if somersault is initiated on-ground so it will be an on-ground somersault.

Definition at line 1638 of file Player.cpp.

◆ stepSomersaultAngleServer()

void proofps_dd::Player::stepSomersaultAngleServer ( float angle)

Stepping the somersault angle i.e.

changing the angle in the proper direction. The idea is that we set the initial angle by a call to startSomersaultServer() and then in consecutive physics timesteps we call stepSomersaultAngleServer() with a value calculated by the physics engine. Somersaulting will stop once stepSomersaultAngleServer() finishes a complete roll/flip. This also means that currently only 1 full roll/flip is done before isSomersaulting() returns false again.

Definition at line 1749 of file Player.cpp.

◆ stopJumping()

void proofps_dd::Player::stopJumping ( )

Definition at line 1151 of file Player.cpp.

◆ takeItem()

void proofps_dd::Player::takeItem ( MapItem & item,
pge_network::PgePacket & pktWpnUpdate,
bool & bHasJustBecomeAvailable )
Parameters
itemItem being picked up by the player.
pktWpnUpdateThis function writes MsgWpnUpdateFromServer into this packet.
bHasJustBecomeAvailableSet by function only in case of weapon items. True if player did not have this weapon before, false otherwise.

Definition at line 2018 of file Player.cpp.

◆ updateAudioVisuals()

void proofps_dd::Player::updateAudioVisuals ( const proofps_dd::Config & config,
bool bServer,
bool bAllowedForGameplay )

Invoked in every frame.

Parameters
bAllowedForGameplayShall come from GameMode::isPlayerAllowedForGameplay().

Definition at line 432 of file Player.cpp.

◆ updateCurrentInventoryItemPowerAudioVisualsShared()

void proofps_dd::Player::updateCurrentInventoryItemPowerAudioVisualsShared ( const proofps_dd::Config & config,
PgeObjectPool< Smoke > & smokes )

For this audio-visual control to work properly, this function shall be invoked MAX 1 time per frame!

Server instance shall invoke it after it updated current inventory item power for the last time in the current frame, but before clearing dirtiness of old-new values. Basically it is invoked at tick-rate.

Client instance shall invoke it before clearing dirtiness of old-new values.

Definition at line 1406 of file Player.cpp.

◆ updateImpactForceByBulletImpactOrRecoil()

void proofps_dd::Player::updateImpactForceByBulletImpactOrRecoil ( bool bRecoil,
Bullet & bullet,
Weapon & wpn )
Parameters
bRecoilTrue if the impact is due to this player firing a bullet, false otherwise (if impact is due to another player's bullet is hitting this player).
bulletIt is either the bullet fired by this player in case of bRecoil is true, or the attacker's fired bullet impacting this player if bRecoil is false.
wpnIt is either this player's current weapon in case of bRecoil is true, or the attacker's weapon if bRecoil is false.

Definition at line 2156 of file Player.cpp.

◆ updateOldValues()

void proofps_dd::Player::updateOldValues ( )

Invokes commit() for all maintained old-new values.

Also sets the isNetDirty() flag if there was any dirty old-new value. The idea is that the game should invoke this function in every tick/physics iteration, and the game should later check the isNetDirty() flag to decide if it should send out updates to clients or not.

Definition at line 546 of file Player.cpp.

◆ wallJump()

void proofps_dd::Player::wallJump ( )

Definition at line 1294 of file Player.cpp.

Member Data Documentation

◆ fBaseSpeedCrouch

float proofps_dd::Player::fBaseSpeedCrouch = 1.5f
staticconstexpr

Definition at line 81 of file Player.h.

◆ fBaseSpeedRun

float proofps_dd::Player::fBaseSpeedRun = 4.f
staticconstexpr

Definition at line 80 of file Player.h.

◆ fBaseSpeedWalk

float proofps_dd::Player::fBaseSpeedWalk = 2.f
staticconstexpr

Definition at line 79 of file Player.h.

◆ fHeightLastJumpWhenPlayerIsOnGround

float proofps_dd::Player::fHeightLastJumpWhenPlayerIsOnGround = 999999.f
staticconstexpr

Definition at line 76 of file Player.h.

◆ fJumpGravityStartFromCrouching

float proofps_dd::Player::fJumpGravityStartFromCrouching = 15.f
staticconstexpr

Definition at line 97 of file Player.h.

◆ fJumpGravityStartFromStanding

float proofps_dd::Player::fJumpGravityStartFromStanding = 19.f
staticconstexpr

Definition at line 94 of file Player.h.

◆ fObjHeightCrouchScaling

float proofps_dd::Player::fObjHeightCrouchScaling = 0.48f
staticconstexpr

Definition at line 74 of file Player.h.

◆ fObjHeightStanding

float proofps_dd::Player::fObjHeightStanding = 1.88f
staticconstexpr

Definition at line 73 of file Player.h.

◆ fObjWidth

float proofps_dd::Player::fObjWidth = 0.95f
staticconstexpr

Definition at line 72 of file Player.h.

◆ fSomersaultGroundImpactForceX

float proofps_dd::Player::fSomersaultGroundImpactForceX = 15.f
staticconstexpr

Definition at line 122 of file Player.h.

◆ fSomersaultMidAirJumpForceMultiplierDef

float proofps_dd::Player::fSomersaultMidAirJumpForceMultiplierDef = Player::fSomersaultMidAirJumpForceMultiplierMax
staticconstexpr

Definition at line 111 of file Player.h.

◆ fSomersaultMidAirJumpForceMultiplierMax

float proofps_dd::Player::fSomersaultMidAirJumpForceMultiplierMax = 2.f
staticconstexpr

Definition at line 110 of file Player.h.

◆ fSomersaultMidAirJumpForceMultiplierMin

float proofps_dd::Player::fSomersaultMidAirJumpForceMultiplierMin = 1.f
staticconstexpr

Definition at line 109 of file Player.h.

◆ m_angleSavedForWallJump

PureVector proofps_dd::Player::m_angleSavedForWallJump
private

Definition at line 542 of file Player.h.

◆ m_audio

pge_audio::PgeAudio& proofps_dd::Player::m_audio
private

Definition at line 515 of file Player.h.

◆ m_bAllowJump

bool proofps_dd::Player::m_bAllowJump = false
private

Definition at line 527 of file Player.h.

◆ m_bAttack

bool proofps_dd::Player::m_bAttack = false
private

Definition at line 617 of file Player.h.

◆ m_bCanFall

bool proofps_dd::Player::m_bCanFall = true
private

Definition at line 544 of file Player.h.

◆ m_bCrouchingStateCurrent

bool proofps_dd::Player::m_bCrouchingStateCurrent = false
private

True when player is crouching currently, regardless of current input (OvCrouchInput).

This should be replicated to all clients and should affect the visuals of the player. Can be set to true by input, but only server physics engine can set it to false, or a respawn event. Somersaulting can also set it to true if mid-air auto-crouch is enabled (Player::szCVarSvSomersaultMidAirAutoCrouch). Default false.

Definition at line 580 of file Player.h.

◆ m_bCrouchingWasActiveWhenInitiatedJump

bool proofps_dd::Player::m_bCrouchingWasActiveWhenInitiatedJump = false
private

We need to save current crouching state at the moment of initiating jump-up, so that we can check in any later moment of jumping up if somersaulting can be initiated: it must not be initiated when player was already crouching at the moment of jump-up.

Definition at line 584 of file Player.h.

◆ m_bExpectingAfterBootUpDelayedUpdate

bool proofps_dd::Player::m_bExpectingAfterBootUpDelayedUpdate = true
private

Definition at line 448 of file Player.h.

◆ m_bFalling

bool proofps_dd::Player::m_bFalling = true
private

Definition at line 545 of file Player.h.

◆ m_bFallingAfterJumpingStopped

bool proofps_dd::Player::m_bFallingAfterJumpingStopped = false
private

Definition at line 549 of file Player.h.

◆ m_bFallingHighTriggered

bool proofps_dd::Player::m_bFallingHighTriggered = false
private

This flag is set by handleFallingFromHigh(), we need to use this flag to make sure the actions are triggered only once when the player is falling from high.

This is because Physics calls handleFallingFromHigh() in each physics step when the player is falling from high. Reset of this flag should be whenever falling high is interrupted, e.g. when player landed on ground.

Definition at line 559 of file Player.h.

◆ m_bFallingNaturally

bool proofps_dd::Player::m_bFallingNaturally = true
private

Definition at line 548 of file Player.h.

◆ m_bForcedSpectating

bool proofps_dd::Player::m_bForcedSpectating = false
private

Definition at line 451 of file Player.h.

◆ m_bHasAntiGravityActive

bool proofps_dd::Player::m_bHasAntiGravityActive = false
private

Definition at line 620 of file Player.h.

◆ m_bHasJetLax

bool proofps_dd::Player::m_bHasJetLax = false
private

Definition at line 619 of file Player.h.

◆ m_bHasJustStartedFallingAfterJumpingStopped

bool proofps_dd::Player::m_bHasJustStartedFallingAfterJumpingStopped = false
private

Definition at line 547 of file Player.h.

◆ m_bHasJustStartedFallingNaturally

bool proofps_dd::Player::m_bHasJustStartedFallingNaturally = true
private

Definition at line 546 of file Player.h.

◆ m_bHasJustStoppedJumping

bool proofps_dd::Player::m_bHasJustStoppedJumping = false
private

Definition at line 552 of file Player.h.

◆ m_bJumping

bool proofps_dd::Player::m_bJumping = false
private

Definition at line 526 of file Player.h.

◆ m_bJumpWasInitiatedByJumppad

bool proofps_dd::Player::m_bJumpWasInitiatedByJumppad = false
private

We need to save if jumping was initiated by jumppad because we should not allow mid-air somersaulting in such case.

Definition at line 587 of file Player.h.

◆ m_bJustCreatedAndExpectingStartPos

bool proofps_dd::Player::m_bJustCreatedAndExpectingStartPos = true
private

Definition at line 606 of file Player.h.

◆ m_bNetDirty

bool proofps_dd::Player::m_bNetDirty = false
private

Definition at line 498 of file Player.h.

◆ m_bResettle

bool proofps_dd::Player::m_bResettle = false
private

Definition at line 501 of file Player.h.

◆ m_bRespawn

bool proofps_dd::Player::m_bRespawn = false
private

Definition at line 500 of file Player.h.

◆ m_bRunning

bool proofps_dd::Player::m_bRunning = true
private

Definition at line 602 of file Player.h.

◆ m_bSndPlayerItemHighThrustAntiGravityLoopingStarted

bool proofps_dd::Player::m_bSndPlayerItemHighThrustAntiGravityLoopingStarted = false
private

Definition at line 567 of file Player.h.

◆ m_bSndPlayerItemLowThrustAntiGravityLoopingStarted

bool proofps_dd::Player::m_bSndPlayerItemLowThrustAntiGravityLoopingStarted = false
private

Definition at line 565 of file Player.h.

◆ m_bSpectatorMode

bool proofps_dd::Player::m_bSpectatorMode = true
private

Definition at line 450 of file Player.h.

◆ m_bullets

PgeObjectPool<PooledBullet>& proofps_dd::Player::m_bullets
private

Definition at line 517 of file Player.h.

◆ m_bWantToStandup

bool proofps_dd::Player::m_bWantToStandup = true
private

True when player wants standing position as per input, regardless of currently crouching or not.

This is an input to the physics engine. Unlike getCrouchInput(), this is persistent across frames. If this is true and the player is currently crouching, the physics engine will contantly check if there is possibility to stand up i.e. there is nothing blocking us from standing up. If the physics engine finds enough space to stand up and other conditions are also fulfilled (e.g. not somersaulting), it will flip m_bCrouchingStateCurrent to false so higher level layers will know the player is not crouching anymore. Default true.

Definition at line 597 of file Player.h.

◆ m_bWillSomersault

bool proofps_dd::Player::m_bWillSomersault = false
private

Definition at line 599 of file Player.h.

◆ m_bWillWallJump

bool proofps_dd::Player::m_bWillWallJump = false
private

Definition at line 539 of file Player.h.

◆ m_cfgProfiles

PGEcfgProfiles& proofps_dd::Player::m_cfgProfiles
private

Definition at line 516 of file Player.h.

◆ m_connHandleServerSide

pge_network::PgeNetworkConnectionHandle proofps_dd::Player::m_connHandleServerSide
private

Used by both server and clients to identify the connection.

Clients don't use it for direct communication. Note: this is the client's handle on server side! This is not the same handle as client has for the connection towards the server, those connection handles are not related to each other!

Definition at line 433 of file Player.h.

◆ m_eventsAmmoChange

EventLister& proofps_dd::Player::m_eventsAmmoChange
private

Definition at line 520 of file Player.h.

◆ m_eventsInventoryChange

EventLister& proofps_dd::Player::m_eventsInventoryChange
private

Definition at line 519 of file Player.h.

◆ m_eventsItemPickup

EventLister& proofps_dd::Player::m_eventsItemPickup
private

Definition at line 518 of file Player.h.

◆ m_fCurrentInventoryItemPower

PgeOldNewValue<float> proofps_dd::Player::m_fCurrentInventoryItemPower { 0.f }
private

Definition at line 621 of file Player.h.

◆ m_fGravity

float proofps_dd::Player::m_fGravity = 0.f
private

Definition at line 525 of file Player.h.

◆ m_fHeightStartedFalling

float proofps_dd::Player::m_fHeightStartedFalling = 0.f
private

Definition at line 551 of file Player.h.

◆ m_fJumpInitiatedHeight

float proofps_dd::Player::m_fJumpInitiatedHeight = fHeightLastJumpWhenPlayerIsOnGround
private

Definition at line 538 of file Player.h.

◆ m_fSomersaultAngleZ

float proofps_dd::Player::m_fSomersaultAngleZ = 0.f
private

If non-zero, there is ongoing somersaulting handled by physics.

Definition at line 600 of file Player.h.

◆ m_fWillJumpMultFactorX

float proofps_dd::Player::m_fWillJumpMultFactorX = 0.f
private

Since v0.2.6 we also record horizontal jump factor which is non-0 for jumppads triggering horizontal force.

Definition at line 531 of file Player.h.

◆ m_fWillJumpMultFactorY

float proofps_dd::Player::m_fWillJumpMultFactorY = 0.f
private

Before v0.2.6 this was a boolean value, but then I changed it to float so it also means how strong the jump will be.

0 means false in the pre-v0.2.6 world, and any positive value means true (= player will jump). Also I added Y to the end of the name because now we also record FactorX in separate var.

Definition at line 537 of file Player.h.

◆ m_gfx

PR00FsUltimateRenderingEngine& proofps_dd::Player::m_gfx
private

Definition at line 521 of file Player.h.

◆ m_handleFallYell

SoLoud::handle proofps_dd::Player::m_handleFallYell = 0
private

Definition at line 568 of file Player.h.

◆ m_handleSndPlayerDamage

SoLoud::handle proofps_dd::Player::m_handleSndPlayerDamage = 0
private

Definition at line 571 of file Player.h.

◆ m_handleSndPlayerFootstep

SoLoud::handle proofps_dd::Player::m_handleSndPlayerFootstep = 0
private

Definition at line 572 of file Player.h.

◆ m_handleSndPlayerItemDeactivateAntiGravity

SoLoud::handle proofps_dd::Player::m_handleSndPlayerItemDeactivateAntiGravity = 0
private

Definition at line 563 of file Player.h.

◆ m_handleSndPlayerItemHighThrustAntiGravity

SoLoud::handle proofps_dd::Player::m_handleSndPlayerItemHighThrustAntiGravity = 0
private

Definition at line 566 of file Player.h.

◆ m_handleSndPlayerItemLowThrustAntiGravity

SoLoud::handle proofps_dd::Player::m_handleSndPlayerItemLowThrustAntiGravity = 0
private

Definition at line 564 of file Player.h.

◆ m_handleSndPlayerLandBigFall

SoLoud::handle proofps_dd::Player::m_handleSndPlayerLandBigFall = 0
private

Definition at line 570 of file Player.h.

◆ m_handleSndPlayerLandSmallFall

SoLoud::handle proofps_dd::Player::m_handleSndPlayerLandSmallFall = 0
private

Definition at line 569 of file Player.h.

◆ m_iTeamId

PgeOldNewValue<unsigned int> proofps_dd::Player::m_iTeamId {0}
private

Which team this player belongs to.

Not all game modes use this member. Check the API documentation of the GameMode-derived classes to know more. 0 means no team selected. Intentionally not part of m_vecOldNewValues, does not contribute to isDirty() or isNetDirty() or MsgUserUpdateFromServer either. Handled in MsgPlayerEventFromServer.

Definition at line 496 of file Player.h.

◆ m_mapItemTypeToWeaponFilename

const std::map< proofps_dd::MapItemType, std::string > proofps_dd::Player::m_mapItemTypeToWeaponFilename
staticprivate

◆ m_nConsecutiveWallJump

int proofps_dd::Player::m_nConsecutiveWallJump = 0
private

Definition at line 540 of file Player.h.

◆ m_network

pge_network::PgeINetwork& proofps_dd::Player::m_network
private

Definition at line 522 of file Player.h.

◆ m_nInvulnerabilityDurationSecs

unsigned int proofps_dd::Player::m_nInvulnerabilityDurationSecs = 0
private

Definition at line 503 of file Player.h.

◆ m_nMaxSndPlayerFootstepDurationMillisecs

std::chrono::milliseconds::rep proofps_dd::Player::m_nMaxSndPlayerFootstepDurationMillisecs = 0
staticprivate

Definition at line 430 of file Player.h.

◆ m_nMinTimeBetweenPlayerWalkSoundsMillisecs

std::chrono::milliseconds::rep proofps_dd::Player::m_nMinTimeBetweenPlayerWalkSoundsMillisecs = 0
staticprivate

Definition at line 431 of file Player.h.

◆ m_nParticleEmitPerNthPhysicsIterCntr

int proofps_dd::Player::m_nParticleEmitPerNthPhysicsIterCntr { 0 }
private

Counter to be used by particle emitter logic.

Used by both PGE client and server instances.

Definition at line 623 of file Player.h.

◆ m_nPlayerInstanceCntr

uint32_t proofps_dd::Player::m_nPlayerInstanceCntr = 0
staticprivate

Definition at line 410 of file Player.h.

◆ m_nShotsHitTarget

unsigned int proofps_dd::Player::m_nShotsHitTarget = 0
private

Definition at line 505 of file Player.h.

◆ m_nTicksSinceLastHorizontalCollision

int proofps_dd::Player::m_nTicksSinceLastHorizontalCollision = 0
private

Definition at line 541 of file Player.h.

◆ m_pObj

PureObject3D* proofps_dd::Player::m_pObj = nullptr
private

Definition at line 510 of file Player.h.

◆ m_prevActualStrafe

proofps_dd::Strafe proofps_dd::Player::m_prevActualStrafe = Strafe::NONE
private

Definition at line 609 of file Player.h.

◆ m_pTexPlayerCrouch

PureTexture* proofps_dd::Player::m_pTexPlayerCrouch = nullptr
private

Definition at line 512 of file Player.h.

◆ m_pTexPlayerStand

PureTexture* proofps_dd::Player::m_pTexPlayerStand = nullptr
private

Definition at line 511 of file Player.h.

◆ m_sIpAddress

std::string proofps_dd::Player::m_sIpAddress
private

Definition at line 440 of file Player.h.

◆ m_sName

std::string proofps_dd::Player::m_sName
private

Definition at line 441 of file Player.h.

◆ m_sndArmor

SoLoud::Wav * proofps_dd::Player::m_sndArmor = nullptr
staticprivate

Definition at line 415 of file Player.h.

◆ m_sndFallYell_1

SoLoud::Wav * proofps_dd::Player::m_sndFallYell_1 = nullptr
staticprivate

Definition at line 423 of file Player.h.

◆ m_sndFallYell_2

SoLoud::Wav * proofps_dd::Player::m_sndFallYell_2 = nullptr
staticprivate

Definition at line 424 of file Player.h.

◆ m_sndJetlax

SoLoud::Wav * proofps_dd::Player::m_sndJetlax = nullptr
staticprivate

Definition at line 417 of file Player.h.

◆ m_sndJumppad

SoLoud::Wav * proofps_dd::Player::m_sndJumppad = nullptr
staticprivate

Definition at line 418 of file Player.h.

◆ m_sndMedkit

SoLoud::Wav * proofps_dd::Player::m_sndMedkit = nullptr
staticprivate

Definition at line 416 of file Player.h.

◆ m_sndPlayerDamage

SoLoud::Wav * proofps_dd::Player::m_sndPlayerDamage = nullptr
staticprivate

Definition at line 427 of file Player.h.

◆ m_sndPlayerFootstep

SoLoud::Wav * proofps_dd::Player::m_sndPlayerFootstep = { nullptr }
staticprivate

Definition at line 2784 of file Player.h.

◆ m_sndPlayerFunnyLaughDiedByLanding

SoLoud::Wav * proofps_dd::Player::m_sndPlayerFunnyLaughDiedByLanding = nullptr
staticprivate

Definition at line 429 of file Player.h.

◆ m_sndPlayerItemActivateAntiGravity

SoLoud::Wav * proofps_dd::Player::m_sndPlayerItemActivateAntiGravity = nullptr
staticprivate

Definition at line 419 of file Player.h.

◆ m_sndPlayerItemDeactivateAntiGravity

SoLoud::Wav * proofps_dd::Player::m_sndPlayerItemDeactivateAntiGravity = nullptr
staticprivate

Definition at line 420 of file Player.h.

◆ m_sndPlayerItemHighThrustAntiGravity

SoLoud::Wav * proofps_dd::Player::m_sndPlayerItemHighThrustAntiGravity = nullptr
staticprivate

Definition at line 422 of file Player.h.

◆ m_sndPlayerItemLowThrustAntiGravity

SoLoud::Wav * proofps_dd::Player::m_sndPlayerItemLowThrustAntiGravity = nullptr
staticprivate

Definition at line 421 of file Player.h.

◆ m_sndPlayerLandBigFall

SoLoud::Wav * proofps_dd::Player::m_sndPlayerLandBigFall = nullptr
staticprivate

Definition at line 426 of file Player.h.

◆ m_sndPlayerLandSmallFall

SoLoud::Wav * proofps_dd::Player::m_sndPlayerLandSmallFall = nullptr
staticprivate

Definition at line 425 of file Player.h.

◆ m_sndWpnAmmo

SoLoud::Wav * proofps_dd::Player::m_sndWpnAmmo = nullptr
staticprivate

Definition at line 413 of file Player.h.

◆ m_sndWpnNew

SoLoud::Wav * proofps_dd::Player::m_sndWpnNew = nullptr
staticprivate

Definition at line 414 of file Player.h.

◆ m_strafe

proofps_dd::Strafe proofps_dd::Player::m_strafe = Strafe::NONE
private

Definition at line 608 of file Player.h.

◆ m_strafeSpeed

float proofps_dd::Player::m_strafeSpeed = 0.f
private

Definition at line 615 of file Player.h.

◆ m_timeBootedUp

std::chrono::time_point<std::chrono::steady_clock> proofps_dd::Player::m_timeBootedUp
private

Timestamp of server-side processing of UserNameChangeAndBootupDone (after MsgUserConnectedServerSelf and MsgUserSetupFromServer is already processed.

Definition at line 446 of file Player.h.

◆ m_timeCtor

std::chrono::time_point<std::chrono::steady_clock> proofps_dd::Player::m_timeCtor
private

Definition at line 443 of file Player.h.

◆ m_timeDied

std::chrono::time_point<std::chrono::steady_clock> proofps_dd::Player::m_timeDied
private

Definition at line 499 of file Player.h.

◆ m_timeLastSndPlayerFootstepPlayed

std::chrono::time_point<std::chrono::steady_clock> proofps_dd::Player::m_timeLastSndPlayerFootstepPlayed
private

Definition at line 573 of file Player.h.

◆ m_timeLastStrafe

std::chrono::time_point<std::chrono::steady_clock> proofps_dd::Player::m_timeLastStrafe
private

Definition at line 610 of file Player.h.

◆ m_timeLastToggleRun

std::chrono::time_point<std::chrono::steady_clock> proofps_dd::Player::m_timeLastToggleRun
private

Definition at line 603 of file Player.h.

◆ m_timeLastToggleUseItem

std::chrono::time_point<std::chrono::steady_clock> proofps_dd::Player::m_timeLastToggleUseItem
private

Definition at line 604 of file Player.h.

◆ m_timeLastWillJump

std::chrono::time_point<std::chrono::steady_clock> proofps_dd::Player::m_timeLastWillJump
private

Definition at line 543 of file Player.h.

◆ m_timeStartedFalling

std::chrono::time_point<std::chrono::steady_clock> proofps_dd::Player::m_timeStartedFalling
private

Definition at line 550 of file Player.h.

◆ m_timeStartedInvulnerability

std::chrono::time_point<std::chrono::steady_clock> proofps_dd::Player::m_timeStartedInvulnerability
private

Definition at line 502 of file Player.h.

◆ m_vecAntiGravityForce

PureVector proofps_dd::Player::m_vecAntiGravityForce
private

Definition at line 508 of file Player.h.

◆ m_vecImpactForce

PureVector proofps_dd::Player::m_vecImpactForce
private

Definition at line 507 of file Player.h.

◆ m_vecJumpForce

PureVector proofps_dd::Player::m_vecJumpForce
private

Definition at line 524 of file Player.h.

◆ m_vecOldNewValues

std::map<OldNewValueName, std::variant< PgeOldNewValue<int>, PgeOldNewValue<unsigned int>, PgeOldNewValue<bool>, PgeOldNewValue<TPureFloat>, PgeOldNewValue<PureVector> > > proofps_dd::Player::m_vecOldNewValues
private
Initial value:
= {
{OldNewValueName::OvArmor, PgeOldNewValue<int>(0)},
{OldNewValueName::OvHealth, PgeOldNewValue<int>(0)},
{OldNewValueName::OvFrags, PgeOldNewValue<int>(0)},
{OldNewValueName::OvDeaths, PgeOldNewValue<int>(0)},
{OldNewValueName::OvSuicides, PgeOldNewValue<unsigned int>(0)},
{OldNewValueName::OvFiringAccuracy, PgeOldNewValue<float>(0.f)},
{OldNewValueName::OvShotsFired, PgeOldNewValue<unsigned int>(0)},
{OldNewValueName::OvPos, PgeOldNewValue<PureVector>()},
{OldNewValueName::OvAngleY, PgeOldNewValue<TPureFloat>(0.f)},
{OldNewValueName::OvAngleZ, PgeOldNewValue<TPureFloat>(0.f)},
{OldNewValueName::OvWpnAngle, PgeOldNewValue<PureVector>()},
{OldNewValueName::OvWpnMomentaryAccuracy, PgeOldNewValue<TPureFloat>(0.f) },
{OldNewValueName::OvCrouchInput, PgeOldNewValue<bool>(false)},
{OldNewValueName::OvDescentInput, PgeOldNewValue<bool>(false)},
{OldNewValueName::OvActuallyRunningOnGround, PgeOldNewValue<bool>(false)},
{OldNewValueName::OvInvulnerability, PgeOldNewValue<bool>(true)},
{OldNewValueName::OvJumpInput, PgeOldNewValue<bool>(false)},
{OldNewValueName::OvCurrentInventoryItemPower, PgeOldNewValue<float>(0.f)}
}

Definition at line 460 of file Player.h.

◆ m_wpnMgr

WeaponManager proofps_dd::Player::m_wpnMgr
private

Definition at line 514 of file Player.h.

◆ nPlayersMax

unsigned int proofps_dd::Player::nPlayersMax = 15
staticconstexpr

Definition at line 130 of file Player.h.

◆ nSomersaultTargetDurationMillisecs

unsigned int proofps_dd::Player::nSomersaultTargetDurationMillisecs = 300
staticconstexpr

Definition at line 104 of file Player.h.

◆ nSvDmRespawnDelaySecsDef

unsigned int proofps_dd::Player::nSvDmRespawnDelaySecsDef = 3
staticconstexpr

Definition at line 124 of file Player.h.

◆ nSvDmRespawnInvulnerabilityDelaySecsDef

unsigned int proofps_dd::Player::nSvDmRespawnInvulnerabilityDelaySecsDef = 3
staticconstexpr

Definition at line 127 of file Player.h.

◆ smokeEmitOperValuesHighPowerThrust

auto proofps_dd::Player::smokeEmitOperValuesHighPowerThrust
staticconstexpr
Initial value:
= PFL::std_array_of<Smoke::SmokeEmitOperValues>(
Smoke::SmokeEmitOperValues{ 2.f, 15 },
Smoke::SmokeEmitOperValues{ 2.f, 3 }
)

See explanation of this at Smoke::smokeEmitOperValues.

Definition at line 63 of file Player.h.

◆ smokeEmitOperValuesLowPowerThrust

auto proofps_dd::Player::smokeEmitOperValuesLowPowerThrust
staticconstexpr
Initial value:
= PFL::std_array_of<Smoke::SmokeEmitOperValues>(
Smoke::SmokeEmitOperValues{ 2.f, 15 },
Smoke::SmokeEmitOperValues{ 2.f, 6 }
)

See explanation of this at Smoke::smokeEmitOperValues.

Definition at line 53 of file Player.h.

◆ szCVarClName

char* proofps_dd::Player::szCVarClName = "cl_name"
staticconstexpr

Definition at line 70 of file Player.h.

◆ szCVarPlayersMax

char* proofps_dd::Player::szCVarPlayersMax = "players_max"
staticconstexpr

Definition at line 131 of file Player.h.

◆ szCVarSvDmRespawnDelaySecs

char* proofps_dd::Player::szCVarSvDmRespawnDelaySecs = "sv_dm_respawn_delay"
staticconstexpr

Definition at line 125 of file Player.h.

◆ szCVarSvDmRespawnInvulnerabilityDelaySecs

char* proofps_dd::Player::szCVarSvDmRespawnInvulnerabilityDelaySecs = "sv_dm_respawn_invulnerability_delay"
staticconstexpr

Definition at line 128 of file Player.h.

◆ szCVarSvMovingAffectsAim

char* proofps_dd::Player::szCVarSvMovingAffectsAim = "sv_moving_affects_aim"
staticconstexpr

Definition at line 99 of file Player.h.

◆ szCVarSvSomersaultMidAirAutoCrouch

char* proofps_dd::Player::szCVarSvSomersaultMidAirAutoCrouch = "sv_somersault_mid_air_auto_crouch"
staticconstexpr

Definition at line 101 of file Player.h.

◆ szCVarSvSomersaultMidAirJumpForceMultiplier

char* proofps_dd::Player::szCVarSvSomersaultMidAirJumpForceMultiplier = "sv_somersault_mid_air_jump_force_multiplier"
staticconstexpr

Definition at line 102 of file Player.h.


The documentation for this class was generated from the following files: