mirror of https://github.com/2dust/v2rayN
fix Import old config
parent
3a740118f0
commit
a359a508ae
|
@ -44,7 +44,6 @@ namespace v2rayN.Handler
|
||||||
{
|
{
|
||||||
config = new Config
|
config = new Config
|
||||||
{
|
{
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (config.coreBasicItem == null)
|
if (config.coreBasicItem == null)
|
||||||
|
@ -312,20 +311,45 @@ namespace v2rayN.Handler
|
||||||
}
|
}
|
||||||
|
|
||||||
config = Utils.FromJson<Config>(Utils.ToJson(configOld));
|
config = Utils.FromJson<Config>(Utils.ToJson(configOld));
|
||||||
if (config.tunModeItem == null)
|
|
||||||
|
if (config.coreBasicItem == null)
|
||||||
{
|
{
|
||||||
config.tunModeItem = new TunModeItem
|
config.coreBasicItem = new()
|
||||||
{
|
{
|
||||||
enableTun = false,
|
logEnabled = configOld.logEnabled,
|
||||||
showWindow = true,
|
loglevel = configOld.loglevel,
|
||||||
mtu = 9000,
|
muxEnabled = configOld.muxEnabled,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (config.routingBasicItem == null)
|
||||||
|
{
|
||||||
|
config.routingBasicItem = new()
|
||||||
|
{
|
||||||
|
enableRoutingAdvanced = configOld.enableRoutingAdvanced,
|
||||||
|
domainStrategy = configOld.domainStrategy
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (config.guiItem == null)
|
||||||
|
{
|
||||||
|
config.guiItem = new()
|
||||||
|
{
|
||||||
|
enableStatistics = configOld.enableStatistics,
|
||||||
|
statisticsFreshRate = configOld.statisticsFreshRate,
|
||||||
|
keepOlderDedupl = configOld.keepOlderDedupl,
|
||||||
|
ignoreGeoUpdateCore = configOld.ignoreGeoUpdateCore,
|
||||||
|
autoUpdateInterval = configOld.autoUpdateInterval,
|
||||||
|
checkPreReleaseUpdate = configOld.checkPreReleaseUpdate,
|
||||||
|
enableSecurityProtocolTls13 = configOld.enableSecurityProtocolTls13,
|
||||||
|
trayMenuServersLimit = configOld.trayMenuServersLimit,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
GetDefaultServer(ref config);
|
GetDefaultServer(ref config);
|
||||||
GetDefaultRouting(ref config);
|
GetDefaultRouting(ref config);
|
||||||
SaveConfig(ref config);
|
SaveConfig(ref config);
|
||||||
LazyConfig.Instance.SetConfig(ref config);
|
LoadConfig(ref config);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue