mirror of
https://github.com/2dust/v2rayN.git
synced 2026-04-17 21:15:47 +00:00
Simplify code
This commit is contained in:
parent
7d3e630b5c
commit
73e3a203e5
2 changed files with 3 additions and 4 deletions
|
|
@ -21,7 +21,7 @@ public static class CoreConfigHandler
|
||||||
_ => await GenerateClientCustomConfig(node, fileName)
|
_ => await GenerateClientCustomConfig(node, fileName)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else if (AppManager.Instance.GetCoreType(node, node.ConfigType) == ECoreType.sing_box)
|
else if (context.RunCoreType == ECoreType.sing_box)
|
||||||
{
|
{
|
||||||
result = new CoreConfigSingboxService(context).GenerateClientConfigContent();
|
result = new CoreConfigSingboxService(context).GenerateClientConfigContent();
|
||||||
}
|
}
|
||||||
|
|
@ -128,12 +128,11 @@ public static class CoreConfigHandler
|
||||||
public static async Task<RetResult> GenerateClientSpeedtestConfig(Config config, CoreConfigContext context, ServerTestItem testItem, string fileName)
|
public static async Task<RetResult> GenerateClientSpeedtestConfig(Config config, CoreConfigContext context, ServerTestItem testItem, string fileName)
|
||||||
{
|
{
|
||||||
var result = new RetResult();
|
var result = new RetResult();
|
||||||
var node = context.Node;
|
|
||||||
var initPort = AppManager.Instance.GetLocalPort(EInboundProtocol.speedtest);
|
var initPort = AppManager.Instance.GetLocalPort(EInboundProtocol.speedtest);
|
||||||
var port = Utils.GetFreePort(initPort + testItem.QueueNum);
|
var port = Utils.GetFreePort(initPort + testItem.QueueNum);
|
||||||
testItem.Port = port;
|
testItem.Port = port;
|
||||||
|
|
||||||
if (AppManager.Instance.GetCoreType(node, node.ConfigType) == ECoreType.sing_box)
|
if (context.RunCoreType == ECoreType.sing_box)
|
||||||
{
|
{
|
||||||
result = new CoreConfigSingboxService(context).GenerateClientSpeedtestConfig(port);
|
result = new CoreConfigSingboxService(context).GenerateClientSpeedtestConfig(port);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -132,7 +132,7 @@ public class CoreManager
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
var coreType = AppManager.Instance.GetCoreType(node, node.ConfigType);
|
var coreType = context.RunCoreType;
|
||||||
var coreInfo = CoreInfoManager.Instance.GetCoreInfo(coreType);
|
var coreInfo = CoreInfoManager.Instance.GetCoreInfo(coreType);
|
||||||
return await RunProcess(coreInfo, fileName, true, false);
|
return await RunProcess(coreInfo, fileName, true, false);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue