mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-30 04:13:40 +01:00
Merge remote-tracking branch 'origin/master' into apiX-rollup
This commit is contained in:
commit
4e331b1d85
28 changed files with 1320 additions and 341 deletions
|
|
@ -17,17 +17,6 @@ namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
|
|||
/// </summary>
|
||||
internal class NetworkMonitorWidget : IDataWindowWidget
|
||||
{
|
||||
#pragma warning disable SA1313
|
||||
private readonly record struct NetworkPacketData(ushort OpCode, NetworkMessageDirection Direction, uint SourceActorId, uint TargetActorId)
|
||||
#pragma warning restore SA1313
|
||||
{
|
||||
public readonly IReadOnlyList<byte> Data = Array.Empty<byte>();
|
||||
|
||||
public NetworkPacketData(NetworkMonitorWidget widget, ushort opCode, NetworkMessageDirection direction, uint sourceActorId, uint targetActorId, nint dataPtr)
|
||||
: this(opCode, direction, sourceActorId, targetActorId)
|
||||
=> this.Data = MemoryHelper.Read<byte>(dataPtr, widget.GetSizeFromOpCode(opCode), false);
|
||||
}
|
||||
|
||||
private readonly ConcurrentQueue<NetworkPacketData> packets = new();
|
||||
|
||||
private bool trackNetwork;
|
||||
|
|
@ -214,4 +203,15 @@ internal class NetworkMonitorWidget : IDataWindowWidget
|
|||
/// <remarks> The filter should find opCodes by number (decimal and hex) and name, if existing. </remarks>
|
||||
private string OpCodeToString(ushort opCode)
|
||||
=> $"{opCode}\0{opCode:X}";
|
||||
|
||||
#pragma warning disable SA1313
|
||||
private readonly record struct NetworkPacketData(ushort OpCode, NetworkMessageDirection Direction, uint SourceActorId, uint TargetActorId)
|
||||
#pragma warning restore SA1313
|
||||
{
|
||||
public readonly IReadOnlyList<byte> Data = Array.Empty<byte>();
|
||||
|
||||
public NetworkPacketData(NetworkMonitorWidget widget, ushort opCode, NetworkMessageDirection direction, uint sourceActorId, uint targetActorId, nint dataPtr)
|
||||
: this(opCode, direction, sourceActorId, targetActorId)
|
||||
=> this.Data = MemoryHelper.Read<byte>(dataPtr, widget.GetSizeFromOpCode(opCode), false);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue