mirror of
https://github.com/BililiveRecorder/BililiveRecorder.git
synced 2024-11-16 11:42:22 +08:00
commit
4f8f1113a6
|
@ -24,7 +24,7 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="NLog.config">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace BililiveRecorder.Core
|
|||
};
|
||||
|
||||
private static readonly Regex invalidXMLChars = new Regex(@"(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x9F\uFEFF\uFFFE\uFFFF]", RegexOptions.Compiled);
|
||||
private static string RemoveInvalidXMLChars(string? text) => string.IsNullOrEmpty(text) ? string.Empty : invalidXMLChars.Replace(text, string.Empty);
|
||||
private static string RemoveInvalidXMLChars(string? text) => string.IsNullOrWhiteSpace(text) ? string.Empty : invalidXMLChars.Replace(text, string.Empty);
|
||||
|
||||
private XmlWriter? xmlWriter = null;
|
||||
private DateTimeOffset offset = DateTimeOffset.UtcNow;
|
||||
|
@ -106,7 +106,7 @@ namespace BililiveRecorder.Core
|
|||
|
||||
this.xmlWriter.WriteStartElement("d");
|
||||
this.xmlWriter.WriteAttributeString("p", $"{ts},{type},{size},{color},{st},0,{danmakuModel.UserID},0");
|
||||
this.xmlWriter.WriteAttributeString("user", danmakuModel.UserName);
|
||||
this.xmlWriter.WriteAttributeString("user", RemoveInvalidXMLChars(danmakuModel.UserName));
|
||||
if (recordDanmakuRaw)
|
||||
this.xmlWriter.WriteAttributeString("raw", danmakuModel.RawObj?["info"]?.ToString(Newtonsoft.Json.Formatting.None));
|
||||
this.xmlWriter.WriteValue(RemoveInvalidXMLChars(danmakuModel.CommentText));
|
||||
|
@ -119,7 +119,7 @@ namespace BililiveRecorder.Core
|
|||
this.xmlWriter.WriteStartElement("sc");
|
||||
var ts = Math.Max((DateTimeOffset.UtcNow - this.offset).TotalSeconds, 0d);
|
||||
this.xmlWriter.WriteAttributeString("ts", ts.ToString());
|
||||
this.xmlWriter.WriteAttributeString("user", danmakuModel.UserName);
|
||||
this.xmlWriter.WriteAttributeString("user", RemoveInvalidXMLChars(danmakuModel.UserName));
|
||||
this.xmlWriter.WriteAttributeString("price", danmakuModel.Price.ToString());
|
||||
this.xmlWriter.WriteAttributeString("time", danmakuModel.SCKeepTime.ToString());
|
||||
if (recordDanmakuRaw)
|
||||
|
@ -134,8 +134,8 @@ namespace BililiveRecorder.Core
|
|||
this.xmlWriter.WriteStartElement("gift");
|
||||
var ts = Math.Max((DateTimeOffset.UtcNow - this.offset).TotalSeconds, 0d);
|
||||
this.xmlWriter.WriteAttributeString("ts", ts.ToString());
|
||||
this.xmlWriter.WriteAttributeString("user", danmakuModel.UserName);
|
||||
this.xmlWriter.WriteAttributeString("giftname", danmakuModel.GiftName);
|
||||
this.xmlWriter.WriteAttributeString("user", RemoveInvalidXMLChars(danmakuModel.UserName));
|
||||
this.xmlWriter.WriteAttributeString("giftname", RemoveInvalidXMLChars(danmakuModel.GiftName));
|
||||
this.xmlWriter.WriteAttributeString("giftcount", danmakuModel.GiftCount.ToString());
|
||||
if (recordDanmakuRaw)
|
||||
this.xmlWriter.WriteAttributeString("raw", danmakuModel.RawObj?["data"]?.ToString(Newtonsoft.Json.Formatting.None));
|
||||
|
@ -148,7 +148,7 @@ namespace BililiveRecorder.Core
|
|||
this.xmlWriter.WriteStartElement("guard");
|
||||
var ts = Math.Max((DateTimeOffset.UtcNow - this.offset).TotalSeconds, 0d);
|
||||
this.xmlWriter.WriteAttributeString("ts", ts.ToString());
|
||||
this.xmlWriter.WriteAttributeString("user", danmakuModel.UserName);
|
||||
this.xmlWriter.WriteAttributeString("user", RemoveInvalidXMLChars(danmakuModel.UserName));
|
||||
this.xmlWriter.WriteAttributeString("level", danmakuModel.UserGuardLevel.ToString()); ;
|
||||
this.xmlWriter.WriteAttributeString("count", danmakuModel.GiftCount.ToString());
|
||||
if (recordDanmakuRaw)
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace BililiveRecorder.WPF
|
|||
if (!File.Exists("BILILIVE_RECORDER_DISABLE_SENTRY")
|
||||
&& string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("BILILIVE_RECORDER_DISABLE_SENTRY")))
|
||||
{
|
||||
o.Dsn = new Dsn("https://efc16b0fd5604608b811c3b358e9d1f1@o210546.ingest.sentry.io/5556540");
|
||||
o.Dsn = new Dsn("https://74f6e28f6a8848dabbb96c5b5c51c4c2@o210546.ingest.sentry.io/5556540");
|
||||
}
|
||||
|
||||
var v = typeof(Program).Assembly.GetName().Version;
|
||||
|
|
Loading…
Reference in New Issue
Block a user