锘??xml version="1.0" encoding="utf-8" standalone="yes"?>
]]>
[Serializable]
struct DR2DE_Send
{
public UInt32 AA;
public UInt32 BB;
public UInt16 CC; //! Encryption method.
public UInt16 DD; //! message version // used to decide message version.
public UInt32 EE; //! message id.
public UInt32 FF; //! Message order. it is a increseable integer and set when checkEncrypt called and when ReturnMessage is set.
public Byte GG;
public Byte LL;
public char[] MM;
}
搴忓垪鍖栨搷浣滐細
byte[] sendMsg = new byte[1024];
BinaryFormatter bf = new BinaryFormatter();
MemoryStream stream = new MemoryStream();
DR2DE_Send dr2deMessage;
dr2deMessage.AA= (UInt32)(0);
dr2deMessage.BB= (UInt16)(0);
dr2deMessage.CC=(UInt32)(0);
dr2deMessage.DD= (UInt16)(0);
dr2deMessage.EE= "Hello".ToCharArray();
dr2deMessage.FF= 40010;
dr2deMessage.GG= (UInt32)(22 + dr2deMessage.data.Length);
dr2deMessage.HH= 1;
dr2deMessage.II= 1;
bf.Serialize(stream, dr2deMessage);
sendMsg = stream.ToArray();
]]>