示例#1
0
        /// <summary>
        /// Gets the integer.
        /// </summary>
        /// <returns>System.Int32.</returns>
        internal int GetInteger()
        {
            if (RemainingLength < 1)
            {
                return(0);
            }
            var v      = GetBytes(4);
            var result = HabboEncoding.DecodeInt32(v);

            {
                _pointer += 4;
                return(result);
            }
        }
示例#2
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());
        }
示例#3
0
        /// <summary>
        /// Gets the next.
        /// </summary>
        /// <returns>System.Byte[].</returns>
        internal byte[] GetNext()
        {
            int bytes = HabboEncoding.DecodeInt16(ReadBytes(2));

            return(ReadBytes(bytes));
        }
示例#4
0
 /// <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())));
 }