Fixes SplitCore == false and Node.CoreType == ECoreType.hysteria2 etc. logic

This commit is contained in:
DHR60 2025-07-24 20:50:59 +08:00
parent 2035a5ae61
commit ac4692c7d0

View file

@ -225,6 +225,24 @@ public class CoreHandler
PreCoreType = null;
}
}
else if (!SplitCore && !EnableTun)
{
switch (Node.CoreType)
{
case ECoreType.hysteria2:
case ECoreType.tuic:
Node.CoreType = ECoreType.sing_box;
CoreType = ECoreType.sing_box;
break;
case ECoreType.v2fly:
case ECoreType.v2fly_v5:
Node.CoreType = ECoreType.Xray;
CoreType = ECoreType.Xray;
break;
default:
break;
}
}
}
/// <summary>
@ -251,15 +269,15 @@ public class CoreHandler
{
PreCoreType = ECoreType.sing_box;
if (PreCoreType != CoreType) // CoreType is xray
if (PreCoreType == CoreType) // CoreType is sing_box
{
PreCoreType = null;
}
else // CoreType is xray, hysteria2, tuic, etc.
{
SplitCore = true;
PreSocksPort = AppHandler.Instance.GetLocalPort(EInboundProtocol.split);
}
else // CoreType is sing_box
{
PreCoreType = null;
}
}
}
}