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

Detailed Description

Definition at line 44 of file WeaponHandling.h.

#include <WeaponHandling.h>

+ Inheritance diagram for proofps_dd::WeaponHandling:

Public Member Functions

CConsole & getConsole () const
 
 WeaponHandling (PGE &pge, proofps_dd::Config &config, proofps_dd::Durations &durations, proofps_dd::GUI &gui, std::map< pge_network::PgeNetworkConnectionHandle, proofps_dd::Player > &mapPlayers, proofps_dd::Maps &maps, proofps_dd::Sounds &sounds, proofps_dd::CameraHandling &camera)
 
 WeaponHandling (const WeaponHandling &)=delete
 
WeaponHandlingoperator= (const WeaponHandling &)=delete
 
 WeaponHandling (WeaponHandling &&)=delete
 
WeaponHandling && operator= (WeaponHandling &&)=delete
 
bool initializeWeaponHandling (PGEcfgProfiles &cfgProfiles)
 
void handleCurrentPlayersCurrentWeaponBulletCountsChangeShared (const Player &player, Weapon &wpnCurrent, const TPureUInt &nOldMagCount, const TPureUInt &nNewMagCount, const TPureUInt &nOldUnmagCount, const TPureUInt &nNewUnmagCount, const Weapon::State &oldState, const Weapon::State &newState)
 
const bool & getWeaponAutoReloadRequest () const
 
void clearWeaponAutoReloadRequest ()
 
void scheduleWeaponAutoReloadRequest ()
 
const bool & getWeaponAutoSwitchToBestLoadedRequest () const
 
void clearWeaponAutoSwitchToBestLoadedRequest ()
 
void scheduleWeaponAutoSwitchToBestLoadedRequest ()
 
const bool & getWeaponAutoSwitchToBestWithAnyKindOfAmmoRequest () const
 
void clearWeaponAutoSwitchToBestWithAnyKindOfAmmoRequest ()
 
void scheduleWeaponAutoSwitchToBestWithAnyKindOfAmmoRequest ()
 
Weapon * getWeaponPickupInducedAutoSwitchRequest () const
 
void clearWeaponPickupInducedAutoSwitchRequest ()
 
void scheduleWeaponPickupInducedAutoSwitchRequest (Weapon *wpn)
 
PgeObjectPool< Smoke > & getSmokePool ()
 
const PgeObjectPool< Smoke > & getSmokePool () const
 

Static Public Member Functions

static const char * getLoggerModuleName ()
 

Protected Member Functions

void deleteWeaponHandlingAll (const bool &bDeallocBullets)
 
void serverUpdateWeapons (proofps_dd::GameMode &gameMode)
 
void serverDeleteAllBulletsNow (proofps_dd::GameMode &gameMode, XHair &xhair, PureVector &vecCamShakeForce)
 
void serverUpdateBulletsAndHandleHittingWallsAndPlayers (proofps_dd::GameMode &gameMode, XHair &xhair, const unsigned int &nPhysicsRate, PureVector &vecCamShakeForce)
 
void serverHandleBulletsVsBullets (proofps_dd::GameMode &gameMode, XHair &xhair, const unsigned int &nPhysicsRate, PureVector &vecCamShakeForce)
 This function does not update bullet positions, it expects up-to-date bullet positions.
 
void clientUpdateBullets (const unsigned int &nPhysicsRate)
 
void serverUpdateExplosions (proofps_dd::GameMode &gameMode, const unsigned int &nPhysicsRate)
 
void clientUpdateExplosions (proofps_dd::GameMode &gameMode, const unsigned int &nPhysicsRate)
 
void updateSmokes (proofps_dd::GameMode &gameMode, const unsigned int &nPhysicsRate)
 
bool handleBulletUpdateFromServer (pge_network::PgeNetworkConnectionHandle connHandleServerSide, const proofps_dd::MsgBulletUpdateFromServer &msg, PureVector &vecCamShakeForce)
 
bool handleWpnUpdateFromServer (pge_network::PgeNetworkConnectionHandle connHandleServerSide, const proofps_dd::MsgWpnUpdateFromServer &msg)
 
bool handleWpnUpdateCurrentFromServer (pge_network::PgeNetworkConnectionHandle connHandleServerSide, const proofps_dd::MsgCurrentWpnUpdateFromServer &msg)
 
void handleCurrentPlayersCurrentWeaponStateChangeShared (const Player &player, Weapon &wpnCurrent, const Weapon::State &oldState, const Weapon::State &newState, const TPureUInt &nMagCount, const TPureUInt &nUnmagCount)
 
void handleAutoSwitchUponWeaponPickupShared (const Player &player, Weapon &wpnCurrent, Weapon &wpnPicked, const bool &bHasJustBecomeAvailable)
 This function was made specifically for deciding if we initiate auto-switch upon picking up a weapon.
 
- Protected Member Functions inherited from proofps_dd::Physics
void serverSetAllowStrafeMidAir (bool bAllow)
 
void serverSetAllowStrafeMidAirFull (bool bAllow)
 
void serverSetFallDamageMultiplier (int n)
 
void serverSetCollisionModeBvh (bool state)
 
void serverGravity (XHair &xhair, const unsigned int &nPhysicsRate, proofps_dd::GameMode &gameMode)
 
void serverPlayerCollisionWithWalls (const unsigned int &nPhysicsRate, XHair &xhair, proofps_dd::GameMode &gameMode, PureVector &vecCamShakeForce)
 
CConsole & getConsole () const
 
 Physics (PGE &pge, proofps_dd::Durations &durations, proofps_dd::GUI &gui, std::map< pge_network::PgeNetworkConnectionHandle, proofps_dd::Player > &mapPlayers, proofps_dd::Maps &maps, proofps_dd::Sounds &sounds, proofps_dd::CameraHandling &camera)
 
 Physics (const Physics &)=delete
 
Physicsoperator= (const Physics &)=delete
 
 Physics (Physics &&)=delete
 
Physics && operator= (Physics &&)=delete
 
- Protected Member Functions inherited from proofps_dd::PlayerHandling
bool hasPlayerBootedUp (const pge_network::PgeNetworkConnectionHandle &connHandle) const
 
void handlePlayerDied (Player &player, XHair &xhair, const pge_network::PgeNetworkConnectionHandle &nKillerConnHandleServerSide)
 
void handlePlayerRespawned (Player &player, XHair &xhair)
 
void serverRespawnPlayer (Player &player, const proofps_dd::GameRestartType_KeepPlayers &eRestartType, const proofps_dd::Config &config, PGEcfgProfiles &cfgProfiles)
 Respawn is required when either a game is started, restarted, or a dead player needs to be revived.
 
void serverResettlePlayer (Player &player, const proofps_dd::Config &config)
 Resettle is required when a round-based game starts a new round, and we need to reposition alive players back to spawn points.
 
void serverUpdateRespawnTimers (const proofps_dd::Config &config, PGEcfgProfiles &cfgProfiles, proofps_dd::GameMode &gameMode, proofps_dd::Durations &durations)
 
void handlePlayerTeamIdChangedOrToggledSpectatorMode (Player &player, const unsigned int &iTeamId, const bool &bToggledSpectatorMode, const proofps_dd::Config &config, PGEcfgProfiles &cfgProfiles)
 
void handleExplosionMultiKill (int nPlayersDiedByExplosion)
 
void writePlayerList ()
 
bool handleUserConnected (pge_network::PgeNetworkConnectionHandle connHandleServerSide, const pge_network::MsgUserConnectedServerSelf &msg, PGEcfgProfiles &cfgProfiles, proofps_dd::Config &config, std::function< void(int)> &cbDisplayMapLoadingProgressUpdate)
 
bool handleUserDisconnected (pge_network::PgeNetworkConnectionHandle connHandleServerSide, const pge_network::MsgUserDisconnectedFromServer &msg, proofps_dd::GameMode &gameMode)
 
bool handleUserNameChange (pge_network::PgeNetworkConnectionHandle connHandleServerSide, const proofps_dd::MsgUserNameChangeAndBootupDone &msg, proofps_dd::Config &config, PGEcfgProfiles &cfgProfiles)
 
void resetSendClientUpdatesCounter (proofps_dd::Config &config)
 
void serverUpdatePlayersOldValues (proofps_dd::Config &config, PgeObjectPool< proofps_dd::Smoke > &smokes)
 
void serverSendUserUpdates (PGEcfgProfiles &cfgProfiles, proofps_dd::Config &config, proofps_dd::Durations &durations, proofps_dd::GameMode &gameMode)
 
bool handleUserUpdateFromServer (pge_network::PgeNetworkConnectionHandle connHandleServerSide, const proofps_dd::MsgUserUpdateFromServer &msg, XHair &xhair, const proofps_dd::Config &config, proofps_dd::GameMode &gameMode, PgeObjectPool< proofps_dd::Smoke > &smokes)
 
bool handleDeathNotificationFromServer (pge_network::PgeNetworkConnectionHandle nDeadConnHandleServerSide, const proofps_dd::MsgDeathNotificationFromServer &msg, proofps_dd::GameMode &gameMode)
 
bool handlePlayerEventFromServer (pge_network::PgeNetworkConnectionHandle connHandleServerSide, const proofps_dd::MsgPlayerEventFromServer &msg, PureVector &vecCamShakeForce, const proofps_dd::Config &config, PGEcfgProfiles &cfgProfiles)
 
bool serverHandleUserInGameMenuCmd (pge_network::PgeNetworkConnectionHandle connHandleServerSide, const proofps_dd::MsgUserInGameMenuCmd &msg, const proofps_dd::Config &config, PGEcfgProfiles &cfgProfiles)
 
void updatePlayersVisuals (const proofps_dd::Config &config, proofps_dd::GameMode &gameMode)
 Invoked in every frame by all instances.
 
CConsole & getConsole () const
 
 PlayerHandling (PGE &pge, proofps_dd::Durations &durations, proofps_dd::GUI &gui, std::map< pge_network::PgeNetworkConnectionHandle, proofps_dd::Player > &mapPlayers, proofps_dd::Maps &maps, proofps_dd::Sounds &sounds, proofps_dd::CameraHandling &camera)
 
 PlayerHandling (const PlayerHandling &)=delete
 
