refactor traffic statistics

This commit is contained in:
2dust 2022-07-02 10:54:27 +08:00
parent 2b40e87eb9
commit d83ae315ed
8 changed files with 2139 additions and 2163 deletions

View file

@ -1189,8 +1189,8 @@ namespace v2rayN.Forms
{ {
try try
{ {
up /= (ulong)(config.statisticsFreshRate / 1000f); up /= (ulong)(config.statisticsFreshRate);
down /= (ulong)(config.statisticsFreshRate / 1000f); down /= (ulong)(config.statisticsFreshRate);
mainMsgControl.SetToolSslInfo("speed", string.Format("{0}/s↑ | {1}/s↓", Utils.HumanFy(up), Utils.HumanFy(down))); mainMsgControl.SetToolSslInfo("speed", string.Format("{0}/s↑ | {1}/s↓", Utils.HumanFy(up), Utils.HumanFy(down)));
foreach (var it in statistics) foreach (var it in statistics)

View file

@ -68,6 +68,7 @@
this.txtKcpmtu = new System.Windows.Forms.TextBox(); this.txtKcpmtu = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label();
this.tabPage7 = new System.Windows.Forms.TabPage(); this.tabPage7 = new System.Windows.Forms.TabPage();
this.numStatisticsFreshRate = new System.Windows.Forms.NumericUpDown();
this.txttrayMenuServersLimit = new System.Windows.Forms.TextBox(); this.txttrayMenuServersLimit = new System.Windows.Forms.TextBox();
this.label17 = new System.Windows.Forms.Label(); this.label17 = new System.Windows.Forms.Label();
this.txtautoUpdateSubInterval = new System.Windows.Forms.TextBox(); this.txtautoUpdateSubInterval = new System.Windows.Forms.TextBox();
@ -79,7 +80,6 @@
this.label15 = new System.Windows.Forms.Label(); this.label15 = new System.Windows.Forms.Label();
this.chkIgnoreGeoUpdateCore = new System.Windows.Forms.CheckBox(); this.chkIgnoreGeoUpdateCore = new System.Windows.Forms.CheckBox();
this.chkKeepOlderDedupl = new System.Windows.Forms.CheckBox(); this.chkKeepOlderDedupl = new System.Windows.Forms.CheckBox();
this.cbFreshrate = new System.Windows.Forms.ComboBox();
this.lbFreshrate = new System.Windows.Forms.Label(); this.lbFreshrate = new System.Windows.Forms.Label();
this.chkEnableStatistics = new System.Windows.Forms.CheckBox(); this.chkEnableStatistics = new System.Windows.Forms.CheckBox();
this.chkAutoRun = new System.Windows.Forms.CheckBox(); this.chkAutoRun = new System.Windows.Forms.CheckBox();
@ -112,6 +112,7 @@
this.tabPage2.SuspendLayout(); this.tabPage2.SuspendLayout();
this.tabPage6.SuspendLayout(); this.tabPage6.SuspendLayout();
this.tabPage7.SuspendLayout(); this.tabPage7.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numStatisticsFreshRate)).BeginInit();
this.tabPageCoreType.SuspendLayout(); this.tabPageCoreType.SuspendLayout();
this.tabPage3.SuspendLayout(); this.tabPage3.SuspendLayout();
this.groupBox2.SuspendLayout(); this.groupBox2.SuspendLayout();
@ -120,33 +121,34 @@
// //
// btnClose // btnClose
// //
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
resources.ApplyResources(this.btnClose, "btnClose"); resources.ApplyResources(this.btnClose, "btnClose");
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnClose.Name = "btnClose"; this.btnClose.Name = "btnClose";
this.btnClose.UseVisualStyleBackColor = true; this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click); this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
// //
// tabControl1 // tabControl1
// //
resources.ApplyResources(this.tabControl1, "tabControl1");
this.tabControl1.Controls.Add(this.tabPage1); this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2); this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Controls.Add(this.tabPage6); this.tabControl1.Controls.Add(this.tabPage6);
this.tabControl1.Controls.Add(this.tabPage7); this.tabControl1.Controls.Add(this.tabPage7);
this.tabControl1.Controls.Add(this.tabPageCoreType); this.tabControl1.Controls.Add(this.tabPageCoreType);
this.tabControl1.Controls.Add(this.tabPage3); this.tabControl1.Controls.Add(this.tabPage3);
resources.ApplyResources(this.tabControl1, "tabControl1");
this.tabControl1.Name = "tabControl1"; this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0; this.tabControl1.SelectedIndex = 0;
// //
// tabPage1 // tabPage1
// //
this.tabPage1.Controls.Add(this.groupBox1);
resources.ApplyResources(this.tabPage1, "tabPage1"); resources.ApplyResources(this.tabPage1, "tabPage1");
this.tabPage1.Controls.Add(this.groupBox1);
this.tabPage1.Name = "tabPage1"; this.tabPage1.Name = "tabPage1";
this.tabPage1.UseVisualStyleBackColor = true; this.tabPage1.UseVisualStyleBackColor = true;
// //
// groupBox1 // groupBox1
// //
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Controls.Add(this.label16); this.groupBox1.Controls.Add(this.label16);
this.groupBox1.Controls.Add(this.label4); this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Controls.Add(this.txtpass); this.groupBox1.Controls.Add(this.txtpass);
@ -163,7 +165,6 @@
this.groupBox1.Controls.Add(this.label5); this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Controls.Add(this.txtlocalPort); this.groupBox1.Controls.Add(this.txtlocalPort);
this.groupBox1.Controls.Add(this.label2); this.groupBox1.Controls.Add(this.label2);
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Name = "groupBox1"; this.groupBox1.Name = "groupBox1";
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
// //
@ -213,8 +214,8 @@
// //
// cmbprotocol // cmbprotocol
// //
this.cmbprotocol.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
resources.ApplyResources(this.cmbprotocol, "cmbprotocol"); resources.ApplyResources(this.cmbprotocol, "cmbprotocol");
this.cmbprotocol.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbprotocol.FormattingEnabled = true; this.cmbprotocol.FormattingEnabled = true;
this.cmbprotocol.Items.AddRange(new object[] { this.cmbprotocol.Items.AddRange(new object[] {
resources.GetString("cmbprotocol.Items"), resources.GetString("cmbprotocol.Items"),
@ -240,6 +241,7 @@
// //
// cmbloglevel // cmbloglevel
// //
resources.ApplyResources(this.cmbloglevel, "cmbloglevel");
this.cmbloglevel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbloglevel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbloglevel.FormattingEnabled = true; this.cmbloglevel.FormattingEnabled = true;
this.cmbloglevel.Items.AddRange(new object[] { this.cmbloglevel.Items.AddRange(new object[] {
@ -248,7 +250,6 @@
resources.GetString("cmbloglevel.Items2"), resources.GetString("cmbloglevel.Items2"),
resources.GetString("cmbloglevel.Items3"), resources.GetString("cmbloglevel.Items3"),
resources.GetString("cmbloglevel.Items4")}); resources.GetString("cmbloglevel.Items4")});
resources.ApplyResources(this.cmbloglevel, "cmbloglevel");
this.cmbloglevel.Name = "cmbloglevel"; this.cmbloglevel.Name = "cmbloglevel";
// //
// label5 // label5
@ -268,10 +269,10 @@
// //
// tabPage2 // tabPage2
// //
resources.ApplyResources(this.tabPage2, "tabPage2");
this.tabPage2.Controls.Add(this.linkDnsObjectDoc); this.tabPage2.Controls.Add(this.linkDnsObjectDoc);
this.tabPage2.Controls.Add(this.txtremoteDNS); this.tabPage2.Controls.Add(this.txtremoteDNS);
this.tabPage2.Controls.Add(this.label14); this.tabPage2.Controls.Add(this.label14);
resources.ApplyResources(this.tabPage2, "tabPage2");
this.tabPage2.Name = "tabPage2"; this.tabPage2.Name = "tabPage2";
this.tabPage2.UseVisualStyleBackColor = true; this.tabPage2.UseVisualStyleBackColor = true;
// //
@ -294,6 +295,7 @@
// //
// tabPage6 // tabPage6
// //
resources.ApplyResources(this.tabPage6, "tabPage6");
this.tabPage6.Controls.Add(this.chkKcpcongestion); this.tabPage6.Controls.Add(this.chkKcpcongestion);
this.tabPage6.Controls.Add(this.txtKcpwriteBufferSize); this.tabPage6.Controls.Add(this.txtKcpwriteBufferSize);
this.tabPage6.Controls.Add(this.label10); this.tabPage6.Controls.Add(this.label10);
@ -307,7 +309,6 @@
this.tabPage6.Controls.Add(this.label7); this.tabPage6.Controls.Add(this.label7);
this.tabPage6.Controls.Add(this.txtKcpmtu); this.tabPage6.Controls.Add(this.txtKcpmtu);
this.tabPage6.Controls.Add(this.label6); this.tabPage6.Controls.Add(this.label6);
resources.ApplyResources(this.tabPage6, "tabPage6");
this.tabPage6.Name = "tabPage6"; this.tabPage6.Name = "tabPage6";
this.tabPage6.UseVisualStyleBackColor = true; this.tabPage6.UseVisualStyleBackColor = true;
// //
@ -379,6 +380,8 @@
// //
// tabPage7 // tabPage7
// //
resources.ApplyResources(this.tabPage7, "tabPage7");
this.tabPage7.Controls.Add(this.numStatisticsFreshRate);
this.tabPage7.Controls.Add(this.txttrayMenuServersLimit); this.tabPage7.Controls.Add(this.txttrayMenuServersLimit);
this.tabPage7.Controls.Add(this.label17); this.tabPage7.Controls.Add(this.label17);
this.tabPage7.Controls.Add(this.txtautoUpdateSubInterval); this.tabPage7.Controls.Add(this.txtautoUpdateSubInterval);
@ -390,14 +393,17 @@
this.tabPage7.Controls.Add(this.label15); this.tabPage7.Controls.Add(this.label15);
this.tabPage7.Controls.Add(this.chkIgnoreGeoUpdateCore); this.tabPage7.Controls.Add(this.chkIgnoreGeoUpdateCore);
this.tabPage7.Controls.Add(this.chkKeepOlderDedupl); this.tabPage7.Controls.Add(this.chkKeepOlderDedupl);
this.tabPage7.Controls.Add(this.cbFreshrate);
this.tabPage7.Controls.Add(this.lbFreshrate); this.tabPage7.Controls.Add(this.lbFreshrate);
this.tabPage7.Controls.Add(this.chkEnableStatistics); this.tabPage7.Controls.Add(this.chkEnableStatistics);
this.tabPage7.Controls.Add(this.chkAutoRun); this.tabPage7.Controls.Add(this.chkAutoRun);
resources.ApplyResources(this.tabPage7, "tabPage7");
this.tabPage7.Name = "tabPage7"; this.tabPage7.Name = "tabPage7";
this.tabPage7.UseVisualStyleBackColor = true; this.tabPage7.UseVisualStyleBackColor = true;
// //
// numStatisticsFreshRate
//
resources.ApplyResources(this.numStatisticsFreshRate, "numStatisticsFreshRate");
this.numStatisticsFreshRate.Name = "numStatisticsFreshRate";
//
// txttrayMenuServersLimit // txttrayMenuServersLimit
// //
resources.ApplyResources(this.txttrayMenuServersLimit, "txttrayMenuServersLimit"); resources.ApplyResources(this.txttrayMenuServersLimit, "txttrayMenuServersLimit");
@ -459,13 +465,6 @@
this.chkKeepOlderDedupl.Name = "chkKeepOlderDedupl"; this.chkKeepOlderDedupl.Name = "chkKeepOlderDedupl";
this.chkKeepOlderDedupl.UseVisualStyleBackColor = true; this.chkKeepOlderDedupl.UseVisualStyleBackColor = true;
// //
// cbFreshrate
//
this.cbFreshrate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbFreshrate.FormattingEnabled = true;
resources.ApplyResources(this.cbFreshrate, "cbFreshrate");
this.cbFreshrate.Name = "cbFreshrate";
//
// lbFreshrate // lbFreshrate
// //
resources.ApplyResources(this.lbFreshrate, "lbFreshrate"); resources.ApplyResources(this.lbFreshrate, "lbFreshrate");
@ -485,6 +484,7 @@
// //
// tabPageCoreType // tabPageCoreType
// //
resources.ApplyResources(this.tabPageCoreType, "tabPageCoreType");
this.tabPageCoreType.Controls.Add(this.cmbCoreType6); this.tabPageCoreType.Controls.Add(this.cmbCoreType6);
this.tabPageCoreType.Controls.Add(this.labCoreType6); this.tabPageCoreType.Controls.Add(this.labCoreType6);
this.tabPageCoreType.Controls.Add(this.cmbCoreType5); this.tabPageCoreType.Controls.Add(this.cmbCoreType5);
@ -497,15 +497,14 @@
this.tabPageCoreType.Controls.Add(this.labCoreType2); this.tabPageCoreType.Controls.Add(this.labCoreType2);
this.tabPageCoreType.Controls.Add(this.cmbCoreType1); this.tabPageCoreType.Controls.Add(this.cmbCoreType1);
this.tabPageCoreType.Controls.Add(this.labCoreType1); this.tabPageCoreType.Controls.Add(this.labCoreType1);
resources.ApplyResources(this.tabPageCoreType, "tabPageCoreType");
this.tabPageCoreType.Name = "tabPageCoreType"; this.tabPageCoreType.Name = "tabPageCoreType";
this.tabPageCoreType.UseVisualStyleBackColor = true; this.tabPageCoreType.UseVisualStyleBackColor = true;
// //
// cmbCoreType6 // cmbCoreType6
// //
resources.ApplyResources(this.cmbCoreType6, "cmbCoreType6");
this.cmbCoreType6.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbCoreType6.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbCoreType6.FormattingEnabled = true; this.cmbCoreType6.FormattingEnabled = true;
resources.ApplyResources(this.cmbCoreType6, "cmbCoreType6");
this.cmbCoreType6.Name = "cmbCoreType6"; this.cmbCoreType6.Name = "cmbCoreType6";
// //
// labCoreType6 // labCoreType6
@ -515,9 +514,9 @@
// //
// cmbCoreType5 // cmbCoreType5
// //
resources.ApplyResources(this.cmbCoreType5, "cmbCoreType5");
this.cmbCoreType5.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbCoreType5.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbCoreType5.FormattingEnabled = true; this.cmbCoreType5.FormattingEnabled = true;
resources.ApplyResources(this.cmbCoreType5, "cmbCoreType5");
this.cmbCoreType5.Name = "cmbCoreType5"; this.cmbCoreType5.Name = "cmbCoreType5";
// //
// labCoreType5 // labCoreType5
@ -527,9 +526,9 @@
// //
// cmbCoreType4 // cmbCoreType4
// //
resources.ApplyResources(this.cmbCoreType4, "cmbCoreType4");
this.cmbCoreType4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbCoreType4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbCoreType4.FormattingEnabled = true; this.cmbCoreType4.FormattingEnabled = true;
resources.ApplyResources(this.cmbCoreType4, "cmbCoreType4");
this.cmbCoreType4.Name = "cmbCoreType4"; this.cmbCoreType4.Name = "cmbCoreType4";
// //
// labCoreType4 // labCoreType4
@ -539,9 +538,9 @@
// //
// cmbCoreType3 // cmbCoreType3
// //
resources.ApplyResources(this.cmbCoreType3, "cmbCoreType3");
this.cmbCoreType3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbCoreType3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbCoreType3.FormattingEnabled = true; this.cmbCoreType3.FormattingEnabled = true;
resources.ApplyResources(this.cmbCoreType3, "cmbCoreType3");
this.cmbCoreType3.Name = "cmbCoreType3"; this.cmbCoreType3.Name = "cmbCoreType3";
// //
// labCoreType3 // labCoreType3
@ -551,9 +550,9 @@
// //
// cmbCoreType2 // cmbCoreType2
// //
resources.ApplyResources(this.cmbCoreType2, "cmbCoreType2");
this.cmbCoreType2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbCoreType2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbCoreType2.FormattingEnabled = true; this.cmbCoreType2.FormattingEnabled = true;
resources.ApplyResources(this.cmbCoreType2, "cmbCoreType2");
this.cmbCoreType2.Name = "cmbCoreType2"; this.cmbCoreType2.Name = "cmbCoreType2";
// //
// labCoreType2 // labCoreType2
@ -563,9 +562,9 @@
// //
// cmbCoreType1 // cmbCoreType1
// //
resources.ApplyResources(this.cmbCoreType1, "cmbCoreType1");
this.cmbCoreType1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbCoreType1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbCoreType1.FormattingEnabled = true; this.cmbCoreType1.FormattingEnabled = true;
resources.ApplyResources(this.cmbCoreType1, "cmbCoreType1");
this.cmbCoreType1.Name = "cmbCoreType1"; this.cmbCoreType1.Name = "cmbCoreType1";
// //
// labCoreType1 // labCoreType1
@ -575,19 +574,19 @@
// //
// tabPage3 // tabPage3
// //
this.tabPage3.Controls.Add(this.groupBox2);
resources.ApplyResources(this.tabPage3, "tabPage3"); resources.ApplyResources(this.tabPage3, "tabPage3");
this.tabPage3.Controls.Add(this.groupBox2);
this.tabPage3.Name = "tabPage3"; this.tabPage3.Name = "tabPage3";
this.tabPage3.UseVisualStyleBackColor = true; this.tabPage3.UseVisualStyleBackColor = true;
// //
// groupBox2 // groupBox2
// //
resources.ApplyResources(this.groupBox2, "groupBox2");
this.groupBox2.Controls.Add(this.label18); this.groupBox2.Controls.Add(this.label18);
this.groupBox2.Controls.Add(this.cmbSystemProxyAdvancedProtocol); this.groupBox2.Controls.Add(this.cmbSystemProxyAdvancedProtocol);
this.groupBox2.Controls.Add(this.label13); this.groupBox2.Controls.Add(this.label13);
this.groupBox2.Controls.Add(this.label12); this.groupBox2.Controls.Add(this.label12);
this.groupBox2.Controls.Add(this.txtsystemProxyExceptions); this.groupBox2.Controls.Add(this.txtsystemProxyExceptions);
resources.ApplyResources(this.groupBox2, "groupBox2");
this.groupBox2.Name = "groupBox2"; this.groupBox2.Name = "groupBox2";
this.groupBox2.TabStop = false; this.groupBox2.TabStop = false;
// //
@ -598,8 +597,8 @@
// //
// cmbSystemProxyAdvancedProtocol // cmbSystemProxyAdvancedProtocol
// //
this.cmbSystemProxyAdvancedProtocol.FormattingEnabled = true;
resources.ApplyResources(this.cmbSystemProxyAdvancedProtocol, "cmbSystemProxyAdvancedProtocol"); resources.ApplyResources(this.cmbSystemProxyAdvancedProtocol, "cmbSystemProxyAdvancedProtocol");
this.cmbSystemProxyAdvancedProtocol.FormattingEnabled = true;
this.cmbSystemProxyAdvancedProtocol.Name = "cmbSystemProxyAdvancedProtocol"; this.cmbSystemProxyAdvancedProtocol.Name = "cmbSystemProxyAdvancedProtocol";
// //
// label13 // label13
@ -619,9 +618,9 @@
// //
// panel2 // panel2
// //
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Controls.Add(this.btnClose); this.panel2.Controls.Add(this.btnClose);
this.panel2.Controls.Add(this.btnOK); this.panel2.Controls.Add(this.btnOK);
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Name = "panel2"; this.panel2.Name = "panel2";
// //
// btnOK // btnOK
@ -657,6 +656,7 @@
this.tabPage6.PerformLayout(); this.tabPage6.PerformLayout();
this.tabPage7.ResumeLayout(false); this.tabPage7.ResumeLayout(false);
this.tabPage7.PerformLayout(); this.tabPage7.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.numStatisticsFreshRate)).EndInit();
this.tabPageCoreType.ResumeLayout(false); this.tabPageCoreType.ResumeLayout(false);
this.tabPageCoreType.PerformLayout(); this.tabPageCoreType.PerformLayout();
this.tabPage3.ResumeLayout(false); this.tabPage3.ResumeLayout(false);
@ -704,7 +704,6 @@
private System.Windows.Forms.CheckBox chkAllowLANConn; private System.Windows.Forms.CheckBox chkAllowLANConn;
private System.Windows.Forms.CheckBox chksniffingEnabled; private System.Windows.Forms.CheckBox chksniffingEnabled;
private System.Windows.Forms.CheckBox chkEnableStatistics; private System.Windows.Forms.CheckBox chkEnableStatistics;
private System.Windows.Forms.ComboBox cbFreshrate;
private System.Windows.Forms.Label lbFreshrate; private System.Windows.Forms.Label lbFreshrate;
private System.Windows.Forms.CheckBox chkKeepOlderDedupl; private System.Windows.Forms.CheckBox chkKeepOlderDedupl;
private System.Windows.Forms.CheckBox chkdefAllowInsecure; private System.Windows.Forms.CheckBox chkdefAllowInsecure;
@ -746,5 +745,6 @@
private System.Windows.Forms.Label label17; private System.Windows.Forms.Label label17;
private System.Windows.Forms.ComboBox cmbSystemProxyAdvancedProtocol; private System.Windows.Forms.ComboBox cmbSystemProxyAdvancedProtocol;
private System.Windows.Forms.Label label18; private System.Windows.Forms.Label label18;
private System.Windows.Forms.NumericUpDown numStatisticsFreshRate;
} }
} }

