mirror of
https://github.com/BeyondDimension/SteamTools.git
synced 2026-10-22 17:49:54 +08:00
修复steam库存游戏在steam账号切换后自动刷新失败的问题
修复steam库存游戏编辑带有本地化名称的游戏无效的问题
This commit is contained in:
@@ -847,6 +847,7 @@ namespace System.Application.Services.Implementation
|
||||
|
||||
static uint GetUInt32(dynamic value)
|
||||
{
|
||||
if (value is null) return 0;
|
||||
if (value is VValue vvalue) return GetUInt32(vvalue.Value!);
|
||||
if (value is uint value2) return value2;
|
||||
if (value is IConvertible convertible)
|
||||
|
||||
@@ -236,7 +236,9 @@ namespace System.Application.Models
|
||||
if (propertyValue2 != null)
|
||||
{
|
||||
_properties.SetPropertyValue(SteamAppPropertyType.Table, propertyValue2, NodeAppInfo, "steam_edit", "base_name_localized");
|
||||
_properties.RemoveProperty("name_localized");
|
||||
|
||||
//_properties.RemoveProperty(NodeAppInfo, NodeCommon, "name_localized");
|
||||
_properties.SetPropertyValue(SteamAppPropertyType.Table, new SteamAppPropertyTable(), NodeAppInfo, NodeCommon, "name_localized");
|
||||
}
|
||||
_properties.SetPropertyValue(SteamAppPropertyType.String, appInfo.BaseName, NodeAppInfo, "steam_edit", "base_name");
|
||||
|
||||
|
||||
@@ -263,7 +263,7 @@ namespace System.Application.Services
|
||||
{
|
||||
IsDisposedClient = false;
|
||||
var id = swLocalService.GetSteamId64();
|
||||
if (id == SteamUser.UndefinedId)
|
||||
if (id <= 0 || id == SteamUser.UndefinedId)
|
||||
{
|
||||
//该64位id的steamID3等于0,是steam未获取到当前登录用户的默认返回值,所以直接重新获取
|
||||
DisposeSteamClient();
|
||||
@@ -296,19 +296,26 @@ namespace System.Application.Services
|
||||
var applist = swLocalService.OwnsApps(await ISteamService.Instance.GetAppInfos());
|
||||
if (!applist.Any_Nullable())
|
||||
{
|
||||
if (!IsDisposedClient)
|
||||
DisposeSteamClient();
|
||||
continue;
|
||||
}
|
||||
LoadGames(applist);
|
||||
InitializeDownloadGameList();
|
||||
}
|
||||
|
||||
if (!SteamUsers.Lookup(id).HasValue)
|
||||
{
|
||||
RefreshSteamUsers();
|
||||
}
|
||||
|
||||
//var mainViewModel = (IWindowService.Instance.MainWindow as WindowViewModel);
|
||||
//await mainViewModel.SteamAppPage.Initialize();
|
||||
//await mainViewModel.AccountPage.Initialize(id);
|
||||
|
||||
#endregion
|
||||
if (!IsDisposedClient)
|
||||
{
|
||||
DisposeSteamClient();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -469,7 +476,7 @@ namespace System.Application.Services
|
||||
IsLoadingGameList = false;
|
||||
DisposeSteamClient();
|
||||
}
|
||||
}, TaskCreationOptions.DenyChildAttach).Forget().ConfigureAwait(false);
|
||||
}, TaskCreationOptions.DenyChildAttach).ConfigureAwait(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -582,8 +589,8 @@ namespace System.Application.Services
|
||||
|
||||
public void DisposeSteamClient()
|
||||
{
|
||||
swLocalService.DisposeSteamClient();
|
||||
IsDisposedClient = true;
|
||||
swLocalService.DisposeSteamClient();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
||||
Reference in New Issue
Block a user