enter intro cutscene

This commit is contained in:
Naruse
2026-04-20 12:40:38 +08:00
parent 2826239284
commit 279da58dc1
81 changed files with 7279 additions and 0 deletions

51
TcpSharp/BasePacket.cs Normal file
View File

@@ -0,0 +1,51 @@
using Google.Protobuf;
using MikuSB.Enums.Packet;
namespace MikuSB.TcpSharp;
public class BasePacket
{
public ushort CmdId { get; set; }
public byte[] Body { get; set; }
public ushort SeqNo { get; set; }
public ushort PushSeq { get; set; }
public long Timestamp { get; set; }
public IMessage? Message { get; set; }
public PacketFraming Framing { get; set; }
public BasePacket(ushort cmdId)
{
CmdId = cmdId;
Body = Array.Empty<byte>();
SeqNo = 0;
PushSeq = 0;
Timestamp = 0;
Framing = PacketFraming.FourByteLittleEndianLength;
}
public BasePacket(ushort cmdId, byte[] body, PacketFraming framing = PacketFraming.FourByteLittleEndianLength)
{
CmdId = cmdId;
Body = body ?? Array.Empty<byte>();
Framing = framing;
SeqNo = 0;
PushSeq = 0;
Timestamp = 0;
}
public void SetData(byte[] data)
{
Body = data;
}
public void SetData(IMessage message)
{
Body = message.ToByteArray();
Message = message;
}
public void SetData(string base64)
{
SetData(Convert.FromBase64String(base64));
}
}