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

Detailed Description

Definition at line 40 of file Player.h.

#include <Player.h>

Public Member Functions

CConsole & getConsole () const
 
 Player (pge_audio::PgeAudio &audio, PGEcfgProfiles &cfgProfiles, std::list< Bullet > &bullets, EventLister &eventsItemPickup, EventLister &eventsAmmoChange, PR00FsUltimateRenderingEngine &gfx, pge_network::PgeINetwork &network, const pge_network::PgeNetworkConnectionHandle &connHandle, const std::string &sIpAddress)
 
 ~Player ()
 
 Player (const Player &)
 
Playeroperator= (const Player &)
 
 Player (Player &&)=delete
 
Player && operator= (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 ()
 
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)
 
void updateAudioVisuals (const proofps_dd::Config &config, bool bServer)
 
void show ()
 
void hide ()
 
void setVisibilityState (bool state)
 
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
 
PgeOldNewValue< int > & getDeaths ()
 
const PgeOldNewValue< int > & getDeaths () const
 
bool & getRespawnFlag ()
 
void respawn (bool bMe, const Weapon &wpnDefaultAvailable, bool bServer)
 
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)
 
bool isJumping () const
 
bool canFall () const
 
void setCanFall (bool state)
 
bool isInAir () const
 
bool getHasJustStartedFallingNaturallyInThisTick () const
 
void setHasJustStartedFallingNaturallyInThisTick (bool val)
 
bool getHasJustStartedFallingAfterJumpingStoppedInThisTick () const
 
void setHasJustStartedFallingAfterJumpingStoppedInThisTick (bool val)
 
bool isFalling () const
 
const std::chrono::time_point< std::chrono::steady_clock > & getTimeStartedFalling () const
 
const float getHeightStartedFalling () const
 
bool & getHasJustStoppedJumpingInThisTick ()
 
bool jumpAllowed () const
 
void setJumpAllowed (bool b)
 
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
 
PureVector & getJumpForce ()
 
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 ()
 
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 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 ()
 
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
 
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 handleFallingFromHigh (int iServerScream)
 
void handleLanded (const float &fFallHeight, bool bDamageTaken, bool bDied)
 
void handleTakeNonWeaponItem (const proofps_dd::MapItemType &eMapItemType)
 
void handleTakeWeaponItem (const proofps_dd::MapItemType &eMapItemType, const Weapon &wpnTaken, const bool &bJustBecameAvailable, const int &nAmmoIncrease)
 
void handleJumppadActivated ()
 

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 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 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 = 10.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"
 

Private Types

enum class  OldNewValueName {
  OvArmor , OvHealth , OvFrags , OvDeaths ,
  OvPos , OvAngleY , OvAngleZ , OvWpnAngle ,
  OvWpnMomentaryAccuracy , OvCrouchInput , OvInvulnerability
}
 

Private Member Functions

void BuildPlayerObject (bool blend)
 
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
 
std::map< OldNewValueName, std::variant< PgeOldNewValue< int >, PgeOldNewValue< bool >, PgeOldNewValue< TPureFloat >, PgeOldNewValue< PureVector > > > m_vecOldNewValues
 
bool m_bNetDirty = false
 
std::chrono::time_point< std::chrono::steady_clock > m_timeDied
 
bool m_bRespawn = false
 
std::chrono::time_point< std::chrono::steady_clock > m_timeStartedInvulnerability
 
unsigned int m_nInvulnerabilityDurationSecs = 0
 
PureVector m_vecImpactForce
 
PureObject3D * m_pObj = nullptr
 
PureTexture * m_pTexPlayerStand = nullptr
 
PureTexture * m_pTexPlayerCrouch = nullptr
 
WeaponManager m_wpnMgr
 
pge_audio::PgeAudio & m_audio
 
PGEcfgProfiles & m_cfgProfiles
 
std::list< Bullet > & m_bullets
 
EventListerm_eventsItemPickup
 
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.
 
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
 
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_handleFallYell = 0
 
SoLoud::handle m_handleSndPlayerLandSmallFall = 0
 
SoLoud::handle m_handleSndPlayerLandBigFall = 0
 
