Compare commits

..
16 Commits
Author SHA1 Message Date
rmbgame 2ab26f7848 ready 1.0.3 2020-12-26 22:20:50 +08:00
rmbgame 11adabb749 添加steam图片修复和pixiv代理选项 2020-12-26 22:19:42 +08:00
rmbgame 8a7ad67363 修改初始化和steamapi连接方式 2020-12-26 20:02:15 +08:00
rmbgame 7af0888b0a 修复一个因为DNS解析错误会导致程序内存溢出闪退的BUG 2020-12-26 19:21:01 +08:00
rmbgame 42fc93a524 修复最小化UI错位BUG 2020-12-26 19:20:48 +08:00
rmbgame 5c832f489b 修复在令牌初始化时犯下的一个愚蠢问题导致令牌各种非空报错
修改帐户切换的最近登录时间为当前电脑时区显示
2020-12-26 19:19:50 +08:00
rmbgame 5e7ed26bc6 add static resources 2020-12-23 01:25:40 +08:00
rmbgame 085ad3d944 修改多语言文本
修改部分相对路径为绝对路径
2020-12-22 13:00:10 +08:00
rmbgame 334503445c edit text 2020-12-22 13:00:03 +08:00
rmbgame d646eacda1 ready 1.0.2 2020-12-21 21:54:23 +08:00
rmbgame fb029f729b ready 1.0.0 2020-12-21 21:47:08 +08:00
rmbgame 5ef6663269 delete ref lib 2020-12-21 21:36:17 +08:00
rmbgame 5c86b53000 ready 1.0.0 2020-12-17 12:10:47 +08:00
rmbgame efb6adbd9b delete ref lib 2020-12-16 10:38:03 +08:00
rmbgame 209202b5cf sync develop 2020-12-16 10:36:52 +08:00
rmbgame c0a081e226 delete ref lib 2020-12-16 10:34:52 +08:00
62 changed files with 994 additions and 480 deletions
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 148 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 322 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 427 KiB

+81
View File
@@ -70,5 +70,86 @@
"PayType": 1,
"Remark": "派大星",
"PayTime": "2020-12-20 12:21:04"
},
{
"Index": 9,
"Name": "*森",
"Amount": 66,
"OrderNumber": "",
"PayType": 1,
"Remark": "区区心意,不成敬意(三个六给不起)",
"PayTime": "2020-12-21 23:03:26"
},
{
"Index": 10,
"Name": "*珂",
"Amount": 50,
"OrderNumber": "",
"PayType": 1,
"Remark": "其乐YK93,支持大佬",
"PayTime": "2020-12-21 23:18:09"
},
{
"Index": 11,
"Name": "**丰",
"Amount": 1,
"OrderNumber": "",
"PayType": 1,
"Remark": "",
"PayTime": "2020-12-22 12:33:46"
},
{
"Index": 12,
"Name": "Ruby",
"Amount": 77,
"OrderNumber": "",
"PayType": 2,
"Remark": "资瓷一下",
"PayTime": "2020-12-24 19:40:25"
},
{
"Index": 13,
"Name": "**桐",
"Amount": 1,
"OrderNumber": "",
"PayType": 1,
"Remark": "",
"PayTime": "2020-12-26 09:32:57"
},
{
"Index": 14,
"Name": "**珂",
"Amount": 5,
"OrderNumber": "",
"PayType": 1,
"Remark": "其乐坛友wjkhj123,小小支持一波",
"PayTime": "2020-12-26 13:28:07"
},
{
"Index": 15,
"Name": "z.w",
"Amount": 10,
"OrderNumber": "",
"PayType": 2,
"Remark": "滋瓷一下",
"PayTime": "2020-12-26 15:34:50"
},
{
"Index": 16,
"Name": "**林",
"Amount": 6,
"OrderNumber": "",
"PayType": 2,
"Remark": "一丶心意,大佬加油!",
"PayTime": "2020-12-26 18:25:06"
},
{
"Index": 17,
"Name": "**立",
"Amount": 1,
"OrderNumber": "",
"PayType": 2,
"Remark": "",
"PayTime": "2020-12-26 18:56:57"
}
]
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 199 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 236 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

