public Protocol(ProtoID id, ProtoBody body) { protoHead = new ProtoHead(); protoHead.CmdID = id; serverHead = new ServerHead(); protoBody = body; }
/// <summary> /// 仅生成ProtoHead /// </summary> public Protocol() { protoHead = new ProtoHead(); serverHead = new ServerHead(); protoBody = null; }
/// <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); }
public static int GetNormalProtoHeadLen() { return(ServerHead.GetSerializeLength() + ProtoHead.GetSerializeLength()); }