Skip to content

Commit

Permalink
The first letter of the guiconfig attribute must be capitalized.
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Oct 23, 2024
1 parent 1e7284f commit 2d14368
Show file tree
Hide file tree
Showing 51 changed files with 695 additions and 706 deletions.
6 changes: 5 additions & 1 deletion v2rayN/ServiceLib/Common/JsonUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ public static T DeepCopy<T>(T obj)
{
return default;
}
return JsonSerializer.Deserialize<T>(strJson);
var options = new JsonSerializerOptions
{
PropertyNameCaseInsensitive = true
};
return JsonSerializer.Deserialize<T>(strJson, options);
}
catch
{
Expand Down
16 changes: 8 additions & 8 deletions v2rayN/ServiceLib/Handler/AppHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public bool InitApp()
{
return false;
}
Thread.CurrentThread.CurrentUICulture = new(_config.uiItem.currentLanguage);
Thread.CurrentThread.CurrentUICulture = new(_config.UiItem.CurrentLanguage);

//Under Win10
if (Utils.IsWindows() && Environment.OSVersion.Version.Major < 10)
Expand Down Expand Up @@ -85,7 +85,7 @@ public bool InitComponents()

public int GetLocalPort(EInboundProtocol protocol)
{
var localPort = _config.inbound.FirstOrDefault(t => t.protocol == nameof(EInboundProtocol.socks))?.localPort ?? 10808;
var localPort = _config.Inbound.FirstOrDefault(t => t.Protocol == nameof(EInboundProtocol.socks))?.LocalPort ?? 10808;
return localPort + (int)protocol;
}

Expand Down Expand Up @@ -165,11 +165,11 @@ from ProfileItem a

public async Task<List<ProfileItemModel>> ProfileItemsEx(string subid, string filter)
{
var lstModel = await ProfileItems(_config.subIndexId, filter);
var lstModel = await ProfileItems(_config.SubIndexId, filter);

await ConfigHandler.SetDefaultServer(_config, lstModel);

var lstServerStat = (_config.guiItem.enableStatistics ? StatisticsHandler.Instance.ServerStat : null) ?? [];
var lstServerStat = (_config.GuiItem.EnableStatistics ? StatisticsHandler.Instance.ServerStat : null) ?? [];
var lstProfileExs = ProfileExHandler.Instance.ProfileExs;
lstModel = (from t in lstModel
join t2 in lstServerStat on t.indexId equals t2.indexId into t2b
Expand All @@ -188,7 +188,7 @@ from t33 in t3b.DefaultIfEmpty()
streamSecurity = t.streamSecurity,
subid = t.subid,
subRemarks = t.subRemarks,
isActive = t.indexId == _config.indexId,
isActive = t.indexId == _config.IndexId,
sort = t33 == null ? 0 : t33.sort,
delay = t33 == null ? 0 : t33.delay,
delayVal = t33?.delay != 0 ? $"{t33?.delay} {Global.DelayUnit}" : string.Empty,
Expand Down Expand Up @@ -268,16 +268,16 @@ public ECoreType GetCoreType(ProfileItem profileItem, EConfigType eConfigType)
return (ECoreType)profileItem.coreType;
}

if (_config.coreTypeItem == null)
if (_config.CoreTypeItem == null)
{
return ECoreType.Xray;
}
var item = _config.coreTypeItem.FirstOrDefault(it => it.configType == eConfigType);
var item = _config.CoreTypeItem.FirstOrDefault(it => it.ConfigType == eConfigType);
if (item == null)
{
return ECoreType.Xray;
}
return item.coreType;
return item.CoreType;
}

#endregion Core Type
Expand Down
2 changes: 1 addition & 1 deletion v2rayN/ServiceLib/Handler/ClashApiHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public void ClashProxiesDelayTest(bool blAll, List<ClashProxyModel> lstProxy, Ac
return;
}
var urlBase = $"{GetApiUrl()}/proxies";
urlBase += @"/{0}/delay?timeout=10000&url=" + AppHandler.Instance.Config.speedTestItem.speedPingTestUrl;
urlBase += @"/{0}/delay?timeout=10000&url=" + AppHandler.Instance.Config.SpeedTestItem.SpeedPingTestUrl;
List<Task> tasks = new List<Task>();
foreach (var it in lstProxy)
Expand Down
Loading

0 comments on commit 2d14368

Please sign in to comment.