using System; using Ion.Storage; using Ion.Net.Connections; using Ion.HabboHotel.Client; using Ion.HabboHotel.Habbos; namespace Ion.HabboHotel { /// /// Represents a multiuser, virtual hotel where users can create avatars, to chat with other users in spaces set up as 'rooms'. Users have the ability to create their own 'guestroom' as well, and they are able to decorate it with virtual furniture. /// public class HabboHotel { #region Fields private uint mVersion; // Modules private GameClientManager mClientManager = null; private HabboManager mHabboManager = null; private HabboAuthenticator mAuthenticator = null; #endregion #region Properties /// /// Gets the version of the game client as a 32 bit unsigned integer. /// public uint Version { get { return mVersion; } } #endregion #region Constructors /// /// Constructs a Habbo Hotel environment and tries to initialize it. /// public HabboHotel() { // Try to parse version IonEnvironment.Configuration.TryParseUInt32("projects.habbo.client.version", out mVersion); // Initialize HabboHotel project modules mClientManager = new GameClientManager(); mHabboManager = new HabboManager(); mAuthenticator = new HabboAuthenticator(); // Start connection checker for clients mClientManager.StartConnectionChecker(); // Print that we are done! IonEnvironment.GetLog().WriteLine(string.Format("Initialized project 'Habbo Hotel' for version {0}.", mVersion)); } #endregion #region Methods public void Destroy() { // Clear clients if (GetClients() != null) { GetClients().Clear(); GetClients().StopConnectionChecker(); } IonEnvironment.GetLog().WriteLine(string.Format("Destroyed project 'Habbo Hotel' for version {0}.", mVersion)); } /// /// Returns the game client manager. /// public GameClientManager GetClients() { return mClientManager; } /// /// Returns the Habbo manager. /// public HabboManager GetHabbos() { return mHabboManager; } /// /// Returns the Habbo authenticator. /// public HabboAuthenticator GetAuthenticator() { return mAuthenticator; } #endregion } }