GekkoNet 1.0
C/C++ Peer to Peer Game Networking SDK
Loading...
Searching...
No Matches
Gekko::GameSession Class Reference

#include <game_session.h>

Inheritance diagram for Gekko::GameSession:
Collaboration diagram for Gekko::GameSession:

Classes

struct  RollbackCounters

Public Member Functions

 GameSession ()
void Init (GekkoConfig *config) override
void SetLocalDelay (i32 player, u8 delay) override
void SetRunahead (u8 runahead) override
void SetInputPredictionWindow (u8 window) override
void SetNetAdapter (GekkoNetAdapter *adapter) override
i32 AddActor (GekkoPlayerType type, GekkoNetAddress *addr) override
bool DisconnectActor (i32 actor) override
void SetDisconnectTimeout (u32 timeout) override
void AddLocalInput (i32 player, void *input) override
GekkoGameEvent ** UpdateSession (i32 *count) override
GekkoSessionEvent ** Events (i32 *count) override
f32 FramesAhead () override
void NetworkStats (i32 player, GekkoNetworkStats *stats) override
void RollbackStats (GekkoRollbackStats *stats) override
void NetworkPoll () override
bool StartRecording (bool save_initial_state, bool disable_compression) override
const u8 * StopRecording (u32 &length) override
const u8 * PeekRecording (u32 &length) override
bool RecordChecksums (u32 interval) override
bool SetReplayUserData (const u8 *data, u32 length) override
Public Member Functions inherited from GekkoSession
virtual i32 SpectatorBufferedFrames ()
virtual bool LoadReplay (const u8 *replay_data, u32 length)
virtual const u8 * ReplayUserData (u32 &length)
virtual ~GekkoSession ()=default

Private Member Functions

void Poll ()
void UpdateRecording ()
void FlushRecording ()
void RecordInitialState ()
void RecordConfirmedChecksums ()
void CaptureChecksumState (Frame frame)
bool AllActorsValid ()
void HandleReceivedInputs ()
void SendLocalInputs ()
u8 GetMinLocalDelay ()
bool IsPlayingLocally ()
bool IsLockstepActive () const
void AddDisconnectedPlayerInputs ()
void SendSpectatorInputs ()
void PrepareSpectatorStates ()
void CaptureSpectatorState ()
void HandleRollback ()
void HandleSavingConfirmedFrame ()
void HandleRunahead ()
void RewindRunahead ()
bool RollbackPending ()
bool ConfirmedSaveDue ()
Frame GetConfirmedFrame ()
bool ShouldStallAdvance ()
void SendSessionHealthCheck ()
void CaptureHealthState (Frame frame)
void SkipUnreachableHealthFrame ()
void SendNetworkHealthCheck ()
void SessionIntegrityCheck ()

Private Attributes

bool _started
Frame _last_saved_frame
Frame _last_sent_healthcheck
Frame _runahead_start_frame
u8 _runahead_frames
u8 _input_prediction_window
Frame _health_frame
bool _health_captured
std::unique_ptr< u8[]> _disconnected_input
GekkoConfig _config
SyncSystem _sync
GekkoNetAdapter * _host
MessageSystem _msg
StateStorage _storage
GameEventSystem _game_events
ReplaySystem _replay
StateEntry _spectator_state
StateEntry _health_state
std::vector< std::unique_ptr< StateEntry > > _checksum_states
u32 _checksum_captures
Frame _last_checksum_capture
RollbackCounters _rollback_stats

Static Private Attributes

static const Frame HEALTH_CHECK_INTERVAL = 16

Detailed Description

Definition at line 16 of file game_session.h.

Constructor & Destructor Documentation

◆ GameSession()

Gekko::GameSession::GameSession ( )

Definition at line 7 of file game_session.cpp.

Member Function Documentation

◆ AddActor()

i32 Gekko::GameSession::AddActor ( GekkoPlayerType type,
GekkoNetAddress * addr )
overridevirtual

Reimplemented from GekkoSession.

Definition at line 94 of file game_session.cpp.

◆ AddDisconnectedPlayerInputs()

void Gekko::GameSession::AddDisconnectedPlayerInputs ( )
private

Definition at line 595 of file game_session.cpp.

Here is the caller graph for this function:

◆ AddLocalInput()

void Gekko::GameSession::AddLocalInput ( i32 player,
void * input )
overridevirtual

Reimplemented from GekkoSession.

Definition at line 183 of file game_session.cpp.

◆ AllActorsValid()

bool Gekko::GameSession::AllActorsValid ( )
private

Definition at line 870 of file game_session.cpp.

Here is the caller graph for this function:

◆ CaptureChecksumState()

void Gekko::GameSession::CaptureChecksumState ( Frame frame)
private

Definition at line 430 of file game_session.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CaptureHealthState()

void Gekko::GameSession::CaptureHealthState ( Frame frame)
private

Definition at line 540 of file game_session.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CaptureSpectatorState()

void Gekko::GameSession::CaptureSpectatorState ( )
private

Definition at line 721 of file game_session.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConfirmedSaveDue()

bool Gekko::GameSession::ConfirmedSaveDue ( )
private

