diff --git a/Facepunch.Steamworks/SteamUgc.cs b/Facepunch.Steamworks/SteamUgc.cs index 6f860e8..8c38253 100644 --- a/Facepunch.Steamworks/SteamUgc.cs +++ b/Facepunch.Steamworks/SteamUgc.cs @@ -200,5 +200,13 @@ public static bool ShowWorkshopEula() return status?.Accepted; } + public static PublishedFileId[] GetSubscribedItemIds() + { + var count = Internal.GetNumSubscribedItems(); + var ids = new PublishedFileId[count]; + Internal.GetSubscribedItems(ids, count); + + return ids; + } } } diff --git a/Facepunch.Steamworks/Structs/Leaderboard.cs b/Facepunch.Steamworks/Structs/Leaderboard.cs index ed7deb8..e66730d 100644 --- a/Facepunch.Steamworks/Structs/Leaderboard.cs +++ b/Facepunch.Steamworks/Structs/Leaderboard.cs @@ -51,9 +51,9 @@ public struct Leaderboard /// /// Attaches a piece of user generated content the user's entry on a leaderboard /// - public async Task AttachUgc( Ugc file ) + public async Task AttachUgc( PublishedFileId file ) { - var r = await SteamUserStats.Internal.AttachLeaderboardUGC( Id, file.Handle ); + var r = await SteamUserStats.Internal.AttachLeaderboardUGC( Id, file.Value ); if ( !r.HasValue ) return Result.Fail; return r.Value.Result; @@ -157,4 +157,4 @@ internal static async Task WaitForUserNames( LeaderboardEntry[] entries) } #endregion } -} \ No newline at end of file +} diff --git a/Facepunch.Steamworks/Structs/LeaderboardEntry.cs b/Facepunch.Steamworks/Structs/LeaderboardEntry.cs index 82eb26f..eb83a44 100644 --- a/Facepunch.Steamworks/Structs/LeaderboardEntry.cs +++ b/Facepunch.Steamworks/Structs/LeaderboardEntry.cs @@ -8,7 +8,7 @@ public struct LeaderboardEntry public int GlobalRank; public int Score; public int[] Details; - // UGCHandle_t m_hUGC + public PublishedFileId? Ugc; internal static LeaderboardEntry From( LeaderboardEntry_t e, int[] detailsBuffer ) { @@ -17,7 +17,8 @@ internal static LeaderboardEntry From( LeaderboardEntry_t e, int[] detailsBuffer User = new Friend( e.SteamIDUser ), GlobalRank = e.GlobalRank, Score = e.Score, - Details = null + Details = null, + Ugc = e.UGC == 0 ? null : (PublishedFileId?) e.UGC }; if ( e.CDetails > 0 ) @@ -28,4 +29,4 @@ internal static LeaderboardEntry From( LeaderboardEntry_t e, int[] detailsBuffer return r; } } -} \ No newline at end of file +} diff --git a/Facepunch.Steamworks/Structs/UgcItem.cs b/Facepunch.Steamworks/Structs/UgcItem.cs index fb63898..f8e288f 100644 --- a/Facepunch.Steamworks/Structs/UgcItem.cs +++ b/Facepunch.Steamworks/Structs/UgcItem.cs @@ -124,6 +124,8 @@ public Item( PublishedFileId id ) : this() public bool IsSubscribed => (State & ItemState.Subscribed) == ItemState.Subscribed; public bool NeedsUpdate => (State & ItemState.NeedsUpdate) == ItemState.NeedsUpdate; + public bool IsGameManagedItem => details.FileType == WorkshopFileType.GameManagedItem; + public string Directory { get