Provide information about family share library locking when Steam client

initialization fails due to ConnectToGlobalUser.
This commit is contained in:
gibbed
2019-05-24 16:23:24 -05:00
parent fe4526b346
commit b68e02f061
3 changed files with 13 additions and 21 deletions

View File

@@ -37,7 +37,7 @@ namespace SAM.API.Interfaces
public IntPtr IsSubscribedApp;
public IntPtr IsDlcInstalled;
public IntPtr GetEarliestPurchaseUnixTime;
public IntPtr BIsSubscribedFromFreeWeekend;
public IntPtr IsSubscribedFromFreeWeekend;
public IntPtr GetDLCCount;
public IntPtr GetDLCDataByIndex;
public IntPtr InstallDLC;

View File

@@ -24,7 +24,6 @@ using System;
using System.Diagnostics;
using System.Net;
using System.Windows.Forms;
using SAM.API;
namespace SAM.Game
{
@@ -67,13 +66,15 @@ namespace SAM.Game
{
client.Initialize(appId);
}
catch (ClientInitializeException e)
catch (API.ClientInitializeException e)
{
if (e.Failure == ClientInitializeFailure.ConnectToGlobalUser)
if (e.Failure == API.ClientInitializeFailure.ConnectToGlobalUser)
{
// TODO(gibbed): show error about family sharing?
MessageBox.Show(
"Steam is not running. Please start Steam then run this tool again.\n\n(" + e.Message + ")",
"Steam is not running. Please start Steam then run this tool again.\n\n" +
"If you have the game through Family Share, the game may be locked due to\n\n" +
"the Family Share account actively playing a game.\n\n" +
"(" + e.Message + ")",
"Error",
MessageBoxButtons.OK,
MessageBoxIcon.Error);
@@ -81,7 +82,8 @@ namespace SAM.Game
else if (string.IsNullOrEmpty(e.Message) == false)
{
MessageBox.Show(
"Steam is not running. Please start Steam then run this tool again.\n\n(" + e.Message + ")",
"Steam is not running. Please start Steam then run this tool again.\n\n" +
"(" + e.Message + ")",
"Error",
MessageBoxButtons.OK,
MessageBoxIcon.Error);

View File

@@ -21,9 +21,7 @@
*/
using System;
using System.Net;
using System.Windows.Forms;
using SAM.API;
namespace SAM.Picker
{
@@ -48,21 +46,13 @@ namespace SAM.Picker
{
client.Initialize(0);
}
catch (ClientInitializeException e)
catch (API.ClientInitializeException e)
{
if (e.Failure == ClientInitializeFailure.ConnectToGlobalUser)
{
// TODO(gibbed): show error about family sharing?
MessageBox.Show(
"Steam is not running. Please start Steam then run this tool again.\n\n(" + e.Message + ")",
"Error",
MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
else if (string.IsNullOrEmpty(e.Message) == false)
if (string.IsNullOrEmpty(e.Message) == false)
{
MessageBox.Show(
"Steam is not running. Please start Steam then run this tool again.\n\n(" + e.Message + ")",
"Steam is not running. Please start Steam then run this tool again.\n\n" +
"(" + e.Message + ")",
"Error",
MessageBoxButtons.OK,
MessageBoxIcon.Error);