mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-09 03:40:46 +00:00
30 lines
754 B
C#
30 lines
754 B
C#
namespace QuantumUNET.Messages
|
|
{
|
|
internal class QSBCRCMessage : QSBMessageBase
|
|
{
|
|
public QSBCRCMessageEntry[] scripts;
|
|
|
|
public override void Deserialize(QSBNetworkReader reader)
|
|
{
|
|
var num = (int)reader.ReadUInt16();
|
|
scripts = new QSBCRCMessageEntry[num];
|
|
for (var i = 0; i < scripts.Length; i++)
|
|
{
|
|
var crcmessageEntry = default(QSBCRCMessageEntry);
|
|
crcmessageEntry.name = reader.ReadString();
|
|
crcmessageEntry.channel = reader.ReadByte();
|
|
scripts[i] = crcmessageEntry;
|
|
}
|
|
}
|
|
|
|
public override void Serialize(QSBNetworkWriter writer)
|
|
{
|
|
writer.Write((ushort)scripts.Length);
|
|
for (var i = 0; i < scripts.Length; i++)
|
|
{
|
|
writer.Write(scripts[i].name);
|
|
writer.Write(scripts[i].channel);
|
|
}
|
|
}
|
|
}
|
|
} |