SoLoud::handle m_handleSndPlayerDamage = 0
 
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
 
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
 

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_sndJumppad = 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
 

Member Enumeration Documentation

◆ OldNewValueName

enum class proofps_dd::Player::OldNewValueName
strongprivate
Enumerator
OvArmor 
OvHealth 
OvFrags 
OvDeaths 
OvPos 
OvAngleY 
OvAngleZ 
OvWpnAngle 
OvWpnMomentaryAccuracy 
OvCrouchInput 
OvInvulnerability 

Definition at line 282 of file Player.h.

Constructor & Destructor Documentation

◆ Player() [1/3]

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

Definition at line 73 of file Player.cpp.

◆ ~Player()

proofps_dd::Player::~Player ( )

Definition at line 257 of file Player.cpp.

◆ Player() [2/3]

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

Definition at line 162 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 1252 of file Player.cpp.

◆ BuildPlayerObject()

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

Definition at line 1698 of file Player.cpp.

◆ canFall()

bool proofps_dd::Player::canFall ( ) const

Definition at line 700 of file Player.cpp.

◆ canTakeItem()

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

Definition at line 1304 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 466 of file Player.cpp.

◆ die()

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

Definition at line 530 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 930 of file Player.cpp.

◆ doCrouchShared()

void proofps_dd::Player::doCrouchShared ( )

Definition at line 959 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 506 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 974 of file Player.cpp.

◆ doStandupShared()

void proofps_dd::Player::doStandupShared ( )

Definition at line 996 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 30 of file Player.cpp.

◆ getAngleY() [1/2]

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

Definition at line 647 of file Player.cpp.

◆ getAngleY() [2/2]

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

Definition at line 653 of file Player.cpp.

◆ getAngleZ() [1/2]

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

Definition at line 659 of file Player.cpp.

◆ getAngleZ() [2/2]

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

Definition at line 665 of file Player.cpp.

◆ getArmor() [1/2]

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

Definition at line 1720 of file Player.cpp.

◆ getArmor() [2/2]

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

Definition at line 476 of file Player.cpp.

◆ getAttack()

bool & proofps_dd::Player::getAttack ( )

Definition at line 1247 of file Player.cpp.

◆ getConsole()

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

Definition at line 471 of file Player.cpp.

◆ getCrouchInput()

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

Definition at line 881 of file Player.cpp.

◆ getCrouchStateCurrent() [1/2]

bool & proofps_dd::Player::getCrouchStateCurrent ( )

Definition at line 887 of file Player.cpp.

◆ getCrouchStateCurrent() [2/2]

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

Definition at line 892 of file Player.cpp.

◆ getDeaths() [1/2]

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

Definition at line 567 of file Player.cpp.

◆ getDeaths() [2/2]

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

Definition at line 573 of file Player.cpp.

◆ getFrags() [1/2]

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

Definition at line 1292 of file Player.cpp.

◆ getFrags() [2/2]

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

Definition at line 1298 of file Player.cpp.

◆ getGravity()

float proofps_dd::Player::getGravity ( ) const

Definition at line 682 of file Player.cpp.

◆ getHasJustStartedFallingAfterJumpingStoppedInThisTick()

bool proofps_dd::Player::getHasJustStartedFallingAfterJumpingStoppedInThisTick ( ) const

Definition at line 737 of file Player.cpp.

◆ getHasJustStartedFallingNaturallyInThisTick()

bool proofps_dd::Player::getHasJustStartedFallingNaturallyInThisTick ( ) const

Definition at line 719 of file Player.cpp.

◆ getHasJustStoppedJumpingInThisTick()

bool & proofps_dd::Player::getHasJustStoppedJumpingInThisTick ( )

Definition at line 768 of file Player.cpp.

◆ getHealth() [1/2]

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

Definition at line 1726 of file Player.cpp.

◆ getHealth() [2/2]

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

Definition at line 486 of file Player.cpp.

◆ getHeightStartedFalling()

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

Definition at line 763 of file Player.cpp.

◆ getImpactForce()

PureVector & proofps_dd::Player::getImpactForce ( )

Definition at line 525 of file Player.cpp.

◆ getInvulnerability()

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

