public static byte[] Create(PackageReqHead head, BaseReqData data) { WriteHead(head); WriteData(data); return(WriteBytesLength()); }
public static byte[] Create(int actionId, BaseReqData data) { var head = new PackageReqHead() { ActionId = actionId, MsgId = ++MsgCounter }; WriteHead(head); WriteData(data); Console.WriteLine("Send: {0}", _sendStr); var bytes = WriteBytesLength(); _sendStr = ""; return(bytes); }
private static void WriteHead(PackageReqHead head) { _sendStr += string.Format("MsgId={0}&ActionId={1}", head.MsgId, head.ActionId); }