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

The customized game engine class. More...

Detailed Description

The customized game engine class.

This handles the game logic. Singleton.

Definition at line 41 of file PRooFPS-dd-PGE.h.

#include <PRooFPS-dd-PGE.h>

+ Inheritance diagram for proofps_dd::PRooFPSddPGE:

Public Member Functions

CConsole & getConsole () const
 

Static Public Member Functions

static PRooFPSddPGEcreateAndGetPRooFPSddPGEinstance ()
 
static const char * getLoggerModuleName ()
 

Protected Member Functions

 PRooFPSddPGE (const char *gametitle)
 This is the only usable ctor, this is used by the static createAndGet().
 
virtual ~PRooFPSddPGE ()
 
 PRooFPSddPGE (const PRooFPSddPGE &)=delete
 
PRooFPSddPGEoperator= (const PRooFPSddPGE &)=delete
 
 PRooFPSddPGE (PRooFPSddPGE &&)=delete
 
PRooFPSddPGE && operator= (PRooFPSddPGE &&)=delete
 
virtual bool onGameInitializing () override
 Must-have minimal stuff before loading anything.
 
virtual bool onGameInitialized () override
 Loading game content here.
 
virtual void onGameFrameBegin () override
 Game logic right before the engine would do anything.
 
virtual void onGameRunning () override
 Game logic for each frame.
 
virtual bool onPacketReceived (const pge_network::PgePacket &pkt) override
 Called when a new network packet is received.
 
virtual void onGameDestroying () override
 Freeing up game content here.
 
- Protected Member Functions inherited from proofps_dd::CameraHandling
void cameraInitForGameStart ()
 
void cameraPositionToMapCenter ()
 
void cameraUpdatePosAndAngle (const Player &player, const XHair &xhair, const float &fFps, bool bCamFollowsXHair, bool bCamTiltingAllowed, bool bCamRollAllowed)
 
PureVector & cameraGetShakeForce ()
 
 CameraHandling (PGE &pge, Durations &durations, Maps &maps)
 
 CameraHandling (const CameraHandling &)=delete
 
CameraHandlingoperator= (const CameraHandling &)=delete
 
 CameraHandling (CameraHandling &&)=delete
 
CameraHandling && operator= (CameraHandling &&)=delete
 
- Protected Member Functions inherited from proofps_dd::InputHandling
PlayerAppActionRequest clientHandleInputWhenConnectedAndSendUserCmdMoveToServer (proofps_dd::GameMode &gameMode, proofps_dd::Player &player, proofps_dd::XHair &xhair, const unsigned int nTickrate, const unsigned int nClUpdateRate, const unsigned int nPhysicsRateMin, proofps_dd::WeaponHandling &wpnHandling)
 
PlayerAppActionRequest clientHandleInputWhenDisconnectedFromServer ()
 
bool serverHandleUserCmdMoveFromClient (pge_network::PgeNetworkConnectionHandle connHandleServerSide, const proofps_dd::MsgUserCmdFromClient &msg, proofps_dd::WeaponHandling &wpnHandling)
 
CConsole & getConsole () const
 
 InputHandling (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)
 
 InputHandling (const InputHandling &)=delete
 
InputHandlingoperator= (const InputHandling &)=delete
 
 InputHandling (InputHandling &&)=delete
 
InputHandling && operator= (InputHandling &&)=delete
 
- Protected Member Functions inherited from proofps_dd::PlayerHandling
void handlePlayerDied (Player &player, XHair &xhair, const pge_network::PgeNetworkConnectionHandle &nKillerConnHandleServerSide, proofps_dd::GameMode &gameMode)
 
void handlePlayerRespawned (Player &player, XHair &xhair)
 
void serverRespawnPlayer (Player &player, bool restartGame, const proofps_dd::Config &config)
 
void serverUpdateRespawnTimers (const proofps_dd::Config &config, proofps_dd::GameMode &gameMode, proofps_dd::Durations &durations)
 
void updatePlayersOldValues ()
 