View file

@ -19,7 +19,7 @@ namespace v2rayN.Forms
private void OptionSettingForm_Load(object sender, EventArgs e) private void OptionSettingForm_Load(object sender, EventArgs e)
{ {
cmbSystemProxyAdvancedProtocol.Items.AddRange(Global.IEProxyProtocols.ToArray()); cmbSystemProxyAdvancedProtocol.Items.AddRange(Global.IEProxyProtocols.ToArray());
InitBase(); InitBase();
InitKCP(); InitKCP();
@ -88,32 +88,9 @@ namespace v2rayN.Forms
chkAutoRun.Checked = Utils.IsAutoRun(); chkAutoRun.Checked = Utils.IsAutoRun();
chkEnableStatistics.Checked = config.enableStatistics; chkEnableStatistics.Checked = config.enableStatistics;
numStatisticsFreshRate.Value = config.statisticsFreshRate;
chkKeepOlderDedupl.Checked = config.keepOlderDedupl; chkKeepOlderDedupl.Checked = config.keepOlderDedupl;
ComboItem[] cbSource = new ComboItem[]
{
new ComboItem{ID = (int)Global.StatisticsFreshRate.quick, Text = ResUI.QuickFresh},
new ComboItem{ID = (int)Global.StatisticsFreshRate.medium, Text = ResUI.MediumFresh},
new ComboItem{ID = (int)Global.StatisticsFreshRate.slow, Text = ResUI.SlowFresh},
};
cbFreshrate.DataSource = cbSource;
cbFreshrate.DisplayMember = "Text";
cbFreshrate.ValueMember = "ID";
switch (config.statisticsFreshRate)
{
case (int)Global.StatisticsFreshRate.quick:
cbFreshrate.SelectedItem = cbSource[0];
break;
case (int)Global.StatisticsFreshRate.medium:
cbFreshrate.SelectedItem = cbSource[1];
break;
case (int)Global.StatisticsFreshRate.slow:
cbFreshrate.SelectedItem = cbSource[2];
break;
}
chkIgnoreGeoUpdateCore.Checked = config.ignoreGeoUpdateCore; chkIgnoreGeoUpdateCore.Checked = config.ignoreGeoUpdateCore;
chkEnableAutoAdjustMainLvColWidth.Checked = config.uiItem.enableAutoAdjustMainLvColWidth; chkEnableAutoAdjustMainLvColWidth.Checked = config.uiItem.enableAutoAdjustMainLvColWidth;
chkEnableSecurityProtocolTls13.Checked = config.enableSecurityProtocolTls13; chkEnableSecurityProtocolTls13.Checked = config.enableSecurityProtocolTls13;
@ -309,7 +286,8 @@ namespace v2rayN.Forms
bool lastEnableStatistics = config.enableStatistics; bool lastEnableStatistics = config.enableStatistics;
config.enableStatistics = chkEnableStatistics.Checked; config.enableStatistics = chkEnableStatistics.Checked;
config.statisticsFreshRate = (int)cbFreshrate.SelectedValue; config.statisticsFreshRate = Convert.ToInt32(numStatisticsFreshRate.Value);
config.keepOlderDedupl = chkKeepOlderDedupl.Checked; config.keepOlderDedupl = chkKeepOlderDedupl.Checked;
config.ignoreGeoUpdateCore = chkIgnoreGeoUpdateCore.Checked; config.ignoreGeoUpdateCore = chkIgnoreGeoUpdateCore.Checked;

File diff suppressed because it is too large Load diff

View file

@ -121,123 +121,6 @@
<value>取消(&amp;C)</value> <value>取消(&amp;C)</value>
</data> </data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="tabPage1.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value>
</data>
<data name="tabPage1.Text" xml:space="preserve">
<value> Core:基础设置 </value>
</data>
<data name="tabPage2.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value>
</data>
<data name="tabPage2.Text" xml:space="preserve">
<value> Core:DNS设置 </value>
</data>
<data name="tabPage6.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value>
</data>
<data name="tabPage6.Text" xml:space="preserve">
<value> Core:KCP设置 </value>
</data>
<data name="txttrayMenuServersLimit.Location" type="System.Drawing.Point, System.Drawing">
<value>248, 211</value>
</data>
<data name="label17.Size" type="System.Drawing.Size, System.Drawing">
<value>185, 12</value>
</data>
<data name="label17.Text" xml:space="preserve">
<value>托盘右键菜单服务器展示数量限制</value>
</data>
<data name="txtautoUpdateSubInterval.Location" type="System.Drawing.Point, System.Drawing">
<value>248, 184</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>173, 12</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>自动更新订阅的间隔(单位小时)</value>
</data>
<data name="chkEnableSecurityProtocolTls13.Text" xml:space="preserve">
<value>启用安全协议TLS v1.3 (订阅/检查更新/测速)</value>
</data>
<data name="chkEnableAutoAdjustMainLvColWidth.Size" type="System.Drawing.Size, System.Drawing">
<value>204, 16</value>
</data>
<data name="chkEnableAutoAdjustMainLvColWidth.Text" xml:space="preserve">
<value>自动调整服务器列宽在更新订阅后</value>
</data>
<data name="btnSetLoopback.Text" xml:space="preserve">
<value>解除Windows10 UWP应用回环代理限制</value>
</data>
<data name="txtautoUpdateInterval.Location" type="System.Drawing.Point, System.Drawing">
<value>248, 157</value>
</data>
<data name="label15.Size" type="System.Drawing.Size, System.Drawing">
<value>191, 12</value>
</data>
<data name="label15.Text" xml:space="preserve">
<value>自动更新Geo文件的间隔(单位小时)</value>
</data>
<data name="chkIgnoreGeoUpdateCore.Size" type="System.Drawing.Size, System.Drawing">
<value>150, 16</value>
</data>
<data name="chkIgnoreGeoUpdateCore.Text" xml:space="preserve">
<value>更新Core时忽略Geo文件</value>
</data>
<data name="chkKeepOlderDedupl.Size" type="System.Drawing.Size, System.Drawing">
<value>156, 16</value>
</data>
<data name="chkKeepOlderDedupl.Text" xml:space="preserve">
<value>去重时保留序号较小的项</value>
</data>
<data name="cbFreshrate.Location" type="System.Drawing.Point, System.Drawing">
<value>431, 37</value>
</data>
<data name="lbFreshrate.Location" type="System.Drawing.Point, System.Drawing">
<value>339, 41</value>
</data>
<data name="lbFreshrate.Size" type="System.Drawing.Size, System.Drawing">
<value>77, 12</value>
</data>
<data name="lbFreshrate.Text" xml:space="preserve">
<value>统计刷新频率</value>
</data>
<data name="chkEnableStatistics.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 16</value>
</data>
<data name="chkEnableStatistics.Text" xml:space="preserve">
<value>启用统计(实时网速显示和使用流量显示,需要重启)</value>
</data>
<data name="chkAutoRun.Size" type="System.Drawing.Size, System.Drawing">
<value>180, 16</value>
</data>
<data name="chkAutoRun.Text" xml:space="preserve">
<value>开机自动启动(可能会不成功)</value>
</data>
<data name="tabPage7.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value>
</data>
<data name="tabPage7.Text" xml:space="preserve">
<value> v2rayN设置 </value>
</data>
<data name="tabPageCoreType.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value>
</data>
<data name="tabPageCoreType.Text" xml:space="preserve">
<value> Core类型设置 </value>
</data>
<data name="tabPage3.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value>
</data>
<data name="tabPage3.Text" xml:space="preserve">
<value> 系统代理设置 </value>
</data>
<data name="tabControl1.Size" type="System.Drawing.Size, System.Drawing">
<value>662, 469</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>648, 437</value>
</data>
<data name="label16.Size" type="System.Drawing.Size, System.Drawing"> <data name="label16.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 12</value> <value>53, 12</value>
</data> </data>
@ -325,6 +208,15 @@
<data name="label2.Text" xml:space="preserve"> <data name="label2.Text" xml:space="preserve">
<value>本地监听端口</value> <value>本地监听端口</value>
</data> </data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>648, 437</value>
</data>
<data name="tabPage1.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value>
</data>
<data name="tabPage1.Text" xml:space="preserve">
<value> Core:基础设置 </value>
</data>
<data name="linkDnsObjectDoc.Size" type="System.Drawing.Size, System.Drawing"> <data name="linkDnsObjectDoc.Size" type="System.Drawing.Size, System.Drawing">
<value>161, 12</value> <value>161, 12</value>
</data> </data>
@ -337,11 +229,110 @@
<data name="label14.Text" xml:space="preserve"> <data name="label14.Text" xml:space="preserve">
<value>自定义DNS(可多个,用逗号(,)隔开)</value> <value>自定义DNS(可多个,用逗号(,)隔开)</value>
</data> </data>
<data name="groupBox2.Size" type="System.Drawing.Size, System.Drawing"> <data name="tabPage2.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value> <value>654, 443</value>
</data> </data>
<data name="groupBox2.Text" xml:space="preserve"> <data name="tabPage2.Text" xml:space="preserve">
<value>例外</value> <value> Core:DNS设置 </value>
</data>
<data name="tabPage6.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value>
</data>
<data name="tabPage6.Text" xml:space="preserve">
<value> Core:KCP设置 </value>
</data>
<data name="numStatisticsFreshRate.Location" type="System.Drawing.Point, System.Drawing">
<value>472, 37</value>
</data>
<data name="txttrayMenuServersLimit.Location" type="System.Drawing.Point, System.Drawing">
<value>248, 211</value>
</data>
<data name="label17.Size" type="System.Drawing.Size, System.Drawing">
<value>185, 12</value>
</data>
<data name="label17.Text" xml:space="preserve">
<value>托盘右键菜单服务器展示数量限制</value>
</data>
<data name="txtautoUpdateSubInterval.Location" type="System.Drawing.Point, System.Drawing">
<value>248, 184</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>173, 12</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>自动更新订阅的间隔(单位小时)</value>
</data>
<data name="chkEnableSecurityProtocolTls13.Text" xml:space="preserve">
<value>启用安全协议TLS v1.3 (订阅/检查更新/测速)</value>
</data>
<data name="chkEnableAutoAdjustMainLvColWidth.Size" type="System.Drawing.Size, System.Drawing">
<value>204, 16</value>
</data>
<data name="chkEnableAutoAdjustMainLvColWidth.Text" xml:space="preserve">
<value>自动调整服务器列宽在更新订阅后</value>
</data>
<data name="btnSetLoopback.Text" xml:space="preserve">
<value>解除Windows10 UWP应用回环代理限制</value>
</data>
<data name="txtautoUpdateInterval.Location" type="System.Drawing.Point, System.Drawing">
<value>248, 157</value>
</data>
<data name="label15.Size" type="System.Drawing.Size, System.Drawing">
<value>191, 12</value>
</data>
<data name="label15.Text" xml:space="preserve">
<value>自动更新Geo文件的间隔(单位小时)</value>
</data>
<data name="chkIgnoreGeoUpdateCore.Size" type="System.Drawing.Size, System.Drawing">
<value>150, 16</value>
</data>
<data name="chkIgnoreGeoUpdateCore.Text" xml:space="preserve">
<value>更新Core时忽略Geo文件</value>
</data>
<data name="chkKeepOlderDedupl.Size" type="System.Drawing.Size, System.Drawing">
<value>156, 16</value>
</data>
<data name="chkKeepOlderDedupl.Text" xml:space="preserve">
<value>去重时保留序号较小的项</value>
</data>
<data name="lbFreshrate.Location" type="System.Drawing.Point, System.Drawing">
<value>339, 41</value>
</data>
<data name="lbFreshrate.Size" type="System.Drawing.Size, System.Drawing">
<value>125, 12</value>
</data>
<data name="lbFreshrate.Text" xml:space="preserve">
<value>统计刷新频率(单位秒)</value>
</data>
<data name="chkEnableStatistics.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 16</value>
</data>
<data name="chkEnableStatistics.Text" xml:space="preserve">
<value>启用统计(实时网速显示和使用流量显示,需要重启)</value>
</data>
<data name="chkAutoRun.Size" type="System.Drawing.Size, System.Drawing">
<value>180, 16</value>
</data>
<data name="chkAutoRun.Text" xml:space="preserve">
<value>开机自动启动(可能会不成功)</value>
</data>
<data name="tabPage7.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value>
</data>
<data name="tabPage7.Text" xml:space="preserve">
<value> v2rayN设置 </value>
</data>
<data name="tabPageCoreType.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value>
</data>
<data name="tabPageCoreType.Text" xml:space="preserve">
<value> Core类型设置 </value>
</data>
<data name="label18.Size" type="System.Drawing.Size, System.Drawing">
<value>173, 12</value>
</data>
<data name="label18.Text" xml:space="preserve">
<value>高级代理设置, 协议选择(可选)</value>
</data> </data>
<data name="label13.Size" type="System.Drawing.Size, System.Drawing"> <data name="label13.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 12</value> <value>95, 12</value>
@ -355,15 +346,30 @@
<data name="label12.Text" xml:space="preserve"> <data name="label12.Text" xml:space="preserve">
<value>对于下列字符开头的地址不使用代理服务器:</value> <value>对于下列字符开头的地址不使用代理服务器:</value>
</data> </data>
<data name="groupBox2.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value>
</data>
<data name="groupBox2.Text" xml:space="preserve">
<value>例外</value>
</data>
<data name="tabPage3.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value>
</data>
<data name="tabPage3.Text" xml:space="preserve">
<value> 系统代理设置 </value>
</data>
<data name="tabControl1.Size" type="System.Drawing.Size, System.Drawing">
<value>662, 469</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>确定(&amp;O)</value>
</data>
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing"> <data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 479</value> <value>0, 479</value>
</data> </data>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing"> <data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>662, 60</value> <value>662, 60</value>
</data> </data>
<data name="btnOK.Text" xml:space="preserve">
<value>确定(&amp;O)</value>
</data>
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing"> <data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
<value>662, 10</value> <value>662, 10</value>
</data> </data>
@ -373,7 +379,4 @@
<data name="$this.Text" xml:space="preserve"> <data name="$this.Text" xml:space="preserve">
<value>参数设置</value> <value>参数设置</value>
</data> </data>
<data name="label18.Text" xml:space="preserve">
<value>高级代理设置, 协议选择(可选)</value>
</data>
</root> </root>

View file

@ -191,12 +191,6 @@ namespace v2rayN
/// </summary> /// </summary>
public const string CustomIconName = "v2rayN.ico"; public const string CustomIconName = "v2rayN.ico";
public enum StatisticsFreshRate
{
quick = 1000,
medium = 2000,
slow = 3000
}
public const string StatisticLogOverall = "StatisticLogOverall.json"; public const string StatisticLogOverall = "StatisticLogOverall.json";
public const string IEProxyExceptions = "localhost;127.*;10.*;172.16.*;172.17.*;172.18.*;172.19.*;172.20.*;172.21.*;172.22.*;172.23.*;172.24.*;172.25.*;172.26.*;172.27.*;172.28.*;172.29.*;172.30.*;172.31.*;192.168.*"; public const string IEProxyExceptions = "localhost;127.*;10.*;172.16.*;172.17.*;172.18.*;172.19.*;172.20.*;172.21.*;172.22.*;172.23.*;172.24.*;172.25.*;172.26.*;172.27.*;172.28.*;172.29.*;172.30.*;172.31.*;192.168.*";

View file

@ -54,11 +54,9 @@ namespace v2rayN.Handler
//Mux //Mux
muxEnabled = false, muxEnabled = false,
// 默认不开启统计
enableStatistics = false, enableStatistics = false,
// 默认中等刷新率 statisticsFreshRate = 1,
statisticsFreshRate = (int)Global.StatisticsFreshRate.medium,
enableRoutingAdvanced = true enableRoutingAdvanced = true
}; };
@ -158,7 +156,10 @@ namespace v2rayN.Handler
{ {
config.groupItem = new List<GroupItem>(); config.groupItem = new List<GroupItem>();
} }
if (config.statisticsFreshRate > 100)
{
config.statisticsFreshRate = 1;
}
if (config == null if (config == null
|| config.vmess.Count <= 0 || config.vmess.Count <= 0

View file

@ -127,7 +127,7 @@ namespace v2rayN.Handler
} }
} }
} }
Thread.Sleep(config_.statisticsFreshRate); Thread.Sleep(1000 * config_.statisticsFreshRate);
channel_.ConnectAsync(); channel_.ConnectAsync();
} }
catch (Exception ex) catch (Exception ex)