internal AvatarEffectsInventoryComponent(uint UserId, GameClient pClient, UserData data)
        {
            this.mClient = pClient;
            this.Effects = new ArrayList();
            this.UserId = UserId;
            this.CurrentEffect = -1;
            this.Effects.Clear();

            StringBuilder QueryBuilder = new StringBuilder();
            foreach (AvatarEffect effect in data.effects)
            {
                if (!effect.HasExpired)
                {
                    Effects.Add(effect);
                    EffectCount++;
                }
                else
                    QueryBuilder.Append("DELETE FROM user_effects WHERE user_id = " + UserId + " AND effect_id = " + effect.EffectId + "; ");
            }

            if (QueryBuilder.Length > 0)
            {
                using (IQueryAdapter dbClient = PiciEnvironment.GetDatabaseManager().getQueryreactor())
                    dbClient.runFastQuery(QueryBuilder.ToString());
            }
        }
Пример #2
0
        internal BadgeComponent(uint userId, UserData data)
        {
            this.Badges = new Hashtable();
            foreach (Badge badge in data.badges)
            {
                if (!Badges.ContainsKey(badge.Code))
                    Badges.Add(badge.Code, badge);
            }

            this.UserId = userId;
        }
Пример #3
0
 internal static InventoryComponent GetInventory(uint UserId, GameClient Client, UserData data)
 {
     return new InventoryComponent(UserId, Client, data);
     //InventoryComponent component;
     //if (storage.TryGetValue(UserId, out component))
     //    return component;
     //else
     //{
     //    InventoryComponent toReturn =
     //    storage.Add(UserId, toReturn);
     //    return toReturn;
     //}
 }
Пример #4
0
        internal InventoryComponent(uint UserId, GameClient Client, UserData UserData)
        {
            this.mClient = Client;
            this.UserId = UserId;
            this.floorItems = new Hashtable();
            this.wallItems = new Hashtable();
            this.discs = new Hashtable();

            foreach (UserItem item in UserData.inventory)
            {
                if (item.GetBaseItem().InteractionType == InteractionType.musicdisc)
                    discs.Add(item.Id, item);
                if (item.isWallItem)
                    wallItems.Add(item.Id, item);
                else
                    floorItems.Add(item.Id, item);
            }

            this.InventoryPets = new SafeDictionary<UInt32, Pet>(UserData.pets);
            this.mAddedItems = new Hashtable();
            this.mRemovedItems = new ArrayList();
            this.isUpdated = false;
        }
Пример #5
0
 internal void LoadData(UserData data)
 {
     LoadAchievements(data.achievements);
     LoadFavorites(data.favouritedRooms);
     LoadMutedUsers(data.ignores);
     LoadTags(data.tags);
 }
Пример #6
0
        internal void Init(GameClient client, UserData data)
        {
            this.mClient = client;

            this.SubscriptionManager = new SubscriptionManager(Id, data);
            this.BadgeComponent = new BadgeComponent(Id, data);
            this.InventoryComponent = InventoryGlobal.GetInventory(Id, client, data);
            this.InventoryComponent.SetActiveState(client);
            this.AvatarEffectsInventoryComponent = new AvatarEffectsInventoryComponent(Id, client, data);
            this.quests = data.quests;
            this.chatMessageManager = new ChatMessageManager();

            this.Messenger = new HabboMessenger(Id);
            this.Messenger.Init(data.friends, data.requests);

            this.SpectatorMode = false;
            this.Disconnected = false;
            this.UsersRooms = data.rooms;
        }
Пример #7
0
 internal SubscriptionManager(uint userID, UserData userData)
 {
     this.UserId = userID;
     Subscriptions = userData.subscriptions;
 }