Files
better-genshin-impact/BetterGenshinImpact/Hutao/PipePacketHeader.cs
2024-10-19 15:20:58 +08:00

26 lines
1.3 KiB
C#

using System.Runtime.InteropServices;
namespace BetterGenshinImpact.Hutao;
// Layout:
// 0 1 2 3 4 Bytes
// ┌─────────┬──────┬─────────┬─────────────┐
// │ Version │ Type │ Command │ ContentType │
// ├─────────┴──────┴─────────┴─────────────┤ 4 Bytes
// │ ContentLength │
// ├────────────────────────────────────────┤ 8 Bytes
// │ │
// │─────────────── Checksum ───────────────│
// │ │
// └────────────────────────────────────────┘ 16 Bytes
// Any content will be placed after the header.
[StructLayout(LayoutKind.Sequential, Pack = 1)]
internal struct PipePacketHeader
{
public byte Version;
public PipePacketType Type;
public PipePacketCommand Command;
public PipePacketContentType ContentType;
public int ContentLength;
public ulong Checksum;
}