void writePlayerList ()
 
bool handleUserConnected (pge_network::PgeNetworkConnectionHandle connHandleServerSide, const pge_network::MsgUserConnectedServerSelf &msg, PGEcfgProfiles &cfgProfiles, proofps_dd::Config &config, proofps_dd::GameMode &gameMode, 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, proofps_dd::GameMode &gameMode, PGEcfgProfiles &cfgProfiles)
 
void resetSendClientUpdatesCounter (proofps_dd::Config &config)
 
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)
 
bool handleDeathNotificationFromServer (pge_network::PgeNetworkConnectionHandle nDeadConnHandleServerSide, const proofps_dd::MsgDeathNotificationFromServer &msg)
 
bool handlePlayerEventFromServer (pge_network::PgeNetworkConnectionHandle connHandleServerSide, const proofps_dd::MsgPlayerEventFromServer &msg)
 
void updatePlayersVisuals (const proofps_dd::Config &config, proofps_dd::GameMode &gameMode)
 
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)
 
 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
 
- Protected Member Functions inherited from proofps_dd::Sounds
CConsole & getConsole () const
 
 Sounds ()
 
 Sounds (const Sounds &)=delete
 
Soundsoperator= (const Sounds &)=delete
 
 Sounds (Sounds &&)=delete
 
Sounds && operator= (Sounds &&)=delete
 
- Protected Member Functions inherited from proofps_dd::WeaponHandling
void deleteWeaponHandlingAll ()
 
void serverUpdateWeapons (proofps_dd::GameMode &gameMode)
 
bool isBulletOutOfMapBounds (const Bullet &bullet) const
 
void serverUpdateBullets (proofps_dd::GameMode &gameMode, XHair &xhair, const unsigned int &nPhysicsRate, PureVector &vecCamShakeForce)
 
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)
 
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.
 
CConsole & getConsole () const
 
 WeaponHandling (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)
 
 WeaponHandling (const WeaponHandling &)=delete
 
WeaponHandlingoperator= (const WeaponHandling &)=delete
 
 WeaponHandling (WeaponHandling &&)=delete
 
WeaponHandling && operator= (WeaponHandling &&)=delete
 
bool initializeWeaponHandling ()
 
float getDamageAndImpactForceAtDistance (const Player &player, const Explosion &xpl, const Bullet::DamageAreaEffect &eDamageAreaEffect, const TPureFloat &fDamageAreaPulse, int &nDamageAp, const int &nDamageHp, PureVector &vecImpactForce)
 
ExplosioncreateExplosionServer (const pge_network::PgeNetworkConnectionHandle &connHandle, const PureVector &pos, const TPureFloat &fDamageAreaSize, const Bullet::DamageAreaEffect &eDamageAreaEffect, const TPureFloat &fDamageAreaPulse, 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, PureVector &vecCamShakeForce)
 
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)
 
- Protected Member Functions inherited from proofps_dd::Physics
void serverSetAllowStrafeMidAir (bool bAllow)
 
void serverSetAllowStrafeMidAirFull (bool bAllow)
 
void serverSetFallDamageMultiplier (int n)
 
void serverGravity (XHair &xhair, const unsigned int &nPhysicsRate, proofps_dd::GameMode &gameMode)
 
void serverPlayerCollisionWithWalls (const unsigned int &nPhysicsRate, XHair &xhair, proofps_dd::GameMode &gameMode)
 
bool serverPlayerCollisionWithWalls_LoopKernelVertical (Player &player, const PureObject3D *obj, const int &iJumppad, const float &fPlayerHalfHeight, const float &fPlayerOPos1XMinusHalf, const float &fPlayerOPos1XPlusHalf, const float &fPlayerPos1YMinusHalf, const float &fPlayerPos1YPlusHalf, const float &fBlockSizeXhalf, const float &fBlockSizeYhalf, XHair &xhair, proofps_dd::GameMode &gameMode)
 
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)
 
 Physics (const Physics &)=delete
 
