示例#1
0
 public Protocol(ProtoID id, ProtoBody body)
 {
     protoHead       = new ProtoHead();
     protoHead.CmdID = id;
     serverHead      = new ServerHead();
     protoBody       = body;
 }
示例#2
0
        /// <summary>
        /// 仅生成ProtoHead
        /// </summary>
        public Protocol()
        {
            protoHead  = new ProtoHead();
            serverHead = new ServerHead();

            protoBody = null;
        }
示例#3
0
        /// <summary>
        /// 生成ProtoHead,ServerHead,ProtoID,并使用传入的ProtoBody赋值
        /// </summary>
        /// <param name="bodyIn"></param>
        public Protocol(ProtoBody bodyIn)
        {
            protoHead  = new ProtoHead();
            serverHead = new ServerHead();
            protoBody  = bodyIn;

            protoHead.CmdID = ProtoID.GetProtoIDByBody(bodyIn);
        }
示例#4
0
 public static int GetNormalProtoHeadLen()
 {
     return(ServerHead.GetSerializeLength() + ProtoHead.GetSerializeLength());
 }