MpPlayerState struct
Network-agnostic per-player game-mode state for a single round.
Holds the round statistics and team assignment that the game modes read and write, independent of any networking concept. In online sessions PeerDescriptor inherits this; in local splitscreen it is owned directly by the local handler. Keeping per-round state here lets the game modes read and write it through IGameModeContext without knowing about peers or networking.
Derived classes
- struct PeerDescriptor
- Peer descriptor.
Constructors, destructors, conversion operators
Public variables
-
std::
uint8_t Team - Team ID.
-
std::
uint8_t PreferredTeam - Preferred team requested by the player (
0xFF= no preference, let the host decide). - bool TeamLocked
- Whether the team was forced (admin/rebalance); client requests are rejected while set.
- float TeamSwitchCooldown
- Remaining frames before the player may switch teams again.
-
std::
uint32_t PointsInRound - Game-mode specific points held in the current round.
-
std::
uint32_t PositionInRound - Position in the current round.
-
std::
uint32_t Deaths - Deaths in the current round.
-
std::
uint32_t Kills - Kills in the current round.
-
std::
uint32_t Laps - Completed laps in the current round.
-
std::
uint32_t TreasureCollected - Treasure collected in the current round.
-
std::
uint32_t RaceFinishOrder - Order in which the player completed all required laps (
0while still racing). - TimeStamp LapStarted
- Timestamp when the last lap started.
- float DeathElapsedFrames
- Elapsed frames when the player lost all lives (
FLT_MAXwhile alive). - float LapsElapsedFrames
- Elapsed frames of all completed laps.
- float RaceFinishFrames
- Elapsed frames when the player completed the last required lap (valid if RaceFinishOrder is not zero).
- float RaceProgress
- Distance travelled along the race track in the current lap, in pixels.
-
std::
uint32_t ModePoints - Score defined by the game mode, e.g. tag points or banked heads (synced to all peers).
-
std::
uint32_t ModeCarried - Amount of something the player carries in the game mode, e.g. heads (synced to all peers).
-
std::
int32_t ModeLives - Lives left in modes that count them (synced to all peers).
- float ModeTimer
- Countdown in frames used by the game mode, e.g. until a zombie returns to life.
- float SpawnedFrames
- Elapsed frames when the player last spawned or joined.
-
std::
uint8_t ModeFlags - Role of the player defined by the game mode, see GameModes::
PlayerModeFlags (synced to all peers). -
std::
uint8_t ModeCarryOverFlags - Flags the game mode carries over to the next round (not reset), e.g. the first zombie of the next round.