Adds successful peer-dial event

This commit is contained in:
benbierens 2024-08-01 08:29:12 +02:00
parent 8e084d6ca0
commit 7352cdf3fe
No known key found for this signature in database
GPG Key ID: 877D2C2E09A22F3A
4 changed files with 30 additions and 2 deletions

View File

@ -53,7 +53,7 @@ namespace CodexPlugin
"connmanager",
"websock",
"ws-session",
"dialer",
// Removed: "dialer", is used for transcript event generation.
"muxedupgrade",
"upgrade",
"identify"

View File

@ -56,7 +56,8 @@ namespace CodexPlugin.OverwatchSupport
private readonly ILineConverter[] converters = new ILineConverter[]
{
new BlockReceivedLineConverter(),
new BootstrapLineConverter()
new BootstrapLineConverter(),
new DialSuccessfulLineConverter(),
};
public ConversionRunner(ITranscriptWriter writer, string name, string peerId)

View File

@ -0,0 +1,20 @@
namespace CodexPlugin.OverwatchSupport.LineConverters
{
public class DialSuccessfulLineConverter : ILineConverter
{
public string Interest => "Dial successful";
public void Process(CodexLogLine line, Action<Action<OverwatchCodexEvent>> addEvent)
{
var peerId = line.Attributes["peerId"];
addEvent(e =>
{
e.DialSuccessful = new DialSuccessfulEvent
{
TargetPeerId = peerId
};
});
}
}
}

View File

@ -21,6 +21,7 @@ namespace CodexPlugin.OverwatchSupport
public FileUploadedEvent? FileUploaded { get; set; }
public FileDownloadedEvent? FileDownloaded { get; set; }
public BlockReceivedEvent? BlockReceived { get; set; }
public DialSuccessfulEvent? DialSuccessful { get; set; }
public void Write(DateTime utc, ITranscriptWriter writer)
{
@ -96,5 +97,11 @@ namespace CodexPlugin.OverwatchSupport
public string SenderPeerId { get; set; } = string.Empty;
}
[Serializable]
public class DialSuccessfulEvent
{
public string TargetPeerId { get; set; } = string.Empty;
}
#endregion
}