mirror of
https://github.com/2dust/v2rayN.git
synced 2026-02-28 21:23:04 +00:00
Compare commits
2 commits
d4fdb93b55
...
e9a6411698
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e9a6411698 | ||
|
|
6d35abe7ca |
2 changed files with 29 additions and 3 deletions
|
|
@ -170,7 +170,8 @@ public static class CoreConfigHandler
|
||||||
var ruleOutboundNode = await AppManager.Instance.GetProfileItemViaRemarks(ruleItem.OutboundTag);
|
var ruleOutboundNode = await AppManager.Instance.GetProfileItemViaRemarks(ruleItem.OutboundTag);
|
||||||
if (ruleOutboundNode != null)
|
if (ruleOutboundNode != null)
|
||||||
{
|
{
|
||||||
await FillNodeContext(context, ruleOutboundNode);
|
var ruleOutboundNodeAct = await FillNodeContext(context, ruleOutboundNode, false);
|
||||||
|
context.AllProxiesMap[$"remark:{ruleItem.OutboundTag}"] = ruleOutboundNodeAct;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -96,9 +96,34 @@ public class GroupProfileManager
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
var childProfileIds = Utils.String2List(extra.ChildItems)
|
var childProfileIds = Utils.String2List(extra.ChildItems)
|
||||||
?.Where(p => !string.IsNullOrEmpty(p)) ?? [];
|
?.Where(p => !string.IsNullOrEmpty(p))
|
||||||
|
.ToList() ?? [];
|
||||||
|
if (childProfileIds.Count == 0)
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
var childProfiles = await AppManager.Instance.GetProfileItemsByIndexIds(childProfileIds);
|
var childProfiles = await AppManager.Instance.GetProfileItemsByIndexIds(childProfileIds);
|
||||||
return childProfiles ?? [];
|
if (childProfiles == null || childProfiles.Count == 0)
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
var profileMap = childProfiles
|
||||||
|
.Where(p => p != null && !p.IndexId.IsNullOrEmpty())
|
||||||
|
.GroupBy(p => p!.IndexId!)
|
||||||
|
.ToDictionary(g => g.Key, g => g.First());
|
||||||
|
|
||||||
|
var ordered = new List<ProfileItem>(childProfileIds.Count);
|
||||||
|
foreach (var id in childProfileIds)
|
||||||
|
{
|
||||||
|
if (id != null && profileMap.TryGetValue(id, out var item) && item != null)
|
||||||
|
{
|
||||||
|
ordered.Add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ordered;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static async Task<List<ProfileItem>> GetSubChildProfileItems(ProtocolExtraItem? extra)
|
private static async Task<List<ProfileItem>> GetSubChildProfileItems(ProtocolExtraItem? extra)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue