Пример #1
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="InventoryComponent" /> class.
        /// </summary>
        /// <param name="userId">The user identifier.</param>
        /// <param name="client">The client.</param>
        /// <param name="userData">The user data.</param>
        internal InventoryComponent(uint userId, GameClient client, UserData userData)
        {
            _mClient = client;
            UserId = userId;
            _floorItems = new HybridDictionary();
            _wallItems = new HybridDictionary();
            SongDisks = new HybridDictionary();

            foreach (UserItem current in userData.Inventory)
            {
                if (current.BaseItem.InteractionType == Interaction.MusicDisc)
                    SongDisks.Add(current.Id, current);
                if (current.IsWallItem)
                    _wallItems.Add(current.Id, current);
                else
                    _floorItems.Add(current.Id, current);
            }

            _inventoryPets = new HybridDictionary();
            _inventoryBots = new HybridDictionary();
            _mAddedItems = new HybridDictionary();
            _mRemovedItems = new HybridDictionary();
            _isUpdated = false;

            foreach (KeyValuePair<uint, RoomBot> bot in userData.Bots)
                AddBot(bot.Value);

            foreach (KeyValuePair<uint, Pet> pets in userData.Pets)
                AddPets(pets.Value);
        }
Пример #2
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="UserBadgeManager" /> class.
        /// </summary>
        /// <param name="userId">The user identifier.</param>
        /// <param name="data">The data.</param>
        internal UserBadgeManager(uint userId, UserData data)
        {
            BadgeList = new HybridDictionary();

            foreach (Badge current in data.Badges.Where(current => !BadgeList.Contains(current.Code)))
                BadgeList.Add(current.Code, current);

            _userId = userId;
        }
Пример #3
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="AvatarEffectComponent" /> class.
        /// </summary>
        /// <param name="userId">The user identifier.</param>
        /// <param name="client">The client.</param>
        /// <param name="data">The data.</param>
        internal AvatarEffectComponent(uint userId, GameClient client, UserData data)
        {
            _userId = userId;
            _session = client;
            _effects = new List<AvatarEffect>();

            foreach (AvatarEffect current in data.Effects)
            {
                if (!current.HasExpired)
                    _effects.Add(current);

                if (!current.HasExpired)
                    return;

                using (IQueryAdapter queryReactor = Yupi.GetDatabaseManager().GetQueryReactor())
                        queryReactor.RunFastQuery("DELETE FROM users_effects WHERE user_id = " + userId + " AND effect_id = " + current.EffectId + "; ");
            }
        }
Пример #4
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="SubscriptionManager" /> class.
 /// </summary>
 /// <param name="userId">The user identifier.</param>
 /// <param name="userData">The user data.</param>
 internal SubscriptionManager(uint userId, UserData userData)
 {
     _userId = userId;
     _subscription = userData.Subscriptions;
 }
Пример #5
0
Файл: Habbo.cs Проект: sgf/Yupi
 /// <summary>
 ///     Loads the data.
 /// </summary>
 /// <param name="data">The data.</param>
 internal void LoadData(UserData data)
 {
     LoadAchievements(data.Achievements);
     LoadTalents(data.Talents);
     LoadFavorites(data.FavouritedRooms);
     LoadMutedUsers(data.Ignores);
     LoadTags(data.Tags);
 }
Пример #6
0
Файл: Habbo.cs Проект: sgf/Yupi
 /// <summary>
 ///     Initializes the specified client.
 /// </summary>
 /// <param name="client">The client.</param>
 /// <param name="data">The data.</param>
 internal void Init(GameClient client, UserData data)
 {
     _mClient = client;
     _subscriptionManager = new SubscriptionManager(Id, data);
     _badgeComponent = new UserBadgeManager(Id, data);
     _inventoryComponent = new InventoryComponent(Id, client, data);
     _inventoryComponent.SetActiveState(client);
     _avatarEffectComponent = new AvatarEffectComponent(Id, client, data);
     Quests = data.Quests;
     _messenger = new HabboMessenger(Id);
     _messenger.Init(data.Friends, data.Requests);
     FriendCount = Convert.ToUInt32(data.Friends.Count);
     SpectatorMode = false;
     Disconnected = false;
     UsersRooms = data.Rooms;
     MinimailUnreadMessages = data.MiniMailCount;
     Relationships = data.Relations;
     AnsweredPolls = data.SuggestedPolls;
     ClothesManagerManager = new UserClothesManager(Id);
     Preferences = new UserPreferences(Id);
     YoutubeManager = new YoutubeManager(Id);
 }
Пример #7
0
Файл: Habbo.cs Проект: sgf/Yupi
 /// <summary>
 ///     Initializes the information.
 /// </summary>
 /// <param name="data">The data.</param>
 internal void InitInformation(UserData data)
 {
     _subscriptionManager = new SubscriptionManager(Id, data);
     _badgeComponent = new UserBadgeManager(Id, data);
     Quests = data.Quests;
     _messenger = new HabboMessenger(Id);
     _messenger.Init(data.Friends, data.Requests);
     SpectatorMode = false;
     Disconnected = false;
     UsersRooms = data.Rooms;
     Relationships = data.Relations;
     AnsweredPolls = data.SuggestedPolls;
 }