Nebula
Loading...
Searching...
No Matches
Multiplayer Namespace Reference

Classes

class  BaseMultiplayerClient
 
class  BaseMultiplayerServer
 
class  ClientConnection
 
struct  ClientProcessorContext
 
class  MultiplayerFeatureUnit
 
struct  ServerProcessorContext
 
class  StandardMultiplayerClient
 
class  StandardMultiplayerServer
 

Enumerations

enum class  ConnectionStatus { Disconnected = 0 , TryingToConnect = 1 , Connected = 2 }
 
enum class  ClientGroup {
  DontCare = 0 , Lobby , Game , Monitoring ,
  NumClientGroups
}
 Clients can be bucketet into client groups that can be polled at differing rates. More...
 

Functions

static void SteamNetConnectionStatusChangedCallback (SteamNetConnectionStatusChangedCallback_t *info)
 
void InterpolatePositions (Game::World *world, NetworkId const &netId, NetworkTransform &s, Game::Position &pos)
 
void SetupClientProcessors (BaseMultiplayerClient *client)
 
void ShutdownClientProcessors ()
 
Game::Entity UnpackEntity (Game::World *world, Util::Blob const &data)
 
 __ImplementClass (Multiplayer::MultiplayerFeatureUnit, 'MPFU', Game::FeatureUnit)
 
 __ImplementSingleton (MultiplayerFeatureUnit)
 
static void DebugOutput (ESteamNetworkingSocketsDebugOutputType eType, const char *pszMsg)
 
static void InitSteamDatagramConnectionSockets ()
 
static void ShutdownSteamDatagramConnectionSockets ()
 
void RefreshConfigCVars (bool force=false)
 
static void SvSteamNetConnectionStatusChangedCallback (SteamNetConnectionStatusChangedCallback_t *info)
 
void SyncPositions (Game::World *world, NetworkId const &netId, NetworkTransform &netTransform, Game::Position &pos)
 
void SetupServerProcessors (BaseMultiplayerServer *server)
 
void ShutdownServerProcessors ()
 
void SetServerProcessorsActive (bool active)
 

Variables

static BaseMultiplayerClientcallbackInstance = nullptr
 
static ClientProcessorContextcontext
 
static Util::StringAtom frameEvent
 
SteamNetworkingMicroseconds logTimeZero
 
Core::CVarnet_fake_packet_lag_send = Core::CVarCreate(Core::CVarType::CVar_Int, "net_fake_packet_lag_send", "0", "Delay all outbound packets by N ms")
 
Core::CVarnet_fake_packet_lag_recv = Core::CVarCreate(Core::CVarType::CVar_Int, "net_fake_packet_lag_recv", "0", "Delay all inbound packets by N ms")
 
Core::CVarnet_fake_packet_loss_send = Core::CVarCreate(Core::CVarType::CVar_Int, "net_fake_packet_loss_send", "0", "[0--100] Randomly discard N percent of packets sent")
 
Core::CVarnet_fake_packet_loss_recv = Core::CVarCreate(Core::CVarType::CVar_Int, "net_fake_packet_loss_recv", "0", "[0--100] Randomly discard N percent of packets received")
 
Core::CVarnet_fake_packet_jitter_send_avg = Core::CVarCreate(Core::CVarType::CVar_Int, "net_fake_packet_jitter_send_avg", "0", "A random jitter time is generated using an exponential distribution using this value as the mean (ms). The default is zero, which disables random jitter.")
 
Core::CVarnet_fake_packet_jitter_send_pct = Core::CVarCreate(Core::CVarType::CVar_Int, "net_fake_packet_jitter_send_pct", "0", "Odds (0-100) that a random jitter value for the packet will be generated. Otherwise, a jitter value of zero is used, and the packet will only be delayed by the jitter system if necessary to retain order, due to the jitter of a previous packet.")
 
Core::CVarnet_fake_packet_jitter_send_max = Core::CVarCreate(Core::CVarType::CVar_Int, "net_fake_packet_jitter_send_max", "0", "Limit the random jitter time to this value (ms). Default 0.")
 
Core::CVarnet_fake_packet_jitter_recv_avg = Core::CVarCreate(Core::CVarType::CVar_Int, "net_fake_packet_jitter_recv_avg", "0", "A random jitter time is generated using an exponential distribution using this value as the mean (ms). The default is zero, which disables random jitter.")
 
Core::CVarnet_fake_packet_jitter_recv_pct = Core::CVarCreate(Core::CVarType::CVar_Int, "net_fake_packet_jitter_recv_pct", "0", "Odds (0-100) that a random jitter value for the packet will be generated. Otherwise, a jitter value of zero is used, and the packet will only be delayed by the jitter system if necessary to retain order, due to the jitter of a previous packet.")
 
Core::CVarnet_fake_packet_jitter_recv_max = Core::CVarCreate(Core::CVarType::CVar_Int, "net_fake_packet_jitter_recv_max", "0", "Limit the random jitter time to this value (ms). Default 0.")
 
Core::CVarnet_fake_packet_reorder_send = Core::CVarCreate(Core::CVarType::CVar_Int, "net_fake_packet_reorder_send", "0", "0-100 Percentage of packets to add additional delay to. If other packet(s) are sent/received within this delay window (that doesn't also randomly receive the same extra delay), then the packets become reordered.")
 
Core::CVarnet_fake_packet_reorder_recv = Core::CVarCreate(Core::CVarType::CVar_Int, "net_fake_packet_reorder_recv", "0", "0-100 Percentage of packets to add additional delay to. If other packet(s) are sent/received within this delay window (that doesn't also randomly receive the same extra delay), then the packets become reordered.")
 
const double NEBULA_DEFAULT_TICK_RATE = 1.0/8.0
 
static BaseMultiplayerServercallbackServerInstance = nullptr
 
static ServerProcessorContextcontext
 
static Util::StringAtom frameEvent
 

Enumeration Type Documentation

◆ ClientGroup

enum class Multiplayer::ClientGroup
strong

Clients can be bucketet into client groups that can be polled at differing rates.

Enumerator
DontCare 
Lobby 
Game 
Monitoring 
NumClientGroups 

◆ ConnectionStatus

enum class Multiplayer::ConnectionStatus
strong
Enumerator
Disconnected 
TryingToConnect 
Connected 

Function Documentation

◆ __ImplementClass()

Multiplayer::__ImplementClass ( Multiplayer::MultiplayerFeatureUnit ,
'MPFU' ,
Game::FeatureUnit  )

◆ __ImplementSingleton()

Multiplayer::__ImplementSingleton ( MultiplayerFeatureUnit )

◆ DebugOutput()

static void Multiplayer::DebugOutput ( ESteamNetworkingSocketsDebugOutputType eType,
const char * pszMsg )
static

◆ InitSteamDatagramConnectionSockets()

static void Multiplayer::InitSteamDatagramConnectionSockets ( )
static

◆ InterpolatePositions()

void Multiplayer::InterpolatePositions ( Game::World * world,
NetworkId const & netId,
NetworkTransform & s,
Game::Position & pos )

◆ RefreshConfigCVars()

void Multiplayer::RefreshConfigCVars ( bool force = false)

◆ SetServerProcessorsActive()

void Multiplayer::SetServerProcessorsActive ( bool active)

◆ SetupClientProcessors()

void Multiplayer::SetupClientProcessors ( BaseMultiplayerClient * client)

◆ SetupServerProcessors()

void Multiplayer::SetupServerProcessors ( BaseMultiplayerServer * server)

◆ ShutdownClientProcessors()

void Multiplayer::ShutdownClientProcessors ( )

◆ ShutdownServerProcessors()

void Multiplayer::ShutdownServerProcessors ( )

◆ ShutdownSteamDatagramConnectionSockets()

static void Multiplayer::ShutdownSteamDatagramConnectionSockets ( )
static

◆ SteamNetConnectionStatusChangedCallback()

static void Multiplayer::SteamNetConnectionStatusChangedCallback ( SteamNetConnectionStatusChangedCallback_t * info)
static

◆ SvSteamNetConnectionStatusChangedCallback()

static void Multiplayer::SvSteamNetConnectionStatusChangedCallback ( SteamNetConnectionStatusChangedCallback_t * info)
static

◆ SyncPositions()

void Multiplayer::SyncPositions ( Game::World * world,
NetworkId const & netId,
NetworkTransform & netTransform,
Game::Position & pos )

◆ UnpackEntity()

Game::Entity Multiplayer::UnpackEntity ( Game::World * world,
Util::Blob const & data )

Variable Documentation

◆ callbackInstance

BaseMultiplayerClient* Multiplayer::callbackInstance = nullptr
static

◆ callbackServerInstance

BaseMultiplayerServer* Multiplayer::callbackServerInstance = nullptr
static

◆ context [1/2]

ClientProcessorContext* Multiplayer::context
static

◆ context [2/2]

ServerProcessorContext* Multiplayer::context
static