PlayerHandlingoperator= (const PlayerHandling &)=delete
 
 PlayerHandling (PlayerHandling &&)=delete
 
PlayerHandling && operator= (PlayerHandling &&)=delete
 
- Protected Member Functions inherited from proofps_dd::Networking
void allowListAppMessages ()
 
 Networking (PGE &pge, proofps_dd::Durations &durations)
 
 Networking (const Networking &)=delete
 
Networkingoperator= (const Networking &)=delete
 
 Networking (Networking &&)=delete
 
Networking && operator= (Networking &&)=delete
 
CConsole & getConsole () const
 
bool isMyConnection (const pge_network::PgeNetworkConnectionHandle &connHandleServerSide) const
 
const pge_network::PgeNetworkConnectionHandle & getMyServerSideConnectionHandle () const
 
bool reinitializeNetworking ()
 
bool isServer () const
 

Private Member Functions

blIteratorAPI::blRawArrayWrapper< PooledBullet >::iterator deleteBulletServer (PgeObjectPool< PooledBullet > &bullets, blIteratorAPI::blRawArrayWrapper< PooledBullet >::iterator itBullet, const bool &bPlayerHit, const bool &bWallHit, XHair &xhair, PureVector &vecCamShakeForce, proofps_dd::GameMode &gameMode, const bool &bEndGame)
 
float getDamageAndImpactForceAtDistance (const Player &player, const Explosion &xpl, const Bullet::DamageAreaEffect &eDamageAreaEffect, const TPureFloat &fDamageAreaPulse, int &nDamageAp, const int &nDamageHp, PureVector &vecImpactForce)
 
ExplosioncreateExplosionServer (const PooledBullet &causedByBullet, const pge_network::PgeNetworkConnectionHandle &connHandle, const PureVector &pos, const TPureFloat &fDamageAreaSize, const Bullet::DamageAreaEffect &eDamageAreaEffect, const TPureFloat &fDamageAreaPulse, const std::string &sExplosionGfxObjFilename, const int &nDamageAp, const int &nDamageHp, XHair &xhair, PureVector &vecCamShakeForce, proofps_dd::GameMode &gameMode)
 
ExplosioncreateExplosionClient (const proofps_dd::Explosion::ExplosionId &id, const pge_network::PgeNetworkConnectionHandle &connHandle, const PureVector &pos, const int &nDamageHp, const TPureFloat &fDamageAreaSize, const Bullet::DamageAreaEffect &eDamageAreaEffect, const TPureFloat &fDamageAreaPulse, const std::string &sExplosionGfxObjFilename, PureVector &vecCamShakeForce)
 
bool isBulletOutOfMapBounds (const Bullet &bullet) const
 
Weapon * getWeaponByIdFromAnyPlayersWeaponManager (const WeaponId &wpnId)
 
void play3dMeleeWeaponHitSound (const WeaponId &wpnId, const float &posX, const float &posY, const float &posZ, const proofps_dd::MsgBulletUpdateFromServer::BulletDelete &hitType)
 
void play3dMeleeWeaponHitSound (const WeaponId &wpnId, const PureVector &posVec, const proofps_dd::MsgBulletUpdateFromServer::BulletDelete &hitType)
 
void play3dMeleeWeaponHitSound (const Bullet &bullet, const proofps_dd::MsgBulletUpdateFromServer::BulletDelete &hitType)
 
void play3dBulletBounceSound (const Bullet &bullet)
 
bool canBulletHitPerFriendlyFireConfig (const Player &playerHit, const std::map< pge_network::PgeNetworkConnectionHandle, proofps_dd::Player >::iterator &itShooter) const
 
bool canBulletHitPerFriendlyFireConfig (const std::map< pge_network::PgeNetworkConnectionHandle, proofps_dd::Player >::iterator &itPlayerHit, const std::map< pge_network::PgeNetworkConnectionHandle, proofps_dd::Player >::iterator &itShooter) const
 
bool shallShooterFragsDecreasedDueToFriendlyFireIfItIsFriendlyFire (const Player &playerHit, const Player &playerShooter) const
 
bool sharedUpdateBouncingBullets (const bool &bCollisionModeBvh, PooledBullet &bullet, const PurePosUpTarget &oldPut, const float &fBulletPosX, const float &fBulletPosY, const float &fBulletScaledSizeX, const float &fBulletScaledSizeY, const unsigned int &nPhysicsRate, const float &fFallGravityMin)
 Bouncing bullet physics are simulated on both server- and client-side, this way server still does not need to update clients about bullet positions continuously.
 
bool sharedUpdateRicochetingBullets (const bool &bCollisionModeBvh, PooledBullet &bullet, const PurePosUpTarget &oldPut, const float &fBulletPosX, const float &fBulletPosY, const float &fBulletScaledSizeX, const float &fBulletScaledSizeY, const unsigned int &nPhysicsRate, const float &fFallGravityMin)
 Ricocheting bullet physics are simulated on both server- and client-side, this way server still does not need to update clients about bullet positions continuously.
 