Definition at line 975 of file game_session.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DisconnectActor()

bool Gekko::GameSession::DisconnectActor ( i32 actor)
overridevirtual

Reimplemented from GekkoSession.

Definition at line 163 of file game_session.cpp.

◆ Events()

GekkoSessionEvent ** Gekko::GameSession::Events ( i32 * count)
overridevirtual

Implements GekkoSession.

Definition at line 257 of file game_session.cpp.

◆ FlushRecording()

void Gekko::GameSession::FlushRecording ( )
private

Definition at line 342 of file game_session.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FramesAhead()

f32 Gekko::GameSession::FramesAhead ( )
overridevirtual

Reimplemented from GekkoSession.

Definition at line 263 of file game_session.cpp.

◆ GetConfirmedFrame()

Frame Gekko::GameSession::GetConfirmedFrame ( )
private

Definition at line 985 of file game_session.cpp.

Here is the caller graph for this function:

◆ GetMinLocalDelay()

u8 Gekko::GameSession::GetMinLocalDelay ( )
private

Definition at line 947 of file game_session.cpp.

Here is the caller graph for this function:

◆ HandleReceivedInputs()

void Gekko::GameSession::HandleReceivedInputs ( )
private

Definition at line 888 of file game_session.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HandleRollback()

void Gekko::GameSession::HandleRollback ( )
private

Definition at line 785 of file game_session.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HandleRunahead()

void Gekko::GameSession::HandleRunahead ( )
private

Definition at line 1020 of file game_session.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HandleSavingConfirmedFrame()

void Gekko::GameSession::HandleSavingConfirmedFrame ( )
private

Definition at line 450 of file game_session.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Init()

void Gekko::GameSession::Init ( GekkoConfig * config)
overridevirtual

Implements GekkoSession.

Definition at line 25 of file game_session.cpp.

◆ IsLockstepActive()

bool Gekko::GameSession::IsLockstepActive ( ) const
private

Definition at line 961 of file game_session.cpp.

Here is the caller graph for this function:

◆ IsPlayingLocally()

bool Gekko::GameSession::IsPlayingLocally ( )
private

Definition at line 956 of file game_session.cpp.

Here is the caller graph for this function:

◆ NetworkPoll()

void Gekko::GameSession::NetworkPoll ( )
overridevirtual

Reimplemented from GekkoSession.

Definition at line 315 of file game_session.cpp.

Here is the call graph for this function:

◆ NetworkStats()

void Gekko::GameSession::NetworkStats ( i32 player,
GekkoNetworkStats * stats )
overridevirtual

Reimplemented from GekkoSession.

Definition at line 281 of file game_session.cpp.

◆ PeekRecording()

const u8 * Gekko::GameSession::PeekRecording ( u32 & length)
overridevirtual

Reimplemented from GekkoSession.

Definition at line 335 of file game_session.cpp.

Here is the call graph for this function:

◆ Poll()

void Gekko::GameSession::Poll ( )
private

Definition at line 834 of file game_session.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrepareSpectatorStates()

void Gekko::GameSession::PrepareSpectatorStates ( )
private

Definition at line 654 of file game_session.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RecordChecksums()

bool Gekko::GameSession::RecordChecksums ( u32 interval)
overridevirtual

Reimplemented from GekkoSession.

Definition at line 351 of file game_session.cpp.

◆ RecordConfirmedChecksums()

void Gekko::GameSession::RecordConfirmedChecksums ( )
private

Definition at line 376 of file game_session.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RecordInitialState()

void Gekko::GameSession::RecordInitialState ( )
private

Definition at line 398 of file game_session.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RewindRunahead()

void Gekko::GameSession::RewindRunahead ( )
private

Definition at line 1004 of file game_session.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RollbackPending()

bool Gekko::GameSession::RollbackPending ( )
private

Definition at line 966 of file game_session.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RollbackStats()

void Gekko::GameSession::RollbackStats ( GekkoRollbackStats * stats)
overridevirtual

Reimplemented from GekkoSession.

Definition at line 305 of file game_session.cpp.

◆ SendLocalInputs()

void Gekko::GameSession::SendLocalInputs ( )
private

Definition at line 918 of file game_session.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SendNetworkHealthCheck()

void Gekko::GameSession::SendNetworkHealthCheck ( )
private

Definition at line 563 of file game_session.cpp.

Here is the caller graph for this function:

◆ SendSessionHealthCheck()

void Gekko::GameSession::SendSessionHealthCheck ( )
private

Definition at line 482 of file game_session.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SendSpectatorInputs()

void Gekko::GameSession::SendSpectatorInputs ( )
private

Definition at line 640 of file game_session.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SessionIntegrityCheck()

void Gekko::GameSession::SessionIntegrityCheck ( )
private

Definition at line 568 of file game_session.cpp.

Here is the caller graph for this function:

◆ SetDisconnectTimeout()

void Gekko::GameSession::SetDisconnectTimeout ( u32 timeout)
overridevirtual

Reimplemented from GekkoSession.

Definition at line 178 of file game_session.cpp.

◆ SetInputPredictionWindow()

void Gekko::GameSession::SetInputPredictionWindow ( u8 window)
overridevirtual

Reimplemented from GekkoSession.

Definition at line 67 of file game_session.cpp.

Here is the call graph for this function:

◆ SetLocalDelay()

void Gekko::GameSession::SetLocalDelay ( i32 player,
u8 delay )
overridevirtual

Reimplemented from GekkoSession.

Definition at line 80 of file game_session.cpp.

◆ SetNetAdapter()

void Gekko::GameSession::SetNetAdapter ( GekkoNetAdapter * adapter)
overridevirtual

Reimplemented from GekkoSession.

Definition at line 89 of file game_session.cpp.

◆ SetReplayUserData()

bool Gekko::GameSession::SetReplayUserData ( const u8 * data,
u32 length )
overridevirtual

Reimplemented from GekkoSession.

Definition at line 356 of file game_session.cpp.

◆ SetRunahead()

void Gekko::GameSession::SetRunahead ( u8 runahead)
overridevirtual

Reimplemented from GekkoSession.

Definition at line 62 of file game_session.cpp.

◆ ShouldStallAdvance()

bool Gekko::GameSession::ShouldStallAdvance ( )
private

Definition at line 991 of file game_session.cpp.

Here is the caller graph for this function:

◆ SkipUnreachableHealthFrame()

void Gekko::GameSession::SkipUnreachableHealthFrame ( )
private

Definition at line 551 of file game_session.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StartRecording()

bool Gekko::GameSession::StartRecording ( bool save_initial_state,
bool disable_compression )
overridevirtual

Reimplemented from GekkoSession.

Definition at line 320 of file game_session.cpp.

◆ StopRecording()

const u8 * Gekko::GameSession::StopRecording ( u32 & length)
overridevirtual

Reimplemented from GekkoSession.

Definition at line 328 of file game_session.cpp.

Here is the call graph for this function:

◆ UpdateRecording()

void Gekko::GameSession::UpdateRecording ( )
private

Definition at line 361 of file game_session.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateSession()

GekkoGameEvent ** Gekko::GameSession::UpdateSession ( i32 * count)
overridevirtual

Implements GekkoSession.

Definition at line 195 of file game_session.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ _checksum_captures

u32 Gekko::GameSession::_checksum_captures
private

Definition at line 169 of file game_session.h.

◆ _checksum_states

std::vector<std::unique_ptr<StateEntry> > Gekko::GameSession::_checksum_states
private

Definition at line 167 of file game_session.h.

◆ _config

GekkoConfig Gekko::GameSession::_config
private

Definition at line 146 of file game_session.h.

◆ _disconnected_input

std::unique_ptr<u8[]> Gekko::GameSession::_disconnected_input
private

Definition at line 144 of file game_session.h.

◆ _game_events

GameEventSystem Gekko::GameSession::_game_events
private

Definition at line 156 of file game_session.h.

◆ _health_captured

bool Gekko::GameSession::_health_captured
private

Definition at line 142 of file game_session.h.

◆ _health_frame

Frame Gekko::GameSession::_health_frame
private

Definition at line 140 of file game_session.h.

◆ _health_state

StateEntry Gekko::GameSession::_health_state
private

Definition at line 162 of file game_session.h.

◆ _host

GekkoNetAdapter* Gekko::GameSession::_host
private

Definition at line 150 of file game_session.h.

◆ _input_prediction_window

u8 Gekko::GameSession::_input_prediction_window
private

Definition at line 138 of file game_session.h.

◆ _last_checksum_capture

Frame Gekko::GameSession::_last_checksum_capture
private

Definition at line 171 of file game_session.h.

◆ _last_saved_frame

Frame Gekko::GameSession::_last_saved_frame
private

Definition at line 130 of file game_session.h.

◆ _last_sent_healthcheck

Frame Gekko::GameSession::_last_sent_healthcheck
private

Definition at line 132 of file game_session.h.

◆ _msg

MessageSystem Gekko::GameSession::_msg
private

Definition at line 152 of file game_session.h.

◆ _replay

ReplaySystem Gekko::GameSession::_replay
private

Definition at line 158 of file game_session.h.

◆ _rollback_stats

RollbackCounters Gekko::GameSession::_rollback_stats
private

Definition at line 173 of file game_session.h.

◆ _runahead_frames

u8 Gekko::GameSession::_runahead_frames
private

Definition at line 136 of file game_session.h.

◆ _runahead_start_frame

Frame Gekko::GameSession::_runahead_start_frame
private

Definition at line 134 of file game_session.h.

◆ _spectator_state

StateEntry Gekko::GameSession::_spectator_state
private

Definition at line 160 of file game_session.h.

◆ _started

bool Gekko::GameSession::_started
private

Definition at line 128 of file game_session.h.

◆ _storage

StateStorage Gekko::GameSession::_storage
private

Definition at line 154 of file game_session.h.

◆ _sync

SyncSystem Gekko::GameSession::_sync
private

Definition at line 148 of file game_session.h.

◆ HEALTH_CHECK_INTERVAL

const Frame Gekko::GameSession::HEALTH_CHECK_INTERVAL = 16
staticprivate

Definition at line 164 of file game_session.h.


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