diff --git a/Facepunch.Steamworks/Client.cs b/Facepunch.Steamworks/Client.cs index f55e158..27f873f 100644 --- a/Facepunch.Steamworks/Client.cs +++ b/Facepunch.Steamworks/Client.cs @@ -61,7 +61,6 @@ namespace Facepunch.Steamworks public Voice Voice { get; private set; } public ServerList ServerList { get; private set; } public LobbyList LobbyList { get; private set; } - public App App { get; private set; } public Achievements Achievements { get; private set; } public Stats Stats { get; private set; } public MicroTransactions MicroTransactions { get; private set; } @@ -107,7 +106,6 @@ namespace Facepunch.Steamworks Voice = new Voice( this ); ServerList = new ServerList( this ); LobbyList = new LobbyList(this); - App = new App( this ); Stats = new Stats( this ); Achievements = new Achievements( this ); MicroTransactions = new MicroTransactions( this ); @@ -195,12 +193,6 @@ namespace Facepunch.Steamworks LobbyList = null; } - if ( App != null ) - { - App.Dispose(); - App = null; - } - if ( Stats != null ) { Stats.Dispose(); diff --git a/Facepunch.Steamworks/Client/App.cs b/Facepunch.Steamworks/Client/App.cs deleted file mode 100644 index a94a052..0000000 --- a/Facepunch.Steamworks/Client/App.cs +++ /dev/null @@ -1,131 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using SteamNative; - -namespace Facepunch.Steamworks -{ - public class App : IDisposable - { - internal Client client; - - internal App( Client c ) - { - client = c; - - client.RegisterCallback( DlcInstalled ); - } - - public delegate void DlcInstalledDelegate( uint appid ); - - /// - /// Triggered after the current user gains ownership of DLC and that DLC is installed. - /// - public event DlcInstalledDelegate OnDlcInstalled; - - private void DlcInstalled( DlcInstalled_t data ) - { - if ( OnDlcInstalled != null ) - { - OnDlcInstalled( data.AppID ); - } - } - - public void Dispose() - { - client = null; - } - - /// - /// Mark the content as corrupt, so it will validate the downloaded files - /// once the app is closed. This is good to call when you detect a crash happening - /// or a file is missing that is meant to be there. - /// - public void MarkContentCorrupt( bool missingFilesOnly = false ) - { - client.native.apps.MarkContentCorrupt( missingFilesOnly ); - } - - /// - /// Tell steam to install the Dlc specified by the AppId - /// - public void InstallDlc( uint appId ) - { - client.native.apps.InstallDLC( appId ); - } - - /// - /// Tell steam to uninstall the Dlc specified by the AppId - /// - public void UninstallDlc(uint appId) - { - client.native.apps.UninstallDLC( appId ); - } - - /// - /// Get the purchase time for this appid. Will return DateTime.MinValue if none. - /// - public DateTime PurchaseTime(uint appId) - { - var time = client.native.apps.GetEarliestPurchaseUnixTime(appId); - if ( time == 0 ) return DateTime.MinValue; - - return Utility.Epoch.ToDateTime( time ); - } - - /// - /// Checks if the active user is subscribed to a specified AppId. - /// Only use this if you need to check ownership of another game related to yours, a demo for example. - /// - public bool IsSubscribed(uint appId) - { - return client.native.apps.BIsSubscribedApp(appId); - } - - /// - /// Returns true if specified app is installed. - /// - public bool IsInstalled(uint appId) - { - return client.native.apps.BIsAppInstalled(appId); - } - - /// - /// Returns true if specified app is installed. - /// - public bool IsDlcInstalled( uint appId ) - { - return client.native.apps.BIsDlcInstalled( appId ); - } - - /// - /// Returns the appid's name - /// Returns error if the current app Id does not have permission to use this interface - /// - public string GetName( uint appId ) - { - var str = client.native.applist.GetAppName( appId ); - if ( str == null ) return "error"; - return str; - } - - /// - /// Returns the app's install folder - /// Returns error if the current app Id does not have permission to use this interface - /// - public string GetInstallFolder( uint appId ) - { - return client.native.applist.GetAppInstallDir( appId ); - } - - /// - /// Returns the app's current build id - /// Returns 0 if the current app Id does not have permission to use this interface - /// - public int GetBuildId( uint appId ) - { - return client.native.applist.GetAppBuildId( appId ); - } - } -}