diff --git a/Source/Engine/Online/IOnlinePlatform.h b/Source/Engine/Online/IOnlinePlatform.h index 3dedafeda..bd21b2e79 100644 --- a/Source/Engine/Online/IOnlinePlatform.h +++ b/Source/Engine/Online/IOnlinePlatform.h @@ -38,7 +38,7 @@ API_ENUM(Namespace="FlaxEngine.Online") enum class OnlinePresenceStates /// /// Online platform user description. /// -API_STRUCT(Namespace="FlaxEngine.Online") struct FLAXENGINE_API OnlineUser +API_STRUCT(Namespace="FlaxEngine.Online", NoDefault) struct FLAXENGINE_API OnlineUser { DECLARE_SCRIPTING_TYPE_MINIMAL(OnlineUser); @@ -52,10 +52,20 @@ API_STRUCT(Namespace="FlaxEngine.Online") struct FLAXENGINE_API OnlineUser /// API_FIELD() String Name; + /// + /// The current player rich-presence status text. + /// + API_FIELD() String PresenceStatus; + /// /// The current player presence state. /// - API_FIELD() OnlinePresenceStates PresenceState; + API_FIELD() OnlinePresenceStates PresenceState = OnlinePresenceStates::Online; + + /// + /// The current game identifier that the user is playing. Empty if not playing any game or not supported by the platform. Can be used to check if the user is playing this game (IOnlinePlatform.GameId) or a different one. + /// + API_FIELD() Guid GameId = Guid::Empty; }; /// @@ -270,6 +280,12 @@ API_INTERFACE(Namespace="FlaxEngine.Online") class FLAXENGINE_API IOnlinePlatfor /// Called only by Online system. Can be used to destroy the object. API_FUNCTION() virtual void Deinitialize() = 0; + /// + /// Gets the platform-specific identifier of this game. The same for all players playing this game. Can be used to check if the user is playing this game or a different one. + /// + /// Game identifier. + API_FUNCTION() virtual Guid GetGameId() = 0; + public: /// /// Logins the local user into the online platform. @@ -317,6 +333,14 @@ public: /// True if failed, otherwise false. API_FUNCTION() virtual bool GetFriends(API_PARAM(Out) Array& friends, User* localUser = nullptr) = 0; + /// + /// Sets the rich-presence status text for the local user. Can be used to display custom status message in the friends list or other places. + /// + /// The status text. Empty to clear presence status. + /// The local user (null if use default one). + /// True if failed, otherwise false. + API_FUNCTION() virtual bool SetPresence(const StringView& status, User* localUser = nullptr) = 0; + public: /// /// Gets the list of all achievements for this game.