public int DecodedPacketForXml() { if (buffer == null) { return(-1); } string xml = Encoding.Default.GetString(buffer); this.xmlPacket = CXmlManager.ParseFromXml(xml); return(buffer.Length); }
public static byte[] EncodedPacketForXml(string user_name, string user_session, string game_key, PROTOCOL protocol, List <string> datas) { CXmlManager xml = new CXmlManager(); xml.XML_FORM(user_name, user_session, game_key, protocol, datas); byte[] packet = Encoding.Default.GetBytes(xml.ByString()); if (BitConverter.IsLittleEndian == false) { Array.Reverse(packet); } return(packet); }