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

#include <spectator_session.h>

Inheritance diagram for Gekko::SpectatorSession:
Collaboration diagram for Gekko::SpectatorSession:

Public Member Functions

 SpectatorSession ()
void Init (GekkoConfig *config) override
void SetNetAdapter (GekkoNetAdapter *adapter) override
i32 AddActor (GekkoPlayerType type, GekkoNetAddress *addr) override
bool DisconnectActor (i32 actor) override
void SetDisconnectTimeout (u32 timeout) override
GekkoGameEvent ** UpdateSession (i32 *count) override
GekkoSessionEvent ** Events (i32 *count) override
i32 SpectatorBufferedFrames () override
void NetworkStats (i32 player, GekkoNetworkStats *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 void SetLocalDelay (i32 player, u8 delay)
virtual void SetRunahead (u8 runahead)
virtual void SetInputPredictionWindow (u8 window)
virtual void AddLocalInput (i32 player, void *input)
virtual f32 FramesAhead ()
virtual void RollbackStats (GekkoRollbackStats *stats)
virtual bool LoadReplay (const u8 *replay_data, u32 length)
virtual const u8 * ReplayUserData (u32 &length)
virtual ~GekkoSession ()=default

Private Member Functions

u32 InputBufferSize () const
void Poll ()
bool AllActorsValid ()
void HandleReceivedInputs ()
bool ShouldDelaySpectator ()
void UpdateRecording ()
void FlushRecording ()
void RecordPendingChecksum ()

Private Attributes

bool _started
bool _delay_spectator
Frame _last_saved_frame
GekkoConfig _config
SyncSystem _sync
GekkoNetAdapter * _host
MessageSystem _msg
GameEventSystem _game_events
ReplaySystem _replay
bool _spectator_state_pending
Frame _spectator_state_frame
std::vector< u8 > _spectator_state
StateEntry _checksum_state
bool _checksum_pending

Static Private Attributes

static const u32 CATCH_UP_FRAMES = 3600

Detailed Description

Definition at line 15 of file spectator_session.h.

Constructor & Destructor Documentation

◆ SpectatorSession()

Gekko::SpectatorSession::SpectatorSession ( )

Definition at line 6 of file spectator_session.cpp.

Member Function Documentation

◆ AddActor()

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

Reimplemented from GekkoSession.

Definition at line 49 of file spectator_session.cpp.

◆ AllActorsValid()

bool Gekko::SpectatorSession::AllActorsValid ( )
private

Definition at line 292 of file spectator_session.cpp.

Here is the caller graph for this function:

◆ DisconnectActor()

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

Reimplemented from GekkoSession.

Definition at line 75 of file spectator_session.cpp.

◆ Events()

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

Implements GekkoSession.

Definition at line 160 of file spectator_session.cpp.

◆ FlushRecording()

void Gekko::SpectatorSession::FlushRecording ( )
private

Definition at line 205 of file spectator_session.cpp.

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

◆ HandleReceivedInputs()

void Gekko::SpectatorSession::HandleReceivedInputs ( )
private

Definition at line 312 of file spectator_session.cpp.

Here is the caller graph for this function:

◆ Init()

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

Implements GekkoSession.

Definition at line 18 of file spectator_session.cpp.

Here is the call graph for this function:

◆ InputBufferSize()

u32 Gekko::SpectatorSession::InputBufferSize ( ) const
private

Definition at line 145 of file spectator_session.cpp.

Here is the caller graph for this function:

◆ NetworkPoll()

void Gekko::SpectatorSession::NetworkPoll ( )
overridevirtual

Reimplemented from GekkoSession.

Definition at line 181 of file spectator_session.cpp.

Here is the call graph for this function:

◆ NetworkStats()

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

Reimplemented from GekkoSession.

Definition at line 166 of file spectator_session.cpp.

◆ PeekRecording()

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

Reimplemented from GekkoSession.

Definition at line 198 of file spectator_session.cpp.

Here is the call graph for this function:

◆ Poll()

void Gekko::SpectatorSession::Poll ( )
private

Definition at line 251 of file spectator_session.cpp.

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

◆ RecordChecksums()

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

Reimplemented from GekkoSession.

Definition at line 214 of file spectator_session.cpp.

◆ RecordPendingChecksum()

void Gekko::SpectatorSession::RecordPendingChecksum ( )
private

Definition at line 224 of file spectator_session.cpp.

Here is the caller graph for this function:

◆ SetDisconnectTimeout()

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

Reimplemented from GekkoSession.

Definition at line 91 of file spectator_session.cpp.

◆ SetNetAdapter()

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

Reimplemented from GekkoSession.

Definition at line 44 of file spectator_session.cpp.

◆ SetReplayUserData()

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

Reimplemented from GekkoSession.

Definition at line 219 of file spectator_session.cpp.

◆ ShouldDelaySpectator()

bool Gekko::SpectatorSession::ShouldDelaySpectator ( )
private

Definition at line 342 of file spectator_session.cpp.

Here is the caller graph for this function:

◆ SpectatorBufferedFrames()

i32 Gekko::SpectatorSession::SpectatorBufferedFrames ( )
overridevirtual

Reimplemented from GekkoSession.

Definition at line 150 of file spectator_session.cpp.

◆ StartRecording()

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

Reimplemented from GekkoSession.

Definition at line 186 of file spectator_session.cpp.

◆ StopRecording()

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

Reimplemented from GekkoSession.

Definition at line 191 of file spectator_session.cpp.

Here is the call graph for this function:

◆ UpdateRecording()

void Gekko::SpectatorSession::UpdateRecording ( )
private

Definition at line 235 of file spectator_session.cpp.

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

◆ UpdateSession()

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

Implements GekkoSession.

Definition at line 96 of file spectator_session.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ _checksum_pending

bool Gekko::SpectatorSession::_checksum_pending
private

Definition at line 97 of file spectator_session.h.

◆ _checksum_state

StateEntry Gekko::SpectatorSession::_checksum_state
private

Definition at line 95 of file spectator_session.h.

◆ _config

GekkoConfig Gekko::SpectatorSession::_config
private

Definition at line 76 of file spectator_session.h.

◆ _delay_spectator

bool Gekko::SpectatorSession::_delay_spectator
private

Definition at line 72 of file spectator_session.h.

◆ _game_events

GameEventSystem Gekko::SpectatorSession::_game_events
private

Definition at line 84 of file spectator_session.h.

◆ _host

GekkoNetAdapter* Gekko::SpectatorSession::_host
private

Definition at line 80 of file spectator_session.h.

◆ _last_saved_frame

Frame Gekko::SpectatorSession::_last_saved_frame
private

Definition at line 74 of file spectator_session.h.

◆ _msg

MessageSystem Gekko::SpectatorSession::_msg
private

Definition at line 82 of file spectator_session.h.

◆ _replay

ReplaySystem Gekko::SpectatorSession::_replay
private

Definition at line 86 of file spectator_session.h.

◆ _spectator_state

std::vector<u8> Gekko::SpectatorSession::_spectator_state
private

Definition at line 92 of file spectator_session.h.

◆ _spectator_state_frame

Frame Gekko::SpectatorSession::_spectator_state_frame
private

Definition at line 90 of file spectator_session.h.

◆ _spectator_state_pending

bool Gekko::SpectatorSession::_spectator_state_pending
private

Definition at line 88 of file spectator_session.h.

◆ _started

bool Gekko::SpectatorSession::_started
private

Definition at line 70 of file spectator_session.h.

◆ _sync

SyncSystem Gekko::SpectatorSession::_sync
private

Definition at line 78 of file spectator_session.h.

◆ CATCH_UP_FRAMES

const u32 Gekko::SpectatorSession::CATCH_UP_FRAMES = 3600
staticprivate

Definition at line 51 of file spectator_session.h.


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