Physicsoperator= (const Physics &)=delete
 
 Physics (Physics &&)=delete
 
Physics && operator= (Physics &&)=delete
 

Private Member Functions

void showLoadingScreen (int nProgress)
 
void hideLoadingScreen ()
 
bool hasValidConnection () const
 
bool connect ()
 
void disconnect (bool bExitFromGameSession, const std::string &sExtraDebugText="")
 
void mainLoopConnectedServerOnlyOneTick (const long long &durElapsedMicrosecs)
 Only server executes this.
 
void mainLoopConnectedClientOnlyOneTick (const long long &durElapsedMicrosecs)
 Only client executes this.
 
void mainLoopConnectedShared (PureWindow &window)
 Both clients and listen-server executes this.
 
void mainLoopDisconnectedShared (PureWindow &window)
 Both clients and listen-server executes this.
 
void updateFramesPerSecond (PureWindow &window)
 
void serverRestartGame ()
 
void updateVisualsForGameMode ()
 
void serverPickupAndRespawnItems ()
 
bool clientHandleGameSessionStateFromServer (const proofps_dd::MsgGameSessionStateFromServer &msg)
 
bool handleUserSetupFromServer (pge_network::PgeNetworkConnectionHandle connHandleServerSide, const proofps_dd::MsgUserSetupFromServer &msg)
 
bool handleMapChangeFromServer (pge_network::PgeNetworkConnectionHandle connHandleServerSide, const proofps_dd::MsgMapChangeFromServer &msg)
 

Private Attributes

proofps_dd::Configm_config
 
proofps_dd::GUIm_gui
 
proofps_dd::GameModem_gameMode
 
proofps_dd::DeathMatchModem_deathMatchMode
 
std::chrono::time_point< std::chrono::steady_clock > m_timeConnectionStateChangeInitiated
 Whenever we initiate a network connection or disconnection, we save the timestamp here.
 
std::chrono::time_point< std::chrono::steady_clock > m_timeLastPrintWaitConnection
 
Maps m_maps
 
std::function< void(int)> m_cbDisplayMapLoadingProgressUpdate
 
std::chrono::time_point< std::chrono::steady_clock > m_timeSimulation
 For stepping the time ahead in 1 single tick.
 
float m_fps
 
unsigned int m_fps_counter
 
unsigned long m_fps_lastmeasure
 
bool m_bFpsFirstMeasure
 
std::map< pge_network::PgeNetworkConnectionHandle, Playerm_mapPlayers
 Connected players, used by both server and clients.
 
proofps_dd::Durations m_durations
 
proofps_dd::Sounds m_sounds
 

Additional Inherited Members

- Protected Types inherited from proofps_dd::InputHandling
enum  PlayerAppActionRequest { None , Exit }
 
- Static Protected Member Functions inherited from proofps_dd::InputHandling
static const char * getLoggerModuleName ()
 
- 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 ()
 
- Static Protected Member Functions inherited from proofps_dd::Sounds
static const char * getLoggerModuleName ()
 
- Static Protected Member Functions inherited from proofps_dd::WeaponHandling
static const char * getLoggerModuleName ()
 
- 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)
 
- 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).
 
- Protected Attributes inherited from proofps_dd::Sounds
SoLoud::Wav m_sndLetsgo
 
SoLoud::Wav m_sndReloadStart
 
SoLoud::Wav m_sndReloadFinish
 
SoLoud::Wav m_sndShootPistol
 
SoLoud::Wav m_sndReloadBazooka
 
SoLoud::Wav m_sndChangeWeapon
 
SoLoud::Wav m_sndPlayerDie
 
SoLoud::Wav m_sndExplosion
 
- Static Protected Attributes inherited from proofps_dd::InputHandling
static constexpr unsigned int m_nKeyPressOnceWpnHandlingMinumumWaitMilliseconds = 500
 
static constexpr unsigned int m_nKeyPressOnceJumpMinumumWaitMilliseconds = 50
 
