Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9534d10

Browse files
committed
Optimize codes
1 parent 4711d8f commit 9534d10

File tree

4 files changed

+12
-22
lines changed

4 files changed

+12
-22
lines changed

Netch/Controllers/SSController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ public bool Start(Objects.Server server, Objects.Mode mode)
5454
Instance = MainController.GetProcess();
5555
Instance.StartInfo.FileName = "bin\\Shadowsocks.exe";
5656

57-
if(!String.IsNullOrWhiteSpace(server.Plugin) && !String.IsNullOrWhiteSpace(server.PluginOptions))
57+
if(!String.IsNullOrWhiteSpace(server.OBFS) && !String.IsNullOrWhiteSpace(server.OBFSParam))
5858
{
59-
Instance.StartInfo.Arguments = String.Format("-s {0} -p {1} -b 0.0.0.0 -l 2801 -m {2} -k \"{3}\" -u --plugin {4} --plugin-opts \"{5}\"", server.Address, server.Port, server.EncryptMethod, server.Password, server.Plugin, server.PluginOptions);
59+
Instance.StartInfo.Arguments = String.Format("-s {0} -p {1} -b 0.0.0.0 -l 2801 -m {2} -k \"{3}\" -u --plugin {4} --plugin-opts \"{5}\"", server.Address, server.Port, server.EncryptMethod, server.Password, server.OBFS, server.OBFSParam);
6060
}
6161
else
6262
{

Netch/Forms/Server/Shadowsocks.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ private void Shadowsocks_Load(object sender, EventArgs e)
4242
PortTextBox.Text = Global.Server[Index].Port.ToString();
4343
PasswordTextBox.Text = Global.Server[Index].Password;
4444
EncryptMethodComboBox.SelectedIndex = Global.EncryptMethods.SS.IndexOf(Global.Server[Index].EncryptMethod);
45-
PluginTextBox.Text = Global.Server[Index].Plugin;
46-
PluginOptionsTextBox.Text = Global.Server[Index].PluginOptions;
45+
PluginTextBox.Text = Global.Server[Index].OBFS;
46+
PluginOptionsTextBox.Text = Global.Server[Index].OBFSParam;
4747
}
4848
else
4949
{
@@ -93,8 +93,8 @@ private void ControlButton_Click(object sender, EventArgs e)
9393
Port = int.Parse(PortTextBox.Text),
9494
Password = PasswordTextBox.Text,
9595
EncryptMethod = EncryptMethodComboBox.Text,
96-
Plugin = PluginTextBox.Text,
97-
PluginOptions = PluginOptionsTextBox.Text
96+
OBFS = PluginTextBox.Text,
97+
OBFSParam = PluginOptionsTextBox.Text
9898
});
9999
}
100100
else
@@ -108,8 +108,8 @@ private void ControlButton_Click(object sender, EventArgs e)
108108
Port = int.Parse(PortTextBox.Text),
109109
Password = PasswordTextBox.Text,
110110
EncryptMethod = EncryptMethodComboBox.Text,
111-
Plugin = PluginTextBox.Text,
112-
PluginOptions = PluginOptionsTextBox.Text
111+
OBFS = PluginTextBox.Text,
112+
OBFSParam = PluginOptionsTextBox.Text
113113
};
114114
}
115115

Netch/Objects/Server.cs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,25 +69,15 @@ public class Server
6969
public string ProtocolParam;
7070

7171
/// <summary>
72-
/// 混淆
72+
/// 混淆(SSR)/ 插件(SS)
7373
/// </summary>
7474
public string OBFS;
7575

7676
/// <summary>
77-
/// 混淆参数
77+
/// 混淆参数(SSR)/ 插件参数(SS)
7878
/// </summary>
7979
public string OBFSParam;
8080

81-
/// <summary>
82-
/// 插件(SS)
83-
/// </summary>
84-
public string Plugin;
85-
86-
/// <summary>
87-
/// 插件参数(SS)
88-
/// </summary>
89-
public string PluginOptions;
90-
9181
/// <summary>
9282
/// 传输协议(V2)
9383
/// </summary>

Netch/Utils/ShareLink.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ public static string URLSafeBase64Decode(string text)
120120

121121
data.EncryptMethod = match.Groups["method"].Value;
122122
data.Password = match.Groups["password"].Value;
123-
data.Plugin = plugins[0];
124-
data.PluginOptions = plugins[1];
123+
data.OBFS = plugins[0];
124+
data.OBFSParam = plugins[1];
125125
}
126126

127127
if (!Global.EncryptMethods.SS.Contains(data.EncryptMethod))

0 commit comments

Comments
 (0)