Definition at line 316 of file Player.cpp.

◆ getInvulnerabilityDurationSeconds()

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

Definition at line 338 of file Player.cpp.

◆ getIpAddress()

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

Definition at line 301 of file Player.cpp.

◆ getJumpForce()

PureVector & proofps_dd::Player::getJumpForce ( )

Definition at line 876 of file Player.cpp.

◆ getLoggerModuleName()

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

Definition at line 25 of file Player.cpp.

◆ getName()

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

Definition at line 306 of file Player.cpp.

◆ getObject3D()

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

Definition at line 677 of file Player.cpp.

◆ getPos() [1/2]

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

Definition at line 625 of file Player.cpp.

◆ getPos() [2/2]

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

Definition at line 631 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 1214 of file Player.cpp.

◆ getProposedNewPosYforStandup()

float proofps_dd::Player::getProposedNewPosYforStandup ( ) const

Definition at line 912 of file Player.cpp.

◆ getRespawnFlag()

bool & proofps_dd::Player::getRespawnFlag ( )

Definition at line 579 of file Player.cpp.

◆ getServerSideConnectionHandle()

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

Definition at line 296 of file Player.cpp.

◆ getSomersaultAngle()

float proofps_dd::Player::getSomersaultAngle ( ) const

Definition at line 1122 of file Player.cpp.

◆ getStrafe()

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

Definition at line 1188 of file Player.cpp.

◆ getStrafeSpeed()

float & proofps_dd::Player::getStrafeSpeed ( )

Definition at line 1224 of file Player.cpp.

◆ getTimeBootedUp()

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

Definition at line 276 of file Player.cpp.

◆ getTimeConstructed()

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

Definition at line 271 of file Player.cpp.

◆ getTimeDied()

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

Definition at line 562 of file Player.cpp.

◆ getTimeInvulnerabilityStarted()

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

Definition at line 343 of file Player.cpp.

◆ getTimeLastActualStrafe()

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

Definition at line 1219 of file Player.cpp.

◆ getTimeLastSetWillJump()

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

Definition at line 871 of file Player.cpp.

◆ getTimeLastToggleRun()

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

Definition at line 1183 of file Player.cpp.

◆ getTimeStartedFalling()

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

Definition at line 758 of file Player.cpp.

◆ getWantToStandup()

bool & proofps_dd::Player::getWantToStandup ( )

Definition at line 907 of file Player.cpp.

◆ getWeaponAngle()

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

Definition at line 671 of file Player.cpp.

◆ getWeaponInstanceByMapItemType() [1/2]

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

Definition at line 1444 of file Player.cpp.

◆ getWeaponInstanceByMapItemType() [2/2]

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

Definition at line 1414 of file Player.cpp.

◆ getWeaponManager() [1/2]

WeaponManager & proofps_dd::Player::getWeaponManager ( )

Definition at line 399 of file Player.cpp.

◆ getWeaponManager() [2/2]

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

Definition at line 404 of file Player.cpp.

◆ getWeaponMomentaryAccuracy() [1/2]

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

Definition at line 1732 of file Player.cpp.

◆ getWeaponMomentaryAccuracy() [2/2]

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

Definition at line 1275 of file Player.cpp.

◆ getWillJumpXInNextTick()

float proofps_dd::Player::getWillJumpXInNextTick ( ) const

Definition at line 840 of file Player.cpp.

◆ getWillJumpYInNextTick()

float proofps_dd::Player::getWillJumpYInNextTick ( ) const

Definition at line 845 of file Player.cpp.

◆ getWillSomersaultInNextTick()

bool proofps_dd::Player::getWillSomersaultInNextTick ( ) const

Definition at line 1006 of file Player.cpp.

◆ handleFallingFromHigh()

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

Definition at line 1450 of file Player.cpp.

◆ handleJumppadActivated()

void proofps_dd::Player::handleJumppadActivated ( )

Definition at line 1645 of file Player.cpp.

◆ handleLanded()

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

Definition at line 1514 of file Player.cpp.

◆ handleTakeNonWeaponItem()

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

Definition at line 1571 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 1612 of file Player.cpp.

◆ hide()

void proofps_dd::Player::hide ( )

