revert Newtonsoft.Json
This commit is contained in:
@@ -4,6 +4,7 @@ using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Threading;
|
||||
using Newtonsoft.Json;
|
||||
using Shadowsocks.Model;
|
||||
|
||||
namespace Shadowsocks.Controller.Strategy
|
||||
@@ -65,7 +66,7 @@ namespace Shadowsocks.Controller.Strategy
|
||||
score += statisticsData.MinResponse*factor;
|
||||
if (!config.Calculations.TryGetValue("MaxResponse", out factor)) factor = 0;
|
||||
score += statisticsData.MaxResponse*factor;
|
||||
Logging.Debug($"{serverName} {SimpleJson.SimpleJson.SerializeObject(statisticsData)}");
|
||||
Logging.Debug($"{serverName} {JsonConvert.SerializeObject(statisticsData)}");
|
||||
return score;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Reflection;
|
||||
using Shadowsocks.Controller;
|
||||
using Shadowsocks.Controller.Strategy;
|
||||
using SimpleJson;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Shadowsocks.Model
|
||||
{
|
||||
@@ -28,10 +29,10 @@ namespace Shadowsocks.Model
|
||||
try
|
||||
{
|
||||
var content = File.ReadAllText(ConfigFile);
|
||||
var configuration = SimpleJson.SimpleJson.DeserializeObject<StatisticsStrategyConfiguration>(content);
|
||||
var configuration = JsonConvert.DeserializeObject<StatisticsStrategyConfiguration>(content);
|
||||
return configuration;
|
||||
}
|
||||
catch (FileNotFoundException)
|
||||
catch (FileNotFoundException e)
|
||||
{
|
||||
var configuration = new StatisticsStrategyConfiguration();
|
||||
Save(configuration);
|
||||
@@ -48,7 +49,7 @@ namespace Shadowsocks.Model
|
||||
{
|
||||
try
|
||||
{
|
||||
var content = SimpleJson.SimpleJson.SerializeObject(configuration);
|
||||
var content = JsonConvert.SerializeObject(configuration, Formatting.Indented);
|
||||
File.WriteAllText(ConfigFile, content);
|
||||
}
|
||||
catch (Exception e)
|
||||
|
||||
@@ -5,4 +5,5 @@
|
||||
<package id="Microsoft.Bcl" version="1.1.8" targetFramework="net4-client" />
|
||||
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net4-client" />
|
||||
<package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net4-client" />
|
||||
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net4-client" />
|
||||
</packages>
|
||||
@@ -81,6 +81,10 @@
|
||||
<EmbedInteropTypes>False</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualBasic" />
|
||||
<Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>3rd\Newtonsoft.Json.7.0.1\lib\net40\Newtonsoft.Json.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="System" />
|
||||
|
||||
Reference in New Issue
Block a user