public override byte[] GetBuffer() { PacketOut outpack = new PacketOut(mKey); mMsgLen += (ushort)(list_item.Count * 40); outpack.WriteUInt16(mMsgLen); outpack.WriteUInt16(mParam); outpack.WriteInt16(param); outpack.WriteInt32(page); outpack.WriteInt32(param1); outpack.WriteInt16(param2); outpack.WriteInt16((short)list_item.Count); outpack.WriteInt32(param3); for (int i = 0; i < list_item.Count; i++) { byte[] namebyte = Coding.GetDefauleCoding().GetBytes(list_item[i].name); byte[] namebyteex = null; //防止溢出- 2016.1.23 if (namebyte.Length > 15) { namebyteex = new byte[15]; Buffer.BlockCopy(namebyte, 0, namebyteex, 0, 15); } else { namebyteex = new byte[namebyte.Length]; Buffer.BlockCopy(namebyte, 0, namebyteex, 0, namebyte.Length); } outpack.WriteBuff(namebyteex); byte[] byte_ = new byte[16 - namebyteex.Length]; outpack.WriteBuff(byte_); outpack.WriteInt32(0); outpack.WriteULong(list_item[i].guanjue); outpack.WriteInt32(1); outpack.WriteInt32(list_item[i].pos); outpack.WriteInt32(0); } return outpack.Flush(); }