diff --git a/BarrageGrab/ComPortServer.cs b/BarrageGrab/ComPortServer.cs
index bbdda9a..318ab37 100644
--- a/BarrageGrab/ComPortServer.cs
+++ b/BarrageGrab/ComPortServer.cs
@@ -18,7 +18,7 @@ namespace BarrageGrab
static ComPortServer()
{
- if (AppSetting.Current.UseComPortFilter)
+ if (Appsetting.Current.UseComPortFilter)
{
jsEngine = JsEngine.CreateNewEngine();
var jsFile = JsEngine.GetJsFile("comPortFilter.js");
@@ -28,8 +28,8 @@ namespace BarrageGrab
public ComPortServer(WsBarrageServer server)
{
- string portName = AppSetting.Current.ComPort;
- int baudRate = AppSetting.Current.ComBaudRate;
+ string portName = Appsetting.Current.ComPort;
+ int baudRate = Appsetting.Current.ComBaudRate;
if (portName.IsNullOrWhiteSpace())
{
return;
@@ -50,7 +50,7 @@ namespace BarrageGrab
{
if (!sendPort.IsOpen) return;
if (e == null) return;
- if (!AppSetting.Current.UseComPortFilter)
+ if (!Appsetting.Current.UseComPortFilter)
{
var json = e.ToJson() + "\r\n";
var jbuff = Encoding.UTF8.GetBytes(json);
diff --git a/BarrageGrab/Forms/FormView.cs b/BarrageGrab/Forms/FormView.cs
index b322e6b..72bbe50 100644
--- a/BarrageGrab/Forms/FormView.cs
+++ b/BarrageGrab/Forms/FormView.cs
@@ -32,7 +32,7 @@ namespace BarrageGrab
AppRuntime.RoomCaches.OnCache += RoomCaches_OnCache;
this.txb_wsaddr.Text = barServer.ServerLocation;
this.txb_upstreamProxy.Text = proxy.HttpUpstreamProxy;
- this.cbx_barrageLog.Checked = AppSetting.Current.BarrageLog;
+ this.cbx_barrageLog.Checked = Appsetting.Current.BarrageLog;
InitTabPages();
}
@@ -67,17 +67,17 @@ namespace BarrageGrab
if (page == this.tabPage_Ws)
{
type = "ws";
- ck.Checked = AppSetting.Current.PushFilter.Contains(label.Key);
+ ck.Checked = Appsetting.Current.PushFilter.Contains(label.Key);
}
if (page == this.tabPage_Console)
{
type = "console";
- ck.Checked = AppSetting.Current.PrintFilter.Contains(label.Key);
+ ck.Checked = Appsetting.Current.PrintFilter.Contains(label.Key);
}
if (page == this.tabPage_Log)
{
type = "log";
- ck.Checked = AppSetting.Current.LogFilter.Contains(label.Key);
+ ck.Checked = Appsetting.Current.LogFilter.Contains(label.Key);
}
ck.Name = $"cbx_bartype_{type}_{label.Key}";
ck.CheckedChanged += Ck_CheckedChanged;
@@ -94,17 +94,17 @@ namespace BarrageGrab
var selected = GetCheckedBarTypes((FlowLayoutPanel)cbx.Parent);
if (cbx.Parent.Parent == this.tabPage_Console)
{
- AppSetting.Current.PrintFilter = selected;
+ Appsetting.Current.PrintFilter = selected;
}
if (cbx.Parent.Parent == this.tabPage_Ws)
{
- AppSetting.Current.PushFilter = selected;
+ Appsetting.Current.PushFilter = selected;
}
if(cbx.Parent.Parent == this.tabPage_Log)
{
- AppSetting.Current.LogFilter = selected;
+ Appsetting.Current.LogFilter = selected;
}
- AppSetting.Current.Save();
+ Appsetting.Current.Save();
}
private int[] GetCheckedBarTypes(FlowLayoutPanel panel)
@@ -171,7 +171,7 @@ namespace BarrageGrab
{
//将弹幕输出到richTextBox
//颜色转换
- Color color = AppSetting.Current.ColorMap[e.MsgType].Item2;
+ Color color = Appsetting.Current.ColorMap[e.MsgType].Item2;
string msg = e.Message;
this.Invoke(new Action(() =>
@@ -218,8 +218,8 @@ namespace BarrageGrab
try
{
proxy.SetUpstreamProxy(text);
- AppSetting.Current.UpstreamProxy = text;
- AppSetting.Current.Save();
+ Appsetting.Current.UpstreamProxy = text;
+ Appsetting.Current.Save();
}
catch (Exception ex)
{
@@ -231,8 +231,8 @@ namespace BarrageGrab
private void cbx_barrageLog_CheckedChanged(object sender, EventArgs e)
{
var checker = (CheckBox)sender;
- AppSetting.Current.BarrageLog = checker.Checked;
- AppSetting.Current.Save();
+ Appsetting.Current.BarrageLog = checker.Checked;
+ Appsetting.Current.Save();
}
}
}
diff --git a/BarrageGrab/Logger.cs b/BarrageGrab/Logger.cs
index 507e082..32cd6bc 100644
--- a/BarrageGrab/Logger.cs
+++ b/BarrageGrab/Logger.cs
@@ -94,9 +94,9 @@ namespace BarrageGrab
/// 弹幕内容
public static void LogBarrage(PackMsgType type, Msg msg)
{
- if (!AppSetting.Current.BarrageLog) return;
+ if (!Appsetting.Current.BarrageLog) return;
if (type == PackMsgType.无) return;
- if (AppSetting.Current.LogFilter.Any() && !AppSetting.Current.LogFilter.Contains(type.GetHashCode())) return;
+ if (Appsetting.Current.LogFilter.Any() && !Appsetting.Current.LogFilter.Contains(type.GetHashCode())) return;
try
{
@@ -135,7 +135,7 @@ namespace BarrageGrab
text += $" [{msg.User?.GenderToString()}] ";
}
- ConsoleColor color = AppSetting.Current.ColorMap[barType].Item1;
+ ConsoleColor color = Appsetting.Current.ColorMap[barType].Item1;
var append = msg.Content;
switch (barType)
{
diff --git a/BarrageGrab/Program.cs b/BarrageGrab/Program.cs
index 2ecb8e0..4391ef4 100644
--- a/BarrageGrab/Program.cs
+++ b/BarrageGrab/Program.cs
@@ -63,21 +63,21 @@ namespace BarrageGrab
AppRuntime.Init();
WinApi.SetConsoleCtrlHandler(controlCtr, true);//捕获控制台关闭
WinApi.DisableQuickEditMode();//禁用控制台快速编辑模式
- AppRuntime.DisplayConsole(!AppSetting.Current.HideConsole);//控制控制台可见
- AppRuntime.WsServer.Grab.Proxy.SetUpstreamProxy(AppSetting.Current.UpstreamProxy);//设置上游代理
+ AppRuntime.DisplayConsole(!Appsetting.Current.HideConsole);//控制控制台可见
+ AppRuntime.WsServer.Grab.Proxy.SetUpstreamProxy(Appsetting.Current.UpstreamProxy);//设置上游代理
AppRuntime.WsServer.OnClose += (s, e) =>
{
exited = true;
};
//串口写入服务
- if (!AppSetting.Current.ComPort.IsNullOrWhiteSpace())
+ if (!Appsetting.Current.ComPort.IsNullOrWhiteSpace())
{
AppRuntime.ComPortServer.OpenStart();
}
//显示窗体
- if (AppSetting.Current.ShowWindow)
+ if (Appsetting.Current.ShowWindow)
{
var uiThread = new Thread(new ThreadStart(() =>
{
diff --git a/BarrageGrab/Proxy/SystemProxy.cs b/BarrageGrab/Proxy/SystemProxy.cs
index 661417c..fdcc8b9 100644
--- a/BarrageGrab/Proxy/SystemProxy.cs
+++ b/BarrageGrab/Proxy/SystemProxy.cs
@@ -32,7 +32,7 @@ namespace BarrageGrab.Proxy
///
/// 代理端口
///
- public int ProxyPort { get { return AppSetting.Current.ProxyPort; } }
+ public int ProxyPort { get { return Appsetting.Current.ProxyPort; } }
public abstract string HttpUpstreamProxy { get; }
@@ -55,11 +55,11 @@ namespace BarrageGrab.Proxy
{
host = host.Trim().ToLower();
- if (!AppSetting.Current.FilterHostName) return true;
+ if (!Appsetting.Current.FilterHostName) return true;
if (host.StartsWith("webcast")) return true;
- if (AppSetting.Current.HostNameFilter.Any(a => a.Trim().ToLower() == host)) return true;
+ if (Appsetting.Current.HostNameFilter.Any(a => a.Trim().ToLower() == host)) return true;
return false;
}
diff --git a/BarrageGrab/Proxy/TitaniumProxy.cs b/BarrageGrab/Proxy/TitaniumProxy.cs
index b9e7e05..1825470 100644
--- a/BarrageGrab/Proxy/TitaniumProxy.cs
+++ b/BarrageGrab/Proxy/TitaniumProxy.cs
@@ -212,7 +212,7 @@ namespace BarrageGrab.Proxy
var scriptContext = BuildContext(new Dictionary()
{
{"PROCESS_NAME","'{processName}'"},
- {"AUTOPAUSE",AppSetting.Current.AutoPause.ToString().ToLower()}
+ {"AUTOPAUSE",Appsetting.Current.AutoPause.ToString().ToLower()}
});
liveRoomInjectScript = scriptContext + liveRoomInjectScript;
var html = await e.GetResponseBodyAsString();
@@ -275,7 +275,7 @@ namespace BarrageGrab.Proxy
}
//给script标签 src加上时间戳避免缓存
- if (AppSetting.Current.DisableLivePageScriptCache)
+ if (Appsetting.Current.DisableLivePageScriptCache)
{
var scripts = doc.DocumentNode.SelectNodes("//script[@src]");
if (scripts != null)
@@ -311,7 +311,7 @@ namespace BarrageGrab.Proxy
var scriptContext = BuildContext(new Dictionary()
{
{"PROCESS_NAME","'{processName}'"},
- {"AUTOPAUSE",AppSetting.Current.AutoPause.ToString().ToLower()}
+ {"AUTOPAUSE",Appsetting.Current.AutoPause.ToString().ToLower()}
});
liveHoomInjectScript = scriptContext + liveHoomInjectScript;
@@ -382,7 +382,7 @@ namespace BarrageGrab.Proxy
}
}
- if (url.Contains(LIVE_SCRIPT_PATH) && AppSetting.Current.ForcePolling)
+ if (url.Contains(LIVE_SCRIPT_PATH) && Appsetting.Current.ForcePolling)
{
var reg = new Regex(@"if\s*\((?!this\.stopPolling)\)");
var js = await e.GetResponseBodyAsString();
@@ -393,7 +393,7 @@ namespace BarrageGrab.Proxy
var pollingIntervalMatch = pollingIntervalReg.Match(js);
if (pollingIntervalMatch.Success)
{
- var myValue = AppSetting.Current.PollingInterval;
+ var myValue = Appsetting.Current.PollingInterval;
js = pollingIntervalReg.Replace(js, $"this.pollingInterval={myValue},");
Logger.PrintColor($"直播间已成功修改轮询间隔为{myValue}ms", ConsoleColor.Green);
}
@@ -515,7 +515,7 @@ namespace BarrageGrab.Proxy
{
proxyServer.Stop();
proxyServer.Dispose();
- if (AppSetting.Current.UsedProxy)
+ if (Appsetting.Current.UsedProxy)
{
CloseSystemProxy();
}
@@ -526,8 +526,8 @@ namespace BarrageGrab.Proxy
///
override public void Start()
{
- proxyServer.Start(AppSetting.Current.UsedProxy);
- if (AppSetting.Current.UsedProxy)
+ proxyServer.Start(Appsetting.Current.UsedProxy);
+ if (Appsetting.Current.UsedProxy)
{
proxyServer.SetAsSystemHttpProxy(explicitEndPoint);
proxyServer.SetAsSystemHttpsProxy(explicitEndPoint);
diff --git a/BarrageGrab/WsBarrageServer.cs b/BarrageGrab/WsBarrageServer.cs
index 9aed910..f388a29 100644
--- a/BarrageGrab/WsBarrageServer.cs
+++ b/BarrageGrab/WsBarrageServer.cs
@@ -36,7 +36,7 @@ namespace BarrageGrab
Timer dieout = new Timer(10000);//离线客户端清理计时器
Timer giftCountTimer = new Timer(10000);//礼物缓存清理计时器
WssBarrageGrab grab = new WssBarrageGrab();//弹幕解析器核心
- AppSetting Appsetting = AppSetting.Current;//全局配置文件实例
+ Appsetting Appsetting = Appsetting.Current;//全局配置文件实例
static int printCount = 0; //控制台输出计数,用于判断清理控制台
///
@@ -120,12 +120,12 @@ namespace BarrageGrab
//判断Rommid是否符合拦截规则
private bool CheckRoomId(long roomid)
{
- if (!AppSetting.Current.WebRoomIds.Any()) return true;
+ if (!Appsetting.Current.WebRoomIds.Any()) return true;
var webrid = AppRuntime.RoomCaches.GetCachedWebRoomid(roomid.ToString());
if (webrid <= 0) return true;
- return AppSetting.Current.WebRoomIds.Contains(webrid);
+ return Appsetting.Current.WebRoomIds.Contains(webrid);
}
//解析用户
@@ -174,7 +174,7 @@ namespace BarrageGrab
text += $" [{msg.User?.GenderToString()}] ";
}
- ConsoleColor color = AppSetting.Current.ColorMap[barType].Item1;
+ ConsoleColor color = Appsetting.Current.ColorMap[barType].Item1;
var append = msg.Content;
switch (barType)
{
@@ -185,13 +185,13 @@ namespace BarrageGrab
text += append;
- if (AppSetting.Current.BarrageLog)
+ if (Appsetting.Current.BarrageLog)
{
Logger.LogBarrage(barType, msg);
}
if (!Appsetting.PrintBarrage) return;
- if (AppSetting.Current.PrintFilter.Any() && !AppSetting.Current.PrintFilter.Contains(barType.GetHashCode())) return;
+ if (Appsetting.Current.PrintFilter.Any() && !Appsetting.Current.PrintFilter.Contains(barType.GetHashCode())) return;
OnPrint?.Invoke(this, new PrintEventArgs()
{
@@ -575,7 +575,7 @@ namespace BarrageGrab
public void Broadcast(BarrageMsgPack pack)
{
if (pack == null) return;
- if (AppSetting.Current.PushFilter.Any() && !AppSetting.Current.PushFilter.Contains(pack.Type.GetHashCode())) return;
+ if (Appsetting.Current.PushFilter.Any() && !Appsetting.Current.PushFilter.Contains(pack.Type.GetHashCode())) return;
var offLines = new List();
foreach (var item in socketList)
diff --git a/BarrageGrab/WssBarrageGrab.cs b/BarrageGrab/WssBarrageGrab.cs
index 4552e1a..4f524d0 100644
--- a/BarrageGrab/WssBarrageGrab.cs
+++ b/BarrageGrab/WssBarrageGrab.cs
@@ -19,7 +19,7 @@ namespace BarrageGrab
{
//ISystemProxy proxy = new FiddlerProxy();
ISystemProxy proxy = new TitaniumProxy();
- AppSetting appsetting = AppSetting.Current;
+ Appsetting appsetting = Appsetting.Current;
///
/// 进入直播间