mirror of https://github.com/2dust/v2rayN
Refactor core type
parent
ac79466041
commit
583e824337
|
@ -40,6 +40,8 @@
|
|||
this.panel2 = new System.Windows.Forms.Panel();
|
||||
this.btnOK = new System.Windows.Forms.Button();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.cmbCoreType = new System.Windows.Forms.ComboBox();
|
||||
this.labCoreType = new System.Windows.Forms.Label();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.panel2.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
|
@ -54,6 +56,8 @@
|
|||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.cmbCoreType);
|
||||
this.groupBox1.Controls.Add(this.labCoreType);
|
||||
this.groupBox1.Controls.Add(this.btnBrowse);
|
||||
this.groupBox1.Controls.Add(this.txtAddress);
|
||||
this.groupBox1.Controls.Add(this.label13);
|
||||
|
@ -115,6 +119,18 @@
|
|||
resources.ApplyResources(this.panel1, "panel1");
|
||||
this.panel1.Name = "panel1";
|
||||
//
|
||||
// cmbCoreType
|
||||
//
|
||||
this.cmbCoreType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbCoreType.FormattingEnabled = true;
|
||||
resources.ApplyResources(this.cmbCoreType, "cmbCoreType");
|
||||
this.cmbCoreType.Name = "cmbCoreType";
|
||||
//
|
||||
// labCoreType
|
||||
//
|
||||
resources.ApplyResources(this.labCoreType, "labCoreType");
|
||||
this.labCoreType.Name = "labCoreType";
|
||||
//
|
||||
// AddServer2Form
|
||||
//
|
||||
resources.ApplyResources(this, "$this");
|
||||
|
@ -146,5 +162,7 @@
|
|||
private System.Windows.Forms.Label label13;
|
||||
private System.Windows.Forms.TextBox txtAddress;
|
||||
private System.Windows.Forms.Button btnBrowse;
|
||||
private System.Windows.Forms.ComboBox cmbCoreType;
|
||||
private System.Windows.Forms.Label labCoreType;
|
||||
}
|
||||
}
|
|
@ -15,6 +15,9 @@ namespace v2rayN.Forms
|
|||
|
||||
private void AddServer2Form_Load(object sender, EventArgs e)
|
||||
{
|
||||
cmbCoreType.Items.AddRange(Global.coreTypes.ToArray());
|
||||
cmbCoreType.Items.Add(string.Empty);
|
||||
|
||||
txtAddress.ReadOnly = true;
|
||||
if (vmessItem != null)
|
||||
{
|
||||
|
@ -35,6 +38,15 @@ namespace v2rayN.Forms
|
|||
{
|
||||
txtRemarks.Text = vmessItem.remarks;
|
||||
txtAddress.Text = vmessItem.address;
|
||||
|
||||
if (vmessItem.coreType == null)
|
||||
{
|
||||
cmbCoreType.Text = string.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
cmbCoreType.Text = vmessItem.coreType.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -55,6 +67,14 @@ namespace v2rayN.Forms
|
|||
return;
|
||||
}
|
||||
vmessItem.remarks = remarks;
|
||||
if (Utils.IsNullOrEmpty(cmbCoreType.Text))
|
||||
{
|
||||
vmessItem.coreType = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
vmessItem.coreType = (ECoreType)Enum.Parse(typeof(ECoreType), cmbCoreType.Text);
|
||||
}
|
||||
|
||||
if (ConfigHandler.EditCustomServer(ref config, vmessItem) == 0)
|
||||
{
|
||||
|
|
|
@ -143,12 +143,63 @@
|
|||
<data name=">>btnClose.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="cmbCoreType.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>127, 157</value>
|
||||
</data>
|
||||
<data name="cmbCoreType.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>89, 20</value>
|
||||
</data>
|
||||
<data name="cmbCoreType.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>41</value>
|
||||
</data>
|
||||
<data name=">>cmbCoreType.Name" xml:space="preserve">
|
||||
<value>cmbCoreType</value>
|
||||
</data>
|
||||
<data name=">>cmbCoreType.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>cmbCoreType.Parent" xml:space="preserve">
|
||||
<value>groupBox1</value>
|
||||
</data>
|
||||
<data name=">>cmbCoreType.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="labCoreType.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="labCoreType.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="labCoreType.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>12, 161</value>
|
||||
</data>
|
||||
<data name="labCoreType.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>59, 12</value>
|
||||
</data>
|
||||
<data name="labCoreType.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>42</value>
|
||||
</data>
|
||||
<data name="labCoreType.Text" xml:space="preserve">
|
||||
<value>Core Type</value>
|
||||
</data>
|
||||
<data name=">>labCoreType.Name" xml:space="preserve">
|
||||
<value>labCoreType</value>
|
||||
</data>
|
||||
<data name=">>labCoreType.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>labCoreType.Parent" xml:space="preserve">
|
||||
<value>groupBox1</value>
|
||||
</data>
|
||||
<data name=">>labCoreType.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="btnBrowse.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="btnBrowse.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>127, 121</value>
|
||||
<value>127, 110</value>
|
||||
</data>
|
||||
<data name="btnBrowse.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>75, 23</value>
|
||||
|
@ -169,7 +220,7 @@
|
|||
<value>groupBox1</value>
|
||||
</data>
|
||||
<data name=">>btnBrowse.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
<value>2</value>
|
||||
</data>
|
||||
<data name="txtAddress.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>127, 62</value>
|
||||
|
@ -193,7 +244,7 @@
|
|||
<value>groupBox1</value>
|
||||
</data>
|
||||
<data name=">>txtAddress.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
<value>3</value>
|
||||
</data>
|
||||
<data name="label13.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
|
@ -220,7 +271,7 @@
|
|||
<value>groupBox1</value>
|
||||
</data>
|
||||
<data name=">>label13.ZOrder" xml:space="preserve">
|
||||
<value>2</value>
|
||||
<value>4</value>
|
||||
</data>
|
||||
<data name="txtRemarks.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>127, 23</value>
|
||||
|
@ -241,7 +292,7 @@
|
|||
<value>groupBox1</value>
|
||||
</data>
|
||||
<data name=">>txtRemarks.ZOrder" xml:space="preserve">
|
||||
<value>3</value>
|
||||
<value>5</value>
|
||||
</data>
|
||||
<data name="label6.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
|
@ -268,7 +319,7 @@
|
|||
<value>groupBox1</value>
|
||||
</data>
|
||||
<data name=">>label6.ZOrder" xml:space="preserve">
|
||||
<value>4</value>
|
||||
<value>6</value>
|
||||
</data>
|
||||
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
|
@ -295,7 +346,7 @@
|
|||
<value>groupBox1</value>
|
||||
</data>
|
||||
<data name=">>label1.ZOrder" xml:space="preserve">
|
||||
<value>5</value>
|
||||
<value>7</value>
|
||||
</data>
|
||||
<data name="groupBox1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<value>Fill</value>
|
||||
|
@ -406,7 +457,7 @@
|
|||
<value>611, 259</value>
|
||||
</data>
|
||||
<data name="$this.Text" xml:space="preserve">
|
||||
<value>Edit custom configuration server</value>
|
||||
<value>Custom configuration server</value>
|
||||
</data>
|
||||
<data name=">>$this.Name" xml:space="preserve">
|
||||
<value>AddServer2Form</value>
|
||||
|
|
|
@ -118,7 +118,10 @@
|
|||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="$this.Text" xml:space="preserve">
|
||||
<value>编辑自定义配置服务器</value>
|
||||
<value>自定义配置</value>
|
||||
</data>
|
||||
<data name="btnBrowse.Text" xml:space="preserve">
|
||||
<value>浏览(&B)</value>
|
||||
</data>
|
||||
<data name="btnClose.Text" xml:space="preserve">
|
||||
<value>取消(&C)</value>
|
||||
|
@ -129,6 +132,9 @@
|
|||
<data name="groupBox1.Text" xml:space="preserve">
|
||||
<value>服务器</value>
|
||||
</data>
|
||||
<data name="labCoreType.Text" xml:space="preserve">
|
||||
<value>Core类型</value>
|
||||
</data>
|
||||
<data name="label1.Text" xml:space="preserve">
|
||||
<value>地址(address)</value>
|
||||
</data>
|
||||
|
|
|
@ -31,36 +31,62 @@
|
|||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AddServerForm));
|
||||
this.btnClose = new System.Windows.Forms.Button();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.btnGUID = new System.Windows.Forms.Button();
|
||||
this.label13 = new System.Windows.Forms.Label();
|
||||
this.label8 = new System.Windows.Forms.Label();
|
||||
this.cmbSecurity = new System.Windows.Forms.ComboBox();
|
||||
this.txtRemarks = new System.Windows.Forms.TextBox();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.txtAlterId = new System.Windows.Forms.TextBox();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.txtId = new System.Windows.Forms.TextBox();
|
||||
this.panSocks = new System.Windows.Forms.Panel();
|
||||
this.label17 = new System.Windows.Forms.Label();
|
||||
this.txtSecurity4 = new System.Windows.Forms.TextBox();
|
||||
this.label18 = new System.Windows.Forms.Label();
|
||||
this.txtId4 = new System.Windows.Forms.TextBox();
|
||||
this.panSs = new System.Windows.Forms.Panel();
|
||||
this.txtId3 = new System.Windows.Forms.TextBox();
|
||||
this.label15 = new System.Windows.Forms.Label();
|
||||
this.cmbSecurity3 = new System.Windows.Forms.ComboBox();
|
||||
this.label16 = new System.Windows.Forms.Label();
|
||||
this.panTrojan = new System.Windows.Forms.Panel();
|
||||
this.label12 = new System.Windows.Forms.Label();
|
||||
this.cmbFlow6 = new System.Windows.Forms.ComboBox();
|
||||
this.txtId6 = new System.Windows.Forms.TextBox();
|
||||
this.label14 = new System.Windows.Forms.Label();
|
||||
this.panVless = new System.Windows.Forms.Panel();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.cmbFlow5 = new System.Windows.Forms.ComboBox();
|
||||
this.txtId5 = new System.Windows.Forms.TextBox();
|
||||
this.label9 = new System.Windows.Forms.Label();
|
||||
this.label10 = new System.Windows.Forms.Label();
|
||||
this.btnGUID5 = new System.Windows.Forms.Button();
|
||||
this.cmbSecurity5 = new System.Windows.Forms.ComboBox();
|
||||
this.label11 = new System.Windows.Forms.Label();
|
||||
this.panVmess = new System.Windows.Forms.Panel();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.txtPort = new System.Windows.Forms.TextBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.txtAddress = new System.Windows.Forms.TextBox();
|
||||
this.txtId = new System.Windows.Forms.TextBox();
|
||||
this.btnGUID = new System.Windows.Forms.Button();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.label8 = new System.Windows.Forms.Label();
|
||||
this.txtAlterId = new System.Windows.Forms.TextBox();
|
||||
this.cmbSecurity = new System.Windows.Forms.ComboBox();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.panAddr = new System.Windows.Forms.Panel();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.panel2 = new System.Windows.Forms.Panel();
|
||||
this.txtAddress = new System.Windows.Forms.TextBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.txtPort = new System.Windows.Forms.TextBox();
|
||||
this.txtRemarks = new System.Windows.Forms.TextBox();
|
||||
this.panBottom = new System.Windows.Forms.Panel();
|
||||
this.btnOK = new System.Windows.Forms.Button();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.menuServer = new System.Windows.Forms.MenuStrip();
|
||||
this.MenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.MenuItemImportClient = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.MenuItemImportServer = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.MenuItemImportClipboard = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.panel3 = new System.Windows.Forms.Panel();
|
||||
this.panTop = new System.Windows.Forms.Panel();
|
||||
this.panTran = new System.Windows.Forms.Panel();
|
||||
this.transportControl = new v2rayN.Forms.ServerTransportControl();
|
||||
this.cmbCoreType = new System.Windows.Forms.ComboBox();
|
||||
this.labCoreType = new System.Windows.Forms.Label();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.panel2.SuspendLayout();
|
||||
this.menuServer.SuspendLayout();
|
||||
this.panel3.SuspendLayout();
|
||||
this.panSocks.SuspendLayout();
|
||||
this.panSs.SuspendLayout();
|
||||
this.panTrojan.SuspendLayout();
|
||||
this.panVless.SuspendLayout();
|
||||
this.panVmess.SuspendLayout();
|
||||
this.panAddr.SuspendLayout();
|
||||
this.panBottom.SuspendLayout();
|
||||
this.panTran.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// btnClose
|
||||
|
@ -73,25 +99,189 @@
|
|||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.btnGUID);
|
||||
this.groupBox1.Controls.Add(this.label13);
|
||||
this.groupBox1.Controls.Add(this.label8);
|
||||
this.groupBox1.Controls.Add(this.cmbSecurity);
|
||||
this.groupBox1.Controls.Add(this.txtRemarks);
|
||||
this.groupBox1.Controls.Add(this.label6);
|
||||
this.groupBox1.Controls.Add(this.label5);
|
||||
this.groupBox1.Controls.Add(this.txtAlterId);
|
||||
this.groupBox1.Controls.Add(this.label4);
|
||||
this.groupBox1.Controls.Add(this.txtId);
|
||||
this.groupBox1.Controls.Add(this.label3);
|
||||
this.groupBox1.Controls.Add(this.txtPort);
|
||||
this.groupBox1.Controls.Add(this.label2);
|
||||
this.groupBox1.Controls.Add(this.txtAddress);
|
||||
this.groupBox1.Controls.Add(this.label1);
|
||||
this.groupBox1.Controls.Add(this.panSocks);
|
||||
this.groupBox1.Controls.Add(this.panSs);
|
||||
this.groupBox1.Controls.Add(this.panTrojan);
|
||||
this.groupBox1.Controls.Add(this.panVless);
|
||||
this.groupBox1.Controls.Add(this.panVmess);
|
||||
this.groupBox1.Controls.Add(this.panAddr);
|
||||
resources.ApplyResources(this.groupBox1, "groupBox1");
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.TabStop = false;
|
||||
//
|
||||
// panSocks
|
||||
//
|
||||
this.panSocks.Controls.Add(this.label17);
|
||||
this.panSocks.Controls.Add(this.txtSecurity4);
|
||||
this.panSocks.Controls.Add(this.label18);
|
||||
this.panSocks.Controls.Add(this.txtId4);
|
||||
resources.ApplyResources(this.panSocks, "panSocks");
|
||||
this.panSocks.Name = "panSocks";
|
||||
//
|
||||
// label17
|
||||
//
|
||||
resources.ApplyResources(this.label17, "label17");
|
||||
this.label17.Name = "label17";
|
||||
//
|
||||
// txtSecurity4
|
||||
//
|
||||
resources.ApplyResources(this.txtSecurity4, "txtSecurity4");
|
||||
this.txtSecurity4.Name = "txtSecurity4";
|
||||
//
|
||||
// label18
|
||||
//
|
||||
resources.ApplyResources(this.label18, "label18");
|
||||
this.label18.Name = "label18";
|
||||
//
|
||||
// txtId4
|
||||
//
|
||||
resources.ApplyResources(this.txtId4, "txtId4");
|
||||
this.txtId4.Name = "txtId4";
|
||||
//
|
||||
// panSs
|
||||
//
|
||||
this.panSs.Controls.Add(this.txtId3);
|
||||
this.panSs.Controls.Add(this.label15);
|
||||
this.panSs.Controls.Add(this.cmbSecurity3);
|
||||
this.panSs.Controls.Add(this.label16);
|
||||
resources.ApplyResources(this.panSs, "panSs");
|
||||
this.panSs.Name = "panSs";
|
||||
//
|
||||
// txtId3
|
||||
//
|
||||
resources.ApplyResources(this.txtId3, "txtId3");
|
||||
this.txtId3.Name = "txtId3";
|
||||
//
|
||||
// label15
|
||||
//
|
||||
resources.ApplyResources(this.label15, "label15");
|
||||
this.label15.Name = "label15";
|
||||
//
|
||||
// cmbSecurity3
|
||||
//
|
||||
this.cmbSecurity3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbSecurity3.FormattingEnabled = true;
|
||||
resources.ApplyResources(this.cmbSecurity3, "cmbSecurity3");
|
||||
this.cmbSecurity3.Name = "cmbSecurity3";
|
||||
//
|
||||
// label16
|
||||
//
|
||||
resources.ApplyResources(this.label16, "label16");
|
||||
this.label16.Name = "label16";
|
||||
//
|
||||
// panTrojan
|
||||
//
|
||||
this.panTrojan.Controls.Add(this.label12);
|
||||
this.panTrojan.Controls.Add(this.cmbFlow6);
|
||||
this.panTrojan.Controls.Add(this.txtId6);
|
||||
this.panTrojan.Controls.Add(this.label14);
|
||||
resources.ApplyResources(this.panTrojan, "panTrojan");
|
||||
this.panTrojan.Name = "panTrojan";
|
||||
//
|
||||
// label12
|
||||
//
|
||||
resources.ApplyResources(this.label12, "label12");
|
||||
this.label12.Name = "label12";
|
||||
//
|
||||
// cmbFlow6
|
||||
//
|
||||
this.cmbFlow6.FormattingEnabled = true;
|
||||
resources.ApplyResources(this.cmbFlow6, "cmbFlow6");
|
||||
this.cmbFlow6.Name = "cmbFlow6";
|
||||
//
|
||||
// txtId6
|
||||
//
|
||||
resources.ApplyResources(this.txtId6, "txtId6");
|
||||
this.txtId6.Name = "txtId6";
|
||||
//
|
||||
// label14
|
||||
//
|
||||
resources.ApplyResources(this.label14, "label14");
|
||||
this.label14.Name = "label14";
|
||||
//
|
||||
// panVless
|
||||
//
|
||||
this.panVless.Controls.Add(this.label7);
|
||||
this.panVless.Controls.Add(this.cmbFlow5);
|
||||
this.panVless.Controls.Add(this.txtId5);
|
||||
this.panVless.Controls.Add(this.label9);
|
||||
this.panVless.Controls.Add(this.label10);
|
||||
this.panVless.Controls.Add(this.btnGUID5);
|
||||
this.panVless.Controls.Add(this.cmbSecurity5);
|
||||
this.panVless.Controls.Add(this.label11);
|
||||
resources.ApplyResources(this.panVless, "panVless");
|
||||
this.panVless.Name = "panVless";
|
||||
//
|
||||
// label7
|
||||
//
|
||||
resources.ApplyResources(this.label7, "label7");
|
||||
this.label7.Name = "label7";
|
||||
//
|
||||
// cmbFlow5
|
||||
//
|
||||
this.cmbFlow5.FormattingEnabled = true;
|
||||
resources.ApplyResources(this.cmbFlow5, "cmbFlow5");
|
||||
this.cmbFlow5.Name = "cmbFlow5";
|
||||
//
|
||||
// txtId5
|
||||
//
|
||||
resources.ApplyResources(this.txtId5, "txtId5");
|
||||
this.txtId5.Name = "txtId5";
|
||||
//
|
||||
// label9
|
||||
//
|
||||
resources.ApplyResources(this.label9, "label9");
|
||||
this.label9.Name = "label9";
|
||||
//
|
||||
// label10
|
||||
//
|
||||
resources.ApplyResources(this.label10, "label10");
|
||||
this.label10.Name = "label10";
|
||||
//
|
||||
// btnGUID5
|
||||
//
|
||||
resources.ApplyResources(this.btnGUID5, "btnGUID5");
|
||||
this.btnGUID5.Name = "btnGUID5";
|
||||
this.btnGUID5.UseVisualStyleBackColor = true;
|
||||
this.btnGUID5.Click += new System.EventHandler(this.btnGUID_Click);
|
||||
//
|
||||
// cmbSecurity5
|
||||
//
|
||||
this.cmbSecurity5.DropDownStyle = System.Windows.Forms.ComboBoxStyle.Simple;
|
||||
this.cmbSecurity5.FormattingEnabled = true;
|
||||
this.cmbSecurity5.Items.AddRange(new object[] {
|
||||
resources.GetString("cmbSecurity5.Items")});
|
||||
resources.ApplyResources(this.cmbSecurity5, "cmbSecurity5");
|
||||
this.cmbSecurity5.Name = "cmbSecurity5";
|
||||
//
|
||||
// label11
|
||||
//
|
||||
resources.ApplyResources(this.label11, "label11");
|
||||
this.label11.Name = "label11";
|
||||
//
|
||||
// panVmess
|
||||
//
|
||||
this.panVmess.Controls.Add(this.label3);
|
||||
this.panVmess.Controls.Add(this.txtId);
|
||||
this.panVmess.Controls.Add(this.btnGUID);
|
||||
this.panVmess.Controls.Add(this.label4);
|
||||
this.panVmess.Controls.Add(this.label8);
|
||||
this.panVmess.Controls.Add(this.txtAlterId);
|
||||
this.panVmess.Controls.Add(this.cmbSecurity);
|
||||
this.panVmess.Controls.Add(this.label5);
|
||||
resources.ApplyResources(this.panVmess, "panVmess");
|
||||
this.panVmess.Name = "panVmess";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
resources.ApplyResources(this.label3, "label3");
|
||||
this.label3.Name = "label3";
|
||||
//
|
||||
// txtId
|
||||
//
|
||||
resources.ApplyResources(this.txtId, "txtId");
|
||||
this.txtId.Name = "txtId";
|
||||
//
|
||||
// btnGUID
|
||||
//
|
||||
resources.ApplyResources(this.btnGUID, "btnGUID");
|
||||
|
@ -99,16 +289,21 @@
|
|||
this.btnGUID.UseVisualStyleBackColor = true;
|
||||
this.btnGUID.Click += new System.EventHandler(this.btnGUID_Click);
|
||||
//
|
||||
// label13
|
||||
// label4
|
||||
//
|
||||
resources.ApplyResources(this.label13, "label13");
|
||||
this.label13.Name = "label13";
|
||||
resources.ApplyResources(this.label4, "label4");
|
||||
this.label4.Name = "label4";
|
||||
//
|
||||
// label8
|
||||
//
|
||||
resources.ApplyResources(this.label8, "label8");
|
||||
this.label8.Name = "label8";
|
||||
//
|
||||
// txtAlterId
|
||||
//
|
||||
resources.ApplyResources(this.txtAlterId, "txtAlterId");
|
||||
this.txtAlterId.Name = "txtAlterId";
|
||||
//
|
||||
// cmbSecurity
|
||||
//
|
||||
this.cmbSecurity.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
|
@ -116,67 +311,60 @@
|
|||
resources.ApplyResources(this.cmbSecurity, "cmbSecurity");
|
||||
this.cmbSecurity.Name = "cmbSecurity";
|
||||
//
|
||||
// txtRemarks
|
||||
// label5
|
||||
//
|
||||
resources.ApplyResources(this.txtRemarks, "txtRemarks");
|
||||
this.txtRemarks.Name = "txtRemarks";
|
||||
resources.ApplyResources(this.label5, "label5");
|
||||
this.label5.Name = "label5";
|
||||
//
|
||||
// panAddr
|
||||
//
|
||||
this.panAddr.Controls.Add(this.cmbCoreType);
|
||||
this.panAddr.Controls.Add(this.labCoreType);
|
||||
this.panAddr.Controls.Add(this.label6);
|
||||
this.panAddr.Controls.Add(this.label1);
|
||||
this.panAddr.Controls.Add(this.txtAddress);
|
||||
this.panAddr.Controls.Add(this.label2);
|
||||
this.panAddr.Controls.Add(this.txtPort);
|
||||
this.panAddr.Controls.Add(this.txtRemarks);
|
||||
resources.ApplyResources(this.panAddr, "panAddr");
|
||||
this.panAddr.Name = "panAddr";
|
||||
//
|
||||
// label6
|
||||
//
|
||||
resources.ApplyResources(this.label6, "label6");
|
||||
this.label6.Name = "label6";
|
||||
//
|
||||
// label5
|
||||
// label1
|
||||
//
|
||||
resources.ApplyResources(this.label5, "label5");
|
||||
this.label5.Name = "label5";
|
||||
//
|
||||
// txtAlterId
|
||||
//
|
||||
resources.ApplyResources(this.txtAlterId, "txtAlterId");
|
||||
this.txtAlterId.Name = "txtAlterId";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
resources.ApplyResources(this.label4, "label4");
|
||||
this.label4.Name = "label4";
|
||||
//
|
||||
// txtId
|
||||
//
|
||||
resources.ApplyResources(this.txtId, "txtId");
|
||||
this.txtId.Name = "txtId";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
resources.ApplyResources(this.label3, "label3");
|
||||
this.label3.Name = "label3";
|
||||
//
|
||||
// txtPort
|
||||
//
|
||||
resources.ApplyResources(this.txtPort, "txtPort");
|
||||
this.txtPort.Name = "txtPort";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
resources.ApplyResources(this.label2, "label2");
|
||||
this.label2.Name = "label2";
|
||||
resources.ApplyResources(this.label1, "label1");
|
||||
this.label1.Name = "label1";
|
||||
//
|
||||
// txtAddress
|
||||
//
|
||||
resources.ApplyResources(this.txtAddress, "txtAddress");
|
||||
this.txtAddress.Name = "txtAddress";
|
||||
//
|
||||
// label1
|
||||
// label2
|
||||
//
|
||||
resources.ApplyResources(this.label1, "label1");
|
||||
this.label1.Name = "label1";
|
||||
resources.ApplyResources(this.label2, "label2");
|
||||
this.label2.Name = "label2";
|
||||
//
|
||||
// panel2
|
||||
// txtPort
|
||||
//
|
||||
this.panel2.Controls.Add(this.btnClose);
|
||||
this.panel2.Controls.Add(this.btnOK);
|
||||
resources.ApplyResources(this.panel2, "panel2");
|
||||
this.panel2.Name = "panel2";
|
||||
resources.ApplyResources(this.txtPort, "txtPort");
|
||||
this.txtPort.Name = "txtPort";
|
||||
//
|
||||
// txtRemarks
|
||||
//
|
||||
resources.ApplyResources(this.txtRemarks, "txtRemarks");
|
||||
this.txtRemarks.Name = "txtRemarks";
|
||||
//
|
||||
// panBottom
|
||||
//
|
||||
this.panBottom.Controls.Add(this.btnClose);
|
||||
this.panBottom.Controls.Add(this.btnOK);
|
||||
resources.ApplyResources(this.panBottom, "panBottom");
|
||||
this.panBottom.Name = "panBottom";
|
||||
//
|
||||
// btnOK
|
||||
//
|
||||
|
@ -185,56 +373,16 @@
|
|||
this.btnOK.UseVisualStyleBackColor = true;
|
||||
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
|
||||
//
|
||||
// panel1
|
||||
// panTop
|
||||
//
|
||||
resources.ApplyResources(this.panel1, "panel1");
|
||||
this.panel1.Name = "panel1";
|
||||
resources.ApplyResources(this.panTop, "panTop");
|
||||
this.panTop.Name = "panTop";
|
||||
//
|
||||
// menuServer
|
||||
// panTran
|
||||
//
|
||||
this.menuServer.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.MenuItem1});
|
||||
resources.ApplyResources(this.menuServer, "menuServer");
|
||||
this.menuServer.Name = "menuServer";
|
||||
//
|
||||
// MenuItem1
|
||||
//
|
||||
this.MenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.MenuItemImportClient,
|
||||
this.MenuItemImportServer,
|
||||
this.toolStripSeparator1,
|
||||
this.MenuItemImportClipboard});
|
||||
this.MenuItem1.Name = "MenuItem1";
|
||||
resources.ApplyResources(this.MenuItem1, "MenuItem1");
|
||||
//
|
||||
// MenuItemImportClient
|
||||
//
|
||||
this.MenuItemImportClient.Name = "MenuItemImportClient";
|
||||
resources.ApplyResources(this.MenuItemImportClient, "MenuItemImportClient");
|
||||
this.MenuItemImportClient.Click += new System.EventHandler(this.MenuItemImportClient_Click);
|
||||
//
|
||||
// MenuItemImportServer
|
||||
//
|
||||
this.MenuItemImportServer.Name = "MenuItemImportServer";
|
||||
resources.ApplyResources(this.MenuItemImportServer, "MenuItemImportServer");
|
||||
this.MenuItemImportServer.Click += new System.EventHandler(this.MenuItemImportServer_Click);
|
||||
//
|
||||
// toolStripSeparator1
|
||||
//
|
||||
this.toolStripSeparator1.Name = "toolStripSeparator1";
|
||||
resources.ApplyResources(this.toolStripSeparator1, "toolStripSeparator1");
|
||||
//
|
||||
// MenuItemImportClipboard
|
||||
//
|
||||
this.MenuItemImportClipboard.Name = "MenuItemImportClipboard";
|
||||
resources.ApplyResources(this.MenuItemImportClipboard, "MenuItemImportClipboard");
|
||||
this.MenuItemImportClipboard.Click += new System.EventHandler(this.MenuItemImportClipboard_Click);
|
||||
//
|
||||
// panel3
|
||||
//
|
||||
this.panel3.Controls.Add(this.transportControl);
|
||||
resources.ApplyResources(this.panel3, "panel3");
|
||||
this.panel3.Name = "panel3";
|
||||
this.panTran.Controls.Add(this.transportControl);
|
||||
resources.ApplyResources(this.panTran, "panTran");
|
||||
this.panTran.Name = "panTran";
|
||||
//
|
||||
// transportControl
|
||||
//
|
||||
|
@ -242,27 +390,46 @@
|
|||
resources.ApplyResources(this.transportControl, "transportControl");
|
||||
this.transportControl.Name = "transportControl";
|
||||
//
|
||||
// cmbCoreType
|
||||
//
|
||||
this.cmbCoreType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbCoreType.FormattingEnabled = true;
|
||||
resources.ApplyResources(this.cmbCoreType, "cmbCoreType");
|
||||
this.cmbCoreType.Name = "cmbCoreType";
|
||||
//
|
||||
// labCoreType
|
||||
//
|
||||
resources.ApplyResources(this.labCoreType, "labCoreType");
|
||||
this.labCoreType.Name = "labCoreType";
|
||||
//
|
||||
// AddServerForm
|
||||
//
|
||||
resources.ApplyResources(this, "$this");
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.btnClose;
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.Controls.Add(this.panel3);
|
||||
this.Controls.Add(this.panel2);
|
||||
this.Controls.Add(this.panel1);
|
||||
this.Controls.Add(this.menuServer);
|
||||
this.Controls.Add(this.panTran);
|
||||
this.Controls.Add(this.panBottom);
|
||||
this.Controls.Add(this.panTop);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.Name = "AddServerForm";
|
||||
this.Load += new System.EventHandler(this.AddServerForm_Load);
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
this.panel2.ResumeLayout(false);
|
||||
this.menuServer.ResumeLayout(false);
|
||||
this.menuServer.PerformLayout();
|
||||
this.panel3.ResumeLayout(false);
|
||||
this.panSocks.ResumeLayout(false);
|
||||
this.panSocks.PerformLayout();
|
||||
this.panSs.ResumeLayout(false);
|
||||
this.panSs.PerformLayout();
|
||||
this.panTrojan.ResumeLayout(false);
|
||||
this.panTrojan.PerformLayout();
|
||||
this.panVless.ResumeLayout(false);
|
||||
this.panVless.PerformLayout();
|
||||
this.panVmess.ResumeLayout(false);
|
||||
this.panVmess.PerformLayout();
|
||||
this.panAddr.ResumeLayout(false);
|
||||
this.panAddr.PerformLayout();
|
||||
this.panBottom.ResumeLayout(false);
|
||||
this.panTran.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
|
@ -284,17 +451,38 @@
|
|||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.ComboBox cmbSecurity;
|
||||
private System.Windows.Forms.Label label8;
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private System.Windows.Forms.Panel panel2;
|
||||
private System.Windows.Forms.Label label13;
|
||||
private System.Windows.Forms.MenuStrip menuServer;
|
||||
private System.Windows.Forms.ToolStripMenuItem MenuItem1;
|
||||
private System.Windows.Forms.ToolStripMenuItem MenuItemImportClient;
|
||||
private System.Windows.Forms.ToolStripMenuItem MenuItemImportServer;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
|
||||
private System.Windows.Forms.ToolStripMenuItem MenuItemImportClipboard;
|
||||
private System.Windows.Forms.Panel panTop;
|
||||
private System.Windows.Forms.Panel panBottom;
|
||||
private System.Windows.Forms.Button btnGUID;
|
||||
private System.Windows.Forms.Panel panel3;
|
||||
private System.Windows.Forms.Panel panTran;
|
||||
private ServerTransportControl transportControl;
|
||||
private System.Windows.Forms.Panel panAddr;
|
||||
private System.Windows.Forms.Panel panVmess;
|
||||
private System.Windows.Forms.Panel panVless;
|
||||
private System.Windows.Forms.Label label7;
|
||||
private System.Windows.Forms.ComboBox cmbFlow5;
|
||||
private System.Windows.Forms.TextBox txtId5;
|
||||
private System.Windows.Forms.Label label9;
|
||||
private System.Windows.Forms.Label label10;
|
||||
private System.Windows.Forms.Button btnGUID5;
|
||||
private System.Windows.Forms.ComboBox cmbSecurity5;
|
||||
private System.Windows.Forms.Label label11;
|
||||
private System.Windows.Forms.Panel panTrojan;
|
||||
private System.Windows.Forms.Label label12;
|
||||
private System.Windows.Forms.ComboBox cmbFlow6;
|
||||
private System.Windows.Forms.TextBox txtId6;
|
||||
private System.Windows.Forms.Label label14;
|
||||
private System.Windows.Forms.Panel panSs;
|
||||
private System.Windows.Forms.TextBox txtId3;
|
||||
private System.Windows.Forms.Label label15;
|
||||
private System.Windows.Forms.ComboBox cmbSecurity3;
|
||||
private System.Windows.Forms.Label label16;
|
||||
private System.Windows.Forms.Panel panSocks;
|
||||
private System.Windows.Forms.Label label17;
|
||||
private System.Windows.Forms.TextBox txtSecurity4;
|
||||
private System.Windows.Forms.Label label18;
|
||||
private System.Windows.Forms.TextBox txtId4;
|
||||
private System.Windows.Forms.ComboBox cmbCoreType;
|
||||
private System.Windows.Forms.Label labCoreType;
|
||||
}
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using v2rayN.Handler;
|
||||
using v2rayN.Mode;
|
||||
|
@ -7,7 +8,6 @@ namespace v2rayN.Forms
|
|||
{
|
||||
public partial class AddServerForm : BaseServerForm
|
||||
{
|
||||
|
||||
public AddServerForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
@ -15,8 +15,46 @@ namespace v2rayN.Forms
|
|||
|
||||
private void AddServerForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.Text = ((EConfigType)eConfigType).ToString();
|
||||
|
||||
cmbSecurity.Items.AddRange(Global.vmessSecuritys.ToArray());
|
||||
//FillCoreType(cmbCoreType);
|
||||
cmbSecurity3.Items.AddRange(config.GetShadowsocksSecuritys().ToArray());
|
||||
|
||||
cmbFlow5.Items.AddRange(Global.xtlsFlows.ToArray());
|
||||
cmbFlow6.Items.AddRange(Global.xtlsFlows.ToArray());
|
||||
|
||||
cmbCoreType.Items.AddRange(Global.coreTypes.ToArray());
|
||||
cmbCoreType.Items.Add(string.Empty);
|
||||
|
||||
switch (eConfigType)
|
||||
{
|
||||
case EConfigType.Vmess:
|
||||
panVmess.Dock = DockStyle.Fill;
|
||||
panVmess.Visible = true;
|
||||
break;
|
||||
case EConfigType.Shadowsocks:
|
||||
panSs.Dock = DockStyle.Fill;
|
||||
panSs.Visible = true;
|
||||
panTran.Visible = false;
|
||||
this.Height = this.Height - panTran.Height;
|
||||
break;
|
||||
case EConfigType.Socks:
|
||||
panSocks.Dock = DockStyle.Fill;
|
||||
panSocks.Visible = true;
|
||||
panTran.Visible = false;
|
||||
this.Height = this.Height - panTran.Height;
|
||||
break;
|
||||
case EConfigType.VLESS:
|
||||
panVless.Dock = DockStyle.Fill;
|
||||
panVless.Visible = true;
|
||||
transportControl.AllowXtls = true;
|
||||
break;
|
||||
case EConfigType.Trojan:
|
||||
panTrojan.Dock = DockStyle.Fill;
|
||||
panTrojan.Visible = true;
|
||||
transportControl.AllowXtls = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (vmessItem != null)
|
||||
{
|
||||
|
@ -35,41 +73,122 @@ namespace v2rayN.Forms
|
|||
/// </summary>
|
||||
private void BindingServer()
|
||||
{
|
||||
txtRemarks.Text = vmessItem.remarks;
|
||||
txtAddress.Text = vmessItem.address;
|
||||
txtPort.Text = vmessItem.port.ToString();
|
||||
txtId.Text = vmessItem.id;
|
||||
txtAlterId.Text = vmessItem.alterId.ToString();
|
||||
cmbSecurity.Text = vmessItem.security;
|
||||
txtRemarks.Text = vmessItem.remarks;
|
||||
// BindingCoreType(cmbCoreType, vmessItem);
|
||||
|
||||
switch (eConfigType)
|
||||
{
|
||||
case EConfigType.Vmess:
|
||||
txtId.Text = vmessItem.id;
|
||||
txtAlterId.Text = vmessItem.alterId.ToString();
|
||||
cmbSecurity.Text = vmessItem.security;
|
||||
break;
|
||||
case EConfigType.Shadowsocks:
|
||||
txtId3.Text = vmessItem.id;
|
||||
cmbSecurity3.Text = vmessItem.security;
|
||||
break;
|
||||
case EConfigType.Socks:
|
||||
txtId4.Text = vmessItem.id;
|
||||
txtSecurity4.Text = vmessItem.security;
|
||||
break;
|
||||
case EConfigType.VLESS:
|
||||
txtId5.Text = vmessItem.id;
|
||||
cmbFlow5.Text = vmessItem.flow;
|
||||
cmbSecurity5.Text = vmessItem.security;
|
||||
break;
|
||||
case EConfigType.Trojan:
|
||||
txtId6.Text = vmessItem.id;
|
||||
cmbFlow6.Text = vmessItem.flow;
|
||||
break;
|
||||
}
|
||||
|
||||
if (vmessItem.coreType == null)
|
||||
{
|
||||
cmbCoreType.Text = string.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
cmbCoreType.Text = vmessItem.coreType.ToString();
|
||||
}
|
||||
|
||||
transportControl.BindingServer(vmessItem);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 清除设置
|
||||
/// </summary>
|
||||
private void ClearServer()
|
||||
{
|
||||
txtRemarks.Text = "";
|
||||
txtAddress.Text = "";
|
||||
txtPort.Text = "";
|
||||
txtId.Text = "";
|
||||
txtAlterId.Text = "0";
|
||||
cmbSecurity.Text = Global.DefaultSecurity;
|
||||
txtRemarks.Text = "";
|
||||
|
||||
switch (eConfigType)
|
||||
{
|
||||
case EConfigType.Vmess:
|
||||
txtId.Text = "";
|
||||
txtAlterId.Text = "0";
|
||||
cmbSecurity.Text = Global.DefaultSecurity;
|
||||
break;
|
||||
case EConfigType.Shadowsocks:
|
||||
txtId3.Text = "";
|
||||
cmbSecurity3.Text = Global.DefaultSecurity;
|
||||
break;
|
||||
case EConfigType.Socks:
|
||||
txtId4.Text = "";
|
||||
txtSecurity4.Text = "";
|
||||
break;
|
||||
case EConfigType.VLESS:
|
||||
txtId5.Text = "";
|
||||
cmbFlow5.Text = "";
|
||||
cmbSecurity5.Text = Global.None;
|
||||
break;
|
||||
case EConfigType.Trojan:
|
||||
txtId6.Text = "";
|
||||
cmbFlow6.Text = "";
|
||||
break;
|
||||
}
|
||||
|
||||
transportControl.ClearServer(vmessItem);
|
||||
}
|
||||
|
||||
private void btnOK_Click(object sender, EventArgs e)
|
||||
{
|
||||
string remarks = txtRemarks.Text;
|
||||
string address = txtAddress.Text;
|
||||
string port = txtPort.Text;
|
||||
string id = txtId.Text;
|
||||
string alterId = txtAlterId.Text;
|
||||
string security = cmbSecurity.Text;
|
||||
string remarks = txtRemarks.Text;
|
||||
|
||||
string id = string.Empty;
|
||||
string alterId = string.Empty;
|
||||
string security = string.Empty;
|
||||
string flow = string.Empty;
|
||||
|
||||
switch (eConfigType)
|
||||
{
|
||||
case EConfigType.Vmess:
|
||||
id = txtId.Text;
|
||||
alterId = txtAlterId.Text;
|
||||
security = cmbSecurity.Text;
|
||||
break;
|
||||
case EConfigType.Shadowsocks:
|
||||
id = txtId3.Text;
|
||||
security = cmbSecurity3.Text;
|
||||
break;
|
||||
case EConfigType.Socks:
|
||||
id = txtId4.Text;
|
||||
security = txtSecurity4.Text;
|
||||
break;
|
||||
case EConfigType.VLESS:
|
||||
id = txtId5.Text;
|
||||
flow = cmbFlow5.Text;
|
||||
security = cmbSecurity5.Text;
|
||||
break;
|
||||
case EConfigType.Trojan:
|
||||
id = txtId6.Text;
|
||||
flow = cmbFlow6.Text;
|
||||
break;
|
||||
}
|
||||
|
||||
if (Utils.IsNullOrEmpty(address))
|
||||
{
|
||||
|
@ -81,23 +200,69 @@ namespace v2rayN.Forms
|
|||
UI.Show(UIRes.I18N("FillCorrectServerPort"));
|
||||
return;
|
||||
}
|
||||
if (Utils.IsNullOrEmpty(id))
|
||||
if (eConfigType == EConfigType.Shadowsocks)
|
||||
{
|
||||
UI.Show(UIRes.I18N("FillUUID"));
|
||||
return;
|
||||
if (Utils.IsNullOrEmpty(id))
|
||||
{
|
||||
UI.Show(UIRes.I18N("FillPassword"));
|
||||
return;
|
||||
}
|
||||
if (Utils.IsNullOrEmpty(security))
|
||||
{
|
||||
UI.Show(UIRes.I18N("PleaseSelectEncryption"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (eConfigType != EConfigType.Socks)
|
||||
{
|
||||
if (Utils.IsNullOrEmpty(id))
|
||||
{
|
||||
UI.Show(UIRes.I18N("FillUUID"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
transportControl.EndBindingServer();
|
||||
|
||||
vmessItem.remarks = remarks;
|
||||
vmessItem.address = address;
|
||||
vmessItem.port = Utils.ToInt(port);
|
||||
vmessItem.id = id;
|
||||
vmessItem.alterId = Utils.ToInt(alterId);
|
||||
vmessItem.security = security;
|
||||
vmessItem.remarks = remarks;
|
||||
//vmessItem.coreType = GetCoreType(cmbCoreType);
|
||||
|
||||
if (ConfigHandler.AddServer(ref config, vmessItem) == 0)
|
||||
if (Utils.IsNullOrEmpty(cmbCoreType.Text))
|
||||
{
|
||||
vmessItem.coreType = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
vmessItem.coreType = (ECoreType)Enum.Parse(typeof(ECoreType), cmbCoreType.Text);
|
||||
}
|
||||
|
||||
int ret = -1;
|
||||
switch (eConfigType)
|
||||
{
|
||||
case EConfigType.Vmess:
|
||||
ret = ConfigHandler.AddServer(ref config, vmessItem);
|
||||
break;
|
||||
case EConfigType.Shadowsocks:
|
||||
ret = ConfigHandler.AddShadowsocksServer(ref config, vmessItem);
|
||||
break;
|
||||
case EConfigType.Socks:
|
||||
ret = ConfigHandler.AddSocksServer(ref config, vmessItem);
|
||||
break;
|
||||
case EConfigType.VLESS:
|
||||
vmessItem.flow = flow;
|
||||
ret = ConfigHandler.AddVlessServer(ref config, vmessItem);
|
||||
break;
|
||||
case EConfigType.Trojan:
|
||||
vmessItem.flow = flow;
|
||||
ret = ConfigHandler.AddTrojanServer(ref config, vmessItem);
|
||||
break;
|
||||
}
|
||||
|
||||
if (ret == 0)
|
||||
{
|
||||
this.DialogResult = DialogResult.OK;
|
||||
}
|
||||
|
@ -105,110 +270,18 @@ namespace v2rayN.Forms
|
|||
{
|
||||
UI.ShowWarning(UIRes.I18N("OperationFailed"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void btnGUID_Click(object sender, EventArgs e)
|
||||
{
|
||||
txtId.Text = Utils.GetGUID();
|
||||
txtId.Text =
|
||||
txtId5.Text = Utils.GetGUID();
|
||||
}
|
||||
|
||||
private void btnClose_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.DialogResult = DialogResult.Cancel;
|
||||
}
|
||||
|
||||
#region 导入客户端/服务端配置
|
||||
|
||||
/// <summary>
|
||||
/// 导入客户端
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void MenuItemImportClient_Click(object sender, EventArgs e)
|
||||
{
|
||||
MenuItemImport(1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 导入服务端
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void MenuItemImportServer_Click(object sender, EventArgs e)
|
||||
{
|
||||
MenuItemImport(2);
|
||||
}
|
||||
|
||||
private void MenuItemImport(int type)
|
||||
{
|
||||
ClearServer();
|
||||
|
||||
OpenFileDialog fileDialog = new OpenFileDialog
|
||||
{
|
||||
Multiselect = false,
|
||||
Filter = "Config|*.json|All|*.*"
|
||||
};
|
||||
if (fileDialog.ShowDialog() != DialogResult.OK)
|
||||
{
|
||||
return;
|
||||
}
|
||||
string fileName = fileDialog.FileName;
|
||||
if (Utils.IsNullOrEmpty(fileName))
|
||||
{
|
||||
return;
|
||||
}
|
||||
string msg;
|
||||
VmessItem vmessItemTemp;
|
||||
if (type.Equals(1))
|
||||
{
|
||||
vmessItemTemp = V2rayConfigHandler.ImportFromClientConfig(fileName, out msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
vmessItemTemp = V2rayConfigHandler.ImportFromServerConfig(fileName, out msg);
|
||||
}
|
||||
if (vmessItemTemp == null)
|
||||
{
|
||||
UI.ShowWarning(msg);
|
||||
return;
|
||||
}
|
||||
vmessItem = vmessItemTemp;
|
||||
|
||||
txtAddress.Text = vmessItem.address;
|
||||
txtPort.Text = vmessItem.port.ToString();
|
||||
txtId.Text = vmessItem.id;
|
||||
txtAlterId.Text = vmessItem.alterId.ToString();
|
||||
txtRemarks.Text = vmessItem.remarks;
|
||||
|
||||
transportControl.BindingServer(vmessItem);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 从剪贴板导入URL
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void MenuItemImportClipboard_Click(object sender, EventArgs e)
|
||||
{
|
||||
ClearServer();
|
||||
|
||||
VmessItem vmessItemTemp = ShareHandler.ImportFromClipboardConfig(Utils.GetClipboardData(), out string msg);
|
||||
if (vmessItemTemp == null)
|
||||
{
|
||||
UI.ShowWarning(msg);
|
||||
return;
|
||||
}
|
||||
vmessItem = vmessItemTemp;
|
||||
|
||||
txtAddress.Text = vmessItem.address;
|
||||
txtPort.Text = vmessItem.port.ToString();
|
||||
txtId.Text = vmessItem.id;
|
||||
txtAlterId.Text = vmessItem.alterId.ToString();
|
||||
txtRemarks.Text = vmessItem.remarks;
|
||||
|
||||
transportControl.BindingServer(vmessItem);
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -120,93 +120,109 @@
|
|||
<data name="btnClose.Text" xml:space="preserve">
|
||||
<value>取消(&C)</value>
|
||||
</data>
|
||||
<data name="groupBox1.Text" xml:space="preserve">
|
||||
<value>服务器</value>
|
||||
</data>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="panel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<value>None</value>
|
||||
</data>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="panel1.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>270, 156</value>
|
||||
</data>
|
||||
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>115, 61</value>
|
||||
</data>
|
||||
<data name="label17.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>77, 12</value>
|
||||
</data>
|
||||
<data name="label17.Text" xml:space="preserve">
|
||||
<value>用户名(可选)</value>
|
||||
</data>
|
||||
<data name="label18.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>65, 12</value>
|
||||
</data>
|
||||
<data name="label18.Text" xml:space="preserve">
|
||||
<value>密码(可选)</value>
|
||||
</data>
|
||||
<data name="panel3.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<value>None</value>
|
||||
</data>
|
||||
<data name="panel3.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>142, 147</value>
|
||||
</data>
|
||||
<data name="panel3.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>137, 78</value>
|
||||
</data>
|
||||
<data name="label15.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>89, 12</value>
|
||||
</data>
|
||||
<data name="label15.Text" xml:space="preserve">
|
||||
<value>密码(password)</value>
|
||||
</data>
|
||||
<data name="label16.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>125, 12</value>
|
||||
</data>
|
||||
<data name="label16.Text" xml:space="preserve">
|
||||
<value>加密方式(encryption)</value>
|
||||
</data>
|
||||
<data name="label12.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>89, 12</value>
|
||||
</data>
|
||||
<data name="label12.Text" xml:space="preserve">
|
||||
<value>密码(password)</value>
|
||||
</data>
|
||||
<data name="label14.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>65, 12</value>
|
||||
</data>
|
||||
<data name="label14.Text" xml:space="preserve">
|
||||
<value>流控(flow)</value>
|
||||
</data>
|
||||
<data name="panVless.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>110, 52</value>
|
||||
</data>
|
||||
<data name="label7.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>65, 12</value>
|
||||
</data>
|
||||
<data name="label7.Text" xml:space="preserve">
|
||||
<value>用户ID(id)</value>
|
||||
</data>
|
||||
<data name="label9.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>65, 12</value>
|
||||
</data>
|
||||
<data name="label9.Text" xml:space="preserve">
|
||||
<value>流控(flow)</value>
|
||||
</data>
|
||||
<data name="label10.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>101, 12</value>
|
||||
</data>
|
||||
<data name="label10.Text" xml:space="preserve">
|
||||
<value>加密(encryption)</value>
|
||||
</data>
|
||||
<data name="button1.Text" xml:space="preserve">
|
||||
<value>生成</value>
|
||||
</data>
|
||||
<data name="label11.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>71, 12</value>
|
||||
</data>
|
||||
<data name="label11.Text" xml:space="preserve">
|
||||
<value>*非空(none)</value>
|
||||
</data>
|
||||
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>65, 12</value>
|
||||
</data>
|
||||
<data name="label3.Text" xml:space="preserve">
|
||||
<value>用户ID(id)</value>
|
||||
</data>
|
||||
<data name="btnGUID.Text" xml:space="preserve">
|
||||
<value>生成(&G)</value>
|
||||
</data>
|
||||
<data name="label13.Text" xml:space="preserve">
|
||||
<value>*手填,方便识别管理</value>
|
||||
</data>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="label24.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>149, 12</value>
|
||||
</data>
|
||||
<data name="label23.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<data name="label4.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>95, 12</value>
|
||||
</data>
|
||||
<data name="label21.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>167, 12</value>
|
||||
</data>
|
||||
<data name="cmbAllowInsecure.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>180, 7</value>
|
||||
</data>
|
||||
<data name="label9.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>350, 36</value>
|
||||
</data>
|
||||
<data name="label9.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>143, 12</value>
|
||||
</data>
|
||||
<data name="label20.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>149, 12</value>
|
||||
</data>
|
||||
<data name="txtPath.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>127, 168</value>
|
||||
</data>
|
||||
<data name="cmbNetwork.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>127, 32</value>
|
||||
</data>
|
||||
<data name="cmbNetwork.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>211, 20</value>
|
||||
</data>
|
||||
<data name="label7.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>9, 36</value>
|
||||
</data>
|
||||
<data name="label7.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>107, 12</value>
|
||||
</data>
|
||||
<data name="label19.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>9, 168</value>
|
||||
</data>
|
||||
<data name="label19.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>65, 12</value>
|
||||
</data>
|
||||
<data name="label14.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>161, 12</value>
|
||||
</data>
|
||||
<data name="label15.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>9, 237</value>
|
||||
</data>
|
||||
<data name="label15.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>107, 12</value>
|
||||
</data>
|
||||
<data name="cmbStreamSecurity.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>127, 237</value>
|
||||
</data>
|
||||
<data name="label12.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>282, 71</value>
|
||||
</data>
|
||||
<data name="label12.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>197, 12</value>
|
||||
</data>
|
||||
<data name="txtRequestHost.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>127, 102</value>
|
||||
</data>
|
||||
<data name="txtRequestHost.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>334, 51</value>
|
||||
</data>
|
||||
<data name="label11.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>9, 71</value>
|
||||
</data>
|
||||
<data name="label11.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>89, 12</value>
|
||||
</data>
|
||||
<data name="label10.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>9, 102</value>
|
||||
</data>
|
||||
<data name="label10.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>89, 12</value>
|
||||
</data>
|
||||
<data name="cmbHeaderType.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>127, 67</value>
|
||||
<data name="label4.Text" xml:space="preserve">
|
||||
<value>额外ID(alterId)</value>
|
||||
</data>
|
||||
<data name="label8.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>113, 12</value>
|
||||
|
@ -215,40 +231,22 @@
|
|||
<value>*随便选,建议(auto)</value>
|
||||
</data>
|
||||
<data name="cmbSecurity.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>127, 143</value>
|
||||
<value>126, 65</value>
|
||||
</data>
|
||||
<data name="cmbSecurity.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>211, 20</value>
|
||||
</data>
|
||||
<data name="label6.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>83, 12</value>
|
||||
</data>
|
||||
<data name="label6.Text" xml:space="preserve">
|
||||
<value>别名(remarks)</value>
|
||||
</data>
|
||||
<data name="label5.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>113, 12</value>
|
||||
</data>
|
||||
<data name="label5.Text" xml:space="preserve">
|
||||
<value>加密方式(security)</value>
|
||||
</data>
|
||||
<data name="label4.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>95, 12</value>
|
||||
<data name="label6.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>83, 12</value>
|
||||
</data>
|
||||
<data name="label4.Text" xml:space="preserve">
|
||||
<value>额外ID(alterId)</value>
|
||||
</data>
|
||||
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>65, 12</value>
|
||||
</data>
|
||||
<data name="label3.Text" xml:space="preserve">
|
||||
<value>用户ID(id)</value>
|
||||
</data>
|
||||
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>65, 12</value>
|
||||
</data>
|
||||
<data name="label2.Text" xml:space="preserve">
|
||||
<value>端口(port)</value>
|
||||
<data name="label6.Text" xml:space="preserve">
|
||||
<value>别名(remarks)</value>
|
||||
</data>
|
||||
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>83, 12</value>
|
||||
|
@ -256,40 +254,22 @@
|
|||
<data name="label1.Text" xml:space="preserve">
|
||||
<value>地址(address)</value>
|
||||
</data>
|
||||
<data name="groupBox1.Text" xml:space="preserve">
|
||||
<value>服务器</value>
|
||||
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>65, 12</value>
|
||||
</data>
|
||||
<data name="label2.Text" xml:space="preserve">
|
||||
<value>端口(port)</value>
|
||||
</data>
|
||||
<data name="btnOK.Text" xml:space="preserve">
|
||||
<value>确定(&O)</value>
|
||||
</data>
|
||||
<data name="MenuItemImportClient.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>171, 22</value>
|
||||
</data>
|
||||
<data name="MenuItemImportClient.Text" xml:space="preserve">
|
||||
<value>导入客户端配置</value>
|
||||
</data>
|
||||
<data name="MenuItemImportServer.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>171, 22</value>
|
||||
</data>
|
||||
<data name="MenuItemImportServer.Text" xml:space="preserve">
|
||||
<value>导入服务端配置</value>
|
||||
</data>
|
||||
<data name="toolStripSeparator1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>168, 6</value>
|
||||
</data>
|
||||
<data name="MenuItemImportClipboard.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>171, 22</value>
|
||||
</data>
|
||||
<data name="MenuItemImportClipboard.Text" xml:space="preserve">
|
||||
<value>从剪贴板导入URL</value>
|
||||
</data>
|
||||
<data name="MenuItem1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>92, 21</value>
|
||||
</data>
|
||||
<data name="MenuItem1.Text" xml:space="preserve">
|
||||
<value>导入配置文件</value>
|
||||
</data>
|
||||
<data name="$this.Text" xml:space="preserve">
|
||||
<value>编辑或添加[VMess]服务器</value>
|
||||
</data>
|
||||
<data name="btnGUID5.Text" xml:space="preserve">
|
||||
<value>生成</value>
|
||||
</data>
|
||||
<data name="labCoreType.Text" xml:space="preserve">
|
||||
<value>Core类型</value>
|
||||
</data>
|
||||
</root>
|
|
@ -8,11 +8,12 @@ namespace v2rayN.Forms
|
|||
{
|
||||
public VmessItem vmessItem = null;
|
||||
public string groupId;
|
||||
public EConfigType eConfigType;
|
||||
|
||||
public BaseServerForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -496,7 +496,7 @@ namespace v2rayN.Forms
|
|||
groupId = string.Empty;
|
||||
//groupId = tabGroup.TabPages[tabGroup.SelectedIndex].Name;
|
||||
groupId = tabGroup.SelectedTab.Name;
|
||||
|
||||
|
||||
RefreshServers();
|
||||
|
||||
lvServers.Focus();
|
||||
|
@ -579,29 +579,17 @@ namespace v2rayN.Forms
|
|||
private void ShowServerForm(int configType, int index)
|
||||
{
|
||||
BaseServerForm fm;
|
||||
switch (configType)
|
||||
if (configType == (int)EConfigType.Custom)
|
||||
{
|
||||
case (int)EConfigType.Vmess:
|
||||
fm = new AddServerForm();
|
||||
break;
|
||||
case (int)EConfigType.Shadowsocks:
|
||||
fm = new AddServer3Form();
|
||||
break;
|
||||
case (int)EConfigType.Socks:
|
||||
fm = new AddServer4Form();
|
||||
break;
|
||||
case (int)EConfigType.VLESS:
|
||||
fm = new AddServer5Form();
|
||||
break;
|
||||
case (int)EConfigType.Trojan:
|
||||
fm = new AddServer6Form();
|
||||
break;
|
||||
default:
|
||||
fm = new AddServer2Form();
|
||||
break;
|
||||
fm = new AddServer2Form();
|
||||
}
|
||||
else
|
||||
{
|
||||
fm = new AddServerForm();
|
||||
}
|
||||
fm.vmessItem = index >= 0 ? lstVmess[index] : null;
|
||||
fm.groupId = groupId;
|
||||
fm.eConfigType = (EConfigType)configType;
|
||||
if (fm.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
RefreshServers();
|
||||
|
@ -714,7 +702,7 @@ namespace v2rayN.Forms
|
|||
{
|
||||
return;
|
||||
}
|
||||
if (ConfigHandler.CopyServer(ref config, lstVmess[index]) == 0)
|
||||
if (ConfigHandler.CopyServer(ref config, lstSelecteds) == 0)
|
||||
{
|
||||
RefreshServers();
|
||||
}
|
||||
|
|
|
@ -75,14 +75,25 @@
|
|||
this.txtautoUpdateInterval = new System.Windows.Forms.TextBox();
|
||||
this.label15 = new System.Windows.Forms.Label();
|
||||
this.chkIgnoreGeoUpdateCore = new System.Windows.Forms.CheckBox();
|
||||
this.cmbCoreType = new System.Windows.Forms.ComboBox();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.chkKeepOlderDedupl = new System.Windows.Forms.CheckBox();
|
||||
this.cbFreshrate = new System.Windows.Forms.ComboBox();
|
||||
this.lbFreshrate = new System.Windows.Forms.Label();
|
||||
this.chkEnableStatistics = new System.Windows.Forms.CheckBox();
|
||||
this.chkAllowLANConn = new System.Windows.Forms.CheckBox();
|
||||
this.chkAutoRun = new System.Windows.Forms.CheckBox();
|
||||
this.tabPageCoreType = new System.Windows.Forms.TabPage();
|
||||
this.cmbCoreType6 = new System.Windows.Forms.ComboBox();
|
||||
this.labCoreType6 = new System.Windows.Forms.Label();
|
||||
this.cmbCoreType5 = new System.Windows.Forms.ComboBox();
|
||||
this.labCoreType5 = new System.Windows.Forms.Label();
|
||||
this.cmbCoreType4 = new System.Windows.Forms.ComboBox();
|
||||
this.labCoreType4 = new System.Windows.Forms.Label();
|
||||
this.cmbCoreType3 = new System.Windows.Forms.ComboBox();
|
||||
this.labCoreType3 = new System.Windows.Forms.Label();
|
||||
this.cmbCoreType2 = new System.Windows.Forms.ComboBox();
|
||||
this.labCoreType2 = new System.Windows.Forms.Label();
|
||||
this.cmbCoreType1 = new System.Windows.Forms.ComboBox();
|
||||
this.labCoreType1 = new System.Windows.Forms.Label();
|
||||
this.tabPage3 = new System.Windows.Forms.TabPage();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.label13 = new System.Windows.Forms.Label();
|
||||
|
@ -97,6 +108,7 @@
|
|||
this.tabPage2.SuspendLayout();
|
||||
this.tabPage6.SuspendLayout();
|
||||
this.tabPage7.SuspendLayout();
|
||||
this.tabPageCoreType.SuspendLayout();
|
||||
this.tabPage3.SuspendLayout();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.panel2.SuspendLayout();
|
||||
|
@ -116,6 +128,7 @@
|
|||
this.tabControl1.Controls.Add(this.tabPage2);
|
||||
this.tabControl1.Controls.Add(this.tabPage6);
|
||||
this.tabControl1.Controls.Add(this.tabPage7);
|
||||
this.tabControl1.Controls.Add(this.tabPageCoreType);
|
||||
this.tabControl1.Controls.Add(this.tabPage3);
|
||||
resources.ApplyResources(this.tabControl1, "tabControl1");
|
||||
this.tabControl1.Name = "tabControl1";
|
||||
|
@ -382,8 +395,6 @@
|
|||
this.tabPage7.Controls.Add(this.txtautoUpdateInterval);
|
||||
this.tabPage7.Controls.Add(this.label15);
|
||||
this.tabPage7.Controls.Add(this.chkIgnoreGeoUpdateCore);
|
||||
this.tabPage7.Controls.Add(this.cmbCoreType);
|
||||
this.tabPage7.Controls.Add(this.label4);
|
||||
this.tabPage7.Controls.Add(this.chkKeepOlderDedupl);
|
||||
this.tabPage7.Controls.Add(this.cbFreshrate);
|
||||
this.tabPage7.Controls.Add(this.lbFreshrate);
|
||||
|
@ -429,18 +440,6 @@
|
|||
this.chkIgnoreGeoUpdateCore.Name = "chkIgnoreGeoUpdateCore";
|
||||
this.chkIgnoreGeoUpdateCore.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// cmbCoreType
|
||||
//
|
||||
this.cmbCoreType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbCoreType.FormattingEnabled = true;
|
||||
resources.ApplyResources(this.cmbCoreType, "cmbCoreType");
|
||||
this.cmbCoreType.Name = "cmbCoreType";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
resources.ApplyResources(this.label4, "label4");
|
||||
this.label4.Name = "label4";
|
||||
//
|
||||
// chkKeepOlderDedupl
|
||||
//
|
||||
resources.ApplyResources(this.chkKeepOlderDedupl, "chkKeepOlderDedupl");
|
||||
|
@ -477,6 +476,96 @@
|
|||
this.chkAutoRun.Name = "chkAutoRun";
|
||||
this.chkAutoRun.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// tabPageCoreType
|
||||
//
|
||||
this.tabPageCoreType.Controls.Add(this.cmbCoreType6);
|
||||
this.tabPageCoreType.Controls.Add(this.labCoreType6);
|
||||
this.tabPageCoreType.Controls.Add(this.cmbCoreType5);
|
||||
this.tabPageCoreType.Controls.Add(this.labCoreType5);
|
||||
this.tabPageCoreType.Controls.Add(this.cmbCoreType4);
|
||||
this.tabPageCoreType.Controls.Add(this.labCoreType4);
|
||||
this.tabPageCoreType.Controls.Add(this.cmbCoreType3);
|
||||
this.tabPageCoreType.Controls.Add(this.labCoreType3);
|
||||
this.tabPageCoreType.Controls.Add(this.cmbCoreType2);
|
||||
this.tabPageCoreType.Controls.Add(this.labCoreType2);
|
||||
this.tabPageCoreType.Controls.Add(this.cmbCoreType1);
|
||||
this.tabPageCoreType.Controls.Add(this.labCoreType1);
|
||||
resources.ApplyResources(this.tabPageCoreType, "tabPageCoreType");
|
||||
this.tabPageCoreType.Name = "tabPageCoreType";
|
||||
this.tabPageCoreType.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// cmbCoreType6
|
||||
//
|
||||
this.cmbCoreType6.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbCoreType6.FormattingEnabled = true;
|
||||
resources.ApplyResources(this.cmbCoreType6, "cmbCoreType6");
|
||||
this.cmbCoreType6.Name = "cmbCoreType6";
|
||||
//
|
||||
// labCoreType6
|
||||
//
|
||||
resources.ApplyResources(this.labCoreType6, "labCoreType6");
|
||||
this.labCoreType6.Name = "labCoreType6";
|
||||
//
|
||||
// cmbCoreType5
|
||||
//
|
||||
this.cmbCoreType5.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbCoreType5.FormattingEnabled = true;
|
||||
resources.ApplyResources(this.cmbCoreType5, "cmbCoreType5");
|
||||
this.cmbCoreType5.Name = "cmbCoreType5";
|
||||
//
|
||||
// labCoreType5
|
||||
//
|
||||
resources.ApplyResources(this.labCoreType5, "labCoreType5");
|
||||
this.labCoreType5.Name = "labCoreType5";
|
||||
//
|
||||
// cmbCoreType4
|
||||
//
|
||||
this.cmbCoreType4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbCoreType4.FormattingEnabled = true;
|
||||
resources.ApplyResources(this.cmbCoreType4, "cmbCoreType4");
|
||||
this.cmbCoreType4.Name = "cmbCoreType4";
|
||||
//
|
||||
// labCoreType4
|
||||
//
|
||||
resources.ApplyResources(this.labCoreType4, "labCoreType4");
|
||||
this.labCoreType4.Name = "labCoreType4";
|
||||
//
|
||||
// cmbCoreType3
|
||||
//
|
||||
this.cmbCoreType3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbCoreType3.FormattingEnabled = true;
|
||||
resources.ApplyResources(this.cmbCoreType3, "cmbCoreType3");
|
||||
this.cmbCoreType3.Name = "cmbCoreType3";
|
||||
//
|
||||
// labCoreType3
|
||||
//
|
||||
resources.ApplyResources(this.labCoreType3, "labCoreType3");
|
||||
this.labCoreType3.Name = "labCoreType3";
|
||||
//
|
||||
// cmbCoreType2
|
||||
//
|
||||
this.cmbCoreType2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbCoreType2.FormattingEnabled = true;
|
||||
resources.ApplyResources(this.cmbCoreType2, "cmbCoreType2");
|
||||
this.cmbCoreType2.Name = "cmbCoreType2";
|
||||
//
|
||||
// labCoreType2
|
||||
//
|
||||
resources.ApplyResources(this.labCoreType2, "labCoreType2");
|
||||
this.labCoreType2.Name = "labCoreType2";
|
||||
//
|
||||
// cmbCoreType1
|
||||
//
|
||||
this.cmbCoreType1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbCoreType1.FormattingEnabled = true;
|
||||
resources.ApplyResources(this.cmbCoreType1, "cmbCoreType1");
|
||||
this.cmbCoreType1.Name = "cmbCoreType1";
|
||||
//
|
||||
// labCoreType1
|
||||
//
|
||||
resources.ApplyResources(this.labCoreType1, "labCoreType1");
|
||||
this.labCoreType1.Name = "labCoreType1";
|
||||
//
|
||||
// tabPage3
|
||||
//
|
||||
this.tabPage3.Controls.Add(this.groupBox2);
|
||||
|
@ -548,6 +637,8 @@
|
|||
this.tabPage6.PerformLayout();
|
||||
this.tabPage7.ResumeLayout(false);
|
||||
this.tabPage7.PerformLayout();
|
||||
this.tabPageCoreType.ResumeLayout(false);
|
||||
this.tabPageCoreType.PerformLayout();
|
||||
this.tabPage3.ResumeLayout(false);
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
this.groupBox2.PerformLayout();
|
||||
|
@ -607,8 +698,6 @@
|
|||
private System.Windows.Forms.LinkLabel linkDnsObjectDoc;
|
||||
private System.Windows.Forms.TextBox txtremoteDNS;
|
||||
private System.Windows.Forms.Label label14;
|
||||
private System.Windows.Forms.ComboBox cmbCoreType;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.CheckBox chkIgnoreGeoUpdateCore;
|
||||
private System.Windows.Forms.TabPage tabPage3;
|
||||
private System.Windows.Forms.TextBox txtsystemProxyExceptions;
|
||||
|
@ -620,5 +709,18 @@
|
|||
private System.Windows.Forms.Button btnSetLoopback;
|
||||
private System.Windows.Forms.CheckBox chkEnableAutoAdjustMainLvColWidth;
|
||||
private System.Windows.Forms.CheckBox chkEnableSecurityProtocolTls13;
|
||||
private System.Windows.Forms.TabPage tabPageCoreType;
|
||||
private System.Windows.Forms.ComboBox cmbCoreType1;
|
||||
private System.Windows.Forms.Label labCoreType1;
|
||||
private System.Windows.Forms.ComboBox cmbCoreType6;
|
||||
private System.Windows.Forms.Label labCoreType6;
|
||||
private System.Windows.Forms.ComboBox cmbCoreType5;
|
||||
private System.Windows.Forms.Label labCoreType5;
|
||||
private System.Windows.Forms.ComboBox cmbCoreType4;
|
||||
private System.Windows.Forms.Label labCoreType4;
|
||||
private System.Windows.Forms.ComboBox cmbCoreType3;
|
||||
private System.Windows.Forms.Label labCoreType3;
|
||||
private System.Windows.Forms.ComboBox cmbCoreType2;
|
||||
private System.Windows.Forms.Label labCoreType2;
|
||||
}
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Windows.Forms;
|
||||
using v2rayN.Base;
|
||||
|
@ -16,13 +17,13 @@ namespace v2rayN.Forms
|
|||
|
||||
private void OptionSettingForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
cmbCoreType.Items.AddRange(Global.coreTypes.ToArray());
|
||||
|
||||
InitBase();
|
||||
|
||||
InitKCP();
|
||||
|
||||
InitGUI();
|
||||
|
||||
InitCoreType();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -123,11 +124,40 @@ namespace v2rayN.Forms
|
|||
}
|
||||
|
||||
chkIgnoreGeoUpdateCore.Checked = config.ignoreGeoUpdateCore;
|
||||
cmbCoreType.SelectedIndex = (int)config.coreType;
|
||||
txtautoUpdateInterval.Text = config.autoUpdateInterval.ToString();
|
||||
chkEnableAutoAdjustMainLvColWidth.Checked = config.uiItem.enableAutoAdjustMainLvColWidth;
|
||||
chkEnableSecurityProtocolTls13.Checked = config.enableSecurityProtocolTls13;
|
||||
}
|
||||
|
||||
private void InitCoreType()
|
||||
{
|
||||
if (config.coreTypeItem == null)
|
||||
{
|
||||
config.coreTypeItem = new List<CoreTypeItem>();
|
||||
}
|
||||
|
||||
foreach (EConfigType it in Enum.GetValues(typeof(EConfigType)))
|
||||
{
|
||||
if (config.coreTypeItem.FindIndex(t => t.configType == it) >= 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
config.coreTypeItem.Add(new CoreTypeItem()
|
||||
{
|
||||
configType = it,
|
||||
coreType = ECoreType.v2fly
|
||||
});
|
||||
}
|
||||
for (int k = 1; k <= config.coreTypeItem.Count; k++)
|
||||
{
|
||||
var item = config.coreTypeItem[k - 1];
|
||||
((ComboBox)tabPageCoreType.Controls[$"cmbCoreType{k}"]).Items.AddRange(Global.coreTypes.ToArray());
|
||||
tabPageCoreType.Controls[$"labCoreType{k}"].Text = item.configType.ToString();
|
||||
tabPageCoreType.Controls[$"cmbCoreType{k}"].Text = item.coreType.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private void btnOK_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (SaveBase() != 0)
|
||||
|
@ -146,6 +176,11 @@ namespace v2rayN.Forms
|
|||
return;
|
||||
}
|
||||
|
||||
if (SaveCoreType() != 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (ConfigHandler.SaveConfig(ref config) == 0)
|
||||
{
|
||||
this.DialogResult = DialogResult.OK;
|
||||
|
@ -308,7 +343,6 @@ namespace v2rayN.Forms
|
|||
config.keepOlderDedupl = chkKeepOlderDedupl.Checked;
|
||||
|
||||
config.ignoreGeoUpdateCore = chkIgnoreGeoUpdateCore.Checked;
|
||||
config.coreType = (ECoreType)cmbCoreType.SelectedIndex;
|
||||
config.autoUpdateInterval = Utils.ToInt(txtautoUpdateInterval.Text);
|
||||
config.uiItem.enableAutoAdjustMainLvColWidth = chkEnableAutoAdjustMainLvColWidth.Checked;
|
||||
config.enableSecurityProtocolTls13 = chkEnableSecurityProtocolTls13.Checked;
|
||||
|
@ -316,6 +350,17 @@ namespace v2rayN.Forms
|
|||
return 0;
|
||||
}
|
||||
|
||||
private int SaveCoreType()
|
||||
{
|
||||
for (int k = 1; k <= config.coreTypeItem.Count; k++)
|
||||
{
|
||||
var item = config.coreTypeItem[k - 1];
|
||||
item.coreType = (ECoreType)Enum.Parse(typeof(ECoreType), tabPageCoreType.Controls[$"cmbCoreType{k}"].Text);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
private void btnClose_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.DialogResult = DialogResult.Cancel;
|
||||
|
|
|
@ -637,7 +637,7 @@
|
|||
<value>3, 3</value>
|
||||
</data>
|
||||
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>648, 421</value>
|
||||
<value>722, 421</value>
|
||||
</data>
|
||||
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>6</value>
|
||||
|
@ -661,7 +661,7 @@
|
|||
<value>3, 3, 3, 3</value>
|
||||
</data>
|
||||
<data name="tabPage1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>654, 427</value>
|
||||
<value>728, 427</value>
|
||||
</data>
|
||||
<data name="tabPage1.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>0</value>
|
||||
|
@ -775,7 +775,7 @@
|
|||
<value>4, 22</value>
|
||||
</data>
|
||||
<data name="tabPage2.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>654, 427</value>
|
||||
<value>728, 427</value>
|
||||
</data>
|
||||
<data name="tabPage2.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>4</value>
|
||||
|
@ -1117,7 +1117,7 @@
|
|||
<value>3, 3, 3, 3</value>
|
||||
</data>
|
||||
<data name="tabPage6.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>654, 427</value>
|
||||
<value>728, 427</value>
|
||||
</data>
|
||||
<data name="tabPage6.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>2</value>
|
||||
|
@ -1299,57 +1299,6 @@
|
|||
<data name=">>chkIgnoreGeoUpdateCore.ZOrder" xml:space="preserve">
|
||||
<value>5</value>
|
||||
</data>
|
||||
<data name="cmbCoreType.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>325, 130</value>
|
||||
</data>
|
||||
<data name="cmbCoreType.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>97, 20</value>
|
||||
</data>
|
||||
<data name="cmbCoreType.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>34</value>
|
||||
</data>
|
||||
<data name=">>cmbCoreType.Name" xml:space="preserve">
|
||||
<value>cmbCoreType</value>
|
||||
</data>
|
||||
<data name=">>cmbCoreType.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>cmbCoreType.Parent" xml:space="preserve">
|
||||
<value>tabPage7</value>
|
||||
</data>
|
||||
<data name=">>cmbCoreType.ZOrder" xml:space="preserve">
|
||||
<value>6</value>
|
||||
</data>
|
||||
<data name="label4.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="label4.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="label4.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>253, 134</value>
|
||||
</data>
|
||||
<data name="label4.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>59, 12</value>
|
||||
</data>
|
||||
<data name="label4.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>35</value>
|
||||
</data>
|
||||
<data name="label4.Text" xml:space="preserve">
|
||||
<value>Core Type</value>
|
||||
</data>
|
||||
<data name=">>label4.Name" xml:space="preserve">
|
||||
<value>label4</value>
|
||||
</data>
|
||||
<data name=">>label4.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>label4.Parent" xml:space="preserve">
|
||||
<value>tabPage7</value>
|
||||
</data>
|
||||
<data name=">>label4.ZOrder" xml:space="preserve">
|
||||
<value>7</value>
|
||||
</data>
|
||||
<data name="chkKeepOlderDedupl.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
|
@ -1378,7 +1327,7 @@
|
|||
<value>tabPage7</value>
|
||||
</data>
|
||||
<data name=">>chkKeepOlderDedupl.ZOrder" xml:space="preserve">
|
||||
<value>8</value>
|
||||
<value>6</value>
|
||||
</data>
|
||||
<data name="cbFreshrate.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>161, 84</value>
|
||||
|
@ -1399,7 +1348,7 @@
|
|||
<value>tabPage7</value>
|
||||
</data>
|
||||
<data name=">>cbFreshrate.ZOrder" xml:space="preserve">
|
||||
<value>9</value>
|
||||
<value>7</value>
|
||||
</data>
|
||||
<data name="lbFreshrate.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
|
@ -1429,7 +1378,7 @@
|
|||
<value>tabPage7</value>
|
||||
</data>
|
||||
<data name=">>lbFreshrate.ZOrder" xml:space="preserve">
|
||||
<value>10</value>
|
||||
<value>8</value>
|
||||
</data>
|
||||
<data name="chkEnableStatistics.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
|
@ -1459,7 +1408,7 @@
|
|||
<value>tabPage7</value>
|
||||
</data>
|
||||
<data name=">>chkEnableStatistics.ZOrder" xml:space="preserve">
|
||||
<value>11</value>
|
||||
<value>9</value>
|
||||
</data>
|
||||
<data name="chkAllowLANConn.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
|
@ -1486,7 +1435,7 @@
|
|||
<value>tabPage7</value>
|
||||
</data>
|
||||
<data name=">>chkAllowLANConn.ZOrder" xml:space="preserve">
|
||||
<value>12</value>
|
||||
<value>10</value>
|
||||
</data>
|
||||
<data name="chkAutoRun.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
|
@ -1513,7 +1462,7 @@
|
|||
<value>tabPage7</value>
|
||||
</data>
|
||||
<data name=">>chkAutoRun.ZOrder" xml:space="preserve">
|
||||
<value>13</value>
|
||||
<value>11</value>
|
||||
</data>
|
||||
<data name="tabPage7.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>4, 22</value>
|
||||
|
@ -1522,7 +1471,7 @@
|
|||
<value>3, 3, 3, 3</value>
|
||||
</data>
|
||||
<data name="tabPage7.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>654, 427</value>
|
||||
<value>728, 427</value>
|
||||
</data>
|
||||
<data name="tabPage7.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>3</value>
|
||||
|
@ -1542,6 +1491,339 @@
|
|||
<data name=">>tabPage7.ZOrder" xml:space="preserve">
|
||||
<value>3</value>
|
||||
</data>
|
||||
<data name="cmbCoreType6.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>117, 172</value>
|
||||
</data>
|
||||
<data name="cmbCoreType6.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>143, 20</value>
|
||||
</data>
|
||||
<data name="cmbCoreType6.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>46</value>
|
||||
</data>
|
||||
<data name=">>cmbCoreType6.Name" xml:space="preserve">
|
||||
<value>cmbCoreType6</value>
|
||||
</data>
|
||||
<data name=">>cmbCoreType6.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>cmbCoreType6.Parent" xml:space="preserve">
|
||||
<value>tabPageCoreType</value>
|
||||
</data>
|
||||
<data name=">>cmbCoreType6.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="labCoreType6.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="labCoreType6.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="labCoreType6.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>45, 176</value>
|
||||
</data>
|
||||
<data name="labCoreType6.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>59, 12</value>
|
||||
</data>
|
||||
<data name="labCoreType6.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>47</value>
|
||||
</data>
|
||||
<data name="labCoreType6.Text" xml:space="preserve">
|
||||
<value>Core Type</value>
|
||||
</data>
|
||||
<data name=">>labCoreType6.Name" xml:space="preserve">
|
||||
<value>labCoreType6</value>
|
||||
</data>
|
||||
<data name=">>labCoreType6.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>labCoreType6.Parent" xml:space="preserve">
|
||||
<value>tabPageCoreType</value>
|
||||
</data>
|
||||
<data name=">>labCoreType6.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="cmbCoreType5.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>117, 146</value>
|
||||
</data>
|
||||
<data name="cmbCoreType5.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>143, 20</value>
|
||||
</data>
|
||||
<data name="cmbCoreType5.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>44</value>
|
||||
</data>
|
||||
<data name=">>cmbCoreType5.Name" xml:space="preserve">
|
||||
<value>cmbCoreType5</value>
|
||||
</data>
|
||||
<data name=">>cmbCoreType5.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>cmbCoreType5.Parent" xml:space="preserve">
|
||||
<value>tabPageCoreType</value>
|
||||
</data>
|
||||
<data name=">>cmbCoreType5.ZOrder" xml:space="preserve">
|
||||
<value>2</value>
|
||||
</data>
|
||||
<data name="labCoreType5.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="labCoreType5.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="labCoreType5.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>45, 150</value>
|
||||
</data>
|
||||
<data name="labCoreType5.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>59, 12</value>
|
||||
</data>
|
||||
<data name="labCoreType5.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>45</value>
|
||||
</data>
|
||||
<data name="labCoreType5.Text" xml:space="preserve">
|
||||
<value>Core Type</value>
|
||||
</data>
|
||||
<data name=">>labCoreType5.Name" xml:space="preserve">
|
||||
<value>labCoreType5</value>
|
||||
</data>
|
||||
<data name=">>labCoreType5.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>labCoreType5.Parent" xml:space="preserve">
|
||||
<value>tabPageCoreType</value>
|
||||
</data>
|
||||
<data name=">>labCoreType5.ZOrder" xml:space="preserve">
|
||||
<value>3</value>
|
||||
</data>
|
||||
<data name="cmbCoreType4.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>117, 120</value>
|
||||
</data>
|
||||
<data name="cmbCoreType4.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>143, 20</value>
|
||||
</data>
|
||||
<data name="cmbCoreType4.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>42</value>
|
||||
</data>
|
||||
<data name=">>cmbCoreType4.Name" xml:space="preserve">
|
||||
<value>cmbCoreType4</value>
|
||||
</data>
|
||||
<data name=">>cmbCoreType4.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>cmbCoreType4.Parent" xml:space="preserve">
|
||||
<value>tabPageCoreType</value>
|
||||
</data>
|
||||
<data name=">>cmbCoreType4.ZOrder" xml:space="preserve">
|
||||
<value>4</value>
|
||||
</data>
|
||||
<data name="labCoreType4.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="labCoreType4.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="labCoreType4.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>45, 124</value>
|
||||
</data>
|
||||
<data name="labCoreType4.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>59, 12</value>
|
||||
</data>
|
||||
<data name="labCoreType4.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>43</value>
|
||||
</data>
|
||||
<data name="labCoreType4.Text" xml:space="preserve">
|
||||
<value>Core Type</value>
|
||||
</data>
|
||||
<data name=">>labCoreType4.Name" xml:space="preserve">
|
||||
<value>labCoreType4</value>
|
||||
</data>
|
||||
<data name=">>labCoreType4.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>labCoreType4.Parent" xml:space="preserve">
|
||||
<value>tabPageCoreType</value>
|
||||
</data>
|
||||
<data name=">>labCoreType4.ZOrder" xml:space="preserve">
|
||||
<value>5</value>
|
||||
</data>
|
||||
<data name="cmbCoreType3.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>117, 94</value>
|
||||
</data>
|
||||
<data name="cmbCoreType3.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>143, 20</value>
|
||||
</data>
|
||||
<data name="cmbCoreType3.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>40</value>
|
||||
</data>
|
||||
<data name=">>cmbCoreType3.Name" xml:space="preserve">
|
||||
<value>cmbCoreType3</value>
|
||||
</data>
|
||||
<data name=">>cmbCoreType3.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>cmbCoreType3.Parent" xml:space="preserve">
|
||||
<value>tabPageCoreType</value>
|
||||
</data>
|
||||
<data name=">>cmbCoreType3.ZOrder" xml:space="preserve">
|
||||
<value>6</value>
|
||||
</data>
|
||||
<data name="labCoreType3.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="labCoreType3.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="labCoreType3.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>45, 98</value>
|
||||
</data>
|
||||
<data name="labCoreType3.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>59, 12</value>
|
||||
</data>
|
||||
<data name="labCoreType3.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>41</value>
|
||||
</data>
|
||||
<data name="labCoreType3.Text" xml:space="preserve">
|
||||
<value>Core Type</value>
|
||||
</data>
|
||||
<data name=">>labCoreType3.Name" xml:space="preserve">
|
||||
<value>labCoreType3</value>
|
||||
</data>
|
||||
<data name=">>labCoreType3.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>labCoreType3.Parent" xml:space="preserve">
|
||||
<value>tabPageCoreType</value>
|
||||
</data>
|
||||
<data name=">>labCoreType3.ZOrder" xml:space="preserve">
|
||||
<value>7</value>
|
||||
</data>
|
||||
<data name="cmbCoreType2.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>117, 68</value>
|
||||
</data>
|
||||
<data name="cmbCoreType2.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>143, 20</value>
|
||||
</data>
|
||||
<data name="cmbCoreType2.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>38</value>
|
||||
</data>
|
||||
<data name=">>cmbCoreType2.Name" xml:space="preserve">
|
||||
<value>cmbCoreType2</value>
|
||||
</data>
|
||||
<data name=">>cmbCoreType2.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>cmbCoreType2.Parent" xml:space="preserve">
|
||||
<value>tabPageCoreType</value>
|
||||
</data>
|
||||
<data name=">>cmbCoreType2.ZOrder" xml:space="preserve">
|
||||
<value>8</value>
|
||||
</data>
|
||||
<data name="labCoreType2.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="labCoreType2.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="labCoreType2.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>45, 72</value>
|
||||
</data>
|
||||
<data name="labCoreType2.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>59, 12</value>
|
||||
</data>
|
||||
<data name="labCoreType2.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>39</value>
|
||||
</data>
|
||||
<data name="labCoreType2.Text" xml:space="preserve">
|
||||
<value>Core Type</value>
|
||||
</data>
|
||||
<data name=">>labCoreType2.Name" xml:space="preserve">
|
||||
<value>labCoreType2</value>
|
||||
</data>
|
||||
<data name=">>labCoreType2.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>labCoreType2.Parent" xml:space="preserve">
|
||||
<value>tabPageCoreType</value>
|
||||
</data>
|
||||
<data name=">>labCoreType2.ZOrder" xml:space="preserve">
|
||||
<value>9</value>
|
||||
</data>
|
||||
<data name="cmbCoreType1.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>117, 42</value>
|
||||
</data>
|
||||
<data name="cmbCoreType1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>143, 20</value>
|
||||
</data>
|
||||
<data name="cmbCoreType1.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>36</value>
|
||||
</data>
|
||||
<data name=">>cmbCoreType1.Name" xml:space="preserve">
|
||||
<value>cmbCoreType1</value>
|
||||
</data>
|
||||
<data name=">>cmbCoreType1.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>cmbCoreType1.Parent" xml:space="preserve">
|
||||
<value>tabPageCoreType</value>
|
||||
</data>
|
||||
<data name=">>cmbCoreType1.ZOrder" xml:space="preserve">
|
||||
<value>10</value>
|
||||
</data>
|
||||
<data name="labCoreType1.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="labCoreType1.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="labCoreType1.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>45, 46</value>
|
||||
</data>
|
||||
<data name="labCoreType1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>59, 12</value>
|
||||
</data>
|
||||
<data name="labCoreType1.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>37</value>
|
||||
</data>
|
||||
<data name="labCoreType1.Text" xml:space="preserve">
|
||||
<value>Core Type</value>
|
||||
</data>
|
||||
<data name=">>labCoreType1.Name" xml:space="preserve">
|
||||
<value>labCoreType1</value>
|
||||
</data>
|
||||
<data name=">>labCoreType1.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>labCoreType1.Parent" xml:space="preserve">
|
||||
<value>tabPageCoreType</value>
|
||||
</data>
|
||||
<data name=">>labCoreType1.ZOrder" xml:space="preserve">
|
||||
<value>11</value>
|
||||
</data>
|
||||
<data name="tabPageCoreType.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>4, 22</value>
|
||||
</data>
|
||||
<data name="tabPageCoreType.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||
<value>3, 3, 3, 3</value>
|
||||
</data>
|
||||
<data name="tabPageCoreType.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>728, 427</value>
|
||||
</data>
|
||||
<data name="tabPageCoreType.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>6</value>
|
||||
</data>
|
||||
<data name="tabPageCoreType.Text" xml:space="preserve">
|
||||
<value>CoreType settings</value>
|
||||
</data>
|
||||
<data name=">>tabPageCoreType.Name" xml:space="preserve">
|
||||
<value>tabPageCoreType</value>
|
||||
</data>
|
||||
<data name=">>tabPageCoreType.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>tabPageCoreType.Parent" xml:space="preserve">
|
||||
<value>tabControl1</value>
|
||||
</data>
|
||||
<data name=">>tabPageCoreType.ZOrder" xml:space="preserve">
|
||||
<value>4</value>
|
||||
</data>
|
||||
<data name="label13.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
|
@ -1636,7 +1918,7 @@
|
|||
<value>0, 0</value>
|
||||
</data>
|
||||
<data name="groupBox2.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>654, 427</value>
|
||||
<value>728, 427</value>
|
||||
</data>
|
||||
<data name="groupBox2.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>42</value>
|
||||
|
@ -1660,7 +1942,7 @@
|
|||
<value>4, 22</value>
|
||||
</data>
|
||||
<data name="tabPage3.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>654, 427</value>
|
||||
<value>728, 427</value>
|
||||
</data>
|
||||
<data name="tabPage3.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>5</value>
|
||||
|
@ -1678,7 +1960,7 @@
|
|||
<value>tabControl1</value>
|
||||
</data>
|
||||
<data name=">>tabPage3.ZOrder" xml:space="preserve">
|
||||
<value>4</value>
|
||||
<value>5</value>
|
||||
</data>
|
||||
<data name="tabControl1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<value>Fill</value>
|
||||
|
@ -1687,7 +1969,7 @@
|
|||
<value>0, 10</value>
|
||||
</data>
|
||||
<data name="tabControl1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>662, 453</value>
|
||||
<value>736, 453</value>
|
||||
</data>
|
||||
<data name="tabControl1.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>10</value>
|
||||
|
@ -1735,7 +2017,7 @@
|
|||
<value>0, 463</value>
|
||||
</data>
|
||||
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>662, 60</value>
|
||||
<value>736, 60</value>
|
||||
</data>
|
||||
<data name="panel2.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>11</value>
|
||||
|
@ -1759,7 +2041,7 @@
|
|||
<value>0, 0</value>
|
||||
</data>
|
||||
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>662, 10</value>
|
||||
<value>736, 10</value>
|
||||
</data>
|
||||
<data name="panel1.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>9</value>
|
||||
|
@ -1783,7 +2065,7 @@
|
|||
<value>6, 12</value>
|
||||
</data>
|
||||
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
|
||||
<value>662, 523</value>
|
||||
<value>736, 523</value>
|
||||
</data>
|
||||
<data name="$this.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||
<value>4, 4, 4, 4</value>
|
||||
|
|
|
@ -334,4 +334,7 @@
|
|||
<data name="$this.Text" xml:space="preserve">
|
||||
<value>参数设置</value>
|
||||
</data>
|
||||
<data name="tabPageCoreType.Text" xml:space="preserve">
|
||||
<value> Core类型设置 </value>
|
||||
</data>
|
||||
</root>
|
|
@ -199,8 +199,7 @@ namespace v2rayN
|
|||
public static readonly List<string> xtlsFlows = new List<string> { "", "xtls-rprx-origin", "xtls-rprx-origin-udp443", "xtls-rprx-direct", "xtls-rprx-direct-udp443" };
|
||||
public static readonly List<string> networks = new List<string> { "tcp", "kcp", "ws", "h2", "quic", "grpc" };
|
||||
public static readonly List<string> kcpHeaderTypes = new List<string> { "srtp", "utp", "wechat-video", "dtls", "wireguard" };
|
||||
public static readonly List<string> coreTypes = new List<string> { "v2fly_core", "Xray_core" };
|
||||
|
||||
public static readonly List<string> coreTypes = new List<string> { "v2fly", "Xray" };
|
||||
public const string GrpcgunMode = "gun";
|
||||
public const string GrpcmultiMode = "multi";
|
||||
|
||||
|
|
|
@ -250,35 +250,17 @@ namespace v2rayN.Handler
|
|||
/// <param name="config"></param>
|
||||
/// <param name="index"></param>
|
||||
/// <returns></returns>
|
||||
public static int CopyServer(ref Config config, VmessItem item)
|
||||
public static int CopyServer(ref Config config, List<VmessItem> indexs)
|
||||
{
|
||||
if (item == null)
|
||||
foreach (var item in indexs)
|
||||
{
|
||||
return -1;
|
||||
VmessItem vmessItem = Utils.DeepCopy(item);
|
||||
vmessItem.indexId = string.Empty;
|
||||
vmessItem.remarks = string.Format("{0}-clone", item.remarks);
|
||||
|
||||
AddServerCommon(ref config, vmessItem);
|
||||
}
|
||||
|
||||
VmessItem vmessItem = new VmessItem
|
||||
{
|
||||
configVersion = item.configVersion,
|
||||
address = item.address,
|
||||
port = item.port,
|
||||
id = item.id,
|
||||
alterId = item.alterId,
|
||||
security = item.security,
|
||||
network = item.network,
|
||||
remarks = string.Format("{0}-clone", item.remarks),
|
||||
headerType = item.headerType,
|
||||
requestHost = item.requestHost,
|
||||
path = item.path,
|
||||
streamSecurity = item.streamSecurity,
|
||||
allowInsecure = item.allowInsecure,
|
||||
configType = item.configType,
|
||||
flow = item.flow,
|
||||
sni = item.sni
|
||||
};
|
||||
|
||||
AddServerCommon(ref config, vmessItem);
|
||||
|
||||
ToJsonFile(config);
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -36,27 +36,10 @@ namespace v2rayN.Handler
|
|||
/// </summary>
|
||||
public void LoadV2ray(Config config)
|
||||
{
|
||||
if (config.coreType == ECoreType.v2fly_core)
|
||||
{
|
||||
lstV2ray = new List<string>
|
||||
{
|
||||
"wv2ray",
|
||||
"v2ray"
|
||||
};
|
||||
coreUrl = Global.v2flyCoreUrl;
|
||||
}
|
||||
else
|
||||
{
|
||||
lstV2ray = new List<string>
|
||||
{
|
||||
"xray"
|
||||
};
|
||||
coreUrl = Global.xrayCoreUrl;
|
||||
}
|
||||
|
||||
if (Global.reloadV2ray)
|
||||
{
|
||||
var item = ConfigHandler.GetDefaultServer(ref config);
|
||||
SetCore(config, item);
|
||||
string fileName = Utils.GetPath(v2rayConfigRes);
|
||||
if (V2rayConfigHandler.GenerateClientConfig(item, fileName, false, out string msg) != 0)
|
||||
{
|
||||
|
@ -334,5 +317,32 @@ namespace v2rayN.Handler
|
|||
Utils.SaveLog(ex.Message, ex);
|
||||
}
|
||||
}
|
||||
|
||||
private void SetCore(Config config, VmessItem item)
|
||||
{
|
||||
var coreType = config.GetCoreType((EConfigType)item.configType);
|
||||
if (item.coreType != null)
|
||||
{
|
||||
coreType = (ECoreType)item.coreType;
|
||||
}
|
||||
|
||||
if (coreType == ECoreType.v2fly)
|
||||
{
|
||||
lstV2ray = new List<string>
|
||||
{
|
||||
"wv2ray",
|
||||
"v2ray"
|
||||
};
|
||||
coreUrl = Global.v2flyCoreUrl;
|
||||
}
|
||||
else
|
||||
{
|
||||
lstV2ray = new List<string>
|
||||
{
|
||||
"xray"
|
||||
};
|
||||
coreUrl = Global.xrayCoreUrl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -120,10 +120,6 @@ namespace v2rayN.Mode
|
|||
get; set;
|
||||
}
|
||||
|
||||
public ECoreType coreType
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public bool ignoreGeoUpdateCore
|
||||
{
|
||||
get; set;
|
||||
|
@ -208,6 +204,12 @@ namespace v2rayN.Mode
|
|||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public List<CoreTypeItem> coreTypeItem
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region function
|
||||
|
@ -256,7 +258,7 @@ namespace v2rayN.Mode
|
|||
|
||||
public List<string> GetShadowsocksSecuritys()
|
||||
{
|
||||
if (coreType == ECoreType.v2fly_core)
|
||||
if (GetCoreType(EConfigType.Shadowsocks) == ECoreType.v2fly)
|
||||
{
|
||||
return Global.ssSecuritys;
|
||||
}
|
||||
|
@ -283,6 +285,19 @@ namespace v2rayN.Mode
|
|||
return groupItem.Where(it => it.id == groupId).FirstOrDefault()?.remarks;
|
||||
}
|
||||
|
||||
public ECoreType GetCoreType(EConfigType eConfigType)
|
||||
{
|
||||
if (coreTypeItem == null)
|
||||
{
|
||||
return ECoreType.v2fly;
|
||||
}
|
||||
var item = coreTypeItem.FirstOrDefault(it => it.configType == eConfigType);
|
||||
if (item == null)
|
||||
{
|
||||
return ECoreType.v2fly;
|
||||
}
|
||||
return item.coreType;
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
@ -570,6 +585,10 @@ namespace v2rayN.Mode
|
|||
{
|
||||
get; set;
|
||||
} = string.Empty;
|
||||
public ECoreType? coreType
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
|
@ -782,4 +801,19 @@ namespace v2rayN.Mode
|
|||
get; set;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Serializable]
|
||||
public class CoreTypeItem
|
||||
{
|
||||
public EConfigType configType
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public ECoreType coreType
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ namespace v2rayN.Mode
|
|||
{
|
||||
public enum ECoreType
|
||||
{
|
||||
v2fly_core = 0,
|
||||
Xray_core = 1
|
||||
v2fly = 1,
|
||||
Xray = 2
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue