MPlatformSubsystem
- Module
- Networking
- Header
#include "Networking/Subsystems/MPlatformSubsystem.h"- Namespace
Mowo- Reflection
- Reflected by MowoHeaderTool
Public functions
Function details
SetRichPresence
void SetRichPresence(const std::string& details, const std::string& state)presenceStateFormat ("{details}" / "{state}" tokens).
ClearRichPresence
void ClearRichPresence()SetRichPresenceValue
void SetRichPresenceValue(const std::string& key, const std::string& value)One raw presence key ("steam_display", or a %key% the display token's localisation reads) and the party grouping the friends list shows.
SetPresenceGroup
void SetPresenceGroup(const std::string& groupId, int groupSize)UnlockAchievement
bool UnlockAchievement(const std::string& name)Achievements and stats through FAchievements: recorded locally at once (the game reads them back with no platform up, PIE included) and handed to Steam when it has the player's values, uploaded on a short debounce and at exit. Ids are the API names Config/Achievements.ini declares.
ClearAchievement
bool ClearAchievement(const std::string& name)IsAchievementUnlocked
bool IsAchievementUnlocked(const std::string& name) constSetStatInt
bool SetStatInt(const std::string& name, int value)SetStatFloat
bool SetStatFloat(const std::string& name, float value)AddStatInt
bool AddStatInt(const std::string& name, int delta)GetStatInt
int GetStatInt(const std::string& name) constGetStatFloat
float GetStatFloat(const std::string& name) constIndicateAchievementProgress
bool IndicateAchievementProgress(const std::string& name, int current, int max)The platform's "current / max" popup; does not unlock.
StoreStats
void StoreStats()Upload now instead of after the debounce (end of a run, before a quit prompt).
PopUnlockedAchievement
std::string PopUnlockedAchievement()The next achievement this session unlocked, oldest first; empty when none is waiting. A graph polls it to show its own toast.
GetPendingAchievementWrites
int GetPendingAchievementWrites() constWrites waiting for the platform (offline, or its stats not loaded yet).
IsSteamInputActive
bool IsSteamInputActive() constSteam Input. Action sets and layers are the game's controller configuration names (the engine activates the set named after the bottom input context on its own; these are for a game that drives them by hand). Glyph and text answer for the first input bound to the action in the active set — empty when Steam Input does not own the pad, so the UI falls back to its own art.
ActivateActionSet
void ActivateActionSet(const std::string& actionSet)ActivateActionSetLayer
void ActivateActionSetLayer(const std::string& layer)DeactivateActionSetLayer
void DeactivateActionSetLayer(const std::string& layer)DeactivateAllActionSetLayers
void DeactivateAllActionSetLayers()GetActionGlyphPath
std::string GetActionGlyphPath(const std::string& action) constGetActionOriginText
std::string GetActionOriginText(const std::string& action) constTriggerRumble
bool TriggerRumble(float lowFrequency, float highFrequency)ShowControllerBindingPanel
bool ShowControllerBindingPanel()GetRemotePlaySessionCount
int GetRemotePlaySessionCount() constRemote Play Together: guests streaming this game from the host.
GetRemotePlaySessionUserAt
uint64_t GetRemotePlaySessionUserAt(int index) constInviteToRemotePlayTogether
bool InviteToRemotePlayTogether(uint64_t friendId)ShowInviteDialog
bool ShowInviteDialog()The overlay's invite dialog for the current lobby or session.
IsOverlayEnabled
bool IsOverlayEnabled() constRefreshWorkshopItems
int RefreshWorkshopItems()Workshop. RefreshWorkshopItems reads the subscribed list (cheap, no network); the accessors read that snapshot by index. Installed items load as mods (Mods/ModManager) on the next start; progress is 0..1.
GetWorkshopItemIdAt
uint64_t GetWorkshopItemIdAt(int index) constIsWorkshopItemInstalledAt
bool IsWorkshopItemInstalledAt(int index) constGetWorkshopItemFolderAt
std::string GetWorkshopItemFolderAt(int index) constGetWorkshopItemProgressAt
float GetWorkshopItemProgressAt(int index) constSubscribeWorkshopItem
bool SubscribeWorkshopItem(uint64_t itemId)UnsubscribeWorkshopItem
bool UnsubscribeWorkshopItem(uint64_t itemId)DownloadWorkshopItem
bool DownloadWorkshopItem(uint64_t itemId)CreateLobby
void CreateLobby(int maxPlayers)Steam lobbies. maxPlayers <= 0 uses platform.defaultMaxPlayers; visibility comes from platform.defaultLobbyType.
JoinLobby
void JoinLobby(uint64_t lobbyId)LeaveLobby
void LeaveLobby()IsInLobby
bool IsInLobby() constGetCurrentLobbyId
uint64_t GetCurrentLobbyId() constGetLobbyHostSteamId
uint64_t GetLobbyHostSteamId() constSteamID64 of the current lobby's owner (the host), or 0 when not in a lobby. This is the address the join side feeds to ConnectToHost.
RefreshLobbyList
void RefreshLobbyList()Server browser. RefreshLobbyList kicks the async request off; the rows land in the cache a moment later and the accessors read them, so a Visual Script graph can poll instead of needing a callback pin.
IsLobbyListPending
bool IsLobbyListPending() constGetLobbyListCount
int GetLobbyListCount() constGetLobbyIdAt
uint64_t GetLobbyIdAt(int index) constGetLobbyHostAt
uint64_t GetLobbyHostAt(int index) constGetLobbyNameAt
std::string GetLobbyNameAt(int index) constGetLobbyMemberCountAt
int GetLobbyMemberCountAt(int index) constGetLobbyMaxMembersAt
int GetLobbyMaxMembersAt(int index) constSetLobbyData
bool SetLobbyData(const std::string& key, const std::string& value)Lobby metadata and roster. SetLobbyData / SetLobbyJoinable are host only.
GetLobbyData
std::string GetLobbyData(const std::string& key) constSetLobbyJoinable
bool SetLobbyJoinable(bool joinable)GetLobbyRosterCount
int GetLobbyRosterCount() constGetLobbyRosterIdAt
uint64_t GetLobbyRosterIdAt(int index) constGetLobbyRosterNameAt
std::string GetLobbyRosterNameAt(int index) constIsLobbyRosterHostAt
bool IsLobbyRosterHostAt(int index) constGetDiscordFriendCount
int GetDiscordFriendCount() constDiscord friends and join invites. Friends need the player to have authorized (BeginAuthorization) with social scopes (discord.Social on); presence is 0 offline, 1 online elsewhere, 2 playing this game. An invite received from a friend is listed by sender id until accepted, and accepting it joins through the same path as a Steam "Join Game".
GetDiscordFriendIdAt
uint64_t GetDiscordFriendIdAt(int index) constGetDiscordFriendNameAt
std::string GetDiscordFriendNameAt(int index) constGetDiscordFriendPresenceAt
int GetDiscordFriendPresenceAt(int index) constSendDiscordInvite
bool SendDiscordInvite(uint64_t userId, const std::string& message)GetPendingDiscordInviteCount
int GetPendingDiscordInviteCount() constGetPendingDiscordInviteSenderAt
uint64_t GetPendingDiscordInviteSenderAt(int index) constAcceptDiscordInvite
bool AcceptDiscordInvite(uint64_t senderId)CreateDiscordLobby
bool CreateDiscordLobby(int maxMembers)Discord lobbies. The creator's client is the owner; the lobby secret (GetDiscordLobbySecret) is what a friend joins with, and invites carry it. Discord has no lobby search, so discovery is invites and the profile's Join button, not a list. Unverified against live Discord.
JoinDiscordLobbyBySecret
bool JoinDiscordLobbyBySecret(const std::string& secret)LeaveDiscordLobby
void LeaveDiscordLobby()IsInDiscordLobby
bool IsInDiscordLobby() constGetDiscordLobbyId
uint64_t GetDiscordLobbyId() constGetDiscordLobbySecret
std::string GetDiscordLobbySecret() constGetDiscordLobbyOwnerId
uint64_t GetDiscordLobbyOwnerId() constSetDiscordLobbyData
bool SetDiscordLobbyData(const std::string& key, const std::string& value)GetDiscordLobbyData
std::string GetDiscordLobbyData(const std::string& key) constSetDiscordLobbyJoinable
bool SetDiscordLobbyJoinable(bool joinable)GetDiscordLobbyMemberCount
int GetDiscordLobbyMemberCount() constGetDiscordLobbyMemberIdAt
uint64_t GetDiscordLobbyMemberIdAt(int index) constGetDiscordLobbyMemberNameAt
std::string GetDiscordLobbyMemberNameAt(int index) constInviteToDiscordLobby
bool InviteToDiscordLobby(uint64_t userId, const std::string& message)TransferDiscordLobbyOwnership
bool TransferDiscordLobbyOwnership(uint64_t newOwnerId)StartDiscordCall
bool StartDiscordCall()Discord voice call of the current lobby. Status: 0 disconnected, 1 joining, 2 connecting, 3 connected, 4 reconnecting, 5 disconnecting, 6 failed. Volumes: 1 is the default level (participants 0..2, input 0..1, output 0..2). Mode: 0 voice activity, 1 push to talk.
EndDiscordCall
void EndDiscordCall()GetDiscordCallStatus
int GetDiscordCallStatus() constIsInDiscordCall
bool IsInDiscordCall() constSetDiscordSelfMute
void SetDiscordSelfMute(bool mute)SetDiscordSelfDeaf
void SetDiscordSelfDeaf(bool deaf)IsDiscordSelfMuted
bool IsDiscordSelfMuted() constIsDiscordSelfDeaf
bool IsDiscordSelfDeaf() constGetDiscordCallParticipantCount
int GetDiscordCallParticipantCount() constGetDiscordCallParticipantIdAt
uint64_t GetDiscordCallParticipantIdAt(int index) constGetDiscordCallParticipantNameAt
std::string GetDiscordCallParticipantNameAt(int index) constIsDiscordCallParticipantSpeakingAt
bool IsDiscordCallParticipantSpeakingAt(int index) constIsDiscordCallParticipantMutedAt
bool IsDiscordCallParticipantMutedAt(int index) constGetDiscordCallParticipantVolumeAt
float GetDiscordCallParticipantVolumeAt(int index) constSetDiscordParticipantVolume
bool SetDiscordParticipantVolume(uint64_t userId, float volume)SetDiscordParticipantMuted
bool SetDiscordParticipantMuted(uint64_t userId, bool muted)SetDiscordVoiceMode
void SetDiscordVoiceMode(int mode)SetDiscordPushToTalk
void SetDiscordPushToTalk(bool active)ApplyDiscordVoiceOptions
void ApplyDiscordVoiceOptions()RefreshDiscordAudioDevices
void RefreshDiscordAudioDevices()GetDiscordInputDeviceCount
int GetDiscordInputDeviceCount() constGetDiscordInputDeviceIdAt
std::string GetDiscordInputDeviceIdAt(int index) constGetDiscordInputDeviceNameAt
std::string GetDiscordInputDeviceNameAt(int index) constGetDiscordOutputDeviceCount
int GetDiscordOutputDeviceCount() constGetDiscordOutputDeviceIdAt
std::string GetDiscordOutputDeviceIdAt(int index) constGetDiscordOutputDeviceNameAt
std::string GetDiscordOutputDeviceNameAt(int index) constSetDiscordInputDevice
bool SetDiscordInputDevice(const std::string& deviceId)SetDiscordOutputDevice
bool SetDiscordOutputDevice(const std::string& deviceId)RefreshDiscordGuilds
void RefreshDiscordGuilds()Linked channels: mirror the lobby's chat to a channel of a server the player belongs to. The lists are asynchronous; poll the counts.
GetDiscordGuildCount
int GetDiscordGuildCount() constGetDiscordGuildIdAt
uint64_t GetDiscordGuildIdAt(int index) constGetDiscordGuildNameAt
std::string GetDiscordGuildNameAt(int index) constRefreshDiscordGuildChannels
void RefreshDiscordGuildChannels(uint64_t guildId)GetDiscordChannelCount
int GetDiscordChannelCount() constGetDiscordChannelIdAt
uint64_t GetDiscordChannelIdAt(int index) constGetDiscordChannelNameAt
std::string GetDiscordChannelNameAt(int index) constIsDiscordChannelLinkableAt
bool IsDiscordChannelLinkableAt(int index) constLinkDiscordChannel
bool LinkDiscordChannel(uint64_t channelId)UnlinkDiscordChannel
bool UnlinkDiscordChannel()GetLinkedDiscordChannelId
uint64_t GetLinkedDiscordChannelId() constGetLinkedDiscordChannelName
std::string GetLinkedDiscordChannelName() constSignInDiscord
bool SignInDiscord(int method, const std::string& externalToken)Sign-in beyond the plain AuthorizeDiscord: method 0 browser or overlay (PKCE), 1 device code, 2 provisional account (externalToken is the game's own identity token; no Discord account needed). State: 0 signed out, 1 using the stored token, 2 refreshing, 3 waiting for the player, 4 connecting, 5 signed in, 6 failed. The token is stored in the OS credential store, never in a project file.
GetDiscordAuthState
int GetDiscordAuthState() constGetDiscordAuthFailure
std::string GetDiscordAuthFailure() constSignOutDiscord
void SignOutDiscord()SetDiscordProvisionalName
void SetDiscordProvisionalName(const std::string& name)GetDiscordRelationshipCount
int GetDiscordRelationshipCount() constRelationships. State: 0 none, 1 friend, 2 blocked, 3 incoming request, 4 outgoing request, 5 implicit (played together). Discord's own and the game's relationship are separate.
GetDiscordRelationshipIdAt
uint64_t GetDiscordRelationshipIdAt(int index) constGetDiscordRelationshipNameAt
std::string GetDiscordRelationshipNameAt(int index) constGetDiscordRelationshipStateAt
int GetDiscordRelationshipStateAt(int index) constGetDiscordGameRelationshipStateAt
int GetDiscordGameRelationshipStateAt(int index) constSendDiscordFriendRequest
bool SendDiscordFriendRequest(const std::string& username)AcceptDiscordFriendRequest
bool AcceptDiscordFriendRequest(uint64_t userId)RejectDiscordFriendRequest
bool RejectDiscordFriendRequest(uint64_t userId)CancelDiscordFriendRequest
bool CancelDiscordFriendRequest(uint64_t userId)RemoveDiscordFriend
bool RemoveDiscordFriend(uint64_t userId)BlockDiscordUser
bool BlockDiscordUser(uint64_t userId)UnblockDiscordUser
bool UnblockDiscordUser(uint64_t userId)SetDiscordActivity
bool SetDiscordActivity(const std::string& details, const std::string& state, const std::string& partyId, int partySize, int partyMax, bool privateParty, const std::string& joinSecret, uint64_t startUnix, uint64_t endUnix, const std::string& buttonLabel, const std::string& buttonUrl)Rich presence beyond details/state: party size, the join secret that puts Invite and Ask to Join on the card, timestamps, one link button. An empty partyId derives one from the join secret.
UploadLeaderboardScore
bool UploadLeaderboardScore(const std::string& board, int score, bool keepBest)Leaderboards. Upload and request are asynchronous: poll IsLeaderboardPending, then read the rows. range is 0 global, 1 around the local player, 2 friends; rows are ranked, first is 1-based.
WasLeaderboardUploadOk
bool WasLeaderboardUploadOk() constRequestLeaderboard
bool RequestLeaderboard(const std::string& board, int range, int first, int count)IsLeaderboardPending
bool IsLeaderboardPending() constGetLeaderboardCount
int GetLeaderboardCount() constGetLeaderboardRankAt
int GetLeaderboardRankAt(int index) constGetLeaderboardScoreAt
int GetLeaderboardScoreAt(int index) constGetLeaderboardNameAt
std::string GetLeaderboardNameAt(int index) constGetLeaderboardUserAt
uint64_t GetLeaderboardUserAt(int index) constAdvertiseSession
void AdvertiseSession(const std::string& sessionName, int maxPlayers)Host side of the handoff — publish the host SteamID64 + session name so a friend's Join Game resolves to a Steam P2P address.
ClearAdvertisement
void ClearAdvertisement()ConnectToHost
void ConnectToHost(uint64_t hostSteamId)Lobby → session handoff. Connects to a host over Steam P2P (feeds the SteamID64 to NetworkManager so the composite transport picks Steam, not ENet) and, when the project requires ticket auth, arms the client's encrypted-ticket send. This is the entry point a "friend clicks Join" flow lands on.
EnableSteamJoinHandling
void EnableSteamJoinHandling()Route Steam invites / friends-list "Join Game" into ConnectToHost, as the LAST resort: the session layer (FNetSession::EnableInviteHandling) takes precedence whenever a game has claimed the invite, because a bare transport connect gives the joiner no player record and no pawn.
IsSteamAvailable
bool IsSteamAvailable() constIsDiscordReady
bool IsDiscordReady() constAuthorizeDiscord
bool AuthorizeDiscord()Discord OAuth2 sign-in (PKCE, opens the overlay or a browser). Rich presence never needs it — only user-identity features do. Kick off with AuthorizeDiscord, poll IsDiscordAuthorized.
IsDiscordAuthorized
bool IsDiscordAuthorized() constAddTimelineEvent
uint64_t AddTimelineEvent(const std::string& title, const std::string& description, const std::string& icon, int priority, float startOffsetSeconds, float durationSeconds, int clipPriority)Steam Timeline: mark the moments worth clipping. icon is a Steam icon name ("steam_death", "steam_effect", "steam_attack", ...) or one uploaded on the partner site; priority orders overlapping icons (higher wins); clipPriority 0 none, 1 standard, 2 featured. durationSeconds 0 is an instant, a negative startOffsetSeconds places the event in the past (a scare that started before the scream). Returns a handle for RemoveTimelineEvent, 0 when no platform records.
RemoveTimelineEvent
void RemoveTimelineEvent(uint64_t handle)SetTimelineMode
void SetTimelineMode(int mode)0 playing, 1 staging (lobby, pre-round), 2 menus, 3 loading screen.
SetTimelineTooltip
void SetTimelineTooltip(const std::string& description)ClearTimelineTooltip
void ClearTimelineTooltip()StartGamePhase
void StartGamePhase(const std::string& phaseId)A round or a match, offered by the overlay as one recording.
EndGamePhase
void EndGamePhase()GetPlatformHardware
std::string GetPlatformHardware() const"none", "steam_deck", "steam_machine", "steam_frame" or "other".
GetRecommendedQualityPreset
int GetRecommendedQualityPreset() constThe quality preset (EQualityPreset value) the platform recommends for this device, or -1 when it has no opinion.
IsRunningUnderProton
bool IsRunningUnderProton() const