From 72bae110738dfae7110e35f40c97db5bf2d931fa Mon Sep 17 00:00:00 2001 From: Phyxion Date: Tue, 5 Sep 2017 13:29:07 +0200 Subject: [PATCH 1/2] Fixed InstallFolder exception This folder does not always exist. --- Facepunch.Steamworks/Client.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Facepunch.Steamworks/Client.cs b/Facepunch.Steamworks/Client.cs index 32419bd..e70ee7a 100644 --- a/Facepunch.Steamworks/Client.cs +++ b/Facepunch.Steamworks/Client.cs @@ -114,7 +114,8 @@ namespace Facepunch.Steamworks SteamId = native.user.GetSteamID(); BetaName = native.apps.GetCurrentBetaName(); OwnerSteamId = native.apps.GetAppOwner(); - InstallFolder = new DirectoryInfo( native.apps.GetAppInstallDir( AppId ) ); + if (!String.IsNullOrEmpty(native.apps.GetAppInstallDir(AppId)) && Directory.Exists(native.apps.GetAppInstallDir(AppId))) + InstallFolder = new DirectoryInfo( native.apps.GetAppInstallDir( AppId ) ); BuildId = native.apps.GetAppBuildId(); CurrentLanguage = native.apps.GetCurrentGameLanguage(); AvailableLanguages = native.apps.GetAvailableGameLanguages().Split( new[] {';'}, StringSplitOptions.RemoveEmptyEntries ); // TODO: Assumed colon separated From e8b6f31bb2015eca742100dfddb3ff8bd6a42f77 Mon Sep 17 00:00:00 2001 From: Phyxion Date: Tue, 5 Sep 2017 13:53:29 +0200 Subject: [PATCH 2/2] Update Client.cs --- Facepunch.Steamworks/Client.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Facepunch.Steamworks/Client.cs b/Facepunch.Steamworks/Client.cs index e70ee7a..d8c5490 100644 --- a/Facepunch.Steamworks/Client.cs +++ b/Facepunch.Steamworks/Client.cs @@ -114,8 +114,9 @@ namespace Facepunch.Steamworks SteamId = native.user.GetSteamID(); BetaName = native.apps.GetCurrentBetaName(); OwnerSteamId = native.apps.GetAppOwner(); - if (!String.IsNullOrEmpty(native.apps.GetAppInstallDir(AppId)) && Directory.Exists(native.apps.GetAppInstallDir(AppId))) - InstallFolder = new DirectoryInfo( native.apps.GetAppInstallDir( AppId ) ); + var appInstallDir = native.apps.GetAppInstallDir(AppId); + if (!String.IsNullOrEmpty(appInstallDir) && Directory.Exists(appInstallDir)) + InstallFolder = new DirectoryInfo(appInstallDir); BuildId = native.apps.GetAppBuildId(); CurrentLanguage = native.apps.GetCurrentGameLanguage(); AvailableLanguages = native.apps.GetAvailableGameLanguages().Split( new[] {';'}, StringSplitOptions.RemoveEmptyEntries ); // TODO: Assumed colon separated