mirror of
https://github.com/2dust/v2rayN.git
synced 2026-02-28 05:03:02 +00:00
Fix
This commit is contained in:
parent
e2cd3069f0
commit
e47dc40488
3 changed files with 44 additions and 28 deletions
|
|
@ -96,7 +96,10 @@ public sealed class AppManager
|
|||
_ = StatePort;
|
||||
_ = StatePort2;
|
||||
|
||||
_ = MigrateProfileExtra();
|
||||
Task.Run(async () =>
|
||||
{
|
||||
await MigrateProfileExtra();
|
||||
}).Wait();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -277,7 +280,10 @@ public sealed class AppManager
|
|||
break;
|
||||
}
|
||||
|
||||
var batchSuccessCount = 0;
|
||||
foreach (var item in batch)
|
||||
{
|
||||
try
|
||||
{
|
||||
var extra = item.GetProtocolExtra();
|
||||
|
||||
|
|
@ -295,6 +301,7 @@ public sealed class AppManager
|
|||
MultipleLoad = groupItem.MultipleLoad,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
switch (item.ConfigType)
|
||||
{
|
||||
|
|
@ -312,6 +319,7 @@ public sealed class AppManager
|
|||
extra = extra with
|
||||
{
|
||||
Flow = item.Flow.NullIfEmpty(),
|
||||
VlessEncryption = item.Security,
|
||||
};
|
||||
break;
|
||||
case EConfigType.Hysteria2:
|
||||
|
|
@ -341,7 +349,8 @@ public sealed class AppManager
|
|||
WgMtu = int.TryParse(item.ShortId, out var mtu) ? mtu : 1280
|
||||
};
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
item.SetProtocolExtra(extra);
|
||||
|
|
@ -350,9 +359,17 @@ public sealed class AppManager
|
|||
|
||||
item.ConfigVersion = 3;
|
||||
await SQLiteHelper.Instance.UpdateAsync(item);
|
||||
batchSuccessCount++;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logging.SaveLog($"MigrateProfileExtra Error: {ex}");
|
||||
}
|
||||
}
|
||||
|
||||
offset += pageSize;
|
||||
// Only increment offset by the number of failed items that remain in the result set
|
||||
// Successfully updated items are automatically excluded from future queries due to ConfigVersion = 3
|
||||
offset += batch.Count - batchSuccessCount;
|
||||
}
|
||||
|
||||
//await ProfileGroupItemManager.Instance.ClearAll();
|
||||
|
|
|
|||
|
|
@ -114,13 +114,13 @@ public partial class CoreConfigSingboxService
|
|||
|
||||
outbound.packet_encoding = "xudp";
|
||||
|
||||
if (protocolExtra.Flow.IsNullOrEmpty())
|
||||
if (!protocolExtra.Flow.IsNullOrEmpty())
|
||||
{
|
||||
await GenOutboundMux(node, outbound);
|
||||
outbound.flow = protocolExtra.Flow;
|
||||
}
|
||||
else
|
||||
{
|
||||
outbound.flow = protocolExtra.Flow;
|
||||
await GenOutboundMux(node, outbound);
|
||||
}
|
||||
|
||||
await GenOutboundTransport(node, outbound);
|
||||
|
|
|
|||
|
|
@ -144,13 +144,12 @@ public partial class CoreConfigV2rayService
|
|||
usersItem.email = Global.UserEMail;
|
||||
usersItem.encryption = protocolExtra.VlessEncryption;
|
||||
|
||||
if (protocolExtra.Flow.IsNullOrEmpty())
|
||||
if (!protocolExtra.Flow.IsNullOrEmpty())
|
||||
{
|
||||
await GenOutboundMux(node, outbound, muxEnabled, muxEnabled);
|
||||
usersItem.flow = protocolExtra.Flow;
|
||||
}
|
||||
else
|
||||
{
|
||||
usersItem.flow = protocolExtra.Flow;
|
||||
await GenOutboundMux(node, outbound, false, muxEnabled);
|
||||
}
|
||||
outbound.settings.servers = null;
|
||||
|
|
|
|||
Loading…
Reference in a new issue