Definition at line 385 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 413 of file Player.cpp.

◆ isExpectingAfterBootUpDelayedUpdate()

bool proofps_dd::Player::isExpectingAfterBootUpDelayedUpdate ( ) const

Definition at line 286 of file Player.cpp.

◆ isFalling()

bool proofps_dd::Player::isFalling ( ) const

Definition at line 753 of file Player.cpp.

◆ isInAir()

bool proofps_dd::Player::isInAir ( ) const

Definition at line 714 of file Player.cpp.

◆ isJumping()

bool proofps_dd::Player::isJumping ( ) const

Definition at line 695 of file Player.cpp.

◆ isJumpingInitiatedFromCrouching()

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

Definition at line 897 of file Player.cpp.

◆ isJumpInitiatedByJumppad()

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

Definition at line 902 of file Player.cpp.

◆ isJustCreatedAndExpectingStartPos()

bool proofps_dd::Player::isJustCreatedAndExpectingStartPos ( ) const

Definition at line 637 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/late by 1 frame is not a problem.

Returns
True if player is considered to be moving based on previous or current frame data, false otherwise.

Definition at line 1239 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 457 of file Player.cpp.

◆ isRunning()

bool proofps_dd::Player::isRunning ( ) const

Definition at line 1172 of file Player.cpp.

◆ isSomersaulting()

bool proofps_dd::Player::isSomersaulting ( ) const

Definition at line 1117 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 be 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 792 of file Player.cpp.

◆ jumpAllowed()

bool proofps_dd::Player::jumpAllowed ( ) const

Definition at line 773 of file Player.cpp.

◆ operator=() [1/2]

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

Definition at line 210 of file Player.cpp.

◆ operator=() [2/2]

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

◆ resetSomersaultServer()

void proofps_dd::Player::resetSomersaultServer ( )

Definition at line 1166 of file Player.cpp.

◆ respawn()

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

Definition at line 584 of file Player.cpp.

◆ setArmor()

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

Definition at line 482 of file Player.cpp.

◆ setCanFall()

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

Definition at line 705 of file Player.cpp.

◆ setExpectingAfterBootUpDelayedUpdate()

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

Definition at line 291 of file Player.cpp.

◆ setGravity()

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

Definition at line 687 of file Player.cpp.

◆ setHasJustStartedFallingAfterJumpingStoppedInThisTick()

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

Definition at line 742 of file Player.cpp.

◆ setHasJustStartedFallingNaturallyInThisTick()

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

Definition at line 724 of file Player.cpp.

◆ setHealth()

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

Definition at line 492 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 331 of file Player.cpp.

◆ setJumpAllowed()

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

Definition at line 777 of file Player.cpp.

◆ setJustCreatedAndExpectingStartPos()

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

Definition at line 642 of file Player.cpp.

◆ setName()

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

Definition at line 311 of file Player.cpp.

◆ setRun()

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

Definition at line 1177 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 1112 of file Player.cpp.

◆ setStrafe()

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

Definition at line 1193 of file Player.cpp.

◆ setTimeBootedUp()

void proofps_dd::Player::setTimeBootedUp ( )

Definition at line 281 of file Player.cpp.

◆ setVisibilityState()

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

Definition at line 390 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 1285 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 can 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 859 of file Player.cpp.

◆ setWillSomersaultInNextTick()

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

Definition at line 1011 of file Player.cpp.

◆ show()

void proofps_dd::Player::show ( )

Definition at line 380 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 1024 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 1134 of file Player.cpp.

◆ stopJumping()

void proofps_dd::Player::stopJumping ( )

Definition at line 836 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 1335 of file Player.cpp.

◆ updateAudioVisuals()

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

Definition at line 348 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 430 of file Player.cpp.

Member Data Documentation

◆ fBaseSpeedCrouch

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

Definition at line 53 of file Player.h.

◆ fBaseSpeedRun

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

Definition at line 52 of file Player.h.

◆ fBaseSpeedWalk

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

Definition at line 51 of file Player.h.

◆ fJumpGravityStartFromCrouching

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

Definition at line 69 of file Player.h.

◆ fJumpGravityStartFromStanding

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

