FCompositeTransport
Address-form dispatching transport. Owns an ENet backend (always) and a Steam P2P backend (lazily, only when the Steam client is up), and picks per-call: Connect("127.0.0.1") → ENet (contains '.') Connect("fe80::1") → ENet (contains ':') Connect("myserver") → ENet (hostname) Connect("76561198000000000") → Steam (pure digits, > 32 bits = SteamID64) Host(...) → the Steam relay alone when Steam is up, ENet when it is not; both (dual listen) only when direct hosting is allowed (AllowsDirectListen) A dual listen lets an IP client and a SteamID/SDR client join the same session; Steam-side peer ids carry the high bit so the two id spaces never collide. It is opt-in because the direct listener hands the host's IP address to every peer, which the relay exists to hide.
- Module
- Networking
- Header
#include "Networking/CompositeTransport.h"- Namespace
Mowo
Constructors
| Signature | Name | Description |
|---|---|---|
FCompositeTransport() | FCompositeTransport | |
~FCompositeTransport() override | ~FCompositeTransport | |
FCompositeTransport(const FCompositeTransport&) = delete | FCompositeTransport |
Public functions
| Returns | Name | Description |
|---|---|---|
EAddressKind | ClassifyAddress | Pure address-form classification — no Steam/network calls, unit-testable. |
void | SetSessionDirectListen | The next Host() may also open the direct UDP listener: the session asked for a LAN / direct-IP game (FNetSessionSettings::directListen), the project allows it (Network Privacy), net.AllowDirectHost is 1, or this is a dedicated server, whose address is public anyway. |
bool | AllowsDirectListen | |
bool | IsDirectListening | True while the direct (ENet) listener is open on this host. |
bool | Host | |
uint16_t | GetBoundPort | |
bool | Connect | |
void | Disconnect | |
void | DisconnectPeer | |
void | DisconnectPeerAfterFlush | |
void | Poll | |
void | Send | |
void | Broadcast | |
ConnectionState | GetState | |
uint32_t | GetLocalPeerId | |
const std::vector<NetworkPeer>& | GetPeers | |
bool | GetPeerStats | |
bool | GetSimulationStats | |
std::string | GetJoinKey | |
void | SetJoinKey | |
FCompositeTransport& | operator= |
Function details
FCompositeTransport
FCompositeTransport()~FCompositeTransport
~FCompositeTransport() overrideFCompositeTransport
FCompositeTransport(const FCompositeTransport&) = deleteClassifyAddress
static EAddressKind ClassifyAddress(const std::string& address)Pure address-form classification — no Steam/network calls, unit-testable.
SetSessionDirectListen
static void SetSessionDirectListen(bool direct)The next Host() may also open the direct UDP listener: the session asked for a LAN / direct-IP game (FNetSessionSettings::directListen), the project allows it (Network Privacy), net.AllowDirectHost is 1, or this is a dedicated server, whose address is public anyway.
AllowsDirectListen
static bool AllowsDirectListen()IsDirectListening
bool IsDirectListening() constTrue while the direct (ENet) listener is open on this host.
Host
bool Host(uint16_t port, uint32_t maxClients) overrideGetBoundPort
uint16_t GetBoundPort() const overrideConnect
bool Connect(const std::string& address, uint16_t port) overrideDisconnect
void Disconnect() overrideDisconnectPeer
void DisconnectPeer(uint32_t peerId) overrideDisconnectPeerAfterFlush
void DisconnectPeerAfterFlush(uint32_t peerId) overridePoll
void Poll(std::vector<NetworkEvent>& outEvents) overrideSend
void Send(uint32_t peerId, const void* data, size_t size, uint8_t channel) overrideBroadcast
void Broadcast(const void* data, size_t size, uint8_t channel) overrideGetState
ConnectionState GetState() const overrideGetLocalPeerId
uint32_t GetLocalPeerId() const overrideGetPeers
const std::vector<NetworkPeer>& GetPeers() const overrideGetPeerStats
bool GetPeerStats(uint32_t peerId, NetworkPeerStats& outStats) const overrideGetSimulationStats
bool GetSimulationStats(FNetSimTransportStats& outStats) const overrideGetJoinKey
std::string GetJoinKey() const overrideSetJoinKey
void SetJoinKey(const std::string& key) overrideoperator=
FCompositeTransport& operator=(const FCompositeTransport&) = delete