GekkoNet 1.0
C/C++ Peer to Peer Game Networking SDK
Loading...
Searching...
No Matches
stress_session.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4#include <map>
5
6#include "gekkonet.h"
7#include "gekko_types.h"
8#include "session.h"
9#include "backend.h"
10#include "event.h"
11#include "replay.h"
12#include "sync.h"
13#include "storage.h"
14
15namespace Gekko {
16
17 class StressSession : public GekkoSession {
18 public:
20
21 void Init(GekkoConfig* config) override;
22
23 void SetLocalDelay(i32 player, u8 delay) override;
24
25 i32 AddActor(GekkoPlayerType type, GekkoNetAddress* addr) override;
26
27 void AddLocalInput(i32 player, void* input) override;
28
29 GekkoGameEvent** UpdateSession(i32* count) override;
30
31 GekkoSessionEvent** Events(i32* count) override;
32
33 bool StartRecording(bool save_initial_state, bool disable_compression) override;
34
35 const u8* StopRecording(u32& length) override;
36
37 const u8* PeekRecording(u32& length) override;
38
39 bool RecordChecksums(u32 interval) override;
40
41 bool SetReplayUserData(const u8* data, u32 length) override;
42
43 private:
44 void HandleRollback();
45
46 void CheckForDesyncs(Frame check_frame);
47
48 void UpdateRecording();
49
50 void FlushRecording();
51
52 private:
54
56
58
60
62
64
65 std::vector<Player> _locals;
66
68
69 std::map<Frame, u32> _checksum_history;
70 };
71}
bool StartRecording(bool save_initial_state, bool disable_compression) override
void Init(GekkoConfig *config) override
std::map< Frame, u32 > _checksum_history
const u8 * StopRecording(u32 &length) override
GekkoSessionEvent ** Events(i32 *count) override
GekkoGameEvent ** UpdateSession(i32 *count) override
i32 AddActor(GekkoPlayerType type, GekkoNetAddress *addr) override
SessionEventSystem _session_events
GameEventSystem _game_events
std::vector< Player > _locals
bool RecordChecksums(u32 interval) override
const u8 * PeekRecording(u32 &length) override
bool SetReplayUserData(const u8 *data, u32 length) override
void SetLocalDelay(i32 player, u8 delay) override
void CheckForDesyncs(Frame check_frame)
void AddLocalInput(i32 player, void *input) override
int32_t i32
Definition gekko_types.h:12
int32_t Frame
Definition gekko_types.h:18
uint8_t u8
Definition gekko_types.h:5
uint32_t u32
Definition gekko_types.h:7
GekkoPlayerType
Definition gekkonet.h:77