/* Sog 游戏基础库 2016 by zouwei */ using System; using System.Net; using System.Text; namespace SogClient { /// /// 消息打包解包 /// public interface IProtoPacker { // 消息附加头长度 int GetHeaderLength(); int GetFullHeaderLength(); /// /// 打包头 /// /// /// /// 包头长度 int PackHeader(MessageHeader header, byte[] headerBytes); /// /// 返回包头长度,返回0表示失败 /// /// /// /// /// /// int UnPackHeader(byte[] data, int offset, int length, ref MessageHeader header); //解包消息 bool UnpackMessage(MessageData message, out RequestPacket packet); // 打包消息 bool PackMessage(RequestPacket packet, ref MessageData message); //注册类型 void RegisterProtoType(int iMsgID, object obj); } }