static constexpr unsigned int m_nKeyPressSomersaultMaximumWaitMilliseconds = 300
 
static constexpr unsigned int m_nWeaponActionMinimumWaitMillisecondsAfterSwitch = 1000
 
static constexpr unsigned int m_nPlayerAngleYSendIntervalMilliseconds = 100
 
static constexpr unsigned int m_nWeaponAngleZBigChangeSendIntervalMilliseconds = 100
 
static constexpr unsigned int m_nWeaponAngleZSmallChangeSendIntervalMilliseconds = 200
 
static constexpr float m_fWeaponAngleZBigChangeThreshold = 30.f
 
- Static Protected Attributes inherited from proofps_dd::Networking
static constexpr char * szCVarClServerIp = "cl_server_ip"
 

Constructor & Destructor Documentation

◆ PRooFPSddPGE() [1/3]

proofps_dd::PRooFPSddPGE::PRooFPSddPGE ( const char * gametitle)
explicitprotected

This is the only usable ctor, this is used by the static createAndGet().

Definition at line 58 of file PRooFPS-dd-PGE.cpp.

◆ ~PRooFPSddPGE()

proofps_dd::PRooFPSddPGE::~PRooFPSddPGE ( )
protectedvirtual

Definition at line 105 of file PRooFPS-dd-PGE.cpp.

◆ PRooFPSddPGE() [2/3]

proofps_dd::PRooFPSddPGE::PRooFPSddPGE ( const PRooFPSddPGE & )
protecteddelete

◆ PRooFPSddPGE() [3/3]

proofps_dd::PRooFPSddPGE::PRooFPSddPGE ( PRooFPSddPGE && )
protecteddelete

Member Function Documentation

◆ clientHandleGameSessionStateFromServer()

bool proofps_dd::PRooFPSddPGE::clientHandleGameSessionStateFromServer ( const proofps_dd::MsgGameSessionStateFromServer & msg)
private

Definition at line 1088 of file PRooFPS-dd-PGE.cpp.

◆ connect()

bool proofps_dd::PRooFPSddPGE::connect ( )
private

Definition at line 616 of file PRooFPS-dd-PGE.cpp.

◆ createAndGetPRooFPSddPGEinstance()

proofps_dd::PRooFPSddPGE * proofps_dd::PRooFPSddPGE::createAndGetPRooFPSddPGEinstance ( )
static

Definition at line 34 of file PRooFPS-dd-PGE.cpp.

◆ disconnect()

void proofps_dd::PRooFPSddPGE::disconnect ( bool bExitFromGameSession,
const std::string & sExtraDebugText = "" )
private

Definition at line 653 of file PRooFPS-dd-PGE.cpp.

◆ getConsole()

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

Definition at line 40 of file PRooFPS-dd-PGE.cpp.

◆ getLoggerModuleName()

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

Definition at line 46 of file PRooFPS-dd-PGE.cpp.

◆ handleMapChangeFromServer()

bool proofps_dd::PRooFPSddPGE::handleMapChangeFromServer ( pge_network::PgeNetworkConnectionHandle connHandleServerSide,
const proofps_dd::MsgMapChangeFromServer & msg )
private

Definition at line 1440 of file PRooFPS-dd-PGE.cpp.

◆ handleUserSetupFromServer()

bool proofps_dd::PRooFPSddPGE::handleUserSetupFromServer ( pge_network::PgeNetworkConnectionHandle connHandleServerSide,
const proofps_dd::MsgUserSetupFromServer & msg )
private

Definition at line 1113 of file PRooFPS-dd-PGE.cpp.

◆ hasValidConnection()

bool proofps_dd::PRooFPSddPGE::hasValidConnection ( ) const
private

Definition at line 602 of file PRooFPS-dd-PGE.cpp.

◆ hideLoadingScreen()

void proofps_dd::PRooFPSddPGE::hideLoadingScreen ( )
private

Definition at line 596 of file PRooFPS-dd-PGE.cpp.

