GekkoNet 1.0
C/C++ Peer to Peer Game Networking SDK
Loading...
Searching...
No Matches
gekkonet.cpp File Reference
#include "gekkonet.h"
#include "session/game_session.h"
#include "session/replay_session.h"
#include "session/spectator_session.h"
#include "session/stress_session.h"
#include "asio/asio.hpp"
#include <cstring>
#include <iostream>
Include dependency graph for gekkonet.cpp:

Go to the source code of this file.

Macros

#define ASIO_STANDALONE

Functions

GEKKONET_API bool gekko_create (GekkoSession **session, GekkoSessionType session_type)
bool gekko_destroy (GekkoSession **session)
void gekko_start (GekkoSession *session, GekkoConfig *config)
void gekko_net_adapter_set (GekkoSession *session, GekkoNetAdapter *adapter)
int gekko_add_actor (GekkoSession *session, GekkoPlayerType player_type, GekkoNetAddress *addr)
bool gekko_disconnect_actor (GekkoSession *session, int actor)
void gekko_set_disconnect_timeout (GekkoSession *session, unsigned int timeout)
void gekko_set_local_delay (GekkoSession *session, int player, unsigned char delay)
void gekko_set_runahead (GekkoSession *session, unsigned char runahead)
void gekko_set_input_prediction_window (GekkoSession *session, unsigned char window)
void gekko_add_local_input (GekkoSession *session, int player, void *input)
GekkoGameEvent ** gekko_update_session (GekkoSession *session, int *count)
GekkoSessionEvent ** gekko_session_events (GekkoSession *session, int *count)
float gekko_frames_ahead (GekkoSession *session)
int gekko_spectator_buffered_frames (GekkoSession *session)
void gekko_network_stats (GekkoSession *session, int player, GekkoNetworkStats *stats)
void gekko_rollback_stats (GekkoSession *session, GekkoRollbackStats *stats)
void gekko_network_poll (GekkoSession *session)
bool gekko_start_recording (GekkoSession *session, bool save_initial_state, bool disable_compression)
const unsigned char * gekko_stop_recording (GekkoSession *session, unsigned int *length)
const unsigned char * gekko_peek_recording (GekkoSession *session, unsigned int *length)
bool gekko_record_checksums (GekkoSession *session, unsigned int interval)
bool gekko_set_replay_user_data (GekkoSession *session, const void *data, unsigned int length)
bool gekko_load_replay (GekkoSession *session, const unsigned char *replay_data, unsigned int length)
const unsigned char * gekko_replay_user_data (GekkoSession *session, unsigned int *length)
static asio::ip::udp::endpoint STOE (const std::string &str)
static void asio_send (GekkoNetAddress *addr, const char *data, int length)
static GekkoNetResult ** asio_receive (int *length)
static void asio_free (void *data_ptr)
GekkoNetAdapter * gekko_default_adapter (unsigned short port)
bool gekko_default_adapter_destroy ()

Variables

static char _buffer [65536]
static asio::error_code _ec
static asio::io_context _io_ctx
static asio::ip::udp::endpoint _remote
static std::vector< GekkoNetResult * > _results
static asio::ip::udp::socket * _socket = nullptr
static GekkoNetAdapter default_sock

Macro Definition Documentation

◆ ASIO_STANDALONE

#define ASIO_STANDALONE

Definition at line 196 of file gekkonet.cpp.

Function Documentation

◆ asio_free()

void asio_free ( void * data_ptr)
static

Definition at line 278 of file gekkonet.cpp.

◆ asio_receive()

GekkoNetResult ** asio_receive ( int * length)
static

Definition at line 244 of file gekkonet.cpp.

◆ asio_send()

void asio_send ( GekkoNetAddress * addr,
const char * data,
int length )
static

Definition at line 222 of file gekkonet.cpp.

Here is the call graph for this function:

◆ gekko_add_actor()

int gekko_add_actor ( GekkoSession * session,
GekkoPlayerType player_type,
GekkoNetAddress * addr )

Definition at line 59 of file gekkonet.cpp.

Here is the call graph for this function:

◆ gekko_add_local_input()

void gekko_add_local_input ( GekkoSession * session,
int player,
void * input )

Definition at line 89 of file gekkonet.cpp.

Here is the call graph for this function:

◆ gekko_create()

GEKKONET_API bool gekko_create ( GekkoSession ** session,
GekkoSessionType session_type )

Definition at line 8 of file gekkonet.cpp.

◆ gekko_default_adapter()

GekkoNetAdapter * gekko_default_adapter ( unsigned short port)

Definition at line 288 of file gekkonet.cpp.

◆ gekko_default_adapter_destroy()

bool gekko_default_adapter_destroy ( )

Definition at line 322 of file gekkonet.cpp.

◆ gekko_destroy()

bool gekko_destroy ( GekkoSession ** session)

Definition at line 38 of file gekkonet.cpp.

◆ gekko_disconnect_actor()

bool gekko_disconnect_actor ( GekkoSession * session,
int actor )

Definition at line 64 of file gekkonet.cpp.

Here is the call graph for this function:

◆ gekko_frames_ahead()

float gekko_frames_ahead ( GekkoSession * session)

Definition at line 104 of file gekkonet.cpp.

Here is the call graph for this function:

