mirror of
https://github.com/2dust/v2rayN.git
synced 2026-11-05 12:04:59 +03:00
Fix (#10002)
This commit is contained in:
@@ -1797,21 +1797,18 @@ public static class ConfigHandler
|
|||||||
{
|
{
|
||||||
ECoreType.Xray => V2rayFmt.ResolveToCustom(strData, subRemarks),
|
ECoreType.Xray => V2rayFmt.ResolveToCustom(strData, subRemarks),
|
||||||
ECoreType.sing_box => SingboxFmt.ResolveToCustom(strData, subRemarks),
|
ECoreType.sing_box => SingboxFmt.ResolveToCustom(strData, subRemarks),
|
||||||
_ => null
|
_ => null,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (lstProfiles is not null)
|
if ((lstProfiles?.Count ?? 0) == 0)
|
||||||
{
|
{
|
||||||
if (lstProfiles.Count == 0)
|
return -1;
|
||||||
{
|
}
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
var count = await AddBatchCustomServers(config, lstProfiles, subid, isSub);
|
var count = await AddBatchCustomServers(config, lstProfiles, subid, isSub);
|
||||||
if (count > 0)
|
if (count > 0)
|
||||||
{
|
{
|
||||||
return count;
|
return count;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return await SaveCustomRawFileServer(config, strData, subid, isSub, subItem, customCoreType);
|
return await SaveCustomRawFileServer(config, strData, subid, isSub, subItem, customCoreType);
|
||||||
|
|||||||
@@ -34,9 +34,9 @@ public class SingboxFmt : BaseFmt
|
|||||||
if (!isOutbound)
|
if (!isOutbound)
|
||||||
{
|
{
|
||||||
var fullProfile = ResolveFull(jsonObject, subRemarks);
|
var fullProfile = ResolveFull(jsonObject, subRemarks);
|
||||||
profileList.Add(fullProfile);
|
|
||||||
if (fullProfile is not null)
|
if (fullProfile is not null)
|
||||||
{
|
{
|
||||||
|
profileList.Add(fullProfile);
|
||||||
return profileList;
|
return profileList;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,9 +34,9 @@ public class V2rayFmt : BaseFmt
|
|||||||
if (!isOutbound)
|
if (!isOutbound)
|
||||||
{
|
{
|
||||||
var fullProfile = ResolveFull(jsonObject, subRemarks);
|
var fullProfile = ResolveFull(jsonObject, subRemarks);
|
||||||
profileList.Add(fullProfile);
|
|
||||||
if (fullProfile is not null)
|
if (fullProfile is not null)
|
||||||
{
|
{
|
||||||
|
profileList.Add(fullProfile);
|
||||||
return profileList;
|
return profileList;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -125,7 +125,8 @@ public partial class CoreConfigSingboxService
|
|||||||
fullConfigTemplateNode["outbounds"] = customOutboundsNode;
|
fullConfigTemplateNode["outbounds"] = customOutboundsNode;
|
||||||
|
|
||||||
// Process endpoints
|
// Process endpoints
|
||||||
if (fullConfigTemplateNode["endpoints"] is JsonArray { Count: > 0 } coreConfigEndpointsNode)
|
var coreConfigEndpointsNode = coreConfigNode?["endpoints"] as JsonArray ?? [];
|
||||||
|
if (coreConfigEndpointsNode is { Count: > 0 })
|
||||||
{
|
{
|
||||||
var customEndpointsNode = fullConfigTemplateNode["endpoints"] as JsonArray ?? [];
|
var customEndpointsNode = fullConfigTemplateNode["endpoints"] as JsonArray ?? [];
|
||||||
foreach (var endpoint in coreConfigEndpointsNode)
|
foreach (var endpoint in coreConfigEndpointsNode)
|
||||||
|
|||||||
Reference in New Issue
Block a user