void emitParticles (PooledBullet &bullet)
 
const PureObject3D * sharedUpdateBullets_collisionWithWalls_legacy (const PooledBullet &bullet, const float &fBulletPosX, const float &fBulletPosY, const float &fBulletScaledSizeX, const float &fBulletScaledSizeY)
 Used before v0.5.
 
const PureObject3D * sharedUpdateBullets_collisionWithWalls_bvh (const float &fBulletPosX, const float &fBulletPosY, const float &fBulletPosZ, const float &fBulletScaledSizeX, const float &fBulletScaledSizeY, const float &fBulletScaledSizeZ)
 Used from v0.5.
 

Static Private Member Functions

static float getDamageAndImpactForceAtDistance (const float &fNearObjX, const float &fNearObjY, const float &fNearObjRealSizeX, const float &fNearObjRealSizeY, const Explosion &xpl, const Bullet::DamageAreaEffect &eDamageAreaEffect, const TPureFloat &fDamageAreaPulse, int &nDamageAp, const int &nDamageHp, PureVector &vecImpactForce)
 

Private Attributes

PGE & m_pge
 
proofps_dd::Configm_config
 
proofps_dd::Durationsm_durations
 
proofps_dd::GUIm_gui
 
std::map< pge_network::PgeNetworkConnectionHandle, proofps_dd::Player > & m_mapPlayers
 
proofps_dd::Mapsm_maps
 
proofps_dd::Soundsm_sounds
 
SoLoud::handle m_sndWpnReloadStartHandle
 
SoLoud::handle m_sndWpnReloadEndHandle
 
std::list< Explosionm_explosions
 
PgeObjectPool< Smokem_smokes
 
bool m_bWpnAutoReloadRequest = false
 
bool m_bWpnAutoSwitchToBestLoadedRequest = false
 
bool m_bWpnAutoSwitchToBestWithAnyKindOfAmmoRequest = false
 
Weapon * m_pWpnAutoSwitchWhenPickedUp = nullptr
 

Additional Inherited Members

- Static Protected Member Functions inherited from proofps_dd::Physics
static const char * getLoggerModuleName ()
 
static bool colliding (const PureObject3D &a, const PureObject3D &b)
 
static bool colliding_NoZ (const PureObject3D &a, const PureObject3D &b)
 
static bool colliding2 (float o1px, float o1py, float o1pz, float o1sx, float o1sy, float o1sz, float o2px, float o2py, float o2pz, float o2sx, float o2sy, float o2sz)
 
static bool colliding2_NoZ (float o1px, float o1py, float o1sx, float o1sy, float o2px, float o2py, float o2sx, float o2sy)
 
static bool colliding3 (const PureVector &vecPosMin, const PureVector &vecPosMax, const PureVector &vecObjPos, const PureVector &vecObjSize)
 
static float distance_NoZ (float o1px, float o1py, float o2px, float o2py)
 
static float distance_NoZ (float o1px, float o1py, float o1sx, float o1sy, float o2px, float o2py)
 
static float distance_NoZ_with_distancePerAxis (float o1px, float o1py, float o1sx, float o1sy, float o2px, float o2py, PureVector &vDirPerAxis, PureVector &vDistancePerAxis)
 
- Static Protected Member Functions inherited from proofps_dd::PlayerHandling
static const char * getLoggerModuleName ()
 
- Static Protected Member Functions inherited from proofps_dd::Networking
static const char * getLoggerModuleName ()
 
- Protected Attributes inherited from proofps_dd::Networking
pge_network::PgeNetworkConnectionHandle m_nServerSideConnectionHandle
 Server-side connection handle received from server in PgePktUserConnected (server instance also receives this from itself).
 
- Static Protected Attributes inherited from proofps_dd::Networking
static constexpr char * szCVarClServerIp = "cl_server_ip"
 

Constructor & Destructor Documentation

◆ WeaponHandling() [1/3]

proofps_dd::WeaponHandling::WeaponHandling ( PGE & pge,
proofps_dd::Config & config,
proofps_dd::Durations & durations,
proofps_dd::GUI & gui,
std::map< pge_network::PgeNetworkConnectionHandle, proofps_dd::Player > & mapPlayers,
proofps_dd::Maps & maps,
proofps_dd::Sounds & sounds,
proofps_dd::CameraHandling & camera )

Definition at line 32 of file WeaponHandling.cpp.

◆ WeaponHandling() [2/3]

proofps_dd::WeaponHandling::WeaponHandling ( const WeaponHandling & )
delete

◆ WeaponHandling() [3/3]

proofps_dd::WeaponHandling::WeaponHandling ( WeaponHandling && )
delete

Member Function Documentation

◆ canBulletHitPerFriendlyFireConfig() [1/2]

bool proofps_dd::WeaponHandling::canBulletHitPerFriendlyFireConfig ( const Player & playerHit,
const std::map< pge_network::PgeNetworkConnectionHandle, proofps_dd::Player >::iterator & itShooter ) const
private

Definition at line 2116 of file WeaponHandling.cpp.

◆ canBulletHitPerFriendlyFireConfig() [2/2]

bool proofps_dd::WeaponHandling::canBulletHitPerFriendlyFireConfig ( const std::map< pge_network::PgeNetworkConnectionHandle, proofps_dd::Player >::iterator & itPlayerHit,
const std::map< pge_network::PgeNetworkConnectionHandle, proofps_dd::Player >::iterator & itShooter ) const
private

Definition at line 2133 of file WeaponHandling.cpp.

◆ clearWeaponAutoReloadRequest()

void proofps_dd::WeaponHandling::clearWeaponAutoReloadRequest ( )

Definition at line 217 of file WeaponHandling.cpp.

◆ clearWeaponAutoSwitchToBestLoadedRequest()

void proofps_dd::WeaponHandling::clearWeaponAutoSwitchToBestLoadedRequest ( )

Definition at line 237 of file WeaponHandling.cpp.

◆ clearWeaponAutoSwitchToBestWithAnyKindOfAmmoRequest()

void proofps_dd::WeaponHandling::clearWeaponAutoSwitchToBestWithAnyKindOfAmmoRequest ( )

Definition at line 257 of file WeaponHandling.cpp.

◆ clearWeaponPickupInducedAutoSwitchRequest()

void proofps_dd::WeaponHandling::clearWeaponPickupInducedAutoSwitchRequest ( )

Definition at line 277 of file WeaponHandling.cpp.

◆ clientUpdateBullets()

void proofps_dd::WeaponHandling::clientUpdateBullets ( const unsigned int & nPhysicsRate)
protected

Definition at line 917 of file WeaponHandling.cpp.

◆ clientUpdateExplosions()

void proofps_dd::WeaponHandling::clientUpdateExplosions ( proofps_dd::GameMode & gameMode,
const unsigned int & nPhysicsRate )
protected

Definition at line 1015 of file WeaponHandling.cpp.

◆ createExplosionClient()

proofps_dd::Explosion & proofps_dd::WeaponHandling::createExplosionClient ( const proofps_dd::Explosion::ExplosionId & id,
const pge_network::PgeNetworkConnectionHandle & connHandle,
const PureVector & pos,
const int & nDamageHp,
const TPureFloat & fDamageAreaSize,
const Bullet::DamageAreaEffect & eDamageAreaEffect,
const TPureFloat & fDamageAreaPulse,
const std::string & sExplosionGfxObjFilename,
PureVector & vecCamShakeForce )
private

Definition at line 1983 of file WeaponHandling.cpp.

◆ createExplosionServer()

proofps_dd::Explosion & proofps_dd::WeaponHandling::createExplosionServer ( const PooledBullet & causedByBullet,
const pge_network::PgeNetworkConnectionHandle & connHandle,
const PureVector & pos,
const TPureFloat & fDamageAreaSize,
const Bullet::DamageAreaEffect & eDamageAreaEffect,
const TPureFloat & fDamageAreaPulse,
const std::string & sExplosionGfxObjFilename,
const int & nDamageAp,
const int & nDamageHp,
XHair & xhair,
PureVector & vecCamShakeForce,
proofps_dd::GameMode & gameMode )
private

Definition at line 1768 of file WeaponHandling.cpp.

◆ deleteBulletServer()

blIteratorAPI::blRawArrayWrapper< PooledBullet >::iterator proofps_dd::WeaponHandling::deleteBulletServer ( PgeObjectPool< PooledBullet > & bullets,
blIteratorAPI::blRawArrayWrapper< PooledBullet >::iterator itBullet,
const bool & bPlayerHit,
const bool & bWallHit,
XHair & xhair,
PureVector & vecCamShakeForce,
proofps_dd::GameMode & gameMode,
const bool & bEndGame )
private

Definition at line 1585 of file WeaponHandling.cpp.

◆ deleteWeaponHandlingAll()

void proofps_dd::WeaponHandling::deleteWeaponHandlingAll ( const bool & bDeallocBullets)
protected

Definition at line 306 of file WeaponHandling.cpp.

◆ emitParticles()

void proofps_dd::WeaponHandling::emitParticles ( PooledBullet & bullet)
private

Definition at line 2361 of file WeaponHandling.cpp.

◆ getConsole()

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

Definition at line 68 of file WeaponHandling.cpp.

◆ getDamageAndImpactForceAtDistance() [1/2]

float proofps_dd::WeaponHandling::getDamageAndImpactForceAtDistance ( const float & fNearObjX,
const float & fNearObjY,
const float & fNearObjRealSizeX,
const float & fNearObjRealSizeY,
const Explosion & xpl,
const Bullet::DamageAreaEffect & eDamageAreaEffect,
const TPureFloat & fDamageAreaPulse,
int & nDamageAp,
const int & nDamageHp,
PureVector & vecImpactForce )
staticprivate

Definition at line 1692 of file WeaponHandling.cpp.

◆ getDamageAndImpactForceAtDistance() [2/2]