◆ frameEvent [1/2]

Util::StringAtom Multiplayer::frameEvent
static

◆ frameEvent [2/2]

Util::StringAtom Multiplayer::frameEvent
static

◆ logTimeZero

SteamNetworkingMicroseconds Multiplayer::logTimeZero

◆ NEBULA_DEFAULT_TICK_RATE

const double Multiplayer::NEBULA_DEFAULT_TICK_RATE = 1.0/8.0

◆ net_fake_packet_jitter_recv_avg

Core::CVar* Multiplayer::net_fake_packet_jitter_recv_avg = Core::CVarCreate(Core::CVarType::CVar_Int, "net_fake_packet_jitter_recv_avg", "0", "A random jitter time is generated using an exponential distribution using this value as the mean (ms). The default is zero, which disables random jitter.")

◆ net_fake_packet_jitter_recv_max

Core::CVar* Multiplayer::net_fake_packet_jitter_recv_max = Core::CVarCreate(Core::CVarType::CVar_Int, "net_fake_packet_jitter_recv_max", "0", "Limit the random jitter time to this value (ms). Default 0.")

◆ net_fake_packet_jitter_recv_pct

Core::CVar* Multiplayer::net_fake_packet_jitter_recv_pct = Core::CVarCreate(Core::CVarType::CVar_Int, "net_fake_packet_jitter_recv_pct", "0", "Odds (0-100) that a random jitter value for the packet will be generated. Otherwise, a jitter value of zero is used, and the packet will only be delayed by the jitter system if necessary to retain order, due to the jitter of a previous packet.")

◆ net_fake_packet_jitter_send_avg

Core::CVar* Multiplayer::net_fake_packet_jitter_send_avg = Core::CVarCreate(Core::CVarType::CVar_Int, "net_fake_packet_jitter_send_avg", "0", "A random jitter time is generated using an exponential distribution using this value as the mean (ms). The default is zero, which disables random jitter.")

◆ net_fake_packet_jitter_send_max

Core::CVar* Multiplayer::net_fake_packet_jitter_send_max = Core::CVarCreate(Core::CVarType::CVar_Int, "net_fake_packet_jitter_send_max", "0", "Limit the random jitter time to this value (ms). Default 0.")

◆ net_fake_packet_jitter_send_pct

Core::CVar* Multiplayer::net_fake_packet_jitter_send_pct = Core::CVarCreate(Core::CVarType::CVar_Int, "net_fake_packet_jitter_send_pct", "0", "Odds (0-100) that a random jitter value for the packet will be generated. Otherwise, a jitter value of zero is used, and the packet will only be delayed by the jitter system if necessary to retain order, due to the jitter of a previous packet.")

◆ net_fake_packet_lag_recv

Core::CVar* Multiplayer::net_fake_packet_lag_recv = Core::CVarCreate(Core::CVarType::CVar_Int, "net_fake_packet_lag_recv", "0", "Delay all inbound packets by N ms")

◆ net_fake_packet_lag_send

Core::CVar* Multiplayer::net_fake_packet_lag_send = Core::CVarCreate(Core::CVarType::CVar_Int, "net_fake_packet_lag_send", "0", "Delay all outbound packets by N ms")

◆ net_fake_packet_loss_recv

Core::CVar* Multiplayer::net_fake_packet_loss_recv = Core::CVarCreate(Core::CVarType::CVar_Int, "net_fake_packet_loss_recv", "0", "[0--100] Randomly discard N percent of packets received")

◆ net_fake_packet_loss_send

Core::CVar* Multiplayer::net_fake_packet_loss_send = Core::CVarCreate(Core::CVarType::CVar_Int, "net_fake_packet_loss_send", "0", "[0--100] Randomly discard N percent of packets sent")

◆ net_fake_packet_reorder_recv

Core::CVar* Multiplayer::net_fake_packet_reorder_recv = Core::CVarCreate(Core::CVarType::CVar_Int, "net_fake_packet_reorder_recv", "0", "0-100 Percentage of packets to add additional delay to. If other packet(s) are sent/received within this delay window (that doesn't also randomly receive the same extra delay), then the packets become reordered.")

◆ net_fake_packet_reorder_send

Core::CVar* Multiplayer::net_fake_packet_reorder_send = Core::CVarCreate(Core::CVarType::CVar_Int, "net_fake_packet_reorder_send", "0", "0-100 Percentage of packets to add additional delay to. If other packet(s) are sent/received within this delay window (that doesn't also randomly receive the same extra delay), then the packets become reordered.")