core functions finished

This commit is contained in:
icylogic
2015-09-03 23:37:43 +08:00
parent 4e1b140dd9
commit e45dd8b695
10 changed files with 192 additions and 131 deletions
@@ -14,12 +14,12 @@ namespace Shadowsocks.Model
public class StatisticsStrategyConfiguration
{
public static readonly string ID = "com.shadowsocks.strategy.statistics";
private bool _statisticsEnabled;
private bool _byIsp;
private bool _byHourOfDay;
private int _choiceKeptMinutes;
private int _dataCollectionMinutes;
private int _repeatTimesNum;
private bool _statisticsEnabled = true;
private bool _byIsp = false;
private bool _byHourOfDay = false;
private int _choiceKeptMinutes = 10;
private int _dataCollectionMinutes = 10;
private int _repeatTimesNum = 4;
private const string ConfigFile = "statistics-config.json";
@@ -34,7 +34,9 @@ namespace Shadowsocks.Model
}
catch (FileNotFoundException e)
{
return new StatisticsStrategyConfiguration();
var configuration = new StatisticsStrategyConfiguration();
Save(configuration);
return configuration;
}
catch (Exception e)
{