public Friendship(Dictionary<int, Object> Row)
        {
            Security.SecurityCounter Counter = new Security.SecurityCounter(0);

            UserId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            FriendId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            Pending = BrickEngine.GetConvertor().ObjectToBoolean(Row[Counter.Next]);
        }
        public FriendGroup(Dictionary<int, Object> Row)
        {
            Security.SecurityCounter Counter = new Security.SecurityCounter(-1);

            Id = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            UserId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            Name = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]);
        }
        public EcotronReward(DataRow Row)
        {
            Security.SecurityCounter Counter = new Security.SecurityCounter(-1);

            Id = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            BaseId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            Level = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
        }
Exemple #4
0
        public Badge(Dictionary<int, Object> Row)
        {
            Security.SecurityCounter Counter = new Security.SecurityCounter(0);

            OwnerId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            BadgeCode = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]);
            SlotId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
        }
        public QuestCategory(DataRow Row)
        {
            Security.SecurityCounter Counter = new Security.SecurityCounter(-1);

            Id = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            Name = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]);
            OrderId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
        }
Exemple #6
0
        public Clothe(Dictionary<int, Object> Row)
        {
            Security.SecurityCounter Counter = new Security.SecurityCounter(-1);

            HabboId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            SlotId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            Look = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]);
            Gender = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]);
        }
        public MarketDevelopment(Dictionary<int, Object> Row)
        {
            Security.SecurityCounter Counter = new Security.SecurityCounter(-1);

            Id = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            BaseId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            DateTime = BrickEngine.GetConvertor().ObjectToDateTime(Row[Counter.Next]);
            CreditsRequest = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
        }
        public ShopClubItem(DataRow Row)
        {
            Security.SecurityCounter Counter = new Security.SecurityCounter(-1);

            Id = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            MonthsAmount = BrickEngine.GetConvertor().ObjectToShort(Row[Counter.Next]);
            ShopItemId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            MemberShipType = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]);
        }
Exemple #9
0
        public PetAction(DataRow Row)
        {
            Security.SecurityCounter Counter = new Security.SecurityCounter(-1);

            Id = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            PetType = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            Key = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]);
            Value = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]);
        }
Exemple #10
0
        public PetRace(DataRow Row)
        {
            Security.SecurityCounter Counter = new Security.SecurityCounter(-1);

            Id = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            Type = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            RaceAmount = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            StartIndexer = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
        }
Exemple #11
0
        public PetSpeech(DataRow Row)
        {
            Security.SecurityCounter Counter = new Security.SecurityCounter(-1);

            Id = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            PetType = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            Speech = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]);
            Shout = BrickEngine.GetConvertor().ObjectToBoolean(Row[Counter.Next]);
        }
        public PrivateCategory(DataRow Row)
        {
            Security.SecurityCounter Counter = new Security.SecurityCounter(-1);

            Id = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            Name = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]);
            RankAllowed = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            EnableTrading = BrickEngine.GetConvertor().ObjectToBoolean(Row[Counter.Next]);
        }
        public ShopGiftItem(DataRow Row)
        {
            Security.SecurityCounter Counter = new Security.SecurityCounter(-1);

            Id = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            BaseId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            MemberType = (BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]) == "BASIC") ? MemberType.BASIC : MemberType.VIP;
            MemberdaysNeed = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
        }
        public FriendGroupItem(Dictionary<int, Object> Row)
        {
            Security.SecurityCounter Counter = new Security.SecurityCounter(-1);

            Id = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            UserId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            FriendId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            CategoryId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
        }
Exemple #15
0
        public Quest(DataRow Row)
        {
            Security.SecurityCounter Counter = new Security.SecurityCounter(-1);

            Id = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            CategoryId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            Action = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]);
            ActionAmount = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            PixelReward = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            OrderId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
        }
Exemple #16
0
        public Effect(Dictionary<int, Object> Row)
        {
            Security.SecurityCounter Counter = new Security.SecurityCounter(-1);

            Id = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            UserId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            EffectId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            EffectLength = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);

            DateTime.TryParse(BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]), out Activated);
        }
Exemple #17
0
        public BannedItem(DataRow Row)
        {
            Security.SecurityCounter Counter = new Security.SecurityCounter(0);

            this.UserId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            this.UserIP = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]);
            this.IPBan = BrickEngine.GetConvertor().ObjectToBoolean(Row[Counter.Next]);
            this.Started = BrickEngine.GetConvertor().ObjectToDateTime(Row[Counter.Next]);
            this.Ended = BrickEngine.GetConvertor().ObjectToDateTime(Row[Counter.Next]);
            this.GivenModId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            this.Reason = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]);
        }
Exemple #18
0
        public Membership(Dictionary<int, Object> Row)
        {
            Security.SecurityCounter Counter = new Security.SecurityCounter(-1);

            Id = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            UserId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            ActivatedTime = BrickEngine.GetConvertor().ObjectToDateTime(Row[Counter.Next]);
            MonthAmount = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            MonthsPassedBasic = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            MonthsPassedVip = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            MemberScale = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            GiftsSelectedAmount = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
        }
        public MarketOffer(Dictionary<int,Object> Row)
        {
            Security.SecurityCounter Counter = new Security.SecurityCounter(-1);

            Id = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            UserId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            BaseId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            State = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            BaseName = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]);
            CreditsRequest = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            CreditsRequestTot = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            DateTime = BrickEngine.GetConvertor().ObjectToDateTime(Row[Counter.Next]);
        }
        public VirtualRoom(DataRow Row)
        {
            Security.SecurityCounter Counter = new Security.SecurityCounter(-1);

            Id = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            Name = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]);
            Description = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]);
            OwnerId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            CategoryId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            LimitUsers = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            Password = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]);
            ModelParam = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]);

            string TagsParams = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]);

            foreach (string Tag in TagsParams.Split(','))
            {
                if (Tag.Length > 0)
                {
                    Tags.Add(Tag);
                }
            }

            DoorState = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);

            int IconBg = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            int IconFg = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            string ItemsRaw = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]);

            Icon = new RoomIcon(Id, IconBg, IconFg, ItemsRaw);

            Rating = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);

            AllowPets = BrickEngine.GetConvertor().ObjectToBoolean(Row[Counter.Next]);
            AllowPetsEat = BrickEngine.GetConvertor().ObjectToBoolean(Row[Counter.Next]);
            AllowWalkthough = BrickEngine.GetConvertor().ObjectToBoolean(Row[Counter.Next]);
            AllowHideWall = BrickEngine.GetConvertor().ObjectToBoolean(Row[Counter.Next]);

            WallThick = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            FloorThick = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);

            Wallpaper = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]);
            Floor = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]);
            Landscape = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]);
        }
Exemple #21
0
        public RoomModel(DataRow Row)
        {
            Security.SecurityCounter Counter = new Security.SecurityCounter(-1);

            Id = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]);
            Map = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]);

            Door = new iPoint(-1, -1);

            Door.X = BrickEngine.GetConvertor().ObjectToShort(Row[Counter.Next]) - 1;
            Door.Y = BrickEngine.GetConvertor().ObjectToShort(Row[Counter.Next]);
            Door.Z = BrickEngine.GetConvertor().ObjectToDouble(Row[Counter.Next]);
            DoorRot = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);

            LimitUsers = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);

            GenerateLines();
        }
Exemple #22
0
        public PetInfo(DataRow Row)
        {
            Security.SecurityCounter Counter = new Security.SecurityCounter(-1);

            Id = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            UserId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            RoomId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            Name = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]);
            Type = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            Race = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            Color = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]);

            Happiness = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            Expirience = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            Energy = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);

            Respect = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            Created = BrickEngine.GetConvertor().ObjectToDateTime(Row[Counter.Next]);

            X = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            Y = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            Rot = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
        }
        public void Prepare()
        {
            RunningRooms = new Dictionary<int, VirtualRoom>();

            LoadRoomModels();

            // Cached id Generator
            using (QueryReactor Reactor = BrickEngine.GetQueryReactor())
            {
                Reactor.SetQuery("SELECT MAX(id) FROM private_rooms LIMIT 1");
                RoomIdCounter = new Security.SecurityCounter(Reactor.GetInt32());
            }
        }
        public void DeliverMembership(int UserId, int Type, int Months)
        {
            Membership Membership;
            DateTime Activated = DateTime.Now;

            // User has already a Membership
            if (MemberShips.ContainsKey(UserId))
            {
                Membership = MemberShips[UserId];

                if (Membership.MemberScale == Type)
                {
                    Membership.MonthAmount += Months;

                    using (QueryReactor Reactor = BrickEngine.GetQueryReactor())
                    {
                        Reactor.SetQuery("UPDATE user_memberships SET month_amount = month_amount + @months, member_scaler = @type WHERE user_id = @userid LIMIT 1");
                        Reactor.AddParam("userid", UserId);
                        Reactor.AddParam("months", Months);
                        Reactor.AddParam("type", Type);
                        Reactor.ExcuteQuery();
                    }
                }
                else
                {
                    Membership.ActivatedTime = Activated;
                    Membership.MonthAmount = Months;

                    using (QueryReactor Reactor = BrickEngine.GetQueryReactor())
                    {
                        Reactor.SetQuery("UPDATE user_memberships SET activated_datetime = @activated, month_amount = @months, member_scaler = @type WHERE user_id = @userid LIMIT 1");
                        Reactor.AddParam("userid", UserId);
                        Reactor.AddParam("activated", Activated);
                        Reactor.AddParam("months", Months);
                        Reactor.AddParam("type", Type);
                        Reactor.ExcuteQuery();
                    }
                }

                Membership.MemberScale = Type;
            }
            else
            {
                var Dic = new Dictionary<int, Object>();

                Security.SecurityCounter Counter = new Security.SecurityCounter(-1);

                Dic[Counter.Next] = -1;
                Dic[Counter.Next] = UserId;
                Dic[Counter.Next] = Activated;
                Dic[Counter.Next] = Months;
                Dic[Counter.Next] = 0;
                Dic[Counter.Next] = 0;
                Dic[Counter.Next] = Type;
                Dic[Counter.Next] = 0;

                Membership = new Membership(Dic);
                MemberShips.Add(UserId, Membership);

                using (QueryReactor Reactor = BrickEngine.GetQueryReactor())
                {
                    Reactor.SetQuery("INSERT INTO user_memberships (user_id, activated_datetime, month_amount, member_scaler) VALUES (@userid, @activated, @months, @type)");
                    Reactor.AddParam("userid", UserId);
                    Reactor.AddParam("activated", Activated);
                    Reactor.AddParam("months", Months);
                    Reactor.AddParam("type", Type);
                    Reactor.ExcuteQuery();
                }
            }
        }
        public void LoadEffects()
        {
            Effects = new Dictionary<int, Effect>();

            DataTable Table = null;

            using (QueryReactor Reactor = BrickEngine.GetQueryReactor())
            {
                Reactor.SetQuery("SELECT MAX(id) FROM user_effects LIMIT 1");
                EffectIdCounter = new Security.SecurityCounter(Reactor.GetInt32());
            }

            using (QueryReactor Reactor = BrickEngine.GetQueryReactor())
            {
                Reactor.SetQuery("SELECT * FROM user_effects");
                Table = Reactor.GetTable();
            }

            foreach (DataRow Row in Table.Rows)
            {
                Effect Effect = new Effect(Row);

                Effects.Add(Effect.Id, Effect);
            }
        }
