This commit is contained in:
Garry Newman 2018-02-07 13:29:36 +00:00
commit 09c4a4f63e

View File

@ -4,6 +4,7 @@
using System.Net;
using System.Runtime.InteropServices;
using System.Text;
using SteamNative;
namespace Facepunch.Steamworks
{
@ -191,9 +192,16 @@ internal void SetupCommonProperties()
/// </summary>
public void TriggerItemDrop()
{
SteamNative.SteamInventoryResult_t result = 0;
inventory.inventory.TriggerItemDrop( ref result, Id );
inventory.inventory.DestroyResult( result );
inventory.TriggerItemDrop( Id );
}
/// <summary>
/// Trigger a promo item drop. You can call this at startup, it won't
/// give users multiple promo drops.
/// </summary>
public void TriggerPromoDrop()
{
inventory.TriggerPromoDrop( Id );
}
internal void Link( Definition[] definitions )
@ -236,6 +244,38 @@ internal void UpdatePrice()
}
}
/// <summary>
/// Trigger a promo item drop. You can call this at startup, it won't
/// give users multiple promo drops.
/// </summary>
public void TriggerPromoDrop( int definitionId )
{
SteamNative.SteamInventoryResult_t result = 0;
inventory.AddPromoItem( ref result, definitionId );
inventory.DestroyResult( result );
}
/// <summary>
/// Trigger an item drop for this user. This is for timed drops. For promo
/// drops use TriggerPromoDrop.
/// </summary>
public void TriggerItemDrop( int definitionId )
{
SteamNative.SteamInventoryResult_t result = 0;
inventory.TriggerItemDrop( ref result, definitionId );
inventory.DestroyResult( result );
}
/// <summary>
/// Grant all promotional items the user is eligible for.
/// </summary>
public void GrantAllPromoItems()
{
SteamNative.SteamInventoryResult_t result = 0;
inventory.GrantPromoItems( ref result );
inventory.DestroyResult( result );
}
/// <summary>
/// Represents a crafting recepie which was defined using the exchange
/// section in the item schema.