float proofps_dd::WeaponHandling::getDamageAndImpactForceAtDistance ( const Player & player,
const Explosion & xpl,
const Bullet::DamageAreaEffect & eDamageAreaEffect,
const TPureFloat & fDamageAreaPulse,
int & nDamageAp,
const int & nDamageHp,
PureVector & vecImpactForce )
private

Definition at line 1747 of file WeaponHandling.cpp.

◆ getLoggerModuleName()

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

Definition at line 73 of file WeaponHandling.cpp.

◆ getSmokePool() [1/2]

PgeObjectPool< proofps_dd::Smoke > & proofps_dd::WeaponHandling::getSmokePool ( )

Definition at line 292 of file WeaponHandling.cpp.

◆ getSmokePool() [2/2]

const PgeObjectPool< proofps_dd::Smoke > & proofps_dd::WeaponHandling::getSmokePool ( ) const

Definition at line 297 of file WeaponHandling.cpp.

◆ getWeaponAutoReloadRequest()

const bool & proofps_dd::WeaponHandling::getWeaponAutoReloadRequest ( ) const

Definition at line 212 of file WeaponHandling.cpp.

◆ getWeaponAutoSwitchToBestLoadedRequest()

const bool & proofps_dd::WeaponHandling::getWeaponAutoSwitchToBestLoadedRequest ( ) const

Definition at line 232 of file WeaponHandling.cpp.

◆ getWeaponAutoSwitchToBestWithAnyKindOfAmmoRequest()

const bool & proofps_dd::WeaponHandling::getWeaponAutoSwitchToBestWithAnyKindOfAmmoRequest ( ) const

Definition at line 252 of file WeaponHandling.cpp.

◆ getWeaponByIdFromAnyPlayersWeaponManager()

Weapon * proofps_dd::WeaponHandling::getWeaponByIdFromAnyPlayersWeaponManager ( const WeaponId & wpnId)
private

Definition at line 2050 of file WeaponHandling.cpp.

◆ getWeaponPickupInducedAutoSwitchRequest()

Weapon * proofps_dd::WeaponHandling::getWeaponPickupInducedAutoSwitchRequest ( ) const

Definition at line 272 of file WeaponHandling.cpp.

◆ handleAutoSwitchUponWeaponPickupShared()

void proofps_dd::WeaponHandling::handleAutoSwitchUponWeaponPickupShared ( const Player & player,
Weapon & wpnCurrent,
Weapon & wpnPicked,
const bool & bHasJustBecomeAvailable )
protected

This function was made specifically for deciding if we initiate auto-switch upon picking up a weapon.

The pickup-induced auto-reload and firing-induced actions are handled in separate functions.

Definition at line 1538 of file WeaponHandling.cpp.

◆ handleBulletUpdateFromServer()

bool proofps_dd::WeaponHandling::handleBulletUpdateFromServer ( pge_network::PgeNetworkConnectionHandle connHandleServerSide,
const proofps_dd::MsgBulletUpdateFromServer & msg,
PureVector & vecCamShakeForce )
protected

Definition at line 1045 of file WeaponHandling.cpp.

◆ handleCurrentPlayersCurrentWeaponBulletCountsChangeShared()

void proofps_dd::WeaponHandling::handleCurrentPlayersCurrentWeaponBulletCountsChangeShared ( const Player & player,
Weapon & wpnCurrent,
const TPureUInt & nOldMagCount,
const TPureUInt & nNewMagCount,
const TPureUInt & nOldUnmagCount,
const TPureUInt & nNewUnmagCount,
const Weapon::State & oldState,
const Weapon::State & newState )

Definition at line 125 of file WeaponHandling.cpp.

◆ handleCurrentPlayersCurrentWeaponStateChangeShared()

void proofps_dd::WeaponHandling::handleCurrentPlayersCurrentWeaponStateChangeShared ( const Player & player,
Weapon & wpnCurrent,
const Weapon::State & oldState,
const Weapon::State & newState,
const TPureUInt & nMagCount,
const TPureUInt & nUnmagCount )
protected

Definition at line 1377 of file WeaponHandling.cpp.

◆ handleWpnUpdateCurrentFromServer()

bool proofps_dd::WeaponHandling::handleWpnUpdateCurrentFromServer ( pge_network::PgeNetworkConnectionHandle connHandleServerSide,
const proofps_dd::MsgCurrentWpnUpdateFromServer & msg )
protected

Definition at line 1299 of file WeaponHandling.cpp.

◆ handleWpnUpdateFromServer()

bool proofps_dd::WeaponHandling::handleWpnUpdateFromServer ( pge_network::PgeNetworkConnectionHandle connHandleServerSide,
const proofps_dd::MsgWpnUpdateFromServer & msg )
protected

Definition at line 1211 of file WeaponHandling.cpp.

◆ initializeWeaponHandling()

bool proofps_dd::WeaponHandling::initializeWeaponHandling ( PGEcfgProfiles & cfgProfiles)

Definition at line 78 of file WeaponHandling.cpp.

◆ isBulletOutOfMapBounds()

bool proofps_dd::WeaponHandling::isBulletOutOfMapBounds ( const Bullet & bullet) const
private

Definition at line 2035 of file WeaponHandling.cpp.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ play3dBulletBounceSound()

