31 lines
666 B
Plaintext
31 lines
666 B
Plaintext
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System;
|
|
|
|
public class BinaryMessageBase
|
|
{
|
|
protected byte cmdID = 2;
|
|
protected byte sysID = 1;
|
|
|
|
public virtual void ReadMsg(BinaryReader binaryReader)
|
|
{
|
|
}
|
|
|
|
public virtual void WriteMsg(BinaryWriter binaryReader)
|
|
{
|
|
}
|
|
|
|
public virtual void SendMsg()
|
|
{
|
|
using (var ms = new MemoryStream())
|
|
{
|
|
using (var writer = new BinaryWriter(ms))
|
|
{
|
|
writer.Write(sysID);
|
|
writer.Write(cmdID);
|
|
WriteMsg(writer);
|
|
BinaryMessageHandle.PacketSend(ms, writer);
|
|
}
|
|
}
|
|
}
|
|
} |