diff --git a/Facepunch.Steamworks/SteamInventory.cs b/Facepunch.Steamworks/SteamInventory.cs index 1db284a..45aa3ca 100644 --- a/Facepunch.Steamworks/SteamInventory.cs +++ b/Facepunch.Steamworks/SteamInventory.cs @@ -295,6 +295,8 @@ public static bool GetAllItems() if ( !Internal.DeserializeResult( ref sresult, (IntPtr)ptr, (uint)dataLength, false ) ) return null; + + return await InventoryResult.GetAsync( sresult.Value ); } finally diff --git a/Facepunch.Steamworks/Structs/InventoryResult.cs b/Facepunch.Steamworks/Structs/InventoryResult.cs index fd09006..5518ba4 100644 --- a/Facepunch.Steamworks/Structs/InventoryResult.cs +++ b/Facepunch.Steamworks/Structs/InventoryResult.cs @@ -30,6 +30,15 @@ public int ItemCount } } + /// + /// Checks whether an inventory result handle belongs to the specified Steam ID. + /// This is important when using Deserialize, to verify that a remote player is not pretending to have a different user's inventory + /// + public bool BelongsTo( SteamId steamId ) + { + return SteamInventory.Internal.CheckResultSteamID( _id, steamId ); + } + public InventoryItem[] GetItems( bool includeProperties = false ) { uint cnt = (uint) ItemCount;