void proofps_dd::WeaponHandling::play3dBulletBounceSound ( const Bullet & bullet)
private

Definition at line 2097 of file WeaponHandling.cpp.

◆ play3dMeleeWeaponHitSound() [1/3]

void proofps_dd::WeaponHandling::play3dMeleeWeaponHitSound ( const Bullet & bullet,
const proofps_dd::MsgBulletUpdateFromServer::BulletDelete & hitType )
private

Definition at line 2092 of file WeaponHandling.cpp.

◆ play3dMeleeWeaponHitSound() [2/3]

void proofps_dd::WeaponHandling::play3dMeleeWeaponHitSound ( const WeaponId & wpnId,
const float & posX,
const float & posY,
const float & posZ,
const proofps_dd::MsgBulletUpdateFromServer::BulletDelete & hitType )
private

Definition at line 2060 of file WeaponHandling.cpp.

◆ play3dMeleeWeaponHitSound() [3/3]

void proofps_dd::WeaponHandling::play3dMeleeWeaponHitSound ( const WeaponId & wpnId,
const PureVector & posVec,
const proofps_dd::MsgBulletUpdateFromServer::BulletDelete & hitType )
private

Definition at line 2087 of file WeaponHandling.cpp.

◆ scheduleWeaponAutoReloadRequest()

void proofps_dd::WeaponHandling::scheduleWeaponAutoReloadRequest ( )

Definition at line 222 of file WeaponHandling.cpp.

◆ scheduleWeaponAutoSwitchToBestLoadedRequest()

void proofps_dd::WeaponHandling::scheduleWeaponAutoSwitchToBestLoadedRequest ( )

Definition at line 242 of file WeaponHandling.cpp.

◆ scheduleWeaponAutoSwitchToBestWithAnyKindOfAmmoRequest()

void proofps_dd::WeaponHandling::scheduleWeaponAutoSwitchToBestWithAnyKindOfAmmoRequest ( )

Definition at line 262 of file WeaponHandling.cpp.

◆ scheduleWeaponPickupInducedAutoSwitchRequest()

void proofps_dd::WeaponHandling::scheduleWeaponPickupInducedAutoSwitchRequest ( Weapon * wpn)

Definition at line 282 of file WeaponHandling.cpp.

◆ serverDeleteAllBulletsNow()

void proofps_dd::WeaponHandling::serverDeleteAllBulletsNow ( proofps_dd::GameMode & gameMode,
XHair & xhair,
PureVector & vecCamShakeForce )
protected

Definition at line 493 of file WeaponHandling.cpp.

◆ serverHandleBulletsVsBullets()

void proofps_dd::WeaponHandling::serverHandleBulletsVsBullets ( proofps_dd::GameMode & gameMode,
XHair & xhair,
const unsigned int & nPhysicsRate,
PureVector & vecCamShakeForce )
protected

This function does not update bullet positions, it expects up-to-date bullet positions.

Therefore, this shall be invoked AFTER serverUpdateBulletsAndHandleHittingWallsAndPlayers() !

Definition at line 787 of file WeaponHandling.cpp.

◆ serverUpdateBulletsAndHandleHittingWallsAndPlayers()

void proofps_dd::WeaponHandling::serverUpdateBulletsAndHandleHittingWallsAndPlayers ( proofps_dd::GameMode & gameMode,
XHair & xhair,
const unsigned int & nPhysicsRate,
PureVector & vecCamShakeForce )
protected

Definition at line 516 of file WeaponHandling.cpp.

◆ serverUpdateExplosions()

void proofps_dd::WeaponHandling::serverUpdateExplosions ( proofps_dd::GameMode & gameMode,
const unsigned int & nPhysicsRate )
protected

Definition at line 988 of file WeaponHandling.cpp.

◆ serverUpdateWeapons()

void proofps_dd::WeaponHandling::serverUpdateWeapons ( proofps_dd::GameMode & gameMode)
protected

Definition at line 334 of file WeaponHandling.cpp.

◆ shallShooterFragsDecreasedDueToFriendlyFireIfItIsFriendlyFire()

bool proofps_dd::WeaponHandling::shallShooterFragsDecreasedDueToFriendlyFireIfItIsFriendlyFire ( const Player & playerHit,
const Player & playerShooter ) const
private

Definition at line 2147 of file WeaponHandling.cpp.

◆ sharedUpdateBouncingBullets()

bool proofps_dd::WeaponHandling::sharedUpdateBouncingBullets ( const bool & bCollisionModeBvh,
PooledBullet & bullet,
const PurePosUpTarget & oldPut,
const float & fBulletPosX,
const float & fBulletPosY,
const float & fBulletScaledSizeX,
const float & fBulletScaledSizeY,
const unsigned int & nPhysicsRate,
const float & fFallGravityMin )
private

Bouncing bullet physics are simulated on both server- and client-side, this way server still does not need to update clients about bullet positions continuously.

However, bullet delete condition is still detected only by server, that logic is not shared.

Returns
True if bullet hit any map foreground block, false otherwise.

Definition at line 2159 of file WeaponHandling.cpp.

