mirror of
https://github.com/BeyondDimension/SteamTools.git
synced 2026-10-21 00:38:44 +08:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 40b46966dc | |||
| f2a3d9cab1 | |||
| b68e4e062e | |||
| 4f9e6591dc | |||
| b9e03e7ed1 | |||
| b7606b2ec0 | |||
| de01020f8b | |||
| b9742c0514 | |||
| 4e1830bd75 | |||
| d6bbb1bd3d | |||
| 22dd40d43b |
Binary file not shown.
Submodule references/SteamAchievementManager updated: b39839a962...b84d4babe5
+8
-4
@@ -4,14 +4,16 @@
|
||||
届时也会放弃继续对 Win7/8.1 系统的支持,所以这也意味着这是最后一个支持 Win7/8.1 的版本。
|
||||
也请各位敬请期待之后的 3.0 版本吧~
|
||||
|
||||
<!--
|
||||
### 版本亮点
|
||||
1. .NET 运行时升级至 6.0.11,使用 fde 版本需要升级运行时
|
||||
1. .NET 运行时升级至 6.0.12,使用 fde 版本需要升级运行时
|
||||
2. ASF 升级至 V5.3.2.4
|
||||
-->
|
||||
|
||||
### 修复问题
|
||||
1. 改进 Mac 安装证书的提示,显示执行命令
|
||||
2. 修复 Steam 启动参数在一些场景下无效
|
||||
3. 修复 网络加速 关闭 http 重定向到 https 依然监听80端口错误
|
||||
3. 修复 网络加速 关闭 http 重定向到 https 依然监听 80 端口错误
|
||||
4. 修复 网络加速 仅启用脚本功能 导致代理网站无法访问的错误
|
||||
5. 修复 网络加速 开启系统代理和 PAC 代理后,非代理网站无法正常访问的错误
|
||||
6. 修改 证书安装路径 为本地计算机 而不在是 当前用户 以支持跨用户访问,这项改动可能导致大家需要重新安装一次证书
|
||||
@@ -19,8 +21,10 @@
|
||||
8. 修复 捐助列表金额显示错位问题
|
||||
9. 修复 Twitch 聊天连接失败问题
|
||||
10. 修复 discord.gg 无法访问导致无法加入频道分享链接问题
|
||||
|
||||
|
||||
11. 修复 Steam 没有正确识别 Steam 国服提示问题
|
||||
12. ASF 升级至 V5.3.2.4
|
||||
12. .NET 运行时升级至 6.0.12,使用 fde 版本需要升级运行时
|
||||
13. 新增 Steam 设置可设置 模拟蒸汽平台启动参数
|
||||
<!--
|
||||
|
||||
### 已知问题
|
||||
|
||||
@@ -190,6 +190,13 @@ namespace System
|
||||
|
||||
#endregion
|
||||
|
||||
// https://learn.microsoft.com/zh-cn/dotnet/standard/serialization/system-text-json/character-casing#case-insensitive-property-matching
|
||||
|
||||
static readonly SJsonSerializerOptions S_options = new()
|
||||
{
|
||||
PropertyNameCaseInsensitive = true,
|
||||
};
|
||||
|
||||
#region Deserialize(反序列化)
|
||||
|
||||
/// <summary>
|
||||
@@ -204,7 +211,7 @@ namespace System
|
||||
{
|
||||
return implType switch
|
||||
{
|
||||
JsonImplType.SystemTextJson => SJsonSerializer.Deserialize<T>(value),
|
||||
JsonImplType.SystemTextJson => SJsonSerializer.Deserialize<T>(value, S_options),
|
||||
_ =>
|
||||
#if NOT_NJSON
|
||||
throw new NotSupportedException(),
|
||||
|
||||
@@ -17,10 +17,10 @@ internal static class Program
|
||||
{
|
||||
const string ExecutiveName = "Steam++";
|
||||
static BundleArch matchArch;
|
||||
static readonly SemanticVersion runtimeVersion = new(6, 0, 11);
|
||||
static readonly SemanticVersion sdkVersion1 = new(6, 0, 111);
|
||||
static readonly SemanticVersion sdkVersion3 = new(6, 0, 306);
|
||||
static readonly SemanticVersion sdkVersion4 = new(6, 0, 403);
|
||||
static readonly SemanticVersion runtimeVersion = new(6, 0, 12);
|
||||
static readonly SemanticVersion sdkVersion1 = new(6, 0, 112);
|
||||
static readonly SemanticVersion sdkVersion3 = new(6, 0, 307);
|
||||
static readonly SemanticVersion sdkVersion4 = new(6, 0, 404);
|
||||
|
||||
/// <summary>
|
||||
/// 应用程序的主入口点。
|
||||
|
||||
@@ -245,7 +245,7 @@ public abstract class CommandLineHost : IDisposable
|
||||
// -clt steam -account
|
||||
var steamuser = new Command("steam", "Steam 相关操作");
|
||||
steamuser.AddOption(new Option<string>("-account", "指定对应 Steam 用户名"));
|
||||
steamuser.Handler = CommandHandler.Create(async (string account) =>
|
||||
steamuser.Handler = CommandHandler.Create((string account) =>
|
||||
{
|
||||
if (!string.IsNullOrEmpty(account))
|
||||
{
|
||||
@@ -257,7 +257,7 @@ public abstract class CommandLineHost : IDisposable
|
||||
|
||||
var currentuser = users.Where(s => s.AccountName == account).FirstOrDefault();
|
||||
|
||||
await steamService.ShutdownSteamAsync();
|
||||
steamService.TryKillSteamProcess();
|
||||
|
||||
if (currentuser != null)
|
||||
{
|
||||
|
||||
@@ -10,6 +10,7 @@ using NLog;
|
||||
using Avalonia;
|
||||
using Avalonia.ReactiveUI;
|
||||
using Avalonia.Controls;
|
||||
using System.Net.Http;
|
||||
|
||||
#if WINDOWS || WINDOWS_DESKTOP_BRIDGE
|
||||
using WPFMessageBox = System.Windows.MessageBox;
|
||||
@@ -47,6 +48,10 @@ namespace System.Application.UI
|
||||
// fix The request was aborted: Could not create SSL/TLS secure channel
|
||||
TrySetSecurityProtocol();
|
||||
|
||||
#if WINDOWS || WINDOWS_DESKTOP_BRIDGE
|
||||
HttpClient.DefaultProxy = DynamicHttpWindowsProxy.Instance;
|
||||
#endif
|
||||
|
||||
#if WINDOWS_DESKTOP_BRIDGE
|
||||
if (!DesktopBridgeHelper.Init()) return 0;
|
||||
InitWithUWP(ref args);
|
||||
|
||||
+7
@@ -39,6 +39,13 @@
|
||||
</DockPanel>
|
||||
</Border>
|
||||
|
||||
<Border Classes="Item">
|
||||
<DockPanel>
|
||||
<TextBlock Text="{ReflectionBinding Path=Res.Settings_Steam_RunSteamChina,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
|
||||
<ToggleSwitch IsChecked="{ReflectionBinding Source={x:Static ms:SteamSettings.IsRunSteamChina},Path=Value, Mode=TwoWay}"/>
|
||||
</DockPanel>
|
||||
</Border>
|
||||
|
||||
<Border Classes="Item">
|
||||
<DockPanel>
|
||||
<TextBlock Text="{ReflectionBinding Path=Res.Settings_Steam_CheckSteamRuningNotification,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -8,10 +8,14 @@ using System.Application.Settings;
|
||||
using System.Application.UI;
|
||||
using System.Application.UI.Resx;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
#if WINDOWS
|
||||
using System.Management;
|
||||
#endif
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Runtime.Versioning;
|
||||
@@ -143,6 +147,41 @@ namespace System.Application.Services.Implementation
|
||||
/// <returns></returns>
|
||||
private Process? GetSteamProces() => GetSteamProcesses().FirstOrDefault();
|
||||
|
||||
public bool IsSteamChinaLauncher()
|
||||
{
|
||||
#if WINDOWS
|
||||
var process = GetSteamProces();
|
||||
if (process != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
return GetCommandLineArgsCore().Contains("-steamchina", StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
catch (Win32Exception ex) when ((uint)ex.ErrorCode == 0x80004005)
|
||||
{
|
||||
// 没有对该进程的安全访问权限。
|
||||
return false;
|
||||
}
|
||||
catch (InvalidOperationException)
|
||||
{
|
||||
// 进程已退出。
|
||||
return false;
|
||||
}
|
||||
}
|
||||
string GetCommandLineArgsCore()
|
||||
{
|
||||
using (var searcher = new ManagementObjectSearcher(
|
||||
"SELECT CommandLine FROM Win32_Process WHERE ProcessId = " + process.Id))
|
||||
using (var objects = searcher.Get())
|
||||
{
|
||||
var @object = objects.Cast<ManagementBaseObject>().SingleOrDefault();
|
||||
return @object?["CommandLine"]?.ToString() ?? "";
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
public void StartSteam(string? arguments = null)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(SteamProgramPath) && File.Exists(SteamProgramPath))
|
||||
|
||||
+15
@@ -106,6 +106,21 @@ namespace System.Application.Services.Implementation
|
||||
return SteamClient.SteamUtils.IsSteamChinaLauncher();
|
||||
}
|
||||
|
||||
public bool IsSteamInBigPictureMode()
|
||||
{
|
||||
return SteamClient.SteamUtils.IsSteamInBigPictureMode();
|
||||
}
|
||||
|
||||
public uint GetSecondsSinceAppActive()
|
||||
{
|
||||
return SteamClient.SteamUtils.GetSecondsSinceAppActive();
|
||||
}
|
||||
|
||||
public uint GetServerRealTime()
|
||||
{
|
||||
return SteamClient.SteamUtils.GetServerRealTime();
|
||||
}
|
||||
|
||||
public bool IsAppInstalled(uint appid)
|
||||
{
|
||||
return SteamClient.SteamApps008.IsAppInstalled(appid);
|
||||
|
||||
@@ -50,6 +50,8 @@ namespace System.Application.Services
|
||||
/// <returns></returns>
|
||||
int GetSteamProcessPid();
|
||||
|
||||
bool IsSteamChinaLauncher();
|
||||
|
||||
/// <summary>
|
||||
/// 启动 Steam
|
||||
/// </summary>
|
||||
|
||||
@@ -33,6 +33,12 @@ namespace System.Application.Services
|
||||
|
||||
bool IsSteamChinaLauncher();
|
||||
|
||||
bool IsSteamInBigPictureMode();
|
||||
|
||||
uint GetSecondsSinceAppActive();
|
||||
|
||||
uint GetServerRealTime();
|
||||
|
||||
bool IsAppInstalled(uint appid);
|
||||
|
||||
string GetAppInstallDir(uint appid);
|
||||
|
||||
@@ -24,6 +24,12 @@ namespace System.Application.Services.Implementation
|
||||
|
||||
public bool IsSteamChinaLauncher() => default;
|
||||
|
||||
public bool IsSteamInBigPictureMode() => default;
|
||||
|
||||
public uint GetSecondsSinceAppActive() => default;
|
||||
|
||||
public uint GetServerRealTime() => default;
|
||||
|
||||
public bool IsAppInstalled(uint appid) => default;
|
||||
|
||||
public string GetAppInstallDir(uint appid) => string.Empty;
|
||||
|
||||
@@ -274,15 +274,16 @@ namespace System.Application.Services
|
||||
CurrentSteamUser = await swWebService.GetUserInfo(id);
|
||||
CurrentSteamUser.AvatarStream = httpService.GetImageAsync(CurrentSteamUser.AvatarFull, ImageChannelType.SteamAvatars);
|
||||
//AvatarPath = ImageSouce.TryParse(await CurrentSteamUser.AvatarStream, isCircle: true);
|
||||
|
||||
CurrentSteamUser.IPCountry = swLocalService.GetIPCountry();
|
||||
|
||||
IsSteamChinaLauncher = swLocalService.IsSteamChinaLauncher();
|
||||
IsSteamChinaLauncher = stmService.IsSteamChinaLauncher();
|
||||
var steamServerTime = ((long)swLocalService.GetServerRealTime()).ToDateTimeOffsetS();
|
||||
//var steamRunTime = swLocalService.GetSecondsSinceAppActive();
|
||||
|
||||
#region 初始化需要steam启动才能使用的功能
|
||||
if (SteamSettings.IsEnableSteamLaunchNotification.Value)
|
||||
{
|
||||
INotificationService.Instance.Notify($"{AppResources.Steam_CheckStarted}{(IsSteamChinaLauncher ? AppResources.Steam_SteamChina : AppResources.Steam_SteamWorld)}{Environment.NewLine}{AppResources.Steam_CurrentUser}{CurrentSteamUser.SteamNickName}{Environment.NewLine}{AppResources.Steam_CurrentIPCountry}{CurrentSteamUser.IPCountry}", NotificationType.Message);
|
||||
INotificationService.Instance.Notify($"{AppResources.Steam_CheckStarted}{(IsSteamChinaLauncher ? AppResources.Steam_SteamChina : AppResources.Steam_SteamWorld)}{Environment.NewLine}{AppResources.Steam_CurrentUser}{CurrentSteamUser.SteamNickName}{Environment.NewLine}{AppResources.Steam_CurrentIPCountry}{CurrentSteamUser.IPCountry}{Environment.NewLine}{AppResources.Steam_ServerTime}{steamServerTime:yyyy-MM-dd HH:mm:ss}", NotificationType.Message);
|
||||
}
|
||||
|
||||
if (GameLibrarySettings.IsAutoAFKApps.Value)
|
||||
|
||||
@@ -14,6 +14,7 @@ public sealed class SteamSettings : SettingsHost2<SteamSettings>
|
||||
if (!IApplication.IsDesktopPlatform) return;
|
||||
IsRunSteamMinimized.ValueChanged += IsRunSteamMinimized_ValueChanged;
|
||||
IsRunSteamNoCheckUpdate.ValueChanged += IsRunSteamNoCheckUpdate_ValueChanged;
|
||||
IsRunSteamChina.ValueChanged += IsRunSteamChina_ValueChanged;
|
||||
}
|
||||
|
||||
static void IsRunSteamNoCheckUpdate_ValueChanged(object? sender, ValueChangedEventArgs<bool> e)
|
||||
@@ -32,6 +33,14 @@ public sealed class SteamSettings : SettingsHost2<SteamSettings>
|
||||
SteamStratParameter.Value = SteamStratParameter.Value.Replace("-silent", "").Trim();
|
||||
}
|
||||
|
||||
static void IsRunSteamChina_ValueChanged(object? sender, ValueChangedEventArgs<bool> e)
|
||||
{
|
||||
if (e.NewValue)
|
||||
SteamStratParameter.Value += " -steamchina";
|
||||
else if (SteamStratParameter.Value != null)
|
||||
SteamStratParameter.Value = SteamStratParameter.Value.Replace("-steamchina", "").Trim();
|
||||
}
|
||||
|
||||
static readonly SerializableProperty<string?>? _SteamStratParameter = IApplication.IsDesktopPlatform ?
|
||||
GetProperty<string?>(defaultValue: null) : null;
|
||||
|
||||
@@ -82,6 +91,16 @@ public sealed class SteamSettings : SettingsHost2<SteamSettings>
|
||||
[SupportedOSPlatform("Linux")]
|
||||
public static SerializableProperty<bool> IsRunSteamNoCheckUpdate => _IsRunSteamNoCheckUpdate ?? throw new PlatformNotSupportedException();
|
||||
|
||||
static readonly SerializableProperty<bool>? _IsRunSteamChina = IApplication.IsDesktopPlatform ? GetProperty(defaultValue: false) : null;
|
||||
|
||||
/// <summary>
|
||||
/// Steam 启动时模拟为蒸汽平台(Steam国服)启动
|
||||
/// </summary>
|
||||
[SupportedOSPlatform("Windows7.0")]
|
||||
[SupportedOSPlatform("macOS")]
|
||||
[SupportedOSPlatform("Linux")]
|
||||
public static SerializableProperty<bool> IsRunSteamChina => _IsRunSteamChina ?? throw new PlatformNotSupportedException();
|
||||
|
||||
static readonly SerializableProperty<bool>? _IsEnableSteamLaunchNotification = IApplication.IsDesktopPlatform ? GetProperty(defaultValue: true) : null;
|
||||
|
||||
/// <summary>
|
||||
|
||||
+18
@@ -5356,6 +5356,15 @@ namespace System.Application.UI.Resx {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Steam 启动时模拟为蒸汽平台(Steam国服)启动 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string Settings_Steam_RunSteamChina {
|
||||
get {
|
||||
return ResourceManager.GetString("Settings_Steam_RunSteamChina", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Steam 启动参数 的本地化字符串。
|
||||
/// </summary>
|
||||
@@ -5672,6 +5681,15 @@ namespace System.Application.UI.Resx {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Steam 服务端时间: 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string Steam_ServerTime {
|
||||
get {
|
||||
return ResourceManager.GetString("Steam_ServerTime", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 是否删除此家庭库共享。 的本地化字符串。
|
||||
/// </summary>
|
||||
|
||||
@@ -1230,6 +1230,9 @@ AAAAA-BBBBB-CCCC3</value>
|
||||
<data name="Settings_Steam_RuningMinimize" xml:space="preserve">
|
||||
<value>Steam 启动时最小化到托盘</value>
|
||||
</data>
|
||||
<data name="Settings_Steam_RunSteamChina" xml:space="preserve">
|
||||
<value>Steam 启动时模拟为蒸汽平台(Steam国服)启动</value>
|
||||
</data>
|
||||
<data name="Settings_Steam_RuningAdmin" xml:space="preserve">
|
||||
<value>以管理员权限运行 Steam</value>
|
||||
</data>
|
||||
@@ -1723,6 +1726,9 @@ AAAAA-BBBBB-CCCC3</value>
|
||||
<data name="Steam_CurrentUser" xml:space="preserve">
|
||||
<value>Steam 登录用户:</value>
|
||||
</data>
|
||||
<data name="Steam_ServerTime" xml:space="preserve">
|
||||
<value>Steam 服务端时间:</value>
|
||||
</data>
|
||||
<data name="Steam_SteamChina" xml:space="preserve">
|
||||
<value>Steam 国服</value>
|
||||
</data>
|
||||
|
||||
@@ -131,7 +131,7 @@ namespace System.Application.UI.ViewModels
|
||||
foreach (var item in SteamUsers.Where(x => x.MostRecent))
|
||||
item.MostRecent = false;
|
||||
|
||||
await steamService.ShutdownSteamAsync();
|
||||
steamService.TryKillSteamProcess();
|
||||
|
||||
if (user != null)
|
||||
{
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace System.Application.UI.ViewModels
|
||||
{
|
||||
if (await MessageBox.ShowAsync(AppResources.SaveEditedAppInfo_RestartSteamTip, ThisAssembly.AssemblyTrademark, MessageBox.Button.OKCancel) == MessageBox.Result.OK)
|
||||
{
|
||||
await stmService.ShutdownSteamAsync();
|
||||
stmService.TryKillSteamProcess();
|
||||
stmService.StartSteamWithParameter();
|
||||
}
|
||||
Toast.Show(AppResources.SaveEditedAppInfo_SaveToSteamSuccess);
|
||||
|
||||
@@ -1,14 +1,22 @@
|
||||
using System.Application;
|
||||
using System.Application.Models;
|
||||
|
||||
return _(args, "客户端发布命令行工具(Command Line Tools/CLT)", init: () =>
|
||||
try
|
||||
{
|
||||
if (args.FirstOrDefault() == "apphostpatcher")
|
||||
return _(args, "客户端发布命令行工具(Command Line Tools/CLT)", init: () =>
|
||||
{
|
||||
var args_ = args.Skip(1).ToArray();
|
||||
return AppHostPatcher.Program.M(args_);
|
||||
}
|
||||
if (args.FirstOrDefault() == "apphostpatcher")
|
||||
{
|
||||
var args_ = args.Skip(1).ToArray();
|
||||
return AppHostPatcher.Program.M(args_);
|
||||
}
|
||||
|
||||
FileSystem2.InitFileSystem();
|
||||
return null;
|
||||
}, action: ToolConfig.AddInitCommand);
|
||||
FileSystem2.InitFileSystem();
|
||||
return null;
|
||||
}, action: ToolConfig.AddInitCommand);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex);
|
||||
return 500;
|
||||
}
|
||||
@@ -109,7 +109,7 @@ namespace System.Application.Steps
|
||||
#endif
|
||||
}
|
||||
|
||||
static async Task VerHandlerAsync(string token, bool use_last_skey, bool dev)
|
||||
public static async Task VerHandlerAsync(string token, bool use_last_skey, bool dev)
|
||||
{
|
||||
var desc = ReadVersionDesc();
|
||||
var request = new CreateVersionRequest
|
||||
@@ -505,7 +505,7 @@ namespace System.Application.Steps
|
||||
//content.Headers.ContentType = new(MediaTypeNames.MessagePack);
|
||||
//return content;
|
||||
|
||||
var json = Serializable.SJSON_Original(request);
|
||||
var json = Serializable.SJSON(request);
|
||||
var content = new StringContent(json, Encoding.UTF8, MediaTypeNames.JSON);
|
||||
return content;
|
||||
}
|
||||
@@ -516,7 +516,7 @@ namespace System.Application.Steps
|
||||
//return await ApiResponse.DeserializeAsync<T>(stream, default);
|
||||
|
||||
var json = await responseMessage.Content.ReadAsStringAsync();
|
||||
return Serializable.DJSON_Original<ApiRsp<T>>(json)!;
|
||||
return Serializable.DJSON<ApiRsp<T>>(json)!;
|
||||
}
|
||||
|
||||
static async Task<IApiResponse> GetResponseAsync(HttpResponseMessage responseMessage)
|
||||
@@ -525,11 +525,11 @@ namespace System.Application.Steps
|
||||
//return await ApiResponse.DeserializeAsync<object>(stream, default);
|
||||
|
||||
var json = await responseMessage.Content.ReadAsStringAsync();
|
||||
return Serializable.DJSON_Original<ApiRsp>(json)!;
|
||||
return Serializable.DJSON<ApiRsp>(json)!;
|
||||
}
|
||||
|
||||
const string dev_api_base_url = "https://pan.mossimo.net:9911";
|
||||
const string api_base_url = "https://cycyadmin.steampp.net:11002";
|
||||
const string api_base_url = "https://adminapi.steampp.net";
|
||||
const string api_version_create = "/api/version";
|
||||
|
||||
static string GetFullVersion(bool dev)
|
||||
|
||||
Reference in New Issue
Block a user