Skip to content

Commit

Permalink
升级版本为2.0.4.5b
Browse files Browse the repository at this point in the history
===增加功能===
WEB界面增加系统信息总览和自动更新页面信息功能
增加支持MacOS系统使用DDTVLiveRec录制功能
在增加监控的房间为特殊短号时,会自动解析为正确房间号
核心框架升级为.NET5.0
增加DDTVLiveRec手机短信验证码登陆的方式
增加且修改默认弹幕录制通用的xml文件
增加了房间配置文件修改程序
===修改功能===
完善断线重连录制功能
分离DDTVLiveRec的登陆方式为短信登陆
优化新建和下载任务的重连机制
修正控制台和网页输出的任务开结束时间描述错误
优化了DDTVLiveRec的录制内存分配机制
  • Loading branch information
CHKZL committed Nov 23, 2020
1 parent 9f609fe commit 5828a93
Show file tree
Hide file tree
Showing 29 changed files with 2,286 additions and 343 deletions.
10 changes: 9 additions & 1 deletion Auxiliary/App.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
66 changes: 66 additions & 0 deletions Auxiliary/Auxiliary.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,39 @@
<Reference Include="BiliAccount, Version=2.5.1.23, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\BiliAccount.2.5.1.23\lib\net472\BiliAccount.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Configuration, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.Configuration.5.0.0\lib\net461\Microsoft.Extensions.Configuration.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Configuration.Abstractions, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.Configuration.Abstractions.5.0.0\lib\net461\Microsoft.Extensions.Configuration.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Configuration.FileExtensions, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.Configuration.FileExtensions.5.0.0\lib\net461\Microsoft.Extensions.Configuration.FileExtensions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Configuration.Ini, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.Configuration.Ini.5.0.0\lib\net461\Microsoft.Extensions.Configuration.Ini.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.FileProviders.Abstractions, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.FileProviders.Abstractions.5.0.0\lib\net461\Microsoft.Extensions.FileProviders.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.FileProviders.Physical, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.FileProviders.Physical.5.0.0\lib\net461\Microsoft.Extensions.FileProviders.Physical.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.FileSystemGlobbing, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.FileSystemGlobbing.5.0.0\lib\net461\Microsoft.Extensions.FileSystemGlobbing.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Primitives, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.Primitives.5.0.0\lib\net461\Microsoft.Extensions.Primitives.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Configuration" />
<Reference Include="System.Configuration.ConfigurationManager, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Configuration.ConfigurationManager.4.7.0\lib\net461\System.Configuration.ConfigurationManager.dll</HintPath>
Expand All @@ -120,12 +148,47 @@
<Reference Include="System.Data.OracleClient" />
<Reference Include="System.Drawing" />
<Reference Include="System.Drawing.Design" />
<Reference Include="System.IO, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.4.3.0\lib\net462\System.IO.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Management" />
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Net" />
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.4.3.0\lib\net462\System.Runtime.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Security" />
<Reference Include="System.Security.AccessControl, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.AccessControl.4.7.0\lib\net461\System.Security.AccessControl.dll</HintPath>
</Reference>
<Reference Include="System.Security.Cryptography.Algorithms, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.Algorithms.4.3.1\lib\net463\System.Security.Cryptography.Algorithms.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Security.Cryptography.Encoding, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Security.Cryptography.Primitives, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Security.Permissions, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Permissions.4.7.0\lib\net461\System.Security.Permissions.dll</HintPath>
</Reference>
Expand All @@ -134,6 +197,9 @@
</Reference>
<Reference Include="System.ServiceProcess" />
<Reference Include="System.Transactions" />
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Windows.Forms" />
Expand Down
2 changes: 1 addition & 1 deletion Auxiliary/CacheSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public T Get(string id)
var obj = new CachedObject<T>(_handler, id);
obj.TimeoutSec = _timeoutSec;
_objects.Add(id, obj);
DataCache.BilibiliApiCount++;
DataCache.CacheCount++;
return obj.Get();
}
}
Expand Down
59 changes: 44 additions & 15 deletions Auxiliary/DataCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,49 @@

namespace Auxiliary
{
/// <summary>
/// DDTV本地缓存系统
/// </summary>
public class DataCache
{
public static int BilibiliApiCount = 0;
public static Dictionary<string, string> 缓存队列 = new Dictionary<string, string>();
public static Dictionary<string, DateTime> 缓存创建时间 = new Dictionary<string, DateTime>();
public static int CacheCount = 0;
private static Dictionary<string, string> 缓存队列 = new Dictionary<string, string>();
private static Dictionary<string, DateTime> 缓存创建时间 = new Dictionary<string, DateTime>();

/// <summary>
/// 读缓存
/// </summary>
/// <param name="key">查询的键名</param>
/// <param name="ExTime">超时时间,0为永远超时</param>
/// <param name="ExTime">超时时间,0为永远有效</param>
/// <param name="data">查询到的结果</param>
/// <returns>该键名是否有对应的数据</returns>
public static bool 读缓存(string key, double ExTime, out string data)
{
data = null;
if (DataCache.缓存创建时间.TryGetValue(key, out DateTime Cache))
try
{
TimeSpan TS = DateTime.Now - Cache;
if ((TS.TotalSeconds < ExTime || ExTime == 0 )&& DataCache.缓存队列.TryGetValue(key, out string CacheData))

if (DataCache.缓存创建时间.TryGetValue(key, out DateTime Cache))
{
data = CacheData;
InfoLog.InfoPrintf("缓存命中,读取数据:" + key + "|" + CacheData, InfoLog.InfoClass.Debug);
return true;
TimeSpan TS = DateTime.Now - Cache;
if ((TS.TotalSeconds < ExTime || ExTime == 0) && DataCache.缓存队列.TryGetValue(key, out string CacheData))
{
data = CacheData;
InfoLog.InfoPrintf("缓存命中,读取数据:" + key + "|" + CacheData, InfoLog.InfoClass.Debug);
return true;
}
else
{
InfoLog.InfoPrintf("命中缓存,但数据已过期,返回false:" + key, InfoLog.InfoClass.Debug);
}
}
return false;
}
catch (Exception ex)
{
InfoLog.InfoPrintf($"读缓存异常:{ex}", InfoLog.InfoClass.Debug);
return false;
}
return false;
}
/// <summary>
/// 写缓存
Expand All @@ -44,10 +60,23 @@ public static bool 读缓存(string key, double ExTime, out string data)
/// <param name="TS"></param>
public static void 写缓存(string key,string value)
{
缓存创建时间.Add(key,DateTime.Now);
缓存队列.Add(key, value);
InfoLog.InfoPrintf("缓存未命中,缓存数据:"+key+"|" + value, InfoLog.InfoClass.Debug);
DataCache.BilibiliApiCount++;
try
{
if (缓存队列.ContainsKey(key))
缓存队列[key] = value;
else
缓存队列.Add(key, value);
if (缓存创建时间.ContainsKey(key))
缓存创建时间[key]= DateTime.Now;
else
缓存创建时间.Add(key, DateTime.Now);
InfoLog.InfoPrintf("缓存未命中,缓存数据:" + key + "|" + value, InfoLog.InfoClass.Debug);
DataCache.CacheCount++;
}
catch (Exception ex)
{
InfoLog.InfoPrintf($"写缓存异常:{ex}", InfoLog.InfoClass.Debug);
}
}
}
}
Loading

0 comments on commit 5828a93

Please sign in to comment.