Exemple #26
0
        private void UpdateClothe(Client Client, Request Request)
        {
            Membership Membership = Client.GetUser().GetMembership();

            if (Membership == null)
            {
                return;
            }

            int SlotId = Request.PopWiredInt32();
            string Look = BrickEngine.CleanString(Request.PopFixedString());
            string Gender = BrickEngine.CleanString(Request.PopFixedString());

            var LeakedRow = new Dictionary<int, Object>();

            SecurityCounter Counter = new Security.SecurityCounter(-1);

            LeakedRow[Counter.Next] = Client.GetUser().HabboId;
            LeakedRow[Counter.Next] = SlotId;
            LeakedRow[Counter.Next] = Look;
            LeakedRow[Counter.Next] = Gender;

            Clothe LeakedClothe = new Clothe(LeakedRow);

            BrickEngine.GetClothesHandler().UpdateClothe(LeakedClothe.HabboId, LeakedClothe);
        }
Exemple #27
0
        public UserCache(DataRow Row)
        {
            Security.SecurityCounter Counter = new Security.SecurityCounter(-1);

            this.HabboId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            this.Username = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]);

            Counter.Skip();

            this.Email = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]);
            this.Motto = BrickEngine.CleanString(BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]));
            this.Look = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]);
            this.Gender = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]);
            this.Rank = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            this.Credits = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            this.Pixels = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            this.HomeRoomId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            this.AchievementScore = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            this.RespectGained = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            this.RespectGiven = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            this.RespectLeft = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            this.RespectLeftPets = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            this.EnabledFriendStream = BrickEngine.GetConvertor().ObjectToBoolean(Row[Counter.Next]);
            this.EnableNewFriends = BrickEngine.GetConvertor().ObjectToBoolean(Row[Counter.Next]);
            this.Warnings = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);
            this.MinutesOnline = BrickEngine.GetConvertor().ObjectToDouble(Row[Counter.Next]);
            this.MarketplaceTickets = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]);

            Counter.Update(2);

            this.EnableWordfilter = BrickEngine.GetConvertor().ObjectToBoolean(Row[Counter.Next]);
            this.EnableShowOnline = BrickEngine.GetConvertor().ObjectToBoolean(Row[Counter.Next]);
            this.EnableFollow = BrickEngine.GetConvertor().ObjectToBoolean(Row[Counter.Next]);
            this.EnableTrade = BrickEngine.GetConvertor().ObjectToBoolean(Row[Counter.Next]);
            this.ActivatedEmail = BrickEngine.GetConvertor().ObjectToBoolean(Row[Counter.Next]);
            this.ProgressedNewbie = BrickEngine.GetConvertor().ObjectToBoolean(Row[Counter.Next]);

            this.RegisteredDatetime = BrickEngine.GetConvertor().ObjectToDateTime(Row[Counter.Next]);

            BrickEngine.GetScreenWriter().PaintScreen(ConsoleColor.DarkCyan, IO.PaintType.ForeColor);
            BrickEngine.GetScreenWriter().ScretchLine("[" + HabboId + "] User " + Username + " has entered the building.", IO.WriteType.Incoming);

            Hash = BrickEngine.GetUserReactor().GenerateHash();
        }