/// <summary> /// Appends the string. /// </summary> /// <param name="s">The s.</param> /// <param name="isUtf8">If string is UTF8</param> public void AppendString(string s, bool isUtf8 = false) { var toAdd = isUtf8 ? Plus.GetDefaultEncoding().GetBytes(s) : Encoding.UTF8.GetBytes(s); AppendShort(toAdd.Length); AppendBytes(toAdd, false); }
internal static void Set() { XmlPolicyBytes = Plus.GetDefaultEncoding().GetBytes("<?xml version=\"1.0\"?>\r\n" + "<!DOCTYPE cross-domain-policy SYSTEM \"/xml/dtds/cross-domain-policy.dtd\">\r\n" + "<cross-domain-policy>\r\n" + "<allow-access-from domain=\"*\" to-ports=\"1232-30008\" />\r\n" + "</cross-domain-policy>\x0"); /*XmlPolicyBytes = Plus.GetDefaultEncoding().GetBytes("<?xml version=\"1.0\"?>\r\n<!DOCTYPE cross-domain-policy SYSTEM \"/xml/dtds/cross-domain-policy.dtd\">\r\n<cross-domain-policy>\r\n<allow-access-from domain=\"*\" to-ports=\"" + * ConfigurationData.Data["game.tcp.port"] + "\" />\r\n</cross-domain-policy>\0");*/ }
/// <summary> /// Gets the reversed bytes. /// </summary> /// <returns>System.Byte[].</returns> public byte[] GetReversedBytes() { var final = new List <byte>(); final.AddRange(BitConverter.GetBytes(CMessage.Count)); final.Reverse(); final.AddRange(_message); if (Plus.DebugMode) { Console.ForegroundColor = ConsoleColor.DarkBlue; Console.WriteLine(); Console.Write("OUTGOING "); Console.ForegroundColor = ConsoleColor.DarkGreen; Console.Write("PREPARED "); Console.ForegroundColor = ConsoleColor.DarkGray; Console.Write(Id + Environment.NewLine + HabboEncoding.GetCharFilter(Plus.GetDefaultEncoding().GetString(final.ToArray()))); Console.WriteLine(); } return(final.ToArray()); }
/// <summary> /// Returns a <see cref="System.String" /> that represents this instance. /// </summary> /// <returns>A <see cref="System.String" /> that represents this instance.</returns> public override string ToString() { return(HabboEncoding.GetCharFilter(Plus.GetDefaultEncoding().GetString(GetReversedBytes()))); }