Beispiel #1
0
		internal InventoryComponent(uint UserId, GameClient Client, UserData UserData)
		{
			this.mClient = Client;
			this.UserId = UserId;
			this.floorItems = new HybridDictionary();
			this.wallItems = new HybridDictionary();
			this.discs = new HybridDictionary();
			foreach (UserItem current in UserData.inventory)
			{
				if (current.GetBaseItem().InteractionType == InteractionType.musicdisc)
				{
					this.discs.Add(current.Id, current);
				}
				if (current.isWallItem)
				{
					this.wallItems.Add(current.Id, current);
				}
				else
				{
					this.floorItems.Add(current.Id, current);
				}
			}
			this.InventoryPets = new SafeDictionary<uint, Pet>(UserData.pets);
			this.InventoryBots = new SafeDictionary<uint, RoomBot>(UserData.Botinv);
			this.mAddedItems = new HybridDictionary();
			this.mRemovedItems = new HybridDictionary();
			this.isUpdated = false;
		}
		internal AvatarEffectsInventoryComponent(uint UserId, GameClient Client, UserData Data)
		{
			this.UserId = UserId;
			this.Session = Client;
			this.Effects = new List<AvatarEffect>();
			foreach (AvatarEffect current in Data.effects)
			{
				if (!current.HasExpired)
				{
					this.Effects.Add(current);
				}
				else
				{
					using (IQueryAdapter queryreactor = MercuryEnvironment.GetDatabaseManager().getQueryreactor())
					{
						queryreactor.runFastQuery(string.Concat(new object[]
						{
							"DELETE FROM user_effects WHERE user_id = ",
							UserId,
							" AND effect_id = ",
							current.EffectId,
							"; "
						}));
					}
				}
			}
		}
Beispiel #3
0
		internal BadgeComponent(uint userId, UserData data)
		{
			this.Badges = new HybridDictionary();
			foreach (Badge current in data.badges)
			{
                if (!this.Badges.Contains(current.Code))
				{
					this.Badges.Add(current.Code, current);
				}
			}
			this.UserId = userId;
		}
Beispiel #4
0
		internal SubscriptionManager(uint userID, UserData userData)
		{
			this.UserId = userID;
			this.Subscription = userData.subscriptions;
		}
Beispiel #5
0
		internal static InventoryComponent GetInventory(uint UserId, GameClient Client, UserData data)
		{
			return new InventoryComponent(UserId, Client, data);
		}
Beispiel #6
0
		internal void LoadData(UserData data)
		{
			this.LoadAchievements(data.achievements);
			this.LoadTalents(data.talents);
			this.LoadFavorites(data.favouritedRooms);
			this.LoadMutedUsers(data.ignores);
			this.LoadTags(data.tags);
		}
Beispiel #7
0
		internal void Init(GameClient client, UserData data)
		{
			this.mClient = client;
			this.SubscriptionManager = new SubscriptionManager(this.Id, data);
			this.BadgeComponent = new BadgeComponent(this.Id, data);
			this.InventoryComponent = InventoryGlobal.GetInventory(this.Id, client, data);
			this.InventoryComponent.SetActiveState(client);
			this.CommandHandler = new ChatCommandHandler(client);
			this.AvatarEffectsInventoryComponent = new AvatarEffectsInventoryComponent(this.Id, client, data);
			this.quests = data.quests;
			this.Messenger = new HabboMessenger(this.Id);
			this.Messenger.Init(data.friends, data.requests);
			this.FriendCount = Convert.ToUInt32(data.friends.Count);
			this.SpectatorMode = false;
			this.Disconnected = false;
			this.UsersRooms = data.rooms;
            this.MinimailUnreadMessages = data.miniMailCount;
			this.Relationships = data.Relations;
			this.AnsweredPolls = data.suggestedPolls;
		}
Beispiel #8
0
		internal void InitInformation(UserData data)
		{
			this.SubscriptionManager = new SubscriptionManager(this.Id, data);
			this.BadgeComponent = new BadgeComponent(this.Id, data);
			this.quests = data.quests;
			this.Messenger = new HabboMessenger(this.Id);
			this.Messenger.Init(data.friends, data.requests);
			this.SpectatorMode = false;
			this.Disconnected = false;
			this.UsersRooms = data.rooms;
			this.Relationships = data.Relations;
			this.AnsweredPolls = data.suggestedPolls;
		}