◆ sharedUpdateBullets_collisionWithWalls_bvh()

const PureObject3D * proofps_dd::WeaponHandling::sharedUpdateBullets_collisionWithWalls_bvh ( const float & fBulletPosX,
const float & fBulletPosY,
const float & fBulletPosZ,
const float & fBulletScaledSizeX,
const float & fBulletScaledSizeY,
const float & fBulletScaledSizeZ )
private

Used from v0.5.

Used by both server- and client-instances.

Returns
True if bullet hit a wall (foreground block), false otherwise.

Definition at line 2441 of file WeaponHandling.cpp.

◆ sharedUpdateBullets_collisionWithWalls_legacy()

const PureObject3D * proofps_dd::WeaponHandling::sharedUpdateBullets_collisionWithWalls_legacy ( const PooledBullet & bullet,
const float & fBulletPosX,
const float & fBulletPosY,
const float & fBulletScaledSizeX,
const float & fBulletScaledSizeY )
private

Used before v0.5.

Used by both server- and client-instances.

Returns
True if bullet hit a wall (foreground block), false otherwise.

Definition at line 2387 of file WeaponHandling.cpp.

◆ sharedUpdateRicochetingBullets()

bool proofps_dd::WeaponHandling::sharedUpdateRicochetingBullets ( const bool & bCollisionModeBvh,
PooledBullet & bullet,
const PurePosUpTarget & oldPut,
const float & fBulletPosX,
const float & fBulletPosY,
const float & fBulletScaledSizeX,
const float & fBulletScaledSizeY,
const unsigned int & nPhysicsRate,
const float & fFallGravityMin )
private

Ricocheting bullet physics are simulated on both server- and client-side, this way server still does not need to update clients about bullet positions continuously.

However, bullet delete condition is still detected only by server, that logic is not shared.

Returns
True if bullet needs to be deleted because it hit a foreground object in too steep angle, false otherwise. False means bullet survived and has just ricocheted off a foreground object, so no need to delete the bullet.

Definition at line 2253 of file WeaponHandling.cpp.

◆ updateSmokes()

void proofps_dd::WeaponHandling::updateSmokes ( proofps_dd::GameMode & gameMode,
const unsigned int & nPhysicsRate )
protected

Definition at line 1023 of file WeaponHandling.cpp.

Member Data Documentation

◆ m_bWpnAutoReloadRequest

bool proofps_dd::WeaponHandling::m_bWpnAutoReloadRequest = false
private

Definition at line 180 of file WeaponHandling.h.

◆ m_bWpnAutoSwitchToBestLoadedRequest

bool proofps_dd::WeaponHandling::m_bWpnAutoSwitchToBestLoadedRequest = false
private

Definition at line 181 of file WeaponHandling.h.

◆ m_bWpnAutoSwitchToBestWithAnyKindOfAmmoRequest

bool proofps_dd::WeaponHandling::m_bWpnAutoSwitchToBestWithAnyKindOfAmmoRequest = false
private

Definition at line 182 of file WeaponHandling.h.

◆ m_config

proofps_dd::Config& proofps_dd::WeaponHandling::m_config
private

Definition at line 169 of file WeaponHandling.h.

◆ m_durations

proofps_dd::Durations& proofps_dd::WeaponHandling::m_durations
private

Definition at line 170 of file WeaponHandling.h.

◆ m_explosions

std::list<Explosion> proofps_dd::WeaponHandling::m_explosions
private

Definition at line 178 of file WeaponHandling.h.

◆ m_gui

proofps_dd::GUI& proofps_dd::WeaponHandling::m_gui
private

Definition at line 171 of file WeaponHandling.h.

◆ m_mapPlayers

std::map<pge_network::PgeNetworkConnectionHandle, proofps_dd::Player>& proofps_dd::WeaponHandling::m_mapPlayers
private

Definition at line 172 of file WeaponHandling.h.

◆ m_maps

proofps_dd::Maps& proofps_dd::WeaponHandling::m_maps
private

Definition at line 173 of file WeaponHandling.h.

◆ m_pge

PGE& proofps_dd::WeaponHandling::m_pge
private

Definition at line 168 of file WeaponHandling.h.

◆ m_pWpnAutoSwitchWhenPickedUp

Weapon* proofps_dd::WeaponHandling::m_pWpnAutoSwitchWhenPickedUp = nullptr
private

Definition at line 192 of file WeaponHandling.h.

◆ m_smokes

PgeObjectPool<Smoke> proofps_dd::WeaponHandling::m_smokes
private

Definition at line 179 of file WeaponHandling.h.

◆ m_sndWpnReloadEndHandle

SoLoud::handle proofps_dd::WeaponHandling::m_sndWpnReloadEndHandle
private

Definition at line 176 of file WeaponHandling.h.

◆ m_sndWpnReloadStartHandle

SoLoud::handle proofps_dd::WeaponHandling::m_sndWpnReloadStartHandle
private

Definition at line 175 of file WeaponHandling.h.

◆ m_sounds

proofps_dd::Sounds& proofps_dd::WeaponHandling::m_sounds
private

Definition at line 174 of file WeaponHandling.h.


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