Definition at line 66 of file Player.h.

◆ fObjHeightCrouchScaling

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

Definition at line 48 of file Player.h.

◆ fObjHeightStanding

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

Definition at line 47 of file Player.h.

◆ fObjWidth

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

Definition at line 46 of file Player.h.

◆ fSomersaultGroundImpactForceX

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

Definition at line 94 of file Player.h.

◆ fSomersaultMidAirJumpForceMultiplierDef

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

Definition at line 83 of file Player.h.

◆ fSomersaultMidAirJumpForceMultiplierMax

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

Definition at line 82 of file Player.h.

◆ fSomersaultMidAirJumpForceMultiplierMin

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

Definition at line 81 of file Player.h.

◆ m_audio

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

Definition at line 365 of file Player.h.

◆ m_bAllowJump

bool proofps_dd::Player::m_bAllowJump = false
private

Definition at line 376 of file Player.h.

◆ m_bAttack

bool proofps_dd::Player::m_bAttack = false
private

Definition at line 450 of file Player.h.

◆ m_bCanFall

bool proofps_dd::Player::m_bCanFall = true
private

Definition at line 388 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 415 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 419 of file Player.h.

◆ m_bExpectingAfterBootUpDelayedUpdate

bool proofps_dd::Player::m_bExpectingAfterBootUpDelayedUpdate = true
private

Definition at line 327 of file Player.h.

◆ m_bFalling

bool proofps_dd::Player::m_bFalling = true
private

Definition at line 389 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 401 of file Player.h.

◆ m_bHasJustStartedFallingAfterJumpingStopped

bool proofps_dd::Player::m_bHasJustStartedFallingAfterJumpingStopped = false
private

Definition at line 391 of file Player.h.

◆ m_bHasJustStartedFallingNaturally

bool proofps_dd::Player::m_bHasJustStartedFallingNaturally = true
private

Definition at line 390 of file Player.h.

◆ m_bHasJustStoppedJumping

bool proofps_dd::Player::m_bHasJustStoppedJumping = false
private

Definition at line 394 of file Player.h.

◆ m_bJumping

bool proofps_dd::Player::m_bJumping = false
private

Definition at line 375 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 422 of file Player.h.

◆ m_bJustCreatedAndExpectingStartPos

bool proofps_dd::Player::m_bJustCreatedAndExpectingStartPos = true
private

Definition at line 440 of file Player.h.

◆ m_bNetDirty

bool proofps_dd::Player::m_bNetDirty = false
private

Definition at line 352 of file Player.h.

◆ m_bRespawn

bool proofps_dd::Player::m_bRespawn = false
private

Definition at line 354 of file Player.h.

◆ m_bRunning

bool proofps_dd::Player::m_bRunning = true
private

Definition at line 437 of file Player.h.

◆ m_bullets

std::list<Bullet>& proofps_dd::Player::m_bullets
private

Definition at line 367 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 432 of file Player.h.

◆ m_bWillSomersault

bool proofps_dd::Player::m_bWillSomersault = false
private

Definition at line 434 of file Player.h.

◆ m_cfgProfiles

PGEcfgProfiles& proofps_dd::Player::m_cfgProfiles
private

Definition at line 366 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 312 of file Player.h.

◆ m_eventsAmmoChange

EventLister& proofps_dd::Player::m_eventsAmmoChange
private

Definition at line 369 of file Player.h.

◆ m_eventsItemPickup

EventLister& proofps_dd::Player::m_eventsItemPickup
private

Definition at line 368 of file Player.h.

◆ m_fGravity

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

Definition at line 374 of file Player.h.

◆ m_fHeightStartedFalling

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

Definition at line 393 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 435 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 380 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 386 of file Player.h.

◆ m_gfx

PR00FsUltimateRenderingEngine& proofps_dd::Player::m_gfx
private

Definition at line 370 of file Player.h.

◆ m_handleFallYell

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

Definition at line 405 of file Player.h.

◆ m_handleSndPlayerDamage

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

Definition at line 408 of file Player.h.

◆ m_handleSndPlayerLandBigFall

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

Definition at line 407 of file Player.h.

◆ m_handleSndPlayerLandSmallFall

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

