mirror of
https://github.com/2dust/v2rayN.git
synced 2026-02-28 05:03:02 +00:00
Fix hy2 Brutal Bandwidth
This commit is contained in:
parent
ad685fcc03
commit
6d95366971
3 changed files with 8 additions and 8 deletions
|
|
@ -149,10 +149,10 @@ public partial class CoreConfigSingboxService
|
|||
|
||||
outbound.up_mbps = protocolExtra?.UpMbps is { } su and >= 0
|
||||
? su
|
||||
: 0;
|
||||
: _config.HysteriaItem.UpMbps;
|
||||
outbound.down_mbps = protocolExtra?.DownMbps is { } sd and >= 0
|
||||
? sd
|
||||
: 0;
|
||||
: _config.HysteriaItem.DownMbps;
|
||||
var ports = protocolExtra?.Ports?.IsNullOrEmpty() == false ? protocolExtra.Ports : null;
|
||||
if ((!ports.IsNullOrEmpty()) && (ports.Contains(':') || ports.Contains('-') || ports.Contains(',')))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -515,10 +515,10 @@ public partial class CoreConfigV2rayService
|
|||
var ports = protocolExtra?.Ports;
|
||||
int? upMbps = protocolExtra?.UpMbps is { } su and >= 0
|
||||
? su
|
||||
: 0;
|
||||
: _config.HysteriaItem.UpMbps;
|
||||
int? downMbps = protocolExtra?.DownMbps is { } sd and >= 0
|
||||
? sd
|
||||
: 0;
|
||||
: _config.HysteriaItem.UpMbps;
|
||||
var hopInterval = protocolExtra?.HopInterval is { } hi and >= 5
|
||||
? hi
|
||||
: _config.HysteriaItem.HopInterval >= 5 ? _config.HysteriaItem.HopInterval : Global.Hysteria2DefaultHopInt;
|
||||
|
|
|
|||
|
|
@ -113,8 +113,8 @@ public class AddServerViewModel : MyReactiveObject
|
|||
AlterId = int.TryParse(protocolExtra?.AlterId, out var result) ? result : 0;
|
||||
Flow = protocolExtra?.Flow ?? string.Empty;
|
||||
SalamanderPass = protocolExtra?.SalamanderPass ?? string.Empty;
|
||||
UpMbps = protocolExtra?.UpMbps ?? 0;
|
||||
DownMbps = protocolExtra?.DownMbps ?? 0;
|
||||
UpMbps = protocolExtra?.UpMbps ?? _config.HysteriaItem.UpMbps;
|
||||
DownMbps = protocolExtra?.DownMbps ?? _config.HysteriaItem.DownMbps;
|
||||
HopInterval = protocolExtra?.HopInterval ?? Global.Hysteria2DefaultHopInt;
|
||||
VmessSecurity = protocolExtra?.VmessSecurity?.IsNullOrEmpty() == false ? protocolExtra.VmessSecurity : Global.DefaultSecurity;
|
||||
VlessEncryption = protocolExtra?.VlessEncryption.IsNullOrEmpty() == false ? protocolExtra.VlessEncryption : Global.None;
|
||||
|
|
@ -176,8 +176,8 @@ public class AddServerViewModel : MyReactiveObject
|
|||
AlterId = AlterId > 0 ? AlterId.ToString() : null,
|
||||
Flow = Flow.NullIfEmpty(),
|
||||
SalamanderPass = SalamanderPass.NullIfEmpty(),
|
||||
UpMbps = UpMbps > 0 ? UpMbps : null,
|
||||
DownMbps = DownMbps > 0 ? DownMbps : null,
|
||||
UpMbps = UpMbps >= 0 ? UpMbps : null,
|
||||
DownMbps = DownMbps >= 0 ? DownMbps : null,
|
||||
HopInterval = HopInterval >= 5 ? HopInterval : null,
|
||||
VmessSecurity = VmessSecurity.NullIfEmpty(),
|
||||
VlessEncryption = VlessEncryption.NullIfEmpty(),
|
||||
|
|
|
|||
Loading…
Reference in a new issue