FNetSessionPlatform
The one place the platform's lobby/invite surface is reached from, and the single owner of the Steam join-requested delegate. Everything is a safe no-op (false / empty) when Steam is absent or the SDK was not compiled in.
- Module
- Networking
- Header
#include "Networking/Session/NetSessionPlatform.h"- Namespace
Mowo
Type aliases
| Alias | Description |
|---|---|
using JoinRequestedCallback = std::function<void(uint64_t hostSteamId)> | |
using LobbyListCallback = std::function<void(const std::vector<FPlatformLobbyInfo>&)> |
Public functions
| Returns | Name | Description |
|---|---|---|
bool | IsSteamAvailable | |
uint64_t | GetLocalPlatformId | |
bool | IsDlcInstalled | |
bool | CreateLobby | |
bool | JoinLobby | |
void | LeaveLobby | |
bool | IsInLobby | |
uint64_t | GetCurrentLobbyId | |
uint64_t | GetLobbyHostSteamId | |
bool | RequestLobbyList | Browse public lobbies. |
void | AdvertiseSession | Host side of the handoff: publish the host SteamID64 + session name so a friend's "Join Game" resolves to an address the Steam P2P transport can dial. |
void | ClearAdvertisement | |
void | SetRichPresence | |
void | ClearRichPresence | |
void | SetRichPresenceValue | Raw presence keys and the friends-list party, fanned to every service. |
void | SetPresenceGroup | |
void | ClearPresenceGroup | |
void | SetJoinRequestedCallback | Join-requested delegate, two slots with a fixed priority. |
void | ClearJoinRequestedCallback | |
bool | HasJoinRequestedCallback | |
void | SetFallbackJoinHandler | |
bool | HasFallbackJoinHandler | |
bool | DispatchJoinRequested | Entry point of an accepted invite. |
uint64_t | GetLastJoinRequestHost | Host ids handed to DispatchJoinRequested, newest last. |
uint32_t | GetJoinRequestCount | |
void | ResetJoinRequestStats |
Function details
IsSteamAvailable
static bool IsSteamAvailable()GetLocalPlatformId
static uint64_t GetLocalPlatformId()IsDlcInstalled
static bool IsDlcInstalled(uint32_t steamAppId)CreateLobby
static bool CreateLobby(int32_t maxPlayers)JoinLobby
static bool JoinLobby(uint64_t lobbyId)LeaveLobby
static void LeaveLobby()IsInLobby
static bool IsInLobby()GetCurrentLobbyId
static uint64_t GetCurrentLobbyId()GetLobbyHostSteamId
static uint64_t GetLobbyHostSteamId()RequestLobbyList
static bool RequestLobbyList(LobbyListCallback callback)Browse public lobbies. Fires the callback with an empty list when Steam is unavailable, so a caller never has to branch on the build flavour.
AdvertiseSession
static void AdvertiseSession(const std::string& sessionName, int32_t maxPlayers)Host side of the handoff: publish the host SteamID64 + session name so a friend's "Join Game" resolves to an address the Steam P2P transport can dial. Paired with ClearAdvertisement when the session ends.
ClearAdvertisement
static void ClearAdvertisement()SetRichPresence
static void SetRichPresence(const std::string& details, const std::string& state)ClearRichPresence
static void ClearRichPresence()SetRichPresenceValue
static void SetRichPresenceValue(const std::string& key, const std::string& value)Raw presence keys and the friends-list party, fanned to every service. FNetSession keeps the party current on its own: the group is the host's platform id (the session name without one) and the size the roster.
SetPresenceGroup
static void SetPresenceGroup(const std::string& groupId, int32_t groupSize)ClearPresenceGroup
static void ClearPresenceGroup()SetJoinRequestedCallback
static void SetJoinRequestedCallback(JoinRequestedCallback callback)Join-requested delegate, two slots with a fixed priority. The session layer claims the first; the engine-level fallback (MPlatformSubsystem's raw transport connect) only runs when no session handler is installed. Two owners used to race for one slot, so whichever initialized last silently disabled the other.
ClearJoinRequestedCallback
static void ClearJoinRequestedCallback()HasJoinRequestedCallback
static bool HasJoinRequestedCallback()SetFallbackJoinHandler
static void SetFallbackJoinHandler(JoinRequestedCallback callback)HasFallbackJoinHandler
static bool HasFallbackJoinHandler()DispatchJoinRequested
static bool DispatchJoinRequested(uint64_t hostSteamId)Entry point of an accepted invite. Called by the Steam callback and directly by the self-tests, which is what makes the handoff state machine testable without a Steam client.
GetLastJoinRequestHost
static uint64_t GetLastJoinRequestHost()Host ids handed to DispatchJoinRequested, newest last. Diagnostics for the invite path, which is otherwise invisible until a peer connects.
GetJoinRequestCount
static uint32_t GetJoinRequestCount()ResetJoinRequestStats
static void ResetJoinRequestStats()