internal AvatarEffectsInventoryComponent(int UserId, GameClient pClient, UserData data) { _removeQueue = new Queue(); 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 = FirewindEnvironment.GetDatabaseManager().getQueryreactor()) dbClient.runFastQuery(QueryBuilder.ToString()); } }
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; }
internal static InventoryComponent GetInventory(int 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; //} }
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; }
internal SubscriptionManager(int userID, UserData userData) { this.UserId = userID; Subscriptions = userData.subscriptions; }
internal void LoadData(UserData data) { LoadAchievements(data.achievements); LoadFavorites(data.favouritedRooms); LoadMutedUsers(data.ignores); LoadTags(data.tags); }
internal void InitInformation(UserData data) { this.SubscriptionManager = new SubscriptionManager(Id, data); this.BadgeComponent = new BadgeComponent(Id, 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; }
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; }