+12 -1
View File
@@ -1,12 +1,14 @@
using log4net;
using log4net.Config;
using log4net.Repository;
using SteamTool.Core.Properties;
using SteamTool.Model;
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Text;
using System.Xml;
namespace SteamTool.Core.Common
{
@@ -21,7 +23,16 @@ namespace SteamTool.Core.Common
static Logger()
{
ILoggerRepository repository = LogManager.CreateRepository(Assembly.GetCallingAssembly().GetName().Name);
XmlConfigurator.Configure(repository, new FileInfo(@"log\Log4net.config"));
if (File.Exists(Path.Combine(AppContext.BaseDirectory, @"log\Log4net.config")))
{
XmlConfigurator.Configure(repository, new FileInfo(@"log\Log4net.config"));
}
else
{
var doc = new XmlDocument();
doc.LoadXml(Resources.Log4netXml);
XmlConfigurator.Configure(repository, doc.DocumentElement);
}
_textLog = LogManager.GetLogger(repository.Name, "TextLog");
}
+24 -2
View File
@@ -47,8 +47,8 @@ namespace SteamTool.Core.Properties {
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性
/// 重写当前线程的 CurrentUICulture 属性。
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
@@ -124,5 +124,27 @@ namespace SteamTool.Core.Properties {
return ResourceManager.GetString("Hosts_WirteError", resourceCulture);
}
}
/// <summary>
/// 查找类似 &lt;?xml version=&quot;1.0&quot;?&gt;
///&lt;configuration&gt;
/// &lt;configSections&gt;
/// &lt;section name=&quot;log4net&quot; type=&quot;log4net.Config.Log4NetConfigurationSectionHandler, log4net&quot;/&gt;
/// &lt;/configSections&gt;
/// &lt;log4net&gt;
/// &lt;logger name=&quot;TextLog&quot;&gt;
/// &lt;level value=&quot;ALL&quot; /&gt;
/// &lt;appender-ref ref=&quot;RollingLogFileAppender&quot; /&gt;
/// &lt;/logger&gt;
/// &lt;!--写文本--&gt;
/// &lt;appender name=&quot;RollingLogFileAppender&quot; type=&quot;log4net.Appender.RollingFileAppender&quot;&gt;
/// &lt;param name=&quot;File&quot; value=&quot;log\\&quot; /&gt;
/// &lt;param name=&quot;AppendToFile&quot; value=&quot;true&quot; [字符串的其余部分被截断]&quot;; 的本地化字符串。
/// </summary>
internal static string Log4netXml {
get {
return ResourceManager.GetString("Log4netXml", resourceCulture);
}
}
}
}
+29
View File
@@ -154,4 +154,33 @@
<data name="Hosts_WirteError" xml:space="preserve">
<value>写入Hosts时发生错误</value>
</data>
<data name="Log4netXml" xml:space="preserve">
<value>&lt;?xml version="1.0"?&gt;
&lt;configuration&gt;
&lt;configSections&gt;
&lt;section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/&gt;
&lt;/configSections&gt;
&lt;log4net&gt;
&lt;logger name="TextLog"&gt;
&lt;level value="ALL" /&gt;
&lt;appender-ref ref="RollingLogFileAppender" /&gt;
&lt;/logger&gt;
&lt;!--写文本--&gt;
&lt;appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"&gt;
&lt;param name="File" value="log\\" /&gt;
&lt;param name="AppendToFile" value="true" /&gt;
&lt;param name="MaxSizeRollBackups" value="200" /&gt;
&lt;param name="StaticLogFileName" value="false" /&gt;
&lt;param name="DatePattern" value="yyyyMM\\yyyyMMdd'.log'" /&gt;
&lt;param name="RollingStyle" value="Date" /&gt;
&lt;layout type="log4net.Layout.PatternLayout,log4net"&gt;
&lt;param name="ConversionPattern" value="%d %-5p &gt;&gt; %m%n" /&gt;
&lt;!--输出头部并换行--&gt;
&lt;!--&lt;param name="Header" value="&amp;#13;&amp;#10;———————————————————&amp;#13;&amp;#10;" /&gt;
&lt;param name="Footer" value="&amp;#13;&amp;#10;———————————————————&amp;#13;&amp;#10;" /&gt;--&gt;
&lt;/layout&gt;
&lt;/appender&gt;
&lt;/log4net&gt;
&lt;/configuration&gt;</value>
</data>
</root>
+2 -1
View File
@@ -108,7 +108,8 @@ namespace SteamTool.Core
RememberPassword = Convert.ToBoolean(Convert.ToInt64(i.RememberPassword?.ToString())),
Timestamp = Convert.ToInt64(i.Timestamp?.ToString())
};
user.LastLoginTime = new DateTime(1970, 1, 1, 8, 0, 0).AddSeconds(user.Timestamp);
user.LastLoginTime = TimeZoneInfo.ConvertTimeFromUtc(new DateTime(1970, 1, 1, 0, 0, 0).AddSeconds(user.Timestamp), TimeZoneInfo.Local);
if (i.mostrecent != null)//老版本Steam数据 小写mostrecent 支持
{
user.MostRecent = Convert.ToBoolean(Convert.ToInt64(i.mostrecent.ToString()));
+4 -2
View File
@@ -11,7 +11,9 @@ namespace SteamTool.Model
public const string REWARDMELIST_URL = "https://gitee.com/rmbgame/steam-tools_-data/raw/master/RewardRecord.json";
//public const string REWARDMELIST_URL = "https://raw.githubusercontent.com/rmbadmin/SteamTools/develop/Data/RewardRecord.json";
public const string GITHUB_RELEASEAPI_URL = "https://api.github.com/repos/rmbadmin/SteamTools/releases/latest";
public const string GITHUB_LATEST_RELEASEAPI_URL = "https://api.github.com/repos/rmbadmin/SteamTools/releases/latest";
public const string GITHUB_RELEASEAPI_URL = "https://api.github.com/repos/rmbadmin/SteamTools/releases";
public const string GITHUB_URL = "https://github.com/rmbadmin/SteamTools";
public const string GITHUB_RELEASES_URL = "https://github.com/rmbadmin/SteamTools/releases";
@@ -23,7 +25,7 @@ namespace SteamTool.Model
public const string STEAMAPP_LIST_URL = "https://api.steampowered.com/ISteamApps/GetAppList/v2";
public const string STORE_APP_URL = "https://store.steampowered.com/app/{0}";
public const string STEAMAPP_LOGO_URL = "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/apps/{0}/{1}.jpg";
public const string STEAMAPP_ICON_URL = "http://steamcdn-a.akamaihd.net/steamcommunity/public/images/apps/{0}/{1}";
public const string STEAMAPP_ICON_URL = "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/apps/{0}/{1}";
public const string STEAMAPP_CAPSULE_URL = "https://steamcdn-a.akamaihd.net/steam/apps/{0}/capsule_184x69.jpg";
public const string STEAMAPP_HEADIMAGE_URL = "https://steamcdn-a.akamaihd.net/steam/apps/{0}/header.jpg";
public const string STEAM_MEDIA_URL = "https://steamcdn-a.akamaihd.net/steam/apps/{0}/movie_max.webm";
+2
View File
@@ -22,6 +22,8 @@ namespace SteamTool.Model
/// </summary>
public string OnlineState { get; set; }
public string IPCountry { get; set; }
/// <summary>
/// 公开状态
/// friendsonly
+19 -9
View File
@@ -31,6 +31,7 @@ namespace SteamTool.Proxy
public HttpProxy(IReadOnlyCollection<ProxyDomainModel> proxyDomains, string certificateName)
{
proxyServer.ThreadPoolWorkerThread = Environment.ProcessorCount * 8;
ProxyDomains = proxyDomains;
CertificateName = certificateName;
}
@@ -63,8 +64,20 @@ namespace SteamTool.Proxy
}
*/
#endregion
Debug.WriteLine("OnRequest" + e.HttpClient.Request.RequestUri.AbsoluteUri);
#endif
Debug.WriteLine("OnRequest " + e.HttpClient.Request.RequestUri.AbsoluteUri);
Debug.WriteLine("OnRequest Authority " + e.HttpClient.Request.RequestUri.Authority);
Logger.Info("OnRequest" + e.HttpClient.Request.RequestUri.AbsoluteUri);
#endif
await Dns.GetHostAddressesAsync(e.HttpClient.Request.Host).ContinueWith(s =>
{
//部分运营商将奇怪的域名解析到127.0.0.1 再此排除这些不支持的代理域名
if (IPAddress.IsLoopback(s.Result.FirstOrDefault())
&& ProxyDomains.Count(w => w.IsEnable && w.Hosts.Contains(e.HttpClient.Request.Host)) == 0)
{
e.Ok($"URL : {e.HttpClient.Request.RequestUri.AbsoluteUri} \r\n not support proxy");
return;
}
});
foreach (var item in ProxyDomains)
{
if (!item.IsEnable)
@@ -83,10 +96,7 @@ namespace SteamTool.Proxy
else
{
var iPs = await Dns.GetHostAddressesAsync(item.ToDomain);
if (iPs.Length > 0)
{
iP = iPs[0];
}
iP = iPs.FirstOrDefault();
}
if (iP != null)
{
@@ -108,7 +118,6 @@ namespace SteamTool.Proxy
}
}
}
//GC.Collect();
}
public async Task OnResponse(object sender, SessionEventArgs e)
{
@@ -117,6 +126,7 @@ namespace SteamTool.Proxy
//if (!e.ProxySession.Request.Host.Equals("medeczane.sgk.gov.tr")) return;
#if DEBUG
Debug.WriteLine("OnResponse" + e.HttpClient.Request.RequestUri.AbsoluteUri);
Logger.Info("OnResponse" + e.HttpClient.Request.RequestUri.AbsoluteUri);
#endif
if (IsEnableScript)
{
@@ -218,7 +228,7 @@ namespace SteamTool.Proxy
//proxyServer.CertificateManager
// .CreateServerCertificate($"{Assembly.GetCallingAssembly().GetName().Name} Certificate")
// .ContinueWith(c => proxyServer.CertificateManager.RootCertificate = c.Result);
proxyServer.CertificateManager.PfxFilePath = $@"{CertificateName}.Certificate.pfx";
proxyServer.CertificateManager.PfxFilePath = Path.Combine(AppContext.BaseDirectory, $@"{CertificateName}.Certificate.pfx");
//proxyServer.CertificateManager.PfxPassword = $"{CertificateName}";
proxyServer.CertificateManager.RootCertificateIssuerName = CertificateName;
proxyServer.CertificateManager.RootCertificateName = $"{CertificateName} Certificate";
@@ -264,7 +274,7 @@ namespace SteamTool.Proxy
{
//取消删除证书
}
else
else
{
throw;
}
+3 -1
View File
@@ -81,6 +81,8 @@ namespace SteamTool.Proxy
[Description("GOG.COM")]
GOG = 8,
[Description("Github图片修复")]
GithubContent = 9,
GithubContent = 9,
[Description("Pixiv")]
Pixiv = 10,
}
}
+9
View File
@@ -114,6 +114,15 @@ namespace SteamTool.Proxy.Properties {
}
}
/// <summary>
/// 查找类似 Pixiv 的本地化字符串。
/// </summary>
public static string Pixiv {
get {
return ResourceManager.GetString("Pixiv", resourceCulture);
}
}
/// <summary>
/// 查找类似 Steam好友聊天 的本地化字符串。
/// </summary>
@@ -135,6 +135,9 @@
<data name="OriginDownload" xml:space="preserve">
<value>Origin游戏下载(Akamai)</value>
</data>
<data name="Pixiv" xml:space="preserve">
<value>Pixiv</value>
</data>
<data name="SteamChat" xml:space="preserve">
<value>Steam好友聊天</value>
</data>
@@ -64,7 +64,7 @@ namespace SteamTool.Steam.Service.Local
Index = i + 1,
AppId = s.AppId,
Name = s.Name,
Type = Enum.TryParse<SteamAppTypeEnum>(SteamClient.SteamApps001.GetAppData(s.AppId, "type"), true, out var result) ? result : SteamAppTypeEnum.Unknown,
Type = Enum.TryParse<SteamAppTypeEnum>(GetAppData(s.AppId, "type"), true, out var result) ? result : SteamAppTypeEnum.Unknown,
//Logo = SteamClient.SteamApps001.GetAppData(s.AppId, "logo"),
IsInstalled = IsAppInstalled(s.AppId)
}).ToList();
+3 -1
View File
@@ -103,6 +103,8 @@ namespace SAM.API
return;
}
this._IsDisposed = true;
if (this.SteamClient != null && this._Pipe > 0)
{
if (this._User > 0)
@@ -115,7 +117,7 @@ namespace SAM.API
this._Pipe = 0;
}
this._IsDisposed = true;
this._IsDisposed = false;
}
public void Dispose()
Binary file not shown.
Binary file not shown.
+1
View File
@@ -2,6 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="clr-namespace:System;assembly=mscorlib"
ShutdownMode="OnExplicitShutdown"
xmlns:converters="http://schemes.grabacr.net/winfx/2015/personal/converters">
<Application.Resources>
<ResourceDictionary>
+6 -1
View File
@@ -87,13 +87,18 @@ namespace SteamTools
WindowService.Current.AddTo(this).Initialize();
ProxyService.Current.Initialize();
SteamConnectService.Current.Initialize();
//托盘加载
TaskbarService.Current.Taskbar = (TaskbarIcon)FindResource("Taskbar");
ThemeService.Current.Register(this, Theme.Windows, Accent.Windows);
this.MainWindow = WindowService.Current.GetMainWindow();
if (e.Args.ContainsArg("-minimized") || GeneralSettings.IsStartupAppMinimized.Value)
{
//this.MainWindow.Show();
//(WindowService.Current.MainWindow as MainWindowViewModel).IsVisible = false;
(WindowService.Current.MainWindow as MainWindowViewModel).Initialize();
}
else
this.MainWindow.Show();
@@ -101,7 +106,7 @@ namespace SteamTools
appInstance.CommandLineArgsReceived += (sender, args) =>
{
// 检测到多次启动时将主窗口置于最前面
this.Dispatcher.Invoke(() => WindowService.Current.MainWindow.Activate());
this.Dispatcher.Invoke(() => { (WindowService.Current.MainWindow as MainWindowViewModel).IsVisible = true; });
this.ProcessCommandLineParameter(args.CommandLineArgs);
};
#endif
Binary file not shown.
+11 -2
View File
@@ -79,7 +79,7 @@ namespace SteamTools.Properties {
}
/// <summary>
/// 查找类似 捐助纪录 的本地化字符串。
/// 查找类似 捐助记录 的本地化字符串。
/// </summary>
public static string About_DonateList {
get {
@@ -97,7 +97,7 @@ namespace SteamTools.Properties {
}
/// <summary>
/// 查找类似 开源许可 的本地化字符串。
/// 查找类似 开源协议 的本地化字符串。
/// </summary>
public static string About_OpenSourceLicensing {
get {
@@ -231,6 +231,15 @@ namespace SteamTools.Properties {
}
}
/// <summary>
/// 查找类似 交易确认 的本地化字符串。
/// </summary>
public static string Auth_TradeTitle {
get {
return ResourceManager.GetString("Auth_TradeTitle", resourceCulture);
}
}
/// <summary>
/// 查找类似 自动启动代理服务 的本地化字符串。
/// </summary>
+3
View File
@@ -135,6 +135,9 @@
<data name="Settings" xml:space="preserve">
<value>Settings</value>
</data>
<data name="Settings_Language" xml:space="preserve">
<value>Language</value>
</data>
<data name="Steam302" xml:space="preserve">
<value>CommunityFix</value>
</data>
+5 -2
View File
@@ -127,13 +127,13 @@
<value>捐助</value>
</data>
<data name="About_DonateList" xml:space="preserve">
<value>捐助纪录</value>
<value>捐助记录</value>
</data>
<data name="About_Help" xml:space="preserve">
<value>帮助</value>
</data>
<data name="About_OpenSourceLicensing" xml:space="preserve">
<value>开源许可</value>
<value>开源协议</value>
</data>
<data name="About_TheSoft" xml:space="preserve">
<value>此软件</value>
@@ -174,6 +174,9 @@
<data name="Auth_See" xml:space="preserve">
<value>查看令牌</value>
</data>
<data name="Auth_TradeTitle" xml:space="preserve">
<value>交易确认</value>
</data>
<data name="AutoRunProxyService" xml:space="preserve">
<value>自动启动代理服务</value>
</data>
Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 448 B

+4
View File
@@ -74,6 +74,10 @@ namespace SteamTools.Services
WindowService.Current.MainWindow.Dialog($"令牌同步服务器失败,错误信息:{ex.Message}");
}
}
else
{
Authenticators = new BindingList<WinAuthAuthenticator>();
}
}
/// <summary>
+58 -34
View File
@@ -40,57 +40,81 @@ namespace SteamTools.Services
}
#endregion
#region 是否有更新
private bool _IsExistUpdate;
public bool IsExistUpdate
{
get => this._IsExistUpdate;
set
{
if (this._IsExistUpdate != value)
{
this._IsExistUpdate = value;
this.RaisePropertyChanged();
}
}
}
#endregion
public async void CheckUpdate()
{
try
{
StatusService.Current.Notify("正在从Github检查更新...");
var result = await httpServices.Get(Const.GITHUB_RELEASEAPI_URL);
var result = await httpServices.Get(Const.GITHUB_LATEST_RELEASEAPI_URL);
var model = JsonConvert.DeserializeObject<GithubReleaseModel>(result);
if (!(ProductInfo.Version < model.version))
{
IsExistUpdate = false;
StatusService.Current.Notify("当前已是最新版本");
return;
}
if (WindowService.Current.MainWindow.Dialog($"检测到新版本更新内容:{model.body}\r\n是否立即更新?", $"{ProductInfo.Title} | 更新提示") == true)
{
//var name = model.assets.FirstOrDefault()?.name;
var name = Path.Combine(AppContext.BaseDirectory, @$"{ProductInfo.Title} {model.version}.zip");
if (File.Exists(name))
{
StatusService.Current.Notify("更新文件已经存在,不需要下载");
return;
}
var fileReq = WebRequest.Create(model.assets.FirstOrDefault()?.browser_download_url);
await fileReq?.GetResponseAsync().ContinueWith(s =>
{
long totalBytes = s.Result.ContentLength;
using Stream responseStream = s.Result.GetResponseStream();
using FileStream fileStream = new FileStream(name, FileMode.Create, FileAccess.Write);
long totalDownloadBytes = 0;
byte[] bs = new byte[4096];
int size = responseStream.Read(bs, 0, bs.Length);
while (size > 0)
{
totalDownloadBytes += size;
fileStream.Write(bs, 0, size);
ProgressValue = ((double)totalDownloadBytes / (double)totalBytes);
StatusService.Current.Set($"下载更新{ProgressValue.ToString("P")}");
size = responseStream.Read(bs, 0, bs.Length);
}
fileStream.Flush();
fileStream.Close();
StatusService.Current.Set(Resources.Ready);
StatusService.Current.Notify($"{ProductInfo.Title} {model.version}版本已经下载到程序根目录下,暂时请手动替换更新");
});
}
IsExistUpdate = true;
DownloadUpdate(model);
}
catch (Exception ex)
{
Logger.Error("更新出错:", ex);
WindowService.Current.MainWindow.Dialog($"更新出错:{ex.Message}");
WindowService.Current.ShowDialogWindow($"更新出错:{ex.Message}");
}
}
public async void DownloadUpdate(GithubReleaseModel model)
{
if (WindowService.Current.MainWindow.Dialog($"检测到新版本更新内容:{model.body}\r\n是否立即更新?", $"{ProductInfo.Title} | 更新提示") == true)
{
//var name = model.assets.FirstOrDefault()?.name;
var name = Path.Combine(AppContext.BaseDirectory, @$"{ProductInfo.Title} {model.version}.zip");
if (File.Exists(name))
{
StatusService.Current.Notify("更新文件已经存在,不需要下载");
return;
}
var fileReq = WebRequest.Create(model.assets.FirstOrDefault()?.browser_download_url);
await fileReq?.GetResponseAsync().ContinueWith(s =>
{
long totalBytes = s.Result.ContentLength;
using Stream responseStream = s.Result.GetResponseStream();
using FileStream fileStream = new FileStream(name, FileMode.Create, FileAccess.Write);
long totalDownloadBytes = 0;
byte[] bs = new byte[4096];
int size = responseStream.Read(bs, 0, bs.Length);
while (size > 0)
{
totalDownloadBytes += size;
fileStream.Write(bs, 0, size);
ProgressValue = ((double)totalDownloadBytes / (double)totalBytes);
StatusService.Current.Set($"下载更新{ProgressValue:P}");
size = responseStream.Read(bs, 0, bs.Length);
}
fileStream.Flush();
fileStream.Close();
StatusService.Current.Set(Resources.Ready);
StatusService.Current.Notify($"{ProductInfo.Title} {model.version}版本已经下载到程序根目录下,暂时请手动替换更新");
});
}
}
}
}
+249 -200
View File
@@ -44,205 +44,254 @@ namespace SteamTools.Services
}
private Lazy<IReadOnlyCollection<ProxyDomainModel>> _ProxyDomains = new Lazy<IReadOnlyCollection<ProxyDomainModel>>(() => new List<ProxyDomainModel>
{
new ProxyDomainModel{
Index=0,
Name=Resources.SteamCommunity,
Domains = new List<string>{"steamcommunity.com" },
ToDomain = "steamcommunity-a.akamaihd.net",
Hosts = new List<string>{ "steamcommunity.com", "www.steamcommunity.com"},
DomainTag = DomainTag.SteamCommunity,
IsEnable= true,
},
new ProxyDomainModel{
Index=1,
Name=Resources.SteamStore,
Domains = new List<string>{"steampowered.com" },
ToDomain = "steamstore-a.akamaihd.net",
Hosts = new List<string>{ "store.steampowered.com", "api.steampowered.com"},
DomainTag = DomainTag.SteamStore,
IsEnable= false,
},
//new ProxyDomainModel{
// Index=2,
// Name=Resources.SteamImage,
// Domains = new List<string>{"steamcdn-a.akamaihd.net" },
// ToDomain = "steamuserimages-a.akamaihd.net",
// Hosts = new List<string>{ "steamcdn-a.akamaihd.net"},
// DomainTag = DomainTag.SteamImage,
// IsEnable= false,
//},
new ProxyDomainModel{
Index=3,
Name=Resources.SteamChat,
Domains = new List<string>{"steam-chat.com" },
ToDomain = "s.team",
Hosts = new List<string>{ "steam-chat.com"},
DomainTag = DomainTag.SteamChat,
IsEnable= false,
},
new ProxyDomainModel{
Index=4,
Name=Resources.Discord,
Domains = new List<string>{ "discordapp.com","discordapp.net" },
//ToDomain = "discord.com",
ProxyIPAddres="162.159.130.232",
Hosts = new List<string>{
"discordapp.com",
"dl.discordapp.net",
"media.discordapp.net",
"images-ext-2.discordapp.net",
"images-ext-1.discordapp.net",
"support.discordapp.com",
"url9177.discordapp.com",
"canary-api.discordapp.com",
"cdn-ptb.discordapp.com",
"ptb.discordapp.com",
"status.discordapp.com",
"cdn-canary.discordapp.com",
"cdn.discordapp.com",
"streamkit.discordapp.com",
"i18n.discordapp.com" ,
"url9624.discordapp.com",
"url7195.discordapp.com",
"merch.discordapp.com",
"printer.discordapp.com",
"canary.discordapp.com",
"apps.discordapp.com",
"pax.discordapp.com",
},
DomainTag = DomainTag.Discord,
IsEnable= false,
},
new ProxyDomainModel{
Index=5,
Name=Resources.Twitch,
Domains = new List<string>{ "twitch.tv" ,"usher.ttvnw.net"},
ToDomain="twitch.map.fastly.net",
Hosts = new List<string>{
"twitch.tv",
"www.twitch.tv",
"m.twitch.tv",
"app.twitch.tv",
"music.twitch.tv",
"badges.twitch.tv",
"blog.twitch.tv",
"inspector.twitch.tv",
"stream.twitch.tv",
"dev.twitch.tv",
"clips.twitch.tv",
"spade.twitch.tv",
"gql.twitch.tv",
"vod-secure.twitch.tv",
"vod-storyboards.twitch.tv",
"trowel.twitch.tv",
"countess.twitch.tv",
"extension-files.twitch.tv",
"vod-metro.twitch.tv",
"pubster.twitch.tv",
"help.twitch.tv",
"passport.twitch.tv",
"id.twitch.tv",
"link.twitch.tv",
"id-cdn.twitch.tv",
"player.twitch.tv",
"api.twitch.tv",
"cvp.twitch.tv",
"clips-media-assets2.twitch.tv",
"client-event-reporter.twitch.tv",
"gds-vhs-drops-campaign-images.twitch.tv",
"us-west-2.uploads-regional.twitch.tv",
"assets.help.twitch.tv",
"discuss.dev.twitch.tv",
"pubsub-edge.twitch.tv",
"irc-ws.chat.twitch.tv",
"irc-ws-r.chat.twitch.tv",
//"platform.twitter.com",
"usher.ttvnw.net",
},
DomainTag = DomainTag.Twitch,
IsEnable= false,
},
new ProxyDomainModel{
Index=6,
Name=Resources.OriginDownload,
Domains = new List<string>{"origin-a.akamaihd.net" },
ToDomain = "cctv4-lh.akamaihd.net",
Hosts = new List<string>{ "origin-a.akamaihd.net"},
DomainTag = DomainTag.OriginGameDownload,
IsEnable= false,
},
//new ProxyDomainModel{
// Name=Resources.UplayUpdate,
// Domains = new List<string>{"static3.cdn.ubi.com" },
// ToDomain = "static3.cdn.ubi.com",
// Hosts = new List<string>{ "static3.cdn.ubi.com"},
// DomainTag = DomainTag.UplayUpdate,
// IsEnable= false,
//},
//new ProxyDomainModel{
// Index=7,
// Name=Resources.GOG,
// Domains = new List<string>{ "gog.com" },
// ToDomain = "api.gog.com",
// Hosts = new List<string>{
// "www.gog.com",
// "images.gog.com",
// "images-1.gog.com",
// "images-2.gog.com",
// "images-3.gog.com",
// "images-4.gog.com",
// "webinstallers.gog.com",
// "menu.gog.com",
// "auth.gog.com",
// "login.gog.com",
// //"api.gog.com",
// "reviews.gog.com",
// "insights-collector.gog.com",
// "remote-config.gog.com",
// "external-accounts.gog.com",
// "chat.gog.com",
// "presence.gog.com",
// "external-users.gog.com",
// "gamesdb.gog.com",
// "gameplay.gog.com",
// "cfg.gog.com",
// "notifications.gog.com",
// "users.gog.com",
// },
// DomainTag = DomainTag.GOG,
// IsEnable= false,
//},
new ProxyDomainModel{
Index=8,
Name=Resources.GoogleRecaptchaCode,
Domains = new List<string>{"www.google.com" },
ToDomain = "kh.google.com",
Hosts = new List<string>{ "www.google.com"},
DomainTag = DomainTag.GoogleCode,
IsEnable= false,
},
new ProxyDomainModel{
Index=9,
Name=Resources.GithubContent,
Domains = new List<string>{"githubusercontent.com","raw.github.com" },
//ToDomain = "github.map.fastly.net",
ProxyIPAddres = "151.101.88.133",
Hosts = new List<string>{
"raw.github.com",
"raw.githubusercontent.com",
"camo.githubusercontent.com",
"cloud.githubusercontent.com",
"avatars0.githubusercontent.com",
"avatars1.githubusercontent.com",
"avatars2.githubusercontent.com",
"avatars3.githubusercontent.com",
"user-images.githubusercontent.com",
},
DomainTag = DomainTag.GithubContent,
IsEnable= false,
},
});
{
new ProxyDomainModel{
Index=0,
Name=Resources.SteamCommunity,
Domains = new List<string>{"steamcommunity.com" },
ToDomain = "steamcommunity-a.akamaihd.net",
Hosts = new List<string>{ "steamcommunity.com", "www.steamcommunity.com"},
DomainTag = DomainTag.SteamCommunity,
IsEnable= true,
},
new ProxyDomainModel{
Index=1,
Name=Resources.SteamStore,
Domains = new List<string>{"steampowered.com" },
ToDomain = "steamstore-a.akamaihd.net",
Hosts = new List<string>{ "store.steampowered.com", "api.steampowered.com"},
DomainTag = DomainTag.SteamStore,
IsEnable= false,
},
new ProxyDomainModel{
Index=2,
Name=Resources.SteamImage,
Domains = new List<string>{"steamcdn-a.akamaihd.net" },
ToDomain = "cdn.akamai.steamstatic.com",
//ProxyIPAddres = "184.50.87.34",
Hosts = new List<string>{ "steamcdn-a.akamaihd.net"},
DomainTag = DomainTag.SteamImage,
IsEnable= false,
},
new ProxyDomainModel{
Index=3,
Name=Resources.SteamChat,
Domains = new List<string>{"steam-chat.com" },
ToDomain = "steamstore-a.akamaihd.net",
Hosts = new List<string>{ "steam-chat.com"},
DomainTag = DomainTag.SteamChat,
IsEnable= false,
},
new ProxyDomainModel{
Index=4,
Name=Resources.Discord,
Domains = new List<string>{ "discordapp.com","discordapp.net" },
//ToDomain = "discord.com",
ProxyIPAddres="162.159.133.232",
Hosts = new List<string>{
"discordapp.com",
"dl.discordapp.net",
"media.discordapp.net",
"images-ext-2.discordapp.net",
"images-ext-1.discordapp.net",
"support.discordapp.com",
"url9177.discordapp.com",
"canary-api.discordapp.com",
"cdn-ptb.discordapp.com",
"ptb.discordapp.com",
"status.discordapp.com",
"cdn-canary.discordapp.com",
"cdn.discordapp.com",
"streamkit.discordapp.com",
"i18n.discordapp.com" ,
"url9624.discordapp.com",
"url7195.discordapp.com",
"merch.discordapp.com",
"printer.discordapp.com",
"canary.discordapp.com",
"apps.discordapp.com",
"pax.discordapp.com",
},
//ServerName= "discord.com",
DomainTag = DomainTag.Discord,
IsEnable= false,
},
new ProxyDomainModel{
Index=5,
Name=Resources.Twitch,
Domains = new List<string>{ "twitch.tv" ,"usher.ttvnw.net"},
ToDomain="twitch.map.fastly.net",
Hosts = new List<string>{
"twitch.tv",
"www.twitch.tv",
"m.twitch.tv",
"app.twitch.tv",
"music.twitch.tv",
"badges.twitch.tv",
"blog.twitch.tv",
"inspector.twitch.tv",
"stream.twitch.tv",
"dev.twitch.tv",
"clips.twitch.tv",
"spade.twitch.tv",
"gql.twitch.tv",
"vod-secure.twitch.tv",
"vod-storyboards.twitch.tv",
"trowel.twitch.tv",
"countess.twitch.tv",
"extension-files.twitch.tv",
"vod-metro.twitch.tv",
"pubster.twitch.tv",
"help.twitch.tv",
"passport.twitch.tv",
"id.twitch.tv",
"link.twitch.tv",
"id-cdn.twitch.tv",
"player.twitch.tv",
"api.twitch.tv",
"cvp.twitch.tv",
"clips-media-assets2.twitch.tv",
"client-event-reporter.twitch.tv",
"gds-vhs-drops-campaign-images.twitch.tv",
"us-west-2.uploads-regional.twitch.tv",
"assets.help.twitch.tv",
"discuss.dev.twitch.tv",
"pubsub-edge.twitch.tv",
"irc-ws.chat.twitch.tv",
"irc-ws-r.chat.twitch.tv",
//"platform.twitter.com",
"usher.ttvnw.net",
},
DomainTag = DomainTag.Twitch,
IsEnable= false,
},
new ProxyDomainModel{
Index=6,
Name=Resources.OriginDownload,
Domains = new List<string>{"origin-a.akamaihd.net" },
ToDomain = "cctv4-lh.akamaihd.net",
Hosts = new List<string>{ "origin-a.akamaihd.net"},
DomainTag = DomainTag.OriginGameDownload,
IsEnable= false,
},
//new ProxyDomainModel{
//Name=Resources.UplayUpdate,
//Domains = new List<string>{"static3.cdn.ubi.com" },
//ToDomain = "static3.cdn.ubi.com",
//Hosts = new List<string>{ "static3.cdn.ubi.com"},
//DomainTag = DomainTag.UplayUpdate,
//IsEnable= false,
//},
//new ProxyDomainModel{
//Index=7,
//Name=Resources.GOG,
//Domains = new List<string>{ "gog.com" },
//ToDomain = "api.gog.com",
//Hosts = new List<string>{
//"www.gog.com",
//"images.gog.com",
//"images-1.gog.com",
//"images-2.gog.com",
//"images-3.gog.com",
//"images-4.gog.com",
//"webinstallers.gog.com",
//"menu.gog.com",
//"auth.gog.com",
//"login.gog.com",
////"api.gog.com",
//"reviews.gog.com",
//"insights-collector.gog.com",
//"remote-config.gog.com",
//"external-accounts.gog.com",
//"chat.gog.com",
//"presence.gog.com",
//"external-users.gog.com",
//"gamesdb.gog.com",
//"gameplay.gog.com",
//"cfg.gog.com",
//"notifications.gog.com",
//"users.gog.com",
//},
//DomainTag = DomainTag.GOG,
//IsEnable= false,
//},
new ProxyDomainModel{
Index=8,
Name=Resources.GoogleRecaptchaCode,
Domains = new List<string>{"www.google.com" },
ToDomain = "kh.google.com",
Hosts = new List<string>{ "www.google.com"},
DomainTag = DomainTag.GoogleCode,
IsEnable= false,
},
new ProxyDomainModel{
Index=9,
Name=Resources.GithubContent,
Domains = new List<string>{"githubusercontent.com","raw.github.com" },
//ToDomain = "aw.githubusercontent.com",
ProxyIPAddres = "151.101.88.133",
Hosts = new List<string>{
"raw.github.com",
"raw.githubusercontent.com",
"camo.githubusercontent.com",
"cloud.githubusercontent.com",
"avatars0.githubusercontent.com",
"avatars1.githubusercontent.com",
"avatars2.githubusercontent.com",
"avatars3.githubusercontent.com",
"user-images.githubusercontent.com",
},
DomainTag = DomainTag.GithubContent,
IsEnable= false,
},
new ProxyDomainModel{
Index=10,
Name=Resources.Pixiv,
Domains = new List<string>{ "pixiv.net" },
ToDomain="www.fanbox.cc",
//ProxyIPAddres = "210.140.131.219",
Hosts = new List<string>{
"www.pixiv.net",
"touch.pixiv.net",
"source.pixiv.net",
"accounts.pixiv.net",
"imgaz.pixiv.net",
"app-api.pixiv.net",
"oauth.secure.pixiv.net",
"dic.pixiv.net",
"comic.pixiv.net",
"factory.pixiv.net",
"g-client-proxy.pixiv.net",
"sketch.pixiv.net",
"payment.pixiv.net",
"sensei.pixiv.net",
"novel.pixiv.net",
"ssl.pixiv.net",
"times.pixiv.net",
"recruit.pixiv.net",
"pixiv.net",
"p2.pixiv.net",
"matsuri.pixiv.net",
"m.pixiv.net",
"iracon.pixiv.net",
"inside.pixiv.net",
"i1.pixiv.net",
"help.pixiv.net",
"goods.pixiv.net",
"genepixiv.pr.pixiv.net",
"festa.pixiv.net",
"en.dic.pixiv.net",
"dev.pixiv.net",
"chat.pixiv.net",
"blog.pixiv.net",
"embed.pixiv.net",
"comic-api.pixiv.net",
"pay.pixiv.net",
},
DomainTag = DomainTag.GithubContent,
IsEnable= false,
},
});
public Lazy<IReadOnlyCollection<ProxyDomainModel>> ProxyDomains
{
get => _ProxyDomains;
@@ -323,7 +372,7 @@ namespace SteamTools.Services
public void InitJsScript()
{
var scripts = new List<ProxyScript>();
var dir = new DirectoryInfo(Const.SCRIPT_DIR);
var dir = new DirectoryInfo(Path.Combine(AppContext.BaseDirectory, Const.SCRIPT_DIR));
if (!dir.Exists)
{
dir.Create();
+5 -5
View File
@@ -23,8 +23,8 @@ namespace SteamTools.Services
/// </summary>
private readonly string[] supportedCultureNames =
{
"zh-CN", // Resources.resx
"zh-TW",
"zh-Hans", // Resources.resx
"zh-Hant",
"en",
};
@@ -33,8 +33,8 @@ namespace SteamTools.Services
/// </summary>
private readonly Dictionary<string, string> supportedCultureSteamNames = new Dictionary<string, string>
{
{ "zh-CN","schinese"},
{ "zh-TW","tchinese"},
{ "zh-Hans","schinese"},
{ "zh-Hant","tchinese"},
{ "en","english"},
};
@@ -76,7 +76,7 @@ namespace SteamTools.Services
{
Resources.Culture = this.SupportedCultures.SingleOrDefault(x => x.Name == name);
GeneralSettings.Culture.Value = SteamTools.Properties.Resources.Culture?.Name;
Debug.WriteLine(SteamTools.Properties.Resources.ResourceManager.GetString("Welcome", Resources.Culture));
//Debug.WriteLine(SteamTools.Properties.Resources.ResourceManager.GetString("Welcome", Resources.Culture));
this.RaisePropertyChanged(nameof(this.Resources));
}
+46 -35
View File
@@ -94,43 +94,49 @@ namespace SteamTools.Services
public void Initialize()
{
Task.Run(async () =>
{
Thread.CurrentThread.IsBackground = true;
while (true)
{
if (Process.GetProcessesByName("steam").Length > 0)
{
if (!IsConnectToSteam)
{
if (ApiService.Initialize())
{
var id = ApiService.GetSteamId64();
if (id == 76561197960265728)
{
//该64位id的steamID3等于0,是steam未获取到当前登录用户的默认返回值,所以直接重新获取,
//希望这位用户不会用steam++,嗯...
ApiService.SteamClient.Dispose();
continue;
}
IsConnectToSteam = true;
CurrentSteamUser = await steamDbApiService.GetUserInfo(id);
var mainViewModel = (WindowService.Current.MainWindow as MainWindowViewModel);
mainViewModel.SteamAppPage.Initialize();
var t = new Task(async () =>
{
Thread.CurrentThread.IsBackground = true;
while (true)
{
if (Process.GetProcessesByName("steam").Length > 0)
{
if (!IsConnectToSteam)
{
if (ApiService.Initialize())
{
var id = ApiService.GetSteamId64();
if (id == 76561197960265728)
{
//该64位id的steamID3等于0,是steam未获取到当前登录用户的默认返回值,所以直接重新获取,
//希望这位用户不会用steam++,嗯...
ApiService.SteamClient.Dispose();
continue;
}
IsConnectToSteam = true;
CurrentSteamUser = await steamDbApiService.GetUserInfo(id);
CurrentSteamUser.IPCountry = ApiService.GetIPCountry();
var mainViewModel = (WindowService.Current.MainWindow as MainWindowViewModel);
await mainViewModel.SteamAppPage.Initialize();
#if DEBUG
mainViewModel.SystemTabItems[mainViewModel.SystemTabItems.Count - 1].Initialize();
await mainViewModel.SystemTabItems[mainViewModel.SystemTabItems.Count - 1].Initialize();
#endif
}
}
}
else
{
IsConnectToSteam = false;
//StatusService.Current.Notify(Resources.Steam_Not_Runing);
}
await Task.Delay(1500);
}
}).ContinueWith(s => { Logger.Error(s.Exception); WindowService.Current.ShowDialogWindow(s.Exception.Message); }, TaskContinuationOptions.OnlyOnFaulted);
SteamConnectService.Current.DisposeSteamClient();
}
}
}
else
{
IsConnectToSteam = false;
//StatusService.Current.Notify(Resources.Steam_Not_Runing);
}
await Task.Delay(1500);
}
}, TaskCreationOptions.LongRunning);
t.ContinueWith(s => { Logger.Error(s.Exception); WindowService.Current.ShowDialogWindow(s.Exception.Message); }, TaskContinuationOptions.OnlyOnFaulted);
t.Start();
}
public void Initialize(int appid)
@@ -149,5 +155,10 @@ namespace SteamTools.Services
app.Process.Kill();
}
}
public void DisposeSteamClient()
{
ApiService.SteamClient.Dispose();
}
}
}
+10 -7
View File
@@ -40,7 +40,7 @@
<PackageId />
<Version>1.0.2</Version>
<Version>1.0.3</Version>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net472|AnyCPU'">
@@ -70,7 +70,6 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="LivetCask" Version="3.0.1" />
<PackageReference Include="Hardcodet.NotifyIcon.Wpf" Version="1.0.8" />
</ItemGroup>
@@ -80,17 +79,14 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="LivetCask" Version="3.0.1" />
<PackageReference Include="Hardcodet.NotifyIcon.Wpf.NetCore" Version="1.0.14" />
</ItemGroup>
<!--<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<PackageReference Include="LivetCask" Version="3.0.2" />
<PackageReference Include="Hardcodet.NotifyIcon.Wpf.NetCore" Version="1.0.14" />
</ItemGroup>-->
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0-windows'">
<PackageReference Include="LivetCask" Version="3.0.2" />
<PackageReference Include="Hardcodet.NotifyIcon.Wpf.NetCore" Version="1.0.14" />
</ItemGroup>
@@ -115,6 +111,10 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="LivetCask.Behaviors" Version="3.2.3.1" />
<PackageReference Include="LivetCask.EventListeners" Version="3.2.3.1" />
<PackageReference Include="LivetCask.Messaging" Version="3.2.3.1" />
<PackageReference Include="LivetCask.Mvvm" Version="3.2.3.1" />
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.19" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
@@ -195,7 +195,7 @@
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.zh-TW.resx">
<EmbeddedResource Update="Properties\Resources.zh-Hant.resx">
<DependentUpon>Resources.resx</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Update="Properties\Resources.en.resx">
@@ -302,6 +302,9 @@
<Page Update="Views\Pages\WelcomePage.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Views\Window\AuthTradeWindow.xaml">
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
</Page>
<Page Update="Views\Window\ShowAuthWindow.xaml">
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
</Page>
@@ -342,7 +345,7 @@
<ItemGroup>
<None Update="log\Log4net.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</None>
<None Update="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
+51 -50
View File
@@ -11,68 +11,69 @@ using SteamTools.Services;
namespace SteamTools.ViewModels
{
public abstract class TabItemViewModel : ItemViewModel, ITabItem
{
#region Name 変更通知
public abstract class TabItemViewModel : ItemViewModel, ITabItem
{
#region Name 変更通知
public abstract string Name { get; protected set; }
public abstract string Name { get; protected set; }
#endregion
#endregion
#region Badge 変更通知
#region Badge 変更通知
private int? _Badge;
private int? _Badge;
public virtual int? Badge
{
get { return this._Badge; }
protected set
{
if (this._Badge != value)
{
this._Badge = value;
this.RaisePropertyChanged();
}
}
}
public virtual int? Badge
{
get { return this._Badge; }
protected set
{
if (this._Badge != value)
{
this._Badge = value;
this.RaisePropertyChanged();
}
}
}
#endregion
#endregion
#region Status 変更通知
#region Status 変更通知
private ViewModel _Status;
private ViewModel _Status;
/// <summary>
/// 获取状态栏中显示的状态
/// </summary>
public virtual ViewModel Status
{
get { return this._Status; }
protected set
{
if (this._Status != value)
{
this._Status = value;
this.RaisePropertyChanged();
}
}
}
/// <summary>
/// 获取状态栏中显示的状态
/// </summary>
public virtual ViewModel Status
{
get { return this._Status; }
protected set
{
if (this._Status != value)
{
this._Status = value;
this.RaisePropertyChanged();
}
}
}
#endregion
#endregion
protected TabItemViewModel()
{
if (Models.Helper.IsInDesignMode) return;
protected TabItemViewModel()
{
if (Models.Helper.IsInDesignMode) return;
this.CompositeDisposable.Add(new PropertyChangedEventListener(ResourceService.Current)
{
(sender, args) => this.RaisePropertyChanged(nameof(this.Name)),
});
}
this.CompositeDisposable.Add(new PropertyChangedEventListener(ResourceService.Current)
{
(sender, args) => this.RaisePropertyChanged(nameof(this.Name)),
});
}
internal virtual void Initialize()
{
}
}
internal async virtual Task Initialize()
{
await Task.CompletedTask;
}
}
}
@@ -35,8 +35,8 @@ namespace SteamTools.ViewModels
public DateTime PayTime { get; set; }
}
private List<DonateRecord> _DonateRecordList;
public List<DonateRecord> DonateRecordList
private IReadOnlyCollection<DonateRecord> _DonateRecordList;
public IReadOnlyCollection<DonateRecord> DonateRecordList
{
get => this._DonateRecordList;
set
@@ -57,10 +57,10 @@ namespace SteamTools.ViewModels
{
if (!string.IsNullOrEmpty(s.Result))
{
DonateRecordList = JsonConvert.DeserializeObject<List<DonateRecord>>(s.Result);
DonateRecordList = JsonConvert.DeserializeObject<List<DonateRecord>>(s.Result).OrderByDescending(o => o.PayTime).ToList();
}
});
});
}).ContinueWith(s => { Logger.Error(s.Exception); WindowService.Current.ShowDialogWindow(s.Exception.Message); }, TaskContinuationOptions.OnlyOnFaulted);
}
}
}
@@ -17,6 +17,7 @@ using SteamTool.Steam.Service;
using SteamTool.Model;
using Newtonsoft.Json;
using SteamTools.Models.Settings;
using System.IO;
namespace SteamTools.ViewModels
{
@@ -42,7 +43,7 @@ namespace SteamTools.ViewModels
{
var result = await SteamworksWebApi.GetAllSteamAppsString();
if (GeneralSettings.IsSteamAppListLocalCache)
SteamTool.UpdateAppListJson(result, Const.APP_LIST_FILE);
SteamTool.UpdateAppListJson(result, Path.Combine(AppContext.BaseDirectory, Const.APP_LIST_FILE));
var apps = JsonConvert.DeserializeObject<SteamApps>(result).AppList.Apps;
apps = apps.DistinctBy(d => d.AppId).ToList();
//SteamConnectService.Current.SteamApps = apps;
@@ -61,7 +62,7 @@ namespace SteamTools.ViewModels
}
}
public void CheckUpdate_Click()
public void CheckUpdate_Click()
{
AutoUpdateService.Current.CheckUpdate();
}
@@ -46,7 +46,10 @@ namespace SteamTools.ViewModels
CanExecuteFunc = () => true,
CommandAction = () =>
{
var mainWindow = (App.Current.MainWindow.DataContext as MainWindowViewModel);
App.Current.MainWindow = WindowService.Current.GetMainWindow();
//if (!App.Current.MainWindow.IsVisible)
// App.Current.MainWindow.Show();
var mainWindow = (WindowService.Current.MainWindow as MainWindowViewModel);
mainWindow.IsVisible = true;
}
};
@@ -55,14 +58,11 @@ namespace SteamTools.ViewModels
public void ShowUrl()
{
//var mainWindow = (App.Current.MainWindow.DataContext as MainWindowViewModel);
//mainWindow.IsVisible = !mainWindow.IsVisible;
if (SteamConnectService.Current.IsConnectToSteam)
{
Process.Start(SteamConnectService.Current.CurrentSteamUser.ProfileUrl);
}
else
else
{
Process.Start(Const.MY_PROFILE_URL);
}
@@ -81,7 +81,7 @@ namespace SteamTools.ViewModels
/// </summary>
public void NavigateTabItem(string index)
{
var mainWindow = (App.Current.MainWindow.DataContext as MainWindowViewModel);
var mainWindow = (WindowService.Current.MainWindow as MainWindowViewModel);
mainWindow.IsVisible = true;
int.TryParse(index, out int i);
if (i < 0)
+19 -17
View File
@@ -73,9 +73,10 @@ namespace SteamTools.ViewModels
if (value)
{
App.Current.MainWindow.WindowState = WindowState.Normal;
App.Current.MainWindow.Topmost = true;
User32Window.FlashWindow(new WindowInteropHelper(App.Current.MainWindow).Handle);
App.Current.MainWindow.Topmost = false;
//App.Current.MainWindow.Topmost = true;
this.Activate();
//User32Window.FlashWindow(new WindowInteropHelper(App.Current.MainWindow).Handle);
//App.Current.MainWindow.Topmost = false;
}
}
}
@@ -124,24 +125,25 @@ namespace SteamTools.ViewModels
if (!this.IsInitialized)
{
base.Initialize();
await Task.Yield();
await Task.Run(() =>
foreach (var item in this.TabItems)
{
foreach (var item in this.TabItems)
if (item == SteamAppPage)
continue;
await item.Initialize().ContinueWith(s =>
{
if (item == SteamAppPage)
continue;
item.Initialize();
}
}).ContinueWith(s => { Logger.Error(s.Exception); WindowService.Current.ShowDialogWindow(s.Exception.Message); }, TaskContinuationOptions.OnlyOnFaulted)
.ContinueWith(s => s.Dispose());
Logger.Error(s.Exception);
WindowService.Current.ShowDialogWindow(s.Exception.Message);
}, TaskContinuationOptions.OnlyOnFaulted).ContinueWith(s => s.Dispose());
}
AuthService.Current.Initialize();
if (GeneralSettings.IsAutoCheckUpdate)
{
AutoUpdateService.Current.CheckUpdate();
}
StatusService.Current.Set(Resources.Ready);
this.IsInitialized = true;
StatusService.Current.Set(Resources.Ready);
}
}
@@ -150,19 +152,19 @@ namespace SteamTools.ViewModels
/// </summary>
public void ChangeWindowVisible()
{
App.Current.MainWindow = App.Current.MainWindow ?? new MainWindow();
App.Current.MainWindow = App.Current.MainWindow ?? WindowService.Current.GetMainWindow();
if (IsVisible)
{
App.Current.MainWindow.Show();
App.Current.MainWindow.WindowState = WindowState.Normal;
App.Current.MainWindow.Activate();
this.Activate();
User32Window.FlashWindow(new WindowInteropHelper(App.Current.MainWindow).Handle);
}
else
{
//App.Current.MainWindow.WindowState = WindowState.Minimized;
App.Current.MainWindow.WindowState = WindowState.Minimized;
App.Current.MainWindow.Hide();
App.Current.MainWindow.Visibility = Visibility.Collapsed;
//App.Current.MainWindow.Visibility = Visibility.Collapsed;
}
}
}
@@ -54,7 +54,7 @@ namespace SteamTools.ViewModels
{
foreach (var file in fileDialog.FileNames)
{
File.Copy(file, $@"{Const.SCRIPT_DIR}\{Path.GetFileName(file)}", true);
File.Copy(file, $@"{Path.Combine(AppContext.BaseDirectory, Const.SCRIPT_DIR)}\{Path.GetFileName(file)}", true);
}
ProxyService.Current.InitJsScript();
}
@@ -62,7 +62,7 @@ namespace SteamTools.ViewModels
public void OpenScriptFileDir_Click()
{
Process.Start(Const.SCRIPT_DIR);
Process.Start(Path.Combine(AppContext.BaseDirectory, Const.SCRIPT_DIR));
}
public void DeleteScript_OnClick(string path)
@@ -37,9 +37,9 @@ namespace SteamTools.ViewModels
}
internal override void Initialize()
internal async override Task Initialize()
{
Task.Run(() =>
await Task.Run(() =>
{
DebugText += SteamConnectService.Current.IsConnectToSteam;
DebugText += Environment.NewLine;
@@ -60,6 +60,23 @@ namespace SteamTools.ViewModels
public void Test_OnClick()
{
Task.Run(() =>
{
DebugText += SteamConnectService.Current.IsConnectToSteam;
DebugText += Environment.NewLine;
DebugText += SteamConnectService.Current.ApiService.GetSteamId64();
DebugText += Environment.NewLine;
DebugText += SteamConnectService.Current.CurrentSteamUser.SteamId3_Int;
DebugText += Environment.NewLine;
DebugText += SteamConnectService.Current.ApiService.SteamClient.SteamUtils.GetAppId();
DebugText += Environment.NewLine;
DebugText += SteamConnectService.Current.ApiService.SteamClient.SteamApps008.IsAppInstalled(730);
DebugText += Environment.NewLine;
DebugText += SteamConnectService.Current.ApiService.SteamClient.SteamApps008.IsSubscribedFromFamilySharing();
DebugText += Environment.NewLine;
DebugText += SteamConnectService.Current.ApiService.SteamClient.SteamApps008.GetAppInstallDir(730);
DebugText += Environment.NewLine;
}).ContinueWith(s => { Logger.Error(s.Exception); WindowService.Current.ShowDialogWindow(s.Exception.Message); }, TaskContinuationOptions.OnlyOnFaulted).ContinueWith(s => s.Dispose());
}
}
}
@@ -94,20 +94,21 @@ namespace SteamTools.ViewModels
TaskbarService.Current.Notify("已复制令牌");
}
internal override void Initialize()
internal async override Task Initialize()
{
AuthService.Current.Subscribe(nameof(AuthService.Current.Authenticators),
()=> { Authenticators = AuthService.Current.Authenticators; }).AddTo(this);
AuthService.Current.Subscribe(nameof(AuthService.Current.Authenticators),
() => { Authenticators = AuthService.Current.Authenticators; }).AddTo(this);
await Task.CompletedTask;
}
public void AddAuth_Click()
{
new AddAuthWindow() { DataContext = new AddAuthWindowViewModel() }.ShowDialog();
new AddAuthWindow() { DataContext = new AddAuthWindowViewModel() }.Show();
}
public void EditAuth_Click()
{
if (Authenticators?.Count < 1)
if (Authenticators == null || !Authenticators.Any())
{
StatusService.Current.Notify("没有可编辑的令牌");
return;
@@ -121,7 +122,13 @@ namespace SteamTools.ViewModels
public void ImageShowAuth_Click(WinAuthAuthenticator auth)
{
new ShowAuthWindow() { DataContext = new ShowAuthWindowViewModel(auth) }.ShowDialog();
new ShowAuthWindow() { DataContext = new ShowAuthWindowViewModel(auth) }.Show();
}
public void ImageAuthTrade_Click(WinAuthAuthenticator auth)
{
new AuthTradeWindow() { DataContext = new AuthTradeWindowViewModel(auth) }.Show();
}
}
}
@@ -47,10 +47,10 @@ namespace SteamTools.ViewModels
}
}
internal override void Initialize()
internal async override Task Initialize()
{
StatusService.Current.Notify("加载本地Steam用户数据");
Task.Run(async () =>
await Task.Run(async () =>
{
SteamUsers = new BindingList<SteamUser>(steamService.GetAllUser());
if (SteamUsers?.Count < 1)
@@ -101,41 +101,46 @@ namespace SteamTools.ViewModels
AppTypeFilter = new SteamAppTypeFilter(this.Update);
}
internal override void Initialize()
internal override async Task Initialize()
{
StatusService.Current.Notify("加载Steam游戏数据");
Task.Run(async () =>
{
var apps = SteamTool.GetAppListJson(Const.APP_LIST_FILE);
if (apps == null || !apps.Any())
{
var result = await SteamworksWebApi.GetAllSteamAppsString();
if (string.IsNullOrEmpty(result))
{
StatusService.Current.Notify("下载Steam游戏数据失败,请尝试开启社区反代刷新");
}
if (GeneralSettings.IsSteamAppListLocalCache)
SteamTool.UpdateAppListJson(result, Const.APP_LIST_FILE);
apps = JsonConvert.DeserializeObject<SteamApps>(result).AppList.Apps;
}
apps = apps.DistinctBy(d => d.AppId).ToList();
//SteamConnectService.Current.SteamApps = apps;
SteamConnectService.Current.SteamApps = SteamConnectService.Current.ApiService.OwnsApps(apps);
await Task.Run(async () =>
{
var apps = SteamTool.GetAppListJson(Path.Combine(AppContext.BaseDirectory, Const.APP_LIST_FILE));
if (apps == null || !apps.Any())
{
var result = await SteamworksWebApi.GetAllSteamAppsString();
if (string.IsNullOrEmpty(result))
{
StatusService.Current.Notify("下载Steam游戏数据失败,请尝试开启社区反代刷新");
return;
}
if (GeneralSettings.IsSteamAppListLocalCache)
SteamTool.UpdateAppListJson(result, Path.Combine(AppContext.BaseDirectory, Const.APP_LIST_FILE));
apps = JsonConvert.DeserializeObject<SteamApps>(result).AppList.Apps;
}
apps = apps.DistinctBy(d => d.AppId).ToList();
//SteamConnectService.Current.SteamApps = apps;
SteamConnectService.Current.SteamApps = SteamConnectService.Current.ApiService.OwnsApps(apps);
this.updateSource
.Do(_ => this.IsReloading = true)
.SelectMany(x => this.UpdateAsync())
.Do(_ => this.IsReloading = false)
.Subscribe()
.AddTo(this);
this.updateSource
.Do(_ => this.IsReloading = true)
.SelectMany(x => this.UpdateAsync())
.Do(_ => this.IsReloading = false)
.Subscribe()
.AddTo(this);
SteamConnectService.Current.Subscribe(nameof(SteamConnectService.Current.SteamApps), this.Update).AddTo(this);
SteamConnectService.Current.Subscribe(nameof(SteamConnectService.Current.SteamApps), this.Update).AddTo(this);
}).ContinueWith(s => { Logger.Error(s.Exception); WindowService.Current.ShowDialogWindow(s.Exception.Message); }, TaskContinuationOptions.OnlyOnFaulted).ContinueWith(s =>
{
StatusService.Current.Notify("加载Steam游戏数据完成");
s.Dispose();
});
}).ContinueWith(s =>
{
Logger.Error(s.Exception);
WindowService.Current.ShowDialogWindow(s.Exception.Message, "加载Steam游戏数据失败");
}, TaskContinuationOptions.OnlyOnFaulted).ContinueWith(s =>
{
StatusService.Current.Notify("加载Steam游戏数据完成");
s.Dispose();
});
}
public void Update()
@@ -9,29 +9,29 @@ using SteamTools.Services;
namespace SteamTools.ViewModels
{
public class WelcomePageViewModel: TabItemViewModel
{
public class WelcomePageViewModel : TabItemViewModel
{
public override string Name
{
get { return Properties.Resources.Welcome; }
protected set { throw new NotImplementedException(); }
}
public override bool IsShowTab
{
get { return GeneralSettings.IsShowStartPage.Value; }
}
public override string Name
{
get { return Properties.Resources.Welcome; }
protected set { throw new NotImplementedException(); }
}
public override bool IsShowTab
{
get { return GeneralSettings.IsShowStartPage.Value; }
}
public MainWindowViewModel Content { get; }
public MainWindowViewModel Content { get; }
public WelcomePageViewModel(MainWindowViewModel owner)
{
this.Content = owner;
}
public WelcomePageViewModel(MainWindowViewModel owner)
{
this.Content = owner;
}
internal override void Initialize()
{
}
internal async override Task Initialize()
{
await Task.CompletedTask;
}
}
}
@@ -0,0 +1,36 @@
using Microsoft.Win32;
using SteamTools.Models;
using SteamTools.Models.Settings;
using SteamTools.Properties;
using SteamTools.Services;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Text;
using SteamTool.Core.Common;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
using WinAuth;
namespace SteamTools.ViewModels
{
public class AuthTradeWindowViewModel : MainWindowViewModelBase
{
private SteamAuthenticator _Authenticator;
public AuthTradeWindowViewModel()
{
this.Title = ProductInfo.Title + " | " + Resources.Auth_TradeTitle;
}
public AuthTradeWindowViewModel(WinAuthAuthenticator auth)
{
_Authenticator = auth.AuthenticatorData as SteamAuthenticator;
this.Title = ProductInfo.Title + " | " + Resources.Auth_TradeTitle;
}
}
}
@@ -38,7 +38,7 @@
<DockPanel Margin="8">
<WrapPanel VerticalAlignment="Center">
<TextBlock Text="{Binding Name}" Foreground="{StaticResource ActiveForegroundBrushKey}" Margin="10,0,0,0" Width="50"></TextBlock>
<TextBlock Text="{Binding Amount,StringFormat={}{0:F2}元}" Foreground="{StaticResource ActiveForegroundBrushKey}" Margin="30,0,0,0" Width="100"></TextBlock>
<TextBlock Text="{Binding Amount,StringFormat={}{0:F2}元}" Foreground="{StaticResource ActiveForegroundBrushKey}" Margin="30,0,0,0" Width="70"></TextBlock>
<TextBlock Text="{Binding Remark}" Foreground="{StaticResource ActiveForegroundBrushKey}" Margin="30,0,0,0"></TextBlock>
</WrapPanel>
<TextBlock Text="{Binding PayTime,StringFormat='{}{0:yyyy年MM月dd日}',ConverterCulture=zh-CN}" Foreground="{StaticResource ActiveForegroundBrushKey}" Margin="10" HorizontalAlignment="Right"></TextBlock>
@@ -20,9 +20,12 @@ namespace SteamTools.Views.Content
/// </summary>
public partial class AboutUpdateHistory : UserControl
{
private const string UpdateLogText = "";
public AboutUpdateHistory()
{
InitializeComponent();
}
}
}
+6 -3
View File
@@ -9,7 +9,7 @@
xmlns:vm="clr-namespace:SteamTools.ViewModels"
mc:Ignorable="d"
d:DesignHeight="25" d:DesignWidth="780"
d:DataContext="{d:DesignInstance vm:StatusBarViewModel}">
d:DataContext="{d:DesignInstance vm:StatusBarViewModel}">
<Grid Grid.Row="2" Background="{DynamicResource AccentBrushKey}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
@@ -18,12 +18,15 @@
<ColumnDefinition Width="23" />
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0"
Text="{Binding Source={x:Static services:StatusService.Current}, Path=Message}"
FontSize="13"
Style="{DynamicResource DefaultTextStyleKey}"
Foreground="{DynamicResource AccentForegroundBrushKey}"
TextWrapping="NoWrap"
Margin="8,0" />
Margin="8,0" >
<Run
Text="{Binding Source={x:Static services:StatusService.Current}, Path=Message}"/>
</TextBlock>
<ContentControl Grid.Column="1"
Content="{Binding}">
<ContentControl.Resources>
+3 -2
View File
@@ -15,6 +15,7 @@ using System.Windows.Navigation;
using System.Windows.Shapes;
using MetroRadiance.Interop.Win32;
using MetroRadiance.UI.Controls;
using SteamTools.Services;
using SteamTools.ViewModels;
namespace SteamTools
@@ -31,7 +32,7 @@ namespace SteamTools
protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
{
e.Cancel = true;
e.Cancel = true;
if (this.WindowSettings != null)
{
var hwnd = new WindowInteropHelper(this).Handle;
@@ -40,7 +41,7 @@ namespace SteamTools
this.WindowSettings.Placement = this.IsRestoringWindowPlacement ? (WINDOWPLACEMENT?)placement : null;
this.WindowSettings.Save();
}
(App.Current.MainWindow.DataContext as MainWindowViewModel).IsVisible = false;
(WindowService.Current.MainWindow as MainWindowViewModel).IsVisible = false;
}
}
}
+1 -1
View File
@@ -82,7 +82,7 @@
<Run Text="{Binding Resources.About_OpenSourceLicensing,Source={x:Static services:ResourceService.Current}, Mode=OneWay}"/>
</TextBlock>
<TextBlock Style="{StaticResource DetailTextStyleKey}">
<Run Text="此软件的诞生离不开以下开源项目:"/>
<Run Text="Steam++采用GPLv3开源许可,此软件的诞生离不开以下开源项目:"/>
<LineBreak/>
</TextBlock>
<ItemsControl ItemsSource="{Binding Source={x:Static models:ProductInfo.Libraries}}">
+3 -1
View File
@@ -129,6 +129,8 @@
<Run Foreground="{DynamicResource ForegroundBrushKey}"
FontSize="20"
Text="{Binding CurrentSteamUser.SteamID,Source={x:Static services:SteamConnectService.Current},Mode=OneWay}" />
<Run Foreground="{DynamicResource ForegroundBrushKey}"
Text="{Binding CurrentSteamUser.IPCountry,Source={x:Static services:SteamConnectService.Current},Mode=OneWay,StringFormat={} ({0})}" />
</Paragraph>
<Paragraph Language="zh-cn">
<Run Text=" "></Run>
@@ -211,7 +213,7 @@
</InlineUIContainer>
</Paragraph>
<Paragraph Language="zh-cn">
<Run Text="工具不定期更新且目前没有自动更新功能,请适当检查更新。" />
<Run Text="工具不定期更新,请适当检查更新。" />
<LineBreak />
<LineBreak />
<!--<Run Text="软件主页:" />
+4 -4
View File
@@ -196,7 +196,7 @@
<Run Text="Steam的移动身份验证器应用程序的桌面实现。" />
<metro2:HyperlinkEx Uri="https://github.com/Jessecar96/SteamDesktopAuthenticator"><Run Text="Github"></Run></metro2:HyperlinkEx>
<LineBreak/>
<Run Text="导入方法:选择SDA目录下maFiles文件夹的maFile文件进行导入。" />
<Run Text="导入方法:选择SDA目录下maFiles文件夹的maFile文件进行导入。(不支持导入加密文件)" />
</TextBlock>
<Grid Visibility="{Binding ElementName=ImportSDA,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}">
<Grid.ColumnDefinitions>
@@ -212,14 +212,14 @@
Grid.Column="0" Grid.ColumnSpan="2"
Text="{Binding SDAFile, Mode=OneWay}"
Prompt="选择*.maFile文件" />
<metro2:CallMethodButton Grid.Column="2" Grid.Row="0"
Content="选择文件"
<metro2:CallMethodButton Grid.Row="0" Grid.Column="2"
Content="选择文件" Height="30"
MethodName="OpenSDAFile"
Margin="6,0,0,0" />
<metro:PromptTextBox Grid.Row="1"
Grid.Column="0" Grid.ColumnSpan="3"
Text="{Binding SDAPassword, Mode=TwoWay}"
Prompt="如果设定了密码请输入密码" />
Prompt="如果设定了密码请输入密码" Visibility="Collapsed" />
<!--<metro2:CallMethodButton Grid.Column="2" Grid.Row="1"
Content="导入"
MethodName="ImportWinAuthFile"
@@ -0,0 +1,97 @@
<metro:MetroWindow x:Class="SteamTools.AuthTradeWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:livet="http://schemas.livet-mvvm.net/2011/wpf"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:metro="http://schemes.grabacr.net/winfx/2014/controls"
xmlns:metro2="clr-namespace:MetroTrilithon.UI.Controls;assembly=MetroTrilithon.Desktop"
xmlns:viewModel="clr-namespace:SteamTools.ViewModels"
xmlns:prop="clr-namespace:SteamTools.Properties"
xmlns:services="clr-namespace:SteamTools.Services"
xmlns:input="clr-namespace:System.Windows.Input;assembly=PresentationCore"
xmlns:controls="clr-namespace:SteamTools.Views.Controls"
xmlns:models="clr-namespace:SteamTools.Models"
mc:Ignorable="d"
Width="600"
Height="400"
IsRestoringWindowPlacement="True"
WindowStartupLocation="CenterScreen"
Title="{Binding Title}"
Background="{DynamicResource ThemeBrushKey}"
Foreground="{DynamicResource ActiveForegroundBrushKey}"
FontFamily="{StaticResource DefaultFontFamilyKey}"
FontSize="16"
ResizeMode="NoResize"
UseLayoutRounding="True"
TextOptions.TextFormattingMode="Display"
SnapsToDevicePixels="True"
d:DataContext="{d:DesignInstance viewModel:ShowAuthWindowViewModel}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="ContentRendered">
<livet:LivetCallMethodAction MethodTarget="{Binding}"
MethodName="Initialize" />
</i:EventTrigger>
<i:EventTrigger EventName="Closed">
<livet:DataContextDisposeAction />
</i:EventTrigger>
<livet:InteractionMessageTrigger Messenger="{Binding Messenger, Mode=OneWay}"
MessageKey="Window.Activate">
<livet:WindowInteractionMessageAction InvokeActionOnlyWhenWindowIsActive="False" />
</livet:InteractionMessageTrigger>
<livet:InteractionMessageTrigger Messenger="{Binding Messenger}"
MessageKey="Window.Transition">
<livet:TransitionInteractionMessageAction InvokeActionOnlyWhenWindowIsActive="False"
IsOwned="False" />
</livet:InteractionMessageTrigger>
<livet:InteractionMessageTrigger Messenger="{Binding Messenger}"
MessageKey="Window.Transition.Child">
<livet:TransitionInteractionMessageAction InvokeActionOnlyWhenWindowIsActive="False"
IsOwned="True" />
</livet:InteractionMessageTrigger>
</i:Interaction.Triggers>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<!--Title-->
<Border Grid.Row="0"
metro:MetroWindow.IsCaptionBar="True" >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
</Grid.RowDefinitions>
<metro:CaptionIcon Grid.Column="0" Padding="6,3">
<Image Source="pack://application:,,,/Resources/Asstes/app.ico" Width="32" Height="32"></Image>
</metro:CaptionIcon>
<TextBlock Grid.Column="1"
Grid.Row="0"
Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type Window}}, Path=Title}"
TextTrimming="CharacterEllipsis"
Foreground="{DynamicResource ForegroundBrushKey}"
FontSize="16"
VerticalAlignment="Center" />
<metro:SystemButtons Grid.Column="2"
Grid.Row="0"
VerticalAlignment="Top" />
</Grid>
</Border>
<!--Body-->
<Grid Grid.Row="1">
<Grid Margin="0,8,0,0">
</Grid>
</Grid>
</Grid>
</metro:MetroWindow>
@@ -0,0 +1,28 @@
using SteamTools.Models;
using SteamTools.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace SteamTools
{
public partial class AuthTradeWindow
{
public AuthTradeWindow()
{
InitializeComponent();
App.Current.MainWindow.Closed += (sender, args) => this.Close();
}
}
}
+48 -23
View File
@@ -3,14 +3,40 @@
Steam++项目创建于2018年5月8日,不过并不是耗时两年才做出来,之前一直由于工作原因,并没有多少空闲时间,直到今年中旬辞职了,才开始猛肝。
本来是想一直做到完全体了,才考虑发布,不过现在感慨一下,果然是没法这么快就整完的,所以还是一版一版更新做到完全体吧。
Steam++只在keylol论坛与github发布,为了账号安全,请不要到其它不明地方下载。
已经收到了B叔制作的图标,下个版本可以换上更好看的图标了。
# Steam++工具箱
## 已知的未修复问题
> 目前已知坛友反馈的严重BUG问题
* steam++启动后运行steam在运行steam的部分游戏会使游戏掉帧,gpu利用率很低,这个问题在作者的电脑上确实无法复现,所以暂时只能请各位在遇到此问题时手动关闭steam++,带来不便请谅解,抱歉。
* (严重)经反馈,程序运行时可能会影响部分steam游戏掉帧,GPU占用率变低,这个BUG目前在作者的机器上无法复现所以暂时没有修复,如果你遇到这个问题可以手动关闭steam++解决。
* 程序在高DPI缩放分辨率下可能会UI布局错位,目前暂时拖动程序可恢复。
* 部分用户无法加载游戏列表,无法复现,原因暂时不明。
## 更新内容
### 1.0.2
```
更新了由Benares制作的图标
新增帐户切换删除功能
添加github图片资源文件代理服务与discord代理服务支持
因为有问题暂时去掉了GOG Galaxy代理选项
修复一个会导致程序启动没有反应的bug
修复托盘菜单steam昵称过长ui错位bug
新增steam启动参数设置
新增启动时程序最小化到托盘菜单设置
新增捐助列表的展示
新增工具自动更新功能
```
## 工具介绍
`Steam++`是一个包含多种Steam工具功能的工具箱,开源发布于[Github](https://github.com/rmbadmin/SteamTools),如果您对发布的二进制文件不放心,可以自行下载源码编译运行。
此工具的大部分功能都是需要您下载安装Steam才能使用。
工具预计将整合进大部分常用的Steam相关工具,并且尽力做到比原工具更好用,在各种整合添加功能的同时,也会注意体积尽量的控制到最小。
@@ -18,9 +44,10 @@ Steam++只在keylol论坛与github发布,为了账号安全,请不要到其
虽然没有什么杀毒软件报毒,但是使用过程中可能遇到windows defender误报,您可以选择添加信任。
软件截图
[hide]
[attachimg]1224039[/attachimg]
[attachimg]1224038[/attachimg]
[attachimg]1224040[/attachimg]
[attachimg]1228394[/attachimg]
[attachimg]1228395[/attachimg]
[attachimg]1228396[/attachimg]
[attachimg]1228397[/attachimg]
[/hide]
## 核心功能
@@ -29,32 +56,31 @@ Steam++只在keylol论坛与github发布,为了账号安全,请不要到其
### 1. 反代Steam的社区网页使其能正常访问
功能类似羽翼城大佬的steamcommunity_302,使用[Titanium-Web-Proxy](https://github.com/justcoding121/Titanium-Web-Proxy)开源项目进行本地反代,相比302工具具有更快的启动速度,以及支持简单的脚本注入。该功能也可以配合羽翼城大佬的[UsbEAm Hosts Editor](https://www.dogfight360.com/blog/475/)里的网页相关-steamcommunity_302 社区/api/商店加载速度选项的hosts提升加载速度。
[attachimg]1224032[/attachimg]
[attachimg]1228388[/attachimg]
### 2. 快速切换当前PC已经记住登陆的Steam账号
该功能是读取Steam路径下存储的本地用户登录记录直接展示操作,可以多账号切换无需重新输入密码和令牌。
[attachimg]1224033[/attachimg]
[attachimg]1228389[/attachimg]
### 3. Steam游戏的成就统计管理功能
功能参考[SteamAchievementManager](https://github.com/gibbed/SteamAchievementManager)进行二次开发,修复了成就语言有中文却依然是英文成就信息的BUG,修改了游戏列表的加载和操作易用性。
[attachimg]1224034[/attachimg]
[attachimg]1228390[/attachimg]
### 4. Steam本地两步身份验证器
功能参考[WinAuth](https://github.com/winauth/winauth)开发,可以使您不用启动移动版Steam App也能查看您的令牌,功能类似的软件有[WinAuth](https://github.com/winauth/winauth)、[SteamDesktopAuthenticator](https://github.com/Jessecar96/SteamDesktopAuthenticator)。
[attachimg]1224035[/attachimg]
[attachimg]1228391[/attachimg]
### 5. 一些游戏工具
目前已有强制游戏无边框窗口化,CSGO修复VAC屏蔽。
这一块是随缘做一些我经常用或者闲着没事捣鼓的功能。
将任何游戏强制无边框窗口化
[attachimg]1224036[/attachimg]
[attachimg]1228392[/attachimg]
使任何窗口化游戏变成动态桌面壁纸(终于可以用《山》当壁纸了)
[attachimg]1224037[/attachimg]
[attachimg]1228393[/attachimg]
------
@@ -85,15 +111,14 @@ Steam++只在keylol论坛与github发布,为了账号安全,请不要到其
> 程序使用C# WPF在 .NET Framework4.7.2环境下开发,如果无法运行请下载安装[.NET Framework 4.7.2](https://dotnet.microsoft.com/download/dotnet-framework/net472)。
## 下载
> [Github](https://github.com/rmbadmin/SteamTools/releases)
> [蓝奏云](https://wws.lanzous.com/ijIlwjg2bjc)
> [百度云](https://pan.baidu.com/s/19XCB3-X7isygG6UFpXcCtg)
> 查看百度云提取码
> [Github](https://github.com/rmbadmin/SteamTools/releases)
> 分流下载:
> [hide]
> 提取码:zbs6
> [/hide]
> exe体积:4.81MB
> md5:AEECBD9B268C0BB8D619555CE125C9A5
> [蓝奏云](https://wws.lanzous.com/ihW80jkylcb)
> [百度云](https://pan.baidu.com/s/1um0YboiVGZTs4rC6uCCa1g)
> 提取码:pz3t
> [/hide]
> EXE 大小:4.85MB
> MD5:F819FEAA3463E0B9DED7E94AB87088B0