◆ gekko_load_replay()

bool gekko_load_replay ( GekkoSession * session,
const unsigned char * replay_data,
unsigned int length )

Definition at line 170 of file gekkonet.cpp.

Here is the call graph for this function:

◆ gekko_net_adapter_set()

void gekko_net_adapter_set ( GekkoSession * session,
GekkoNetAdapter * adapter )

Definition at line 54 of file gekkonet.cpp.

Here is the call graph for this function:

◆ gekko_network_poll()

void gekko_network_poll ( GekkoSession * session)

Definition at line 124 of file gekkonet.cpp.

Here is the call graph for this function:

◆ gekko_network_stats()

void gekko_network_stats ( GekkoSession * session,
int player,
GekkoNetworkStats * stats )

Definition at line 114 of file gekkonet.cpp.

Here is the call graph for this function:

◆ gekko_peek_recording()

const unsigned char * gekko_peek_recording ( GekkoSession * session,
unsigned int * length )

Definition at line 147 of file gekkonet.cpp.

Here is the call graph for this function:

◆ gekko_record_checksums()

bool gekko_record_checksums ( GekkoSession * session,
unsigned int interval )

Definition at line 160 of file gekkonet.cpp.

Here is the call graph for this function:

◆ gekko_replay_user_data()

const unsigned char * gekko_replay_user_data ( GekkoSession * session,
unsigned int * length )

Definition at line 175 of file gekkonet.cpp.

Here is the call graph for this function:

◆ gekko_rollback_stats()

void gekko_rollback_stats ( GekkoSession * session,
GekkoRollbackStats * stats )

Definition at line 119 of file gekkonet.cpp.

Here is the call graph for this function:

◆ gekko_session_events()

GekkoSessionEvent ** gekko_session_events ( GekkoSession * session,
int * count )

Definition at line 99 of file gekkonet.cpp.

Here is the call graph for this function:

◆ gekko_set_disconnect_timeout()

void gekko_set_disconnect_timeout ( GekkoSession * session,
unsigned int timeout )

Definition at line 69 of file gekkonet.cpp.

Here is the call graph for this function:

◆ gekko_set_input_prediction_window()

void gekko_set_input_prediction_window ( GekkoSession * session,
unsigned char window )

Definition at line 84 of file gekkonet.cpp.

Here is the call graph for this function:

◆ gekko_set_local_delay()

void gekko_set_local_delay ( GekkoSession * session,
int player,
unsigned char delay )

Definition at line 74 of file gekkonet.cpp.

Here is the call graph for this function:

◆ gekko_set_replay_user_data()

bool gekko_set_replay_user_data ( GekkoSession * session,
const void * data,
unsigned int length )

Definition at line 165 of file gekkonet.cpp.

Here is the call graph for this function:

◆ gekko_set_runahead()

void gekko_set_runahead ( GekkoSession * session,
unsigned char runahead )

Definition at line 79 of file gekkonet.cpp.

Here is the call graph for this function:

◆ gekko_spectator_buffered_frames()

int gekko_spectator_buffered_frames ( GekkoSession * session)

Definition at line 109 of file gekkonet.cpp.

Here is the call graph for this function:

◆ gekko_start()

void gekko_start ( GekkoSession * session,
GekkoConfig * config )

Definition at line 49 of file gekkonet.cpp.

Here is the call graph for this function:

◆ gekko_start_recording()

bool gekko_start_recording ( GekkoSession * session,
bool save_initial_state,
bool disable_compression )

Definition at line 129 of file gekkonet.cpp.

Here is the call graph for this function:

◆ gekko_stop_recording()

const unsigned char * gekko_stop_recording ( GekkoSession * session,
unsigned int * length )

Definition at line 134 of file gekkonet.cpp.

Here is the call graph for this function:

◆ gekko_update_session()

GekkoGameEvent ** gekko_update_session ( GekkoSession * session,
int * count )

Definition at line 94 of file gekkonet.cpp.

Here is the call graph for this function:

◆ STOE()

asio::ip::udp::endpoint STOE ( const std::string & str)
static

Definition at line 209 of file gekkonet.cpp.

Here is the caller graph for this function:

Variable Documentation

◆ _buffer

char _buffer[65536]
static

Definition at line 202 of file gekkonet.cpp.

◆ _ec

asio::error_code _ec
static

Definition at line 203 of file gekkonet.cpp.

◆ _io_ctx

asio::io_context _io_ctx
static

Definition at line 204 of file gekkonet.cpp.

◆ _remote

asio::ip::udp::endpoint _remote
static

Definition at line 205 of file gekkonet.cpp.

◆ _results

std::vector<GekkoNetResult*> _results
static

Definition at line 206 of file gekkonet.cpp.

◆ _socket

asio::ip::udp::socket* _socket = nullptr
static

Definition at line 207 of file gekkonet.cpp.

◆ default_sock

GekkoNetAdapter default_sock
static
Initial value:
{
}
static void asio_free(void *data_ptr)
Definition gekkonet.cpp:278
static GekkoNetResult ** asio_receive(int *length)
Definition gekkonet.cpp:244
static void asio_send(GekkoNetAddress *addr, const char *data, int length)
Definition gekkonet.cpp:222

Definition at line 282 of file gekkonet.cpp.