From 934bd2154a18266761127e587df72c5cefe60b38 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Wed, 17 Apr 2019 10:39:58 +0100 Subject: [PATCH] AttachUgc --- Facepunch.Steamworks/Structs/Leaderboard.cs | 10 ++++++++++ Facepunch.Steamworks/Structs/Ugc.cs | 9 +++++++++ 2 files changed, 19 insertions(+) create mode 100644 Facepunch.Steamworks/Structs/Ugc.cs diff --git a/Facepunch.Steamworks/Structs/Leaderboard.cs b/Facepunch.Steamworks/Structs/Leaderboard.cs index 1a5dc2f..58ea21d 100644 --- a/Facepunch.Steamworks/Structs/Leaderboard.cs +++ b/Facepunch.Steamworks/Structs/Leaderboard.cs @@ -47,6 +47,16 @@ public struct Leaderboard return LeaderboardUpdate.From( r.Value ); } + /// + /// Attaches a piece of user generated content the user's entry on a leaderboard + /// + public async Task AttachUgc( Ugc file ) + { + var r = await SteamUserStats.Internal.AttachLeaderboardUGC( Id, file.Handle ); + if ( !r.HasValue ) return Result.Fail; + + return r.Value.Result; + } /// /// Used to query for a sequential range of leaderboard entries by leaderboard Sort. diff --git a/Facepunch.Steamworks/Structs/Ugc.cs b/Facepunch.Steamworks/Structs/Ugc.cs new file mode 100644 index 0000000..f902b33 --- /dev/null +++ b/Facepunch.Steamworks/Structs/Ugc.cs @@ -0,0 +1,9 @@ +using System.Linq; + +namespace Steamworks.Data +{ + public struct Ugc + { + internal UGCHandle_t Handle; + } +} \ No newline at end of file