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 (pge_audio::PgeAudio &audio, const std::map< pge_network::PgeNetworkConnectionHandle, proofps_dd::Player > &mapPlayers, const Player &player, XHair &xhair, const float &fFps, bool bCamFollowsXHair, bool bCamTiltingAllowed, bool bCamRollAllowed)
 
PureVector & cameraGetShakeForce ()
 
CConsole & getConsole () const
 
 CameraHandling (PR00FsUltimateRenderingEngine &pure, Durations &durations, Maps &maps)
 
 CameraHandling (const CameraHandling &)=delete
 
CameraHandlingoperator= (const CameraHandling &)=delete
 
 CameraHandling (CameraHandling &&)=delete
 
CameraHandling && operator= (CameraHandling &&)=delete
 
SpectatingViewcameraGetSpectatingView ()
 
void cameraToggleSpectatingView ()
 Toggles between different camera spectating views.
 
PureVector & cameraGetPosToFollowWhenSpectating ()
 This is essentially controlled by cameraUpdatePosAndAngle() when we are in spectator mode, however it is allowed to be accessed by the user to update it in "free camera spectating view".
 
const pge_network::PgeNetworkConnectionHandle & cameraGetPlayerConnectionHandleToFollowWhenSpectating () const
 
bool findNextValidPlayerToFollowInPlayerSpectatingView (const std::map< pge_network::PgeNetworkConnectionHandle, proofps_dd::Player > &mapPlayers)
 Useful when we want to iterate to the next spectatable player in "player follow spectating view".
 
bool findPrevValidPlayerToFollowInPlayerSpectatingView (const std::map< pge_network::PgeNetworkConnectionHandle, proofps_dd::Player > &mapPlayers)
 Useful when we want to iterate to the previous spectatable player in "player follow spectating view".
 
bool findAnyValidPlayerToFollowInPlayerSpectatingView (const std::map< pge_network::PgeNetworkConnectionHandle, proofps_dd::Player > &mapPlayers, PureVector &posPlayerToFollow)
 Useful when we are toggling spectating view to player follow view, or in each frame to check if followed player is still valid in player follow view.
 
- 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::GameMode &gameMode, 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, proofps_dd::CameraHandling &camera)
 
 InputHandling (const InputHandling &)=delete
 
InputHandlingoperator= (const InputHandling &)=delete
 
 InputHandling (InputHandling &&)=delete
 
InputHandling && operator= (InputHandling &&)=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
 
- 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 (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.
 
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
 
- 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
 

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 (const proofps_dd::GameRestartType_KeepPlayers &eRestartType)
 
void serverNewRound ()
 
void updateAudioVisualsForGameModeShared ()
 
void serverRespawnItems ()
 
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
 
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::CameraHandling
enum class  SpectatingView { Free , PlayerFollow }
 
- Protected Types inherited from proofps_dd::InputHandling
enum  PlayerAppActionRequest { None , Exit }
 
- Static Protected Member Functions inherited from proofps_dd::CameraHandling
static const char * getLoggerModuleName ()
 
static bool canSpectatePlayer (const Player &player)
 Use this function when iterating over players, to decide if we can spectate this player.
 
- 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_sndMenuMusic
 
SoLoud::handle m_sndMenuMusicHandle {}
 
SoLoud::Wav m_sndEndgameMusic
 
SoLoud::handle m_sndEndgameMusicHandle {}
 
SoLoud::Wav m_sndRoundWin
 
SoLoud::handle m_sndRoundWinHandle {}
 
SoLoud::Wav m_sndLetsgo
 
SoLoud::Wav m_sndChangeWeapon
 
SoLoud::Wav m_sndPlayerDie
 
- Static Protected Attributes inherited from proofps_dd::InputHandling
static constexpr std::chrono::milliseconds::rep m_nKeyPressOnceWpnHandlingMinumumWaitMilliseconds = 500
 
static constexpr std::chrono::milliseconds::rep m_nKeyPressOnceJumpMinumumWaitMilliseconds = 50
 
static constexpr std::chrono::milliseconds::rep m_nKeyPressOnceToggleUseItemMinumumWaitMilliseconds = 50
 
static constexpr std::chrono::milliseconds::rep m_nKeyPressSomersaultMaximumWaitMilliseconds = 300
 
static constexpr std::chrono::milliseconds::rep m_nWeaponActionMinimumWaitMillisecondsAfterSwitch = 1000
 
static constexpr std::chrono::milliseconds::rep m_nPlayerAngleYSendIntervalMilliseconds = 100
 
static constexpr std::chrono::milliseconds::rep m_nWeaponAngleZBigChangeSendIntervalMilliseconds = 100
 
static constexpr std::chrono::milliseconds::rep 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 108 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 1302 of file PRooFPS-dd-PGE.cpp.

◆ connect()

bool proofps_dd::PRooFPSddPGE::connect ( )
private

Definition at line 659 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 701 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 1791 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 1353 of file PRooFPS-dd-PGE.cpp.

◆ hasValidConnection()

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

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

◆ hideLoadingScreen()

void proofps_dd::PRooFPSddPGE::hideLoadingScreen ( )
private

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

◆ mainLoopConnectedClientOnlyOneTick()

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

Only client executes this.

Definition at line 813 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 762 of file PRooFPS-dd-PGE.cpp.

◆ mainLoopConnectedShared()

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

Both clients and listen-server executes this.

Called back by PRooFPSddPGE::onGameRunning() in every frame. Note that periodical update of Dear ImGui elements shall be done in proofps_dd::GUI::drawDearImGuiCb() instead.

Dedicated server won't need this.

Definition at line 839 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 921 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 607 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 266 of file PRooFPS-dd-PGE.cpp.

◆ onGameInitialized()

bool proofps_dd::PRooFPSddPGE::onGameInitialized ( )
overrideprotectedvirtual

Loading game content here.

Definition at line 154 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 117 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 292 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 419 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

◆ serverNewRound()

void proofps_dd::PRooFPSddPGE::serverNewRound ( )
private

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

◆ serverPickupAndRespawnItems()

void proofps_dd::PRooFPSddPGE::serverPickupAndRespawnItems ( )
private

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

◆ serverRespawnItems()

void proofps_dd::PRooFPSddPGE::serverRespawnItems ( )
private

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

◆ serverRestartGame()

void proofps_dd::PRooFPSddPGE::serverRestartGame ( const proofps_dd::GameRestartType_KeepPlayers & eRestartType)
private

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

◆ showLoadingScreen()

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

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

◆ updateAudioVisualsForGameModeShared()

void proofps_dd::PRooFPSddPGE::updateAudioVisualsForGameModeShared ( )
private

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

◆ updateFramesPerSecond()

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

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

Member Data Documentation

◆ m_bFpsFirstMeasure

bool proofps_dd::PRooFPSddPGE::m_bFpsFirstMeasure
private

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

◆ m_cbDisplayMapLoadingProgressUpdate

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

Definition at line 89 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_durations

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

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

◆ m_fps

float proofps_dd::PRooFPSddPGE::m_fps
private

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

◆ m_fps_counter

unsigned int proofps_dd::PRooFPSddPGE::m_fps_counter
private

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

◆ m_fps_lastmeasure

unsigned long proofps_dd::PRooFPSddPGE::m_fps_lastmeasure
private

Definition at line 95 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 98 of file PRooFPS-dd-PGE.h.

◆ m_maps

Maps proofps_dd::PRooFPSddPGE::m_maps
private

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

◆ m_sounds

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

Definition at line 102 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 85 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 86 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 91 of file PRooFPS-dd-PGE.h.


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