Merge pull request #46 from richdog/master

Made changes surrounding OnItemInstalled and OnFileDownloaded events in Workshop.cs
This commit is contained in:
Garry Newman 2017-07-26 17:12:56 +01:00 committed by GitHub
commit 6c4296a0fc

View File

@ -29,8 +29,7 @@ namespace Facepunch.Steamworks
/// <summary> /// <summary>
/// Called when an item has been downloaded. This could have been /// Called when an item has been downloaded. This could have been
/// because of a call to Download or because of a subscription triggered /// because of a call to Download.
/// via the browser/app.
/// </summary> /// </summary>
public event Action<ulong, Callbacks.Result> OnFileDownloaded; public event Action<ulong, Callbacks.Result> OnFileDownloaded;
@ -39,7 +38,7 @@ namespace Facepunch.Steamworks
/// because of a call to Download or because of a subscription triggered /// because of a call to Download or because of a subscription triggered
/// via the browser/app. /// via the browser/app.
/// </summary> /// </summary>
internal event Action<ulong> OnItemInstalled; public event Action<ulong> OnItemInstalled;
internal Workshop( BaseSteamworks steamworks, SteamNative.SteamUGC ugc, SteamNative.SteamRemoteStorage remoteStorage ) internal Workshop( BaseSteamworks steamworks, SteamNative.SteamUGC ugc, SteamNative.SteamRemoteStorage remoteStorage )
{ {
@ -67,7 +66,7 @@ namespace Facepunch.Steamworks
private void onItemInstalled( SteamNative.ItemInstalled_t obj, bool failed ) private void onItemInstalled( SteamNative.ItemInstalled_t obj, bool failed )
{ {
if ( OnItemInstalled != null ) if ( OnItemInstalled != null && obj.AppID == Client.Instance.AppId )
OnItemInstalled( obj.PublishedFileId ); OnItemInstalled( obj.PublishedFileId );
} }