From 4390724cbe684f6e27dd9aab0ad69ecae82d4c9f Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Fri, 9 Jun 2017 11:06:05 +0100 Subject: [PATCH] friend.GetRichPresence --- Facepunch.Steamworks/Client/Friends.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Facepunch.Steamworks/Client/Friends.cs b/Facepunch.Steamworks/Client/Friends.cs index 366473b..82354f2 100644 --- a/Facepunch.Steamworks/Client/Friends.cs +++ b/Facepunch.Steamworks/Client/Friends.cs @@ -71,6 +71,19 @@ namespace Facepunch.Steamworks internal Client Client { get; set; } + /// + /// Returns null if the value doesn't exist + /// + public string GetRichPresence( string key ) + { + var val = Client.native.friends.GetFriendRichPresence( Id, key ); + if ( string.IsNullOrEmpty( val ) ) return null; + return val; + } + + /// + /// Update this friend, request the latest data from Steam's servers + /// public void Refresh() { Name = Client.native.friends.GetFriendPersonaName( Id ); @@ -95,6 +108,8 @@ namespace Facepunch.Steamworks ServerQueryPort = gameInfo.QueryPort; ServerLobbyId = gameInfo.SteamIDLobby; } + + Client.native.friends.RequestFriendRichPresence( Id ); } }