Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Feb 15, 2024
1 parent a9c5969 commit 4af148f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 24 deletions.
5 changes: 1 addition & 4 deletions v2rayN/v2rayN/Handler/ConfigHandler.cs
Expand Up @@ -187,10 +187,7 @@ public static int LoadConfig(ref Config? config)
config.mux4SboxItem = new()
{
protocol = Global.SingboxMuxs[0],
max_connections = 4,
min_streams = 4,
max_streams = 0,
padding = true
max_connections = 4
};
}

Expand Down
14 changes: 3 additions & 11 deletions v2rayN/v2rayN/Handler/CoreConfigSingbox.cs
Expand Up @@ -170,7 +170,7 @@ private int GenInbounds(SingboxConfig singboxConfig)
{
if (_config.tunModeItem.mtu <= 0)
{
_config.tunModeItem.mtu = Convert.ToInt32(Global.TunMtus[0]);
_config.tunModeItem.mtu = Utils.ToInt(Global.TunMtus[0]);
}
if (Utils.IsNullOrEmpty(_config.tunModeItem.stack))
{
Expand Down Expand Up @@ -294,8 +294,6 @@ private int GenOutbound(ProfileItem node, Outbound4Sbox outbound)

outbound.up_mbps = _config.hysteriaItem.up_mbps > 0 ? _config.hysteriaItem.up_mbps : null;
outbound.down_mbps = _config.hysteriaItem.down_mbps > 0 ? _config.hysteriaItem.down_mbps : null;

GenOutboundMux(node, outbound);
}
else if (node.configType == EConfigType.Tuic)
{
Expand All @@ -304,8 +302,6 @@ private int GenOutbound(ProfileItem node, Outbound4Sbox outbound)
outbound.uuid = node.id;
outbound.password = node.security;
outbound.congestion_control = node.headerType;

GenOutboundMux(node, outbound);
}
else if (node.configType == EConfigType.Wireguard)
{
Expand All @@ -316,7 +312,6 @@ private int GenOutbound(ProfileItem node, Outbound4Sbox outbound)
outbound.reserved = Utils.String2List(node.path).Select(int.Parse).ToArray();
outbound.local_address = [.. Utils.String2List(node.requestHost)];
outbound.mtu = Utils.ToInt(node.shortId.IsNullOrEmpty() ? Global.TunMtus.FirstOrDefault() : node.shortId);
GenOutboundMux(node, outbound);
}

GenOutboundTls(node, outbound);
Expand All @@ -339,11 +334,8 @@ private int GenOutboundMux(ProfileItem node, Outbound4Sbox outbound)
// var mux = new Multiplex4Sbox()
// {
// enabled = true,
// protocol = _config.mux4Sbox.protocol,
// max_connections = _config.mux4Sbox.max_connections,
// min_streams = _config.mux4Sbox.min_streams,
// max_streams = _config.mux4Sbox.max_streams,
// padding = _config.mux4Sbox.padding
// protocol = _config.mux4SboxItem.protocol,
// max_connections = _config.mux4SboxItem.max_connections,
// };
// outbound.multiplex = mux;
//}
Expand Down
3 changes: 0 additions & 3 deletions v2rayN/v2rayN/Mode/ConfigItems.cs
Expand Up @@ -203,9 +203,6 @@ public class Mux4SboxItem
{
public string protocol { get; set; }
public int max_connections { get; set; }
public int min_streams { get; set; }
public int max_streams { get; set; }
public bool padding { get; set; }
}

[Serializable]
Expand Down
3 changes: 0 additions & 3 deletions v2rayN/v2rayN/Mode/SingboxConfig.cs
Expand Up @@ -139,9 +139,6 @@ public class Multiplex4Sbox
public bool enabled { get; set; }
public string protocol { get; set; }
public int max_connections { get; set; }
public int min_streams { get; set; }
public int max_streams { get; set; }
public bool padding { get; set; }
}

public class Utls4Sbox
Expand Down
6 changes: 3 additions & 3 deletions v2rayN/v2rayN/Views/MainWindow.xaml.cs
Expand Up @@ -512,8 +512,8 @@ private void RestoreUI()

private void StorageUI()
{
_config.uiItem.mainWidth = this.Width;
_config.uiItem.mainHeight = this.Height;
_config.uiItem.mainWidth = Utils.ToInt(this.Width);
_config.uiItem.mainHeight = Utils.ToInt(this.Height);

List<ColumnItem> lvColumnItem = new();
for (int k = 0; k < lstProfiles.Columns.Count; k++)
Expand All @@ -522,7 +522,7 @@ private void StorageUI()
lvColumnItem.Add(new()
{
Name = item2.ExName,
Width = item2.Visibility == Visibility.Visible ? Convert.ToInt32(item2.ActualWidth) : -1,
Width = item2.Visibility == Visibility.Visible ? Utils.ToInt(item2.ActualWidth) : -1,
Index = item2.DisplayIndex
});
}
Expand Down

0 comments on commit 4af148f

Please sign in to comment.