using System; using System.Text; using Woodpecker.Specialized.Text; using Woodpecker.Specialized.Encoding; namespace Woodpecker.Net.Game.Messages { /// /// Represents a server>client message for the Habbo FUSE protocol. /// public class serverMessage : fuseStringBuilder { #region Constructors /// /// Constructs a serverMessage with no content. /// public serverMessage() { base.Content = new StringBuilder(); } /// /// Constructs a server>client message with a certain ID. /// /// The ID of this message. public serverMessage(int messageID) { base.Content = new StringBuilder(base64Encoding.Encode(messageID)); } #endregion #region Methods /// /// Clears the stringbuilder and initializes it with a certain message ID. /// /// The ID of this message. public void Initialize(int messageID) { base.Content = new StringBuilder(base64Encoding.Encode(messageID)); } /// /// Appends char1 to the message content and returns the message content as a string. /// public override string ToString() { return base.ToString() + Convert.ToChar(1); } public static serverMessage createDefaultMessageBox(string Text) { serverMessage retCast = new serverMessage(139); // "BK" retCast.Append(Text); return retCast; } #endregion } }