group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
NetworkConfig.hpp
Go to the documentation of this file.
1
3
4#pragma once
5
6#include <cstdint>
7#include <string>
8
11{
12 std::string host = "127.0.0.1";
13 uint16_t port = 9999;
14};
15
48{
53 int snapshotHz = 128;
54};
55
63{
68 bool enableUdpSidecar = true;
69
73 bool inputsOverUdp = true;
74
78 bool pingOverUdp = true;
79
87 bool snapshotsOverUdp = true;
88
95 bool eventsOverUdp = true;
96};
97
109
118[[nodiscard]] NetworkConfig loadNetworkConfig(const char* path);
NetworkConfig loadNetworkConfig(const char *path)
Load network config from a TOML file.
Definition NetworkConfig.cpp:10
Network address parameters.
Definition NetworkConfig.hpp:11
std::string host
Definition NetworkConfig.hpp:12
uint16_t port
Definition NetworkConfig.hpp:13
Runtime network connection parameters.
Definition NetworkConfig.hpp:103
NetworkAddress clientNetwork
Client network config (host and port).
Definition NetworkConfig.hpp:104
NetworkAddress serverNetwork
Server network config (host and port).
Definition NetworkConfig.hpp:105
TransportConfig transport
Phase 3d: UDP transport sub-feature toggles.
Definition NetworkConfig.hpp:107
ServerReplicationConfig serverRep
Server-side replication tuning.
Definition NetworkConfig.hpp:106
Server-side replication tuning parameters.
Definition NetworkConfig.hpp:48
int snapshotHz
How often the server emits a registry snapshot.
Definition NetworkConfig.hpp:53
Phase 3d: per-feature toggles for the UDP transport rollout.
Definition NetworkConfig.hpp:63
bool enableUdpSidecar
Stage 3d-1: bind a UDP datagram socket alongside the TCP socket.
Definition NetworkConfig.hpp:68
bool eventsOverUdp
Stage 3d-5: route KILL_EVENT, PARTICLE_SPAWN, and MATCH_STATE through a reliable-style UDP channel in...
Definition NetworkConfig.hpp:95
bool snapshotsOverUdp
Stage 3d-4: route UPDATE_REGISTRY snapshots over UDP instead of TCP.
Definition NetworkConfig.hpp:87
bool inputsOverUdp
Stage 3d-2: send INPUT packets over UDP instead of TCP.
Definition NetworkConfig.hpp:73
bool pingOverUdp
Stage 3d-3: send PING (client→server) and PONG (server→client) over UDP for accurate RTT measurement ...
Definition NetworkConfig.hpp:78