◆ mainLoopConnectedClientOnlyOneTick()

void proofps_dd::PRooFPSddPGE::mainLoopConnectedClientOnlyOneTick ( const long long & durElapsedMicrosecs)
private

Only client executes this.

Definition at line 760 of file PRooFPS-dd-PGE.cpp.

◆ mainLoopConnectedServerOnlyOneTick()

void proofps_dd::PRooFPSddPGE::mainLoopConnectedServerOnlyOneTick ( const long long & durElapsedMicrosecs)
private

Only server executes this.

Good for either dedicated- or listen- server.

Definition at line 711 of file PRooFPS-dd-PGE.cpp.

◆ mainLoopConnectedShared()

void proofps_dd::PRooFPSddPGE::mainLoopConnectedShared ( PureWindow & window)
private

Both clients and listen-server executes this.

Dedicated server won't need this.

Definition at line 779 of file PRooFPS-dd-PGE.cpp.

◆ mainLoopDisconnectedShared()

void proofps_dd::PRooFPSddPGE::mainLoopDisconnectedShared ( PureWindow & window)
private

Both clients and listen-server executes this.

Dedicated server won't need this.

Definition at line 844 of file PRooFPS-dd-PGE.cpp.

◆ onGameDestroying()

void proofps_dd::PRooFPSddPGE::onGameDestroying ( )
overrideprotectedvirtual

Freeing up game content here.

Free up everything that has been allocated in onGameInitialized() and onGameRunning().

Definition at line 562 of file PRooFPS-dd-PGE.cpp.

◆ onGameFrameBegin()

void proofps_dd::PRooFPSddPGE::onGameFrameBegin ( )
overrideprotectedvirtual

Game logic right before the engine would do anything.

This is invoked at the very beginning of the main game loop, before processing window messages and incoming network packets.

Definition at line 267 of file PRooFPS-dd-PGE.cpp.

◆ onGameInitialized()

bool proofps_dd::PRooFPSddPGE::onGameInitialized ( )
overrideprotectedvirtual

Loading game content here.

Definition at line 151 of file PRooFPS-dd-PGE.cpp.

◆ onGameInitializing()

bool proofps_dd::PRooFPSddPGE::onGameInitializing ( )
overrideprotectedvirtual

Must-have minimal stuff before loading anything.

Game engine calls this before even finishing its own initialization.

Definition at line 114 of file PRooFPS-dd-PGE.cpp.

◆ onGameRunning()

void proofps_dd::PRooFPSddPGE::onGameRunning ( )
overrideprotectedvirtual

Game logic for each frame.

Game logic here.

Game engine invokes this in every frame. DO NOT make any unnecessary operations here, as this function must always complete below 16 msecs to keep stable 60 fps!

Definition at line 291 of file PRooFPS-dd-PGE.cpp.

◆ onPacketReceived()

bool proofps_dd::PRooFPSddPGE::onPacketReceived ( const pge_network::PgePacket & pkt)
overrideprotectedvirtual

Called when a new network packet is received.

Returns
True on successful packet handling, false on serious error that should result in terminating the application.

Definition at line 407 of file PRooFPS-dd-PGE.cpp.

◆ operator=() [1/2]

PRooFPSddPGE & proofps_dd::PRooFPSddPGE::operator= ( const PRooFPSddPGE & )
protecteddelete

◆ operator=() [2/2]

PRooFPSddPGE && proofps_dd::PRooFPSddPGE::operator= ( PRooFPSddPGE && )
protecteddelete

◆ serverPickupAndRespawnItems()

void proofps_dd::PRooFPSddPGE::serverPickupAndRespawnItems ( )
private

Definition at line 980 of file PRooFPS-dd-PGE.cpp.

◆ serverRestartGame()

void proofps_dd::PRooFPSddPGE::serverRestartGame ( )
private

Definition at line 904 of file PRooFPS-dd-PGE.cpp.

◆ showLoadingScreen()

void proofps_dd::PRooFPSddPGE::showLoadingScreen ( int nProgress)
private