Definition at line 406 of file Player.h.

◆ m_mapItemTypeToWeaponFilename

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

◆ m_network

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

Definition at line 371 of file Player.h.

◆ m_nInvulnerabilityDurationSecs

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

Definition at line 356 of file Player.h.

◆ m_nPlayerInstanceCntr

uint32_t proofps_dd::Player::m_nPlayerInstanceCntr = 0
staticprivate

Definition at line 298 of file Player.h.

◆ m_pObj

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

Definition at line 360 of file Player.h.

◆ m_prevActualStrafe

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

Definition at line 443 of file Player.h.

◆ m_pTexPlayerCrouch

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

Definition at line 362 of file Player.h.

◆ m_pTexPlayerStand

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

Definition at line 361 of file Player.h.

◆ m_sIpAddress

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

Definition at line 319 of file Player.h.

◆ m_sName

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

Definition at line 320 of file Player.h.

◆ m_sndArmor

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

Definition at line 303 of file Player.h.

◆ m_sndFallYell_1

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

Definition at line 306 of file Player.h.

◆ m_sndFallYell_2

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

Definition at line 307 of file Player.h.

◆ m_sndJumppad

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

Definition at line 305 of file Player.h.

◆ m_sndMedkit

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

Definition at line 304 of file Player.h.

◆ m_sndPlayerDamage

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

Definition at line 310 of file Player.h.

◆ m_sndPlayerLandBigFall

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

Definition at line 309 of file Player.h.

◆ m_sndPlayerLandSmallFall

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

Definition at line 308 of file Player.h.

◆ m_sndWpnAmmo

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

Definition at line 301 of file Player.h.

◆ m_sndWpnNew

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

Definition at line 302 of file Player.h.

◆ m_strafe

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

Definition at line 442 of file Player.h.

◆ m_strafeSpeed

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

Definition at line 448 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 325 of file Player.h.

◆ m_timeCtor

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

Definition at line 322 of file Player.h.

◆ m_timeDied

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

Definition at line 353 of file Player.h.

◆ m_timeLastStrafe

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

Definition at line 444 of file Player.h.

◆ m_timeLastToggleRun

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

Definition at line 438 of file Player.h.

◆ m_timeLastWillJump

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

Definition at line 387 of file Player.h.

◆ m_timeStartedFalling

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

Definition at line 392 of file Player.h.

◆ m_timeStartedInvulnerability

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

Definition at line 355 of file Player.h.

◆ m_vecImpactForce

PureVector proofps_dd::Player::m_vecImpactForce
private

Definition at line 358 of file Player.h.

◆ m_vecJumpForce

PureVector proofps_dd::Player::m_vecJumpForce
private

Definition at line 373 of file Player.h.

◆ m_vecOldNewValues

std::map<OldNewValueName, std::variant< PgeOldNewValue<int>, PgeOldNewValue<bool>, PgeOldNewValue<TPureFloat>, PgeOldNewValue<PureVector> > > proofps_dd::Player::m_vecOldNewValues
private
Initial value:

Definition at line 335 of file Player.h.

◆ m_wpnMgr

WeaponManager proofps_dd::Player::m_wpnMgr
private

Definition at line 364 of file Player.h.

◆ nSomersaultTargetDurationMillisecs

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

Definition at line 76 of file Player.h.

◆ nSvDmRespawnDelaySecsDef

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

Definition at line 96 of file Player.h.

◆ nSvDmRespawnInvulnerabilityDelaySecsDef

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

Definition at line 99 of file Player.h.

◆ szCVarClName

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

Definition at line 44 of file Player.h.

◆ szCVarSvDmRespawnDelaySecs

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

Definition at line 97 of file Player.h.

◆ szCVarSvDmRespawnInvulnerabilityDelaySecs

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

Definition at line 100 of file Player.h.

◆ szCVarSvMovingAffectsAim

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

Definition at line 71 of file Player.h.

◆ szCVarSvSomersaultMidAirAutoCrouch

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

Definition at line 73 of file Player.h.

◆ szCVarSvSomersaultMidAirJumpForceMultiplier

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

Definition at line 74 of file Player.h.


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