Exemplo n.º 1
0
Arquivo: Habbo.cs Projeto: habb0/IHI-1
        private void LoadFigure()
        {
            string figureString;
            bool   gender;

            HabboActions.GetFigureFromHabboId(Id, out figureString, out gender);
            _figure.Value = CoreManager.ServerCore.HabboFigureFactory.Parse(figureString, gender);
        }
Exemplo n.º 2
0
Arquivo: Habbo.cs Projeto: habb0/IHI-1
 internal Habbo(int id)
 {
     if (!HabboActions.DoesHabboIdExist(id))
     {
         throw new Exception(CoreManager.ServerCore.StringLocale.GetString("CORE:EXCEPTION_HABBO_CONSTRUCT_BAD_ID"));
     }
     Id = id;
     Init();
 }
Exemplo n.º 3
0
        /// <summary>
        ///   Returns the Habbo with the matching SSO Ticket.
        ///   If no match is made, null is returned.
        /// </summary>
        /// <param name = "ssoTicket">The SSO Ticket to match.</param>
        public Habbo GetHabboFromSSOTicket(string ssoTicket)
        {
            // Get the ID of the matching Habbo.
            int habboId = HabboActions.GetHabboIdFromSSOTicket(ssoTicket);

            // Is the ID is -1
            if (habboId == -1)
            {
                // Yes, meaning there was no match. Return null.
                return(null);
            }

            // No, return the Habbo from the cache.
            return(this[habboId]);
        }
Exemplo n.º 4
0
Arquivo: Habbo.cs Projeto: habb0/IHI-1
        private void Init()
        {
            _loginId     = new ResettableLazyDirty <int>(() => HabboActions.GetLoginIdFromHabboId(Id));
            _username    = new ResettableLazyDirty <string>(() => HabboActions.GetHabboUsernameFromHabboId(Id));
            _dateCreated = new ResettableLazyDirty <DateTime>(() => HabboActions.GetCreationDateFromHabboId(Id));
            _lastAccess  = new ResettableLazyDirty <DateTime>(() => HabboActions.GetLastAccessDateFromHabboId(Id));
            _credits     = new ResettableLazyDirty <int>(() => HabboActions.GetCreditsFromHabboId(Id));

            _instanceStorage   = new InstanceStorage();
            _persistentStorage = new PersistentStorage(this);

            _permissions = new ResettableLazyDirty <IDictionary <string, PermissionState> >(() => CoreManager.ServerCore.PermissionDistributor.GetHabboPermissions(this));

            _figure = new ResettableLazyDirty <HabboFigure>(() => LoadFigure());
            _motto  = new ResettableLazyDirty <string>(() => HabboActions.GetMottoFromHabboId(Id));

            MessengerCategories = new HashSet <MessengerCategory>();
        }
Exemplo n.º 5
0
Arquivo: Habbo.cs Projeto: habb0/IHI-1
 internal Habbo(string username)
 {
     // The username really should be set here but it is not currently possible with the lazy loading.
     Id = HabboActions.GetHabboIdFromHabboUsername(username);
     Init();
 }