Definition at line 591 of file PRooFPS-dd-PGE.cpp.

◆ updateFramesPerSecond()

void proofps_dd::PRooFPSddPGE::updateFramesPerSecond ( PureWindow & window)
private

Definition at line 856 of file PRooFPS-dd-PGE.cpp.

◆ updateVisualsForGameMode()

void proofps_dd::PRooFPSddPGE::updateVisualsForGameMode ( )
private

Definition at line 951 of file PRooFPS-dd-PGE.cpp.

Member Data Documentation

◆ m_bFpsFirstMeasure

bool proofps_dd::PRooFPSddPGE::m_bFpsFirstMeasure
private

Definition at line 98 of file PRooFPS-dd-PGE.h.

◆ m_cbDisplayMapLoadingProgressUpdate

std::function<void(int)> proofps_dd::PRooFPSddPGE::m_cbDisplayMapLoadingProgressUpdate
private

Definition at line 91 of file PRooFPS-dd-PGE.h.

◆ m_config

proofps_dd::Config& proofps_dd::PRooFPSddPGE::m_config
private

Definition at line 79 of file PRooFPS-dd-PGE.h.

◆ m_deathMatchMode

proofps_dd::DeathMatchMode* proofps_dd::PRooFPSddPGE::m_deathMatchMode
private

Definition at line 82 of file PRooFPS-dd-PGE.h.

◆ m_durations

proofps_dd::Durations proofps_dd::PRooFPSddPGE::m_durations
private

Definition at line 103 of file PRooFPS-dd-PGE.h.

◆ m_fps

float proofps_dd::PRooFPSddPGE::m_fps
private

Definition at line 95 of file PRooFPS-dd-PGE.h.

◆ m_fps_counter

unsigned int proofps_dd::PRooFPSddPGE::m_fps_counter
private

Definition at line 96 of file PRooFPS-dd-PGE.h.

◆ m_fps_lastmeasure

unsigned long proofps_dd::PRooFPSddPGE::m_fps_lastmeasure
private

Definition at line 97 of file PRooFPS-dd-PGE.h.

◆ m_gameMode

proofps_dd::GameMode* proofps_dd::PRooFPSddPGE::m_gameMode
private

Definition at line 81 of file PRooFPS-dd-PGE.h.

◆ m_gui

proofps_dd::GUI& proofps_dd::PRooFPSddPGE::m_gui
private

Definition at line 80 of file PRooFPS-dd-PGE.h.

◆ m_mapPlayers

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

Connected players, used by both server and clients.

Key is server-side connection handle.

Definition at line 100 of file PRooFPS-dd-PGE.h.

◆ m_maps

Maps proofps_dd::PRooFPSddPGE::m_maps
private

Definition at line 90 of file PRooFPS-dd-PGE.h.

◆ m_sounds

proofps_dd::Sounds proofps_dd::PRooFPSddPGE::m_sounds
private

Definition at line 104 of file PRooFPS-dd-PGE.h.

◆ m_timeConnectionStateChangeInitiated

std::chrono::time_point<std::chrono::steady_clock> proofps_dd::PRooFPSddPGE::m_timeConnectionStateChangeInitiated
private

Whenever we initiate a network connection or disconnection, we save the timestamp here.

This is needed because then in the main game loop we can check the amount of time elapsed and then try reconnect automatically after a specific time.

Definition at line 87 of file PRooFPS-dd-PGE.h.

◆ m_timeLastPrintWaitConnection

std::chrono::time_point<std::chrono::steady_clock> proofps_dd::PRooFPSddPGE::m_timeLastPrintWaitConnection
private

Definition at line 88 of file PRooFPS-dd-PGE.h.

◆ m_timeSimulation

std::chrono::time_point<std::chrono::steady_clock> proofps_dd::PRooFPSddPGE::m_timeSimulation
private

For stepping the time ahead in 1 single tick.

Definition at line 93 of file PRooFPS-dd-PGE.h.


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