Added InventoryResult.BelongsTo( <steamid> )

This commit is contained in:
Garry Newman 2019-05-15 13:11:00 +01:00
parent cf2bc51c54
commit a1599e3226
2 changed files with 11 additions and 0 deletions

View File

@ -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

View File

@ -30,6 +30,15 @@ public int ItemCount
}
}
/// <summary>
/// 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
/// </summary>
public bool BelongsTo( SteamId steamId )
{
return SteamInventory.Internal.CheckResultSteamID( _id, steamId );
}
public InventoryItem[] GetItems( bool includeProperties = false )
{
uint cnt = (uint) ItemCount;