IOnlineService
- Module
- Networking
- Header
#include "Networking/OnlineService.h"- Namespace
Mowo
Constructors
| Signature | Name | Description |
|---|---|---|
virtual ~IOnlineService() = default | ~IOnlineService |
Public functions
| Returns | Name | Description |
|---|---|---|
const char* | Name | |
bool | Init | Lifecycle. |
void | Update | |
void | Shutdown | |
bool | IsAvailable | |
bool | IsReady | |
uint64_t | GetLocalUserId | Identity / entitlements — the primary-platform surface. |
bool | IsDlcInstalled | |
bool | BeginAuthorization | Explicit user-consent sign-in (Discord OAuth2 PKCE). |
bool | IsAuthorized | |
std::unique_ptr<INetworkTransport> | CreateP2PTransport | P2P relay transport. |
bool | SetNetworkSimulation | Network emulation. |
bool | CreateLobby | Lobby / session advertisement. |
bool | JoinLobby | |
void | LeaveLobby | |
bool | IsInLobby | |
uint64_t | GetCurrentLobbyId | |
uint64_t | GetLobbyHostId | |
bool | RequestLobbyList | |
void | AdvertiseSession | |
void | ClearAdvertisement | |
bool | SetLobbyData | Lobby metadata the host publishes for matchmaking filters and the lobby screen (map, difficulty, build). |
std::string | GetLobbyData | |
bool | SetLobbyJoinable | Closes the lobby to new joiners once a run has started, reopens it for the next one. |
std::vector<FOnlineLobbyMember> | GetLobbyMembers | |
std::vector<FOnlineFriend> | GetFriends | Friends and session invites on a social platform (Discord). |
bool | SendSessionInvite | Sends a join invite for the session this player advertised. |
std::vector<uint64_t> | GetPendingSessionInvites | Senders of invites received and not yet accepted. |
bool | AcceptSessionInvite | |
bool | UploadLeaderboardScore | Leaderboards. |
bool | DownloadLeaderboard | |
void | SetRichPresence | Rich presence. |
void | ClearRichPresence | |
void | SetRichPresenceValue | One raw presence key. |
void | SetPresenceGroup | The party this player is in, so the friends list groups everyone in one session together and shows how many of them there are. |
bool | AreStatsReady | Stats / achievements. |
bool | UnlockAchievement | |
bool | ClearAchievement | |
bool | GetAchievement | |
bool | SetStatInt | |
bool | SetStatFloat | |
bool | GetStatInt | |
bool | GetStatFloat | |
bool | IndicateAchievementProgress | The platform's own "3 / 10" progress popup. |
bool | StoreStats | |
void | SetStatsCallbacks | onReceived fires when the player's values arrive (true) or fail to; onStored fires per achievement the server confirmed unlocked. |
bool | InitActionInput | Action-based controller input (Steam Input). |
bool | IsActionInputAvailable | |
void | ActivateActionSet | |
void | ActivateActionSetLayer | |
void | DeactivateActionSetLayer | |
void | DeactivateAllActionSetLayers | |
bool | GetDigitalAction | |
bool | GetAnalogAction | |
std::string | GetActionGlyphPath | The first physical input bound to the action in the active set, as the platform's glyph image path and as display text ("A Button", "Right Trigger"). |
std::string | GetActionOriginText | |
bool | TriggerRumble | 0..1 per motor; 0 and 0 stops it. |
bool | ShowControllerBindingPanel | |
int32_t | GetRemotePlaySessionCount | Remote Play (Steam Remote Play / Remote Play Together): who is streaming this game from the host's machine right now. |
uint32_t | GetRemotePlaySessionId | |
uint64_t | GetRemotePlaySessionUser | |
bool | SendRemotePlayTogetherInvite | |
bool | ShowInviteDialog | The platform overlay's invite dialog for the current lobby (or session connect string) and whether the overlay can open at all — a player who turned it off gets the game's own UI instead. |
bool | IsOverlayEnabled | |
std::vector<FOnlineUgcItem> | GetSubscribedUgcItems | Workshop / user-generated content. |
bool | SubscribeUgcItem | |
bool | UnsubscribeUgcItem | |
bool | DownloadUgcItem | |
void | SetUgcInstalledCallback | Fires when an item finishes installing or updating while the game runs. |
bool | RequestSessionTicket | Encrypted session ticket — the client side of the dedicated-server auth gate. |
void | SetOverlayCallback | Platform overlay (Steam's in-game overlay). |
bool | IsOverlayActive | |
bool | ShowTextInput | On-screen keyboard (Deck Verified requires one for every text field a controller can reach). |
bool | IsTextInputShowing | |
std::string | GetGamepadFamily | The pad family the platform sees ("SteamDeck", "Xbox", "PlayStation", "Switch", "SteamController"; empty when unknown) and the path of its glyph image for a button, empty when the platform ships none — the game falls back to its own art keyed by family. |
std::string | GetGamepadGlyphPath | |
FOnlineVoiceSettings | GetVoiceSettings | The platform voice client's mute / deafen / input mode. |
ISocialVoiceCalls* | GetSocialVoice | |
ISocialLobbies* | GetSocialLobbies | |
ISocialAccounts* | GetSocialAccounts | |
ISocialRelationships* | GetSocialRelationships | |
bool | SetActivity | |
void | SetTimelineMode | Game recording timeline (Steam Timeline). |
uint64_t | AddTimelineEvent | |
void | RemoveTimelineEvent | |
void | SetTimelineTooltip | |
void | ClearTimelineTooltip | |
void | StartGamePhase | |
void | EndGamePhase | |
EOnlinePlatformHardware | GetPlatformHardware | The device the platform says this is, and the settings profile it recommends for it. |
EOnlineHardwareDefaultConfig | GetHardwareDefaultConfig | |
bool | IsCompatibilityLayer | |
bool | IsCloudAvailable | Cloud save files (SaveGame slots). |
bool | CloudWrite | |
bool | CloudExists | |
int32_t | CloudGetFileSize | |
bool | CloudRead | |
int32_t | CloudGetFileCount | |
std::string | CloudGetFileNameAndSize |
Function details
~IOnlineService
virtual ~IOnlineService() = defaultName
virtual const char* Name() const = 0Init
virtual bool Init(const FPlatformInitParams& params) = 0Lifecycle. Init receives the project's platform settings and returns true when the service came up (it self-gates on its own enable flag in the params). Update runs once per frame from the engine loop.
Update
virtual void Update()Shutdown
virtual void Shutdown()IsAvailable
virtual bool IsAvailable() constIsReady
virtual bool IsReady() constGetLocalUserId
virtual uint64_t GetLocalUserId() constIdentity / entitlements — the primary-platform surface.
IsDlcInstalled
virtual bool IsDlcInstalled(uint32_t productId) constBeginAuthorization
virtual bool BeginAuthorization()Explicit user-consent sign-in (Discord OAuth2 PKCE). Platforms with ambient identity (Steam) don't implement these; BeginAuthorization returns true when the consent flow was started, IsAuthorized flips once the user completes it.
IsAuthorized
virtual bool IsAuthorized() constCreateP2PTransport
virtual std::unique_ptr<INetworkTransport> CreateP2PTransport()P2P relay transport. Non-null when the platform can carry game traffic (Steam SDR); the composite transport owns the result.
SetNetworkSimulation
virtual bool SetNetworkSimulation(const FNetSimSettings& settings)Network emulation. The engine's own injector only reaches the ENet backend — a platform relay carries its traffic inside the SDK, so the same net.sim.* cvars have to be handed to the platform's own fake-loss / fake-lag knobs through here rather than by including its header up in Networking. Returns true when the platform applied them.
CreateLobby
virtual bool CreateLobby(int32_t maxMembers)Lobby / session advertisement.
JoinLobby
virtual bool JoinLobby(uint64_t lobbyId)LeaveLobby
virtual void LeaveLobby()IsInLobby
virtual bool IsInLobby() constGetCurrentLobbyId
virtual uint64_t GetCurrentLobbyId() constGetLobbyHostId
virtual uint64_t GetLobbyHostId() constRequestLobbyList
virtual bool RequestLobbyList(std::function<void(const std::vector<FPlatformLobbyInfo>&)> callback)AdvertiseSession
virtual void AdvertiseSession(const std::string& sessionName, int32_t maxMembers)ClearAdvertisement
virtual void ClearAdvertisement()SetLobbyData
virtual bool SetLobbyData(const std::string& key, const std::string& value)Lobby metadata the host publishes for matchmaking filters and the lobby screen (map, difficulty, build). Host only; a non-host or a platform without lobbies returns false and reads back empty.
GetLobbyData
virtual std::string GetLobbyData(const std::string& key) constSetLobbyJoinable
virtual bool SetLobbyJoinable(bool joinable)Closes the lobby to new joiners once a run has started, reopens it for the next one. Host only.
GetLobbyMembers
virtual std::vector<FOnlineLobbyMember> GetLobbyMembers() constGetFriends
virtual std::vector<FOnlineFriend> GetFriends() constFriends and session invites on a social platform (Discord). The list is read from the client's cache, so it is empty until the platform is ready and the player has authorized with social scopes.
SendSessionInvite
virtual bool SendSessionInvite(uint64_t userId, const std::string& message, std::function<void(bool)> done)Sends a join invite for the session this player advertised. done receives the platform's verdict; false from the call means nothing was sent and done will not fire.
GetPendingSessionInvites
virtual std::vector<uint64_t> GetPendingSessionInvites() constSenders of invites received and not yet accepted. AcceptSessionInvite joins through the same path as a platform "Join Game".
AcceptSessionInvite
virtual bool AcceptSessionInvite(uint64_t senderId)UploadLeaderboardScore
virtual bool UploadLeaderboardScore(const std::string& board, int32_t score, bool keepBest, std::function<void(bool)> done)Leaderboards. Both calls are asynchronous and the callback fires on the thread that pumps Update(); false from the call itself means nothing was started (no platform, or the board name is empty) and the callback will not fire. Scores are integers (milliseconds for a best time).
DownloadLeaderboard
virtual bool DownloadLeaderboard(const std::string& board, EOnlineLeaderboardRange range, int32_t first, int32_t count, std::function<void(bool, const std::vector<FOnlineLeaderboardEntry>&)> done)SetRichPresence
virtual void SetRichPresence(const std::string& details, const std::string& state)Rich presence. Formatting ({details}/{state} expansion) happens in the caller; each service maps the pair onto its own fields.
ClearRichPresence
virtual void ClearRichPresence()SetRichPresenceValue
virtual void SetRichPresenceValue(const std::string& key, const std::string& value)One raw presence key. Steam shows only steam_display in the friends list — a "#Token" from the localisation file uploaded on the partner site, whose %key% placeholders are filled from other keys set here.
SetPresenceGroup
virtual void SetPresenceGroup(const std::string& groupId, int32_t groupSize)The party this player is in, so the friends list groups everyone in one session together and shows how many of them there are. An empty group id clears it.
AreStatsReady
virtual bool AreStatsReady() constStats / achievements. Writes land in the client's local copy; StoreStats uploads them (FAchievements debounces it). AreStatsReady is false until the platform has handed the player's current values over; a write before that is refused, and FAchievements keeps it queued instead.
UnlockAchievement
virtual bool UnlockAchievement(const std::string& id)ClearAchievement
virtual bool ClearAchievement(const std::string& id)GetAchievement
virtual bool GetAchievement(const std::string& id, bool& outUnlocked) constSetStatInt
virtual bool SetStatInt(const std::string& id, int32_t value)SetStatFloat
virtual bool SetStatFloat(const std::string& id, float value)GetStatInt
virtual bool GetStatInt(const std::string& id, int32_t& outValue) constGetStatFloat
virtual bool GetStatFloat(const std::string& id, float& outValue) constIndicateAchievementProgress
virtual bool IndicateAchievementProgress(const std::string& id, uint32_t current, uint32_t max)The platform's own "3 / 10" progress popup. It does not unlock anything.
StoreStats
virtual bool StoreStats()SetStatsCallbacks
virtual void SetStatsCallbacks(std::function<void(bool)> onReceived, std::function<void(const std::string&)> onStored)onReceived fires when the player's values arrive (true) or fail to; onStored fires per achievement the server confirmed unlocked.
InitActionInput
virtual bool InitActionInput()Action-based controller input (Steam Input). Action sets and actions are named as in the game's controller configuration; the engine names them after its input contexts and actions so one name means one thing on both paths. False / empty whenever the platform has no controller under its control, so the caller keeps reading the pad itself.
IsActionInputAvailable
virtual bool IsActionInputAvailable() constActivateActionSet
virtual void ActivateActionSet(const std::string& actionSet)ActivateActionSetLayer
virtual void ActivateActionSetLayer(const std::string& layer)DeactivateActionSetLayer
virtual void DeactivateActionSetLayer(const std::string& layer)DeactivateAllActionSetLayers
virtual void DeactivateAllActionSetLayers()GetDigitalAction
virtual bool GetDigitalAction(const std::string& action, bool& outPressed) constGetAnalogAction
virtual bool GetAnalogAction(const std::string& action, float& outX, float& outY) constGetActionGlyphPath
virtual std::string GetActionGlyphPath(const std::string& action) constThe first physical input bound to the action in the active set, as the platform's glyph image path and as display text ("A Button", "Right Trigger"). Empty when the action is unbound or unknown.
GetActionOriginText
virtual std::string GetActionOriginText(const std::string& action) constTriggerRumble
virtual bool TriggerRumble(float lowFrequency, float highFrequency)0..1 per motor; 0 and 0 stops it.
ShowControllerBindingPanel
virtual bool ShowControllerBindingPanel()GetRemotePlaySessionCount
virtual int32_t GetRemotePlaySessionCount() constRemote Play (Steam Remote Play / Remote Play Together): who is streaming this game from the host's machine right now.
GetRemotePlaySessionId
virtual uint32_t GetRemotePlaySessionId(int32_t index) constGetRemotePlaySessionUser
virtual uint64_t GetRemotePlaySessionUser(uint32_t sessionId) constSendRemotePlayTogetherInvite
virtual bool SendRemotePlayTogetherInvite(uint64_t friendId)ShowInviteDialog
virtual bool ShowInviteDialog()The platform overlay's invite dialog for the current lobby (or session connect string) and whether the overlay can open at all — a player who turned it off gets the game's own UI instead.
IsOverlayEnabled
virtual bool IsOverlayEnabled() constGetSubscribedUgcItems
virtual std::vector<FOnlineUgcItem> GetSubscribedUgcItems() constWorkshop / user-generated content.
SubscribeUgcItem
virtual bool SubscribeUgcItem(uint64_t itemId)UnsubscribeUgcItem
virtual bool UnsubscribeUgcItem(uint64_t itemId)DownloadUgcItem
virtual bool DownloadUgcItem(uint64_t itemId, bool highPriority)SetUgcInstalledCallback
virtual void SetUgcInstalledCallback(std::function<void(uint64_t)> callback)Fires when an item finishes installing or updating while the game runs.
RequestSessionTicket
virtual bool RequestSessionTicket(std::function<void(const std::vector<uint8_t>&, bool)> callback)Encrypted session ticket — the client side of the dedicated-server auth gate. The callback receives the ticket bytes and a success flag.
SetOverlayCallback
virtual void SetOverlayCallback(std::function<void(bool)> callback)Platform overlay (Steam's in-game overlay). Opening it takes the keyboard and the mouse inside the SDK, so the engine sees no focus loss and no window event: without this notification a single-player world keeps ticking under a modal the player cannot reach and the camera keeps following a mouse the player is using to browse the store. The callback fires once per transition; IsOverlayActive is the same state for code that polls.
IsOverlayActive
virtual bool IsOverlayActive() constShowTextInput
virtual bool ShowTextInput(const FOnlineTextInputRequest& request, std::function<void(const FOnlineTextInputResult&)> onDone)On-screen keyboard (Deck Verified requires one for every text field a controller can reach). False when the platform has none or refused; onDone runs once, when the keyboard closes.
IsTextInputShowing
virtual bool IsTextInputShowing() constGetGamepadFamily
virtual std::string GetGamepadFamily() constThe pad family the platform sees ("SteamDeck", "Xbox", "PlayStation", "Switch", "SteamController"; empty when unknown) and the path of its glyph image for a button, empty when the platform ships none — the game falls back to its own art keyed by family.
GetGamepadGlyphPath
virtual std::string GetGamepadGlyphPath(EOnlineGamepadButton button) constGetVoiceSettings
virtual FOnlineVoiceSettings GetVoiceSettings() constThe platform voice client's mute / deafen / input mode. Valid is false until the platform has answered.
GetSocialVoice
virtual ISocialVoiceCalls* GetSocialVoice()GetSocialLobbies
virtual ISocialLobbies* GetSocialLobbies()GetSocialAccounts
virtual ISocialAccounts* GetSocialAccounts()GetSocialRelationships
virtual ISocialRelationships* GetSocialRelationships()SetActivity
virtual bool SetActivity(const FSocialActivity& activity)SetTimelineMode
virtual void SetTimelineMode(EOnlineTimelineMode mode)Game recording timeline (Steam Timeline). Events mark the moments a player may want to clip — a death, a scare, an extraction — with a Steam icon name ("steam_death", "steam_effect", ...) or a custom icon uploaded on the partner site. A duration of 0 is an instant; the returned handle (0 when unsupported) removes the event again. A game phase groups a round or a match so the overlay can offer it as one recording.
AddTimelineEvent
virtual uint64_t AddTimelineEvent(const std::string& title, const std::string& description, const std::string& icon, uint32_t priority, float startOffsetSeconds, float durationSeconds, EOnlineClipPriority clip)RemoveTimelineEvent
virtual void RemoveTimelineEvent(uint64_t handle)SetTimelineTooltip
virtual void SetTimelineTooltip(const std::string& description)ClearTimelineTooltip
virtual void ClearTimelineTooltip()StartGamePhase
virtual void StartGamePhase(const std::string& phaseId)EndGamePhase
virtual void EndGamePhase()GetPlatformHardware
virtual EOnlinePlatformHardware GetPlatformHardware() constThe device the platform says this is, and the settings profile it recommends for it. IsCompatibilityLayer is Proton on Steam.
GetHardwareDefaultConfig
virtual EOnlineHardwareDefaultConfig GetHardwareDefaultConfig() constIsCompatibilityLayer
virtual bool IsCompatibilityLayer() constIsCloudAvailable
virtual bool IsCloudAvailable() constCloud save files (SaveGame slots).
CloudWrite
virtual bool CloudWrite(const std::string& name, const void* data, int32_t size)CloudExists
virtual bool CloudExists(const std::string& name) constCloudGetFileSize
virtual int32_t CloudGetFileSize(const std::string& name) constCloudRead
virtual bool CloudRead(const std::string& name, void* buffer, int32_t size) constCloudGetFileCount
virtual int32_t CloudGetFileCount() constCloudGetFileNameAndSize
virtual std::string CloudGetFileNameAndSize(int32_t index, int32_t& outSize) const