mirror of
https://github.com/BeyondDimension/SteamTools.git
synced 2026-10-28 23:19:53 +08:00
#1167 当使用 IPC.config 时,程序内打开网页端口号值不正确
This commit is contained in:
Submodule references/ArchiSteamFarm updated: f1c1e226cf...603b7eedfa
@@ -197,9 +197,30 @@ namespace System.Application.Services.Implementation
|
||||
}
|
||||
}
|
||||
|
||||
string IPCRootUrl
|
||||
{
|
||||
get
|
||||
{
|
||||
string? value = null;
|
||||
var a = ArchiSteamFarm.IPC.ArchiKestrel.ServerAddresses;
|
||||
var loopback = IPAddress.Loopback.ToString();
|
||||
if (a != null)
|
||||
{
|
||||
value = a.FirstOrDefault(x => x.Contains(loopback) && x.StartsWith(Browser2.Prefix_HTTP))
|
||||
?? a.FirstOrDefault(x => x.Contains(loopback))
|
||||
?? a.FirstOrDefault();
|
||||
}
|
||||
if (string.IsNullOrWhiteSpace(value))
|
||||
{
|
||||
value = $"http://{loopback}:{CurrentIPCPortValue}";
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
public string GetIPCUrl()
|
||||
{
|
||||
var defaultUrl = $"http://{IPAddress.Loopback}:{CurrentIPCPortValue}";
|
||||
var defaultUrl = IPCRootUrl;
|
||||
string absoluteConfigDirectory = Path.Combine(ASFPathHelper.AppDataDirectory, SharedInfo.ConfigDirectory);
|
||||
string customConfigPath = Path.Combine(absoluteConfigDirectory, SharedInfo.IPCConfigFile);
|
||||
if (File.Exists(customConfigPath))
|
||||
|
||||
Reference in New Issue
Block a user