Exemplo n.º 1
0
 public void GetResponse(Client Client, Response Response)
 {
     Response.AppendInt32(Id);
     Response.AppendBoolean((Client.GetUser().CurrentQuest.Equals(Id)) ? true : false);
     Response.AppendStringWithBreak(FilterAction);
     Response.AppendStringWithBreak(FilterParam);
     Response.AppendInt32(PixelReward);
     Response.AppendStringWithBreak(FilterReAction);
     Response.AppendInt32((Client.GetUser().CurrentQuest.Equals(Id)) ? Client.GetUser().CurrentQuestProgress : 0);
     Response.AppendInt32(ActionAmount);
 }
Exemplo n.º 2
0
        public void GetResponse(Response Response, int UserId)
        {
            Response.AppendInt32(-1);
            Response.AppendInt32(BrickEngine.GetStreamHandler().GetPrimairStreamIndexer(StreamType));

            Response.AppendRawInt32(HabboId);
            Response.AppendChar(2);

            Response.AppendStringWithBreak(GetUsername());
            Response.AppendStringWithBreak(GetGender().ToLower());

            if (StreamType.Equals(StreamType.AchievedAchievement))
            {
                Response.AppendStringWithBreak("http://www.habbo.com/habbo-imaging/badge/" + AchievedItem.ToString() + ".png");
            }
            else
            {
                Response.AppendStringWithBreak(BrickEngine.GetConfigureFile().CallStringKey("site.link") + "/habbo-imaging/avatar/" + GetLook() + ".gif");
            }

            Response.AppendInt32(BrickEngine.GetConvertor().ObjectToInt32(RunningTime.TotalMinutes));

            if (StreamType.Equals(StreamType.MadeFriends))
            {
                Response.AppendInt32(BrickEngine.GetStreamHandler().GetFriendState(UserId, AchievedItemId));
            }
            else
            {
                Response.AppendInt32(BrickEngine.GetStreamHandler().GetSecondairStreamIndexer(StreamType));
            }

            Response.AppendBoolean(true);
            Response.AppendBoolean(true);

            if (StreamType.Equals(StreamType.RatedRoom) || StreamType.Equals(StreamType.MadeFriends))
            {
                Response.AppendRawInt32(AchievedItemId);
                Response.AppendChar(2);

                if (StreamType.Equals(StreamType.MadeFriends))
                {
                    Response.AppendStringWithBreak(BrickEngine.GetUserReactor().GetUsername(AchievedItemId));
                }
                else
                {
                    Response.AppendStringWithBreak(AchievedItem.ToString());
                }
            }
            else
            {
                Response.AppendStringWithBreak(AchievedItem.ToString());
            }
        }
Exemplo n.º 3
0
 public void GetResponse(Response Response)
 {
     Response.AppendRawInt32(GetRoom().OwnerId);
     Response.AppendChar(2);
     Response.AppendRawInt32(RoomId);
     Response.AppendChar(2);
     Response.AppendStringWithBreak(BrickEngine.GetUserReactor().GetUsername(GetRoom().OwnerId));
     Response.AppendInt32(CategoryId);
     Response.AppendStringWithBreak(Name);
     Response.AppendStringWithBreak(Description);
     Response.AppendStringWithBreak(Started.ToShortTimeString());
     Response.AppendInt32(Tags.Count);
     Tags.ToList().ForEach(Response.AppendStringWithBreak);
 }
Exemplo n.º 4
0
 public void GetExternalResponse(Response Response)
 {
     Response.AppendInt32(Id);
     Response.AppendStringWithBreak(GetBaseItem().InternalName);
     Response.AppendBoolean(true);
     Response.AppendBoolean(false);
     Response.AppendBoolean(false);
     Response.AppendBoolean(true);
     Response.AppendStringWithBreak(GetBaseItem().InternalType.ToLower());
     Response.AppendInt32(GetBaseItem().SpriteId);
     Response.AppendChar(2);
     Response.AppendBoolean(true);
     Response.AppendInt32(-1);
     Response.AppendInt32((MemberType == Items.MemberType.VIP) ? 2 : 1);
 }
Exemplo n.º 5
0
        public void GetResponse(Response Response)
        {
            StringBuilder PacketBuilder = new StringBuilder();
            Response.AppendInt32(ShopItemId);

            PacketBuilder.Append("HABBO_CLUB_");
            PacketBuilder.Append(MemberShipType.ToUpper());
            PacketBuilder.Append('_');
            PacketBuilder.Append(MonthsAmount);
            PacketBuilder.Append("_MONTH");

            if (MonthsAmount > 1)
            {
                PacketBuilder.Append('S');
            }

            Response.AppendStringWithBreak(PacketBuilder.ToString());
            Response.AppendInt32(BrickEngine.GetShopReactor().GetShopItem(ShopItemId).CreditsCost);
            Response.AppendBoolean(false);
            Response.AppendBoolean(MemberShipType == "VIP");
            Response.AppendInt32(MonthsAmount);
            Response.AppendInt32(MonthsAmount * 31);
            Response.AppendInt32(ExpireDate().Year);
            Response.AppendInt32(ExpireDate().Month);
            Response.AppendInt32(ExpireDate().Day);
        }
Exemplo n.º 6
0
        private void CreateRoom(Client Client, Request Request)
        {
            int Limit = BrickEngine.GetConfigureFile().CallIntKey("max.rooms.amount");
            int RoomAmount = BrickEngine.GetRoomReactor().GetMe(Client.GetUser().HabboId).Count;

            if (RoomAmount >= Limit)
            {
                Client.Notif("You're over the rooms limit, first delete a room before you create a new one.", false);
                return;
            }

            string RawName = Request.PopFixedString();
            string RawModel = Request.PopFixedString();

            int RoomId = -1;

            if ((RoomId = BrickEngine.GetRoomReactor().CreateRoom(Client, RawName, RawModel)) > 0)
            {
                Response Response = new Response(59);
                Response.AppendInt32(RoomId);
                Response.AppendStringWithBreak(BrickEngine.CleanString(RawName));
                Client.SendResponse(Response);
            }
            else
            {
                CheckRoomCreate(Client, null);
            }
        }
Exemplo n.º 7
0
 public void GetButtonData(Response Response)
 {
     Response.AppendBoolean(true); // always true
     Response.AppendUInt32(IconPaint);
     Response.AppendUInt32(IconId);
     Response.AppendInt32(Id);
     Response.AppendStringWithBreak(Name);
     Response.AppendInt32(BrickEngine.GetShopReactor().GetButtonTreeAmount(Id));
 }
Exemplo n.º 8
0
 public void GetResponse(Response Response)
 {
     Response.AppendInt32(Id);
     Response.AppendInt32(State);
     Response.AppendInt32(CategoryId);
     Response.AppendInt32(ReportedCategoryId);
     Response.AppendInt32(0); // TimeStampInteger
     Response.AppendInt32(Priority);
     Response.AppendInt32(ReporterId);
     Response.AppendStringWithBreak(ReporterUsername);
     Response.AppendInt32(ModeratorId);
     Response.AppendStringWithBreak(ModeratorUsername);
     Response.AppendStringWithBreak(IssueMessage);
     Response.AppendInt32(RoomId);
     Response.AppendStringWithBreak(RoomName);
     Response.AppendInt32(0);
     Response.AppendStringWithBreak(string.Empty);
     Response.AppendInt32(RoomCategory);
     Response.AppendInt32(0);
 }
Exemplo n.º 9
0
        private void ChatWithFriend(Client Client, Request Request)
        {
            int FriendId = Request.PopWiredInt32();

            if (!BrickEngine.GetMessengerHandler().HasFriend(Client.GetUser().HabboId, FriendId))
            {
                return;
            }

            BrickEmulator.HabboHotel.Users.Handlers.Messenger.Friend Friend = BrickEngine.GetMessengerHandler().GetFriend(Client.GetUser().HabboId, FriendId);

            if (Friend == null)
            {
                Response Respose = new Response(261);
                Respose.AppendInt32(6);
                Respose.AppendInt32(FriendId);
                Client.SendResponse(Respose);
                return;
            }

            if (Client.GetUser().Muted)
            {
                Response Respose = new Response(261);
                Respose.AppendInt32(4);
                Respose.AppendInt32(FriendId);
                Client.SendResponse(Respose);
                return;
            }

            if (Friend.IsAlive)
            {
                if (Friend.GetClient().GetUser().Muted)
                {
                    Response Respose = new Response(261);
                    Respose.AppendInt32(3);
                    Respose.AppendInt32(FriendId);
                    Client.SendResponse(Respose);
                }

                Response Response = new Response(134);
                Response.AppendInt32(Client.GetUser().HabboId);
                Response.AppendStringWithBreak(BrickEngine.CleanString(Request.PopFixedString()));

                Friend.GetClient().SendResponse(Response);
            }
            else
            {
                Response Respose = new Response(261);
                Respose.AppendInt32(5);
                Respose.AppendInt32(FriendId);
                Client.SendResponse(Respose);
            }
        }
Exemplo n.º 10
0
 private void HandleSessionDetails(Client Client, Request Request)
 {
     Response Response = new Response(257);
     Response.AppendInt32(9);
     Response.AppendBoolean(false);
     Response.AppendBoolean(false);
     Response.AppendBoolean(true);
     Response.AppendBoolean(true);
     Response.AppendInt32(3);
     Response.AppendBoolean(false);
     Response.AppendInt32(2);
     Response.AppendBoolean(false);
     Response.AppendInt32(4);
     Response.AppendBoolean(true);
     Response.AppendInt32(5);
     Response.AppendStringWithBreak("dd-MM-yyyy");
     Response.AppendInt32(7);
     Response.AppendBoolean(false);
     Response.AppendInt32(8);
     Response.AppendStringWithBreak("http://");
     Response.AppendInt32(9);
     Response.AppendBoolean(false);
     Client.SendResponse(Response);
 }
Exemplo n.º 11
0
        public void GetBadges(Client Client, Request Request)
        {
            var Badges = BrickEngine.GetBadgeHandler().GetBadgesForUser(Client.GetUser().HabboId);
            var Equiped = BrickEngine.GetBadgeHandler().GetEquipedBadges(Client.GetUser().HabboId);

            Response Response = new Response(229);
            Response.AppendInt32(Badges.Count);

            foreach (Badge Badge in Badges)
            {
                Response.AppendInt32(BrickEngine.GetBadgeHandler().GetIdForBadge(Badge.BadgeCode));
                Response.AppendStringWithBreak(Badge.BadgeCode);
            }

            Response.AppendInt32(Equiped.Count);

            foreach (Badge Badge in Equiped)
            {
                Response.AppendInt32(Badge.SlotId);
                Response.AppendStringWithBreak(Badge.BadgeCode);
            }

            Client.SendResponse(Response);
        }
Exemplo n.º 12
0
        public void GetFurniture(Client Client, Request Request)
        {
            var Items = BrickEngine.GetItemReactor().GetItemsForUser(Client.GetUser().HabboId);

            var FloorItems = new List<Item>();
            var WallItems = new List<Item>();

            foreach (Item Item in Items)
            {
                if (Item.GetBaseItem().InternalType.ToLower() == "s")
                {
                    FloorItems.Add(Item);
                }
                else if (Item.GetBaseItem().InternalType.ToLower() == "i")
                {
                    WallItems.Add(Item);
                }
            }

            Response FloorItemsResponse = new Response(140);
            FloorItemsResponse.AppendStringWithBreak("S");
            FloorItemsResponse.AppendBoolean(true);
            FloorItemsResponse.AppendBoolean(true);
            FloorItemsResponse.AppendInt32(FloorItems.Count);

            foreach (Item Item in FloorItems)
            {
                Item.GetInventoryResponse(FloorItemsResponse);
            }

            Client.SendResponse(FloorItemsResponse);

            Response WallItemsResponse = new Response(140);
            WallItemsResponse.AppendStringWithBreak("I");
            WallItemsResponse.AppendBoolean(true);
            WallItemsResponse.AppendBoolean(true);
            WallItemsResponse.AppendInt32(WallItems.Count);

            foreach (Item Item in WallItems)
            {
                Item.GetInventoryResponse(WallItemsResponse);
            }

            Client.SendResponse(WallItemsResponse);
        }
Exemplo n.º 13
0
        public Response GetResponse()
        {
            Response Response = new Response(127);
            Response.AppendInt32(Id);
            Response.AppendStringWithBreak(Base);

            BrickEngine.GetShopReactor().SerializeShopData(Response, this);

            var Items = BrickEngine.GetShopReactor().GetItemsForPage(Id);

            Response.AppendInt32(Items.Count);

            foreach (ShopItem Item in Items)
            {
                Item.GetResponse(Response, false);
            }

            Response.AppendInt32(-1);

            return Response;
        }
Exemplo n.º 14
0
        public void GetResponse(Client Client, Response Response)
        {
            var AchievedQuests = Client.GetUser().Quests;
            var CategoryQuests = BrickEngine.GetQuestReactor().OrderQuestsForCategory(Id);

            Response.AppendStringWithBreak(Name.ToLower());

            if (!AchievedQuests.ContainsKey(Id))
            {
                Response.AppendInt32(0);
            }
            else
            {
                Response.AppendInt32(AchievedQuests[Id]);
            }

            Response.AppendInt32(CategoryQuests.Count);

            Response.AppendInt32(0); // Pixels Type - Reward

            if (AchievedCategory(Client) || BrickEngine.GetQuestReactor().GetQuestForCategory(Client, Id) == null)
            {
                Response.AppendInt32(0);
                Response.AppendBoolean(false);
                Response.AppendChar(2);
                Response.AppendChar(2);
                Response.AppendInt32(0);
                Response.AppendChar(2);
                Response.AppendInt32(0);
                Response.AppendInt32(0);
            }
            else
            {
                BrickEngine.GetQuestReactor().GetQuestForCategory(Client, Id).GetResponse(Client, Response);
            }

            Response.AppendBoolean(false);
        }
Exemplo n.º 15
0
        private void HandleTicket(Client Client, Request Request)
        {
            string Ticket = Request.PopFixedString();

            Client.ParseUser(BrickEngine.GetUserReactor().HandleTicket(Ticket));

            if (Client.IsValidUser)
            {
                if (BrickEngine.GetToolReactor().IsBanned(Client.GetUser().HabboId, Client.IPAddress))
                {
                    Client.Dispose();
                    return;
                }

                Response Userhash = new Response(439);
                Userhash.AppendStringWithBreak(Client.GetUser().Hash);
                Client.SendResponse(Userhash);

                Client.SendResponse(new Response(3));

                if (BrickEngine.GetConfigureFile().CallBooleanKey("welcomemessage.enabled"))
                {
                    Client.LongNotif(string.Empty);
                }

                Client.SendResponse(Client.GetUser().GetLoginResponse());

                Client.Authenticated = true;

                Client.SendResponse(BrickEngine.GetToolReactor().GetResponse(Client));
            }
            else
            {
                Client.Notif("Invalid Ticket, try again!", false);
                Client.Dispose();
            }
        }
Exemplo n.º 16
0
        public void UpdateCredits(bool InDatabase)
        {
            Response Response = new Response(6);
            Response.AppendStringWithBreak(Credits + ".0");
            GetClient().SendResponse(Response);

            if (InDatabase)
            {
                using (QueryReactor Reactor = BrickEngine.GetQueryReactor())
                {
                    Reactor.SetQuery("UPDATE users SET credits = @amount WHERE id = @habboid LIMIT 1");
                    Reactor.AddParam("amount", Credits);
                    Reactor.AddParam("habboid", HabboId);
                    Reactor.ExcuteQuery();
                }
            }
        }
Exemplo n.º 17
0
        public void GetSecondairResponse(Client Client)
        {
            Response PasteLink = new Response(166);
            PasteLink.AppendStringWithBreak("/client/private/" + Id + "/id");
            Client.SendResponse(PasteLink);

            Response ModelParams = new Response(69);
            ModelParams.AppendStringWithBreak(ModelParam.ToLower());
            ModelParams.AppendInt32(Id);
            Client.SendResponse(ModelParams);

            Response Environment = new Response();

            if (!Wallpaper.Equals("0.0"))
            {
                Environment.Initialize(46);
                Environment.AppendStringWithBreak("wallpaper");
                Environment.AppendStringWithBreak(Wallpaper);
            }

            if (!Floor.Equals("0.0"))
            {
                Environment.Initialize(46);
                Environment.AppendStringWithBreak("floor");
                Environment.AppendStringWithBreak(Floor);
            }

            Environment.Initialize(46);
            Environment.AppendStringWithBreak("landscape");
            Environment.AppendStringWithBreak(Landscape);

            Environment.Initialize(345);

            if (GetRoomEngine().HasRights(Client.GetUser().HabboId, RightsType.Founder) || Client.GetUser().VotedRooms.Contains(Id))
            {
                Environment.AppendInt32(Rating);
            }
            else
            {
                Environment.AppendInt32(-1);
            }

            Environment.Initialize(370);

            if (Event != null)
            {
                Event.GetResponse(Environment);
            }
            else
            {
                Environment.AppendRawInt32(-1);
                Environment.AppendChar(2);
            }

            Client.SendResponse(Environment);
        }
Exemplo n.º 18
0
        public void GetNavigatorResponse(Response Response, Boolean AllowEvents)
        {
            Response.AppendInt32(Id);
            Response.AppendBoolean(AllowEvents);
            Response.AppendStringWithBreak((AllowEvents) ? Event.Name : Name);
            Response.AppendStringWithBreak(BrickEngine.GetUserReactor().GetUsername(OwnerId));
            Response.AppendInt32(DoorState);
            Response.AppendInt32(RoomUserAmount);
            Response.AppendInt32(LimitUsers);
            Response.AppendStringWithBreak((AllowEvents) ? Event.Description : Description);
            Response.AppendBoolean(false);
            Response.AppendBoolean(BrickEngine.GetNavigatorManager().GetPrivateCategory(CategoryId).EnableTrading);
            Response.AppendInt32(Rating);
            Response.AppendInt32((AllowEvents) ? Event.CategoryId : CategoryId);

            if (AllowEvents)
            {
                Response.AppendString(Event.Started.ToShortTimeString());
            }

            Response.AppendChar(2);
            Response.AppendInt32((AllowEvents) ? Event.Tags.Count : Tags.Count);

            if (AllowEvents)
            {
                Event.Tags.ToList().ForEach(Response.AppendStringWithBreak);
            }
            else
            {
                Tags.ToList().ForEach(Response.AppendStringWithBreak);
            }

            Icon.GetResponse(Response);

            Response.AppendBoolean(true);
            Response.AppendBoolean(false);
        }
Exemplo n.º 19
0
        public void GetMapsResponse(Client Client)
        {
            Response Premair = new Response(31);
            Premair.AppendStringWithBreak(GetRoomModel().GetPremairParams());
            Client.SendResponse(Premair);

            Response Secondair = new Response(470);
            Secondair.AppendStringWithBreak(GetRoomModel().GetSecondairParams());
            Client.SendResponse(Secondair);
        }
Exemplo n.º 20
0
        private void SerializePetRaces(Client Client, Request Request)
        {
            string PetType = Request.PopFixedString();

            int Type = Convert.ToInt32(PetType.Substring(6));

            if (Type < 0)
            {
                return;
            }

            Response Response = new Response(827);

            PetRace PetRace = BrickEngine.GetShopReactor().SelectPetRace(Type);

            if (PetRace == null)
            {
                System.Data.DataRow Row = new DataTable().Rows[0];

                Row[0] = 1;
                Row[1] = Type;
                Row[2] = 0;
                Row[3] = 0;

                PetRace = new PetRace(Row);
            }

            Response.AppendStringWithBreak("a0 pet" + Type);
            Response.AppendInt32(PetRace.RaceAmount);

            for (int i = PetRace.StartIndexer; i < PetRace.RaceAmount; i++)
            {
                Response.AppendInt32(Type);
                Response.AppendInt32(i);
                Response.AppendBoolean(true);
                Response.AppendBoolean(false);
            }

            Client.SendResponse(Response);
        }
Exemplo n.º 21
0
        private void BeginEditRoom(Client Client, Request Request)
        {
            if (!Client.GetUser().IsInRoom)
            {
                return;
            }

            int RoomId = Request.PopWiredInt32();

            VirtualRoom Room = BrickEngine.GetRoomReactor().GetVirtualRoom(RoomId, RoomRunningState.Alive);

            if (Room == null)
            {
                return;
            }

            if (!Room.GetRoomEngine().HasRights(Client.GetUser().HabboId, Rooms.RightsType.Founder))
            {
                return;
            }

            Response Response = new Response(465);
            Response.AppendInt32(RoomId);
            Response.AppendStringWithBreak(Room.Name);
            Response.AppendStringWithBreak(Room.Description);
            Response.AppendInt32(Room.DoorState);
            Response.AppendInt32(Room.CategoryId);
            Response.AppendInt32(Room.LimitUsers);
            Response.AppendInt32(Room.GetRoomModel().LimitUsers);
            Response.AppendInt32(Room.Tags.Count);
            Room.Tags.ForEach(Response.AppendStringWithBreak);

            Response.AppendInt32(Room.GetRoomEngine().GetUsersWithRights().Count);

            foreach (int UserId in Room.GetRoomEngine().GetUsersWithRights())
            {
                Response.AppendInt32(UserId);
                Response.AppendStringWithBreak(BrickEngine.GetUserReactor().GetUsername(UserId));
            }

            Response.AppendInt32(Room.GetRoomEngine().GetUsersWithRights().Count);

            Response.AppendBoolean(Room.AllowPets);
            Response.AppendBoolean(Room.AllowPetsEat);
            Response.AppendBoolean(Room.AllowWalkthough);
            Response.AppendBoolean(Room.AllowHideWall);
            Response.AppendInt32(Room.WallThick);
            Response.AppendInt32(Room.FloorThick);
            Client.SendResponse(Response);
        }
Exemplo n.º 22
0
 public void GetInventoryResponse(Response Response)
 {
     Response.AppendInt32(Id);
     Response.AppendStringWithBreak(Name);
     Response.AppendInt32(Type);
     Response.AppendInt32(Race);
     Response.AppendStringWithBreak(Color);
 }
Exemplo n.º 23
0
        public void GetResponse(Response Response, Client Client)
        {
            int Next = GetNextLevel(Client);

            Response.AppendInt32(Id);
            Response.AppendInt32(Next);
            Response.AppendStringWithBreak(GetBadgeCode(Next));
            Response.AppendInt32(GetNeeded(Next));
            Response.AppendInt32(GetPixelReward(Next));
            Response.AppendBoolean(false);
            Response.AppendInt32(BrickEngine.GetAchievementReactor().GetGotAmount(Client, Id)); // GotAmount;
            Response.AppendBoolean(CompletedAchievement(Client));
            Response.AppendStringWithBreak(Category.Name.ToLower());
            Response.AppendInt32(MaxLevel);
        }
Exemplo n.º 24
0
        private void GetEcotronRewards(Client Client, Request Request)
        {
            Response Response = new Response(506);
            Response.AppendInt32(5);

            for (int i = 5; i > 0; i--)
            {
                var Items = BrickEngine.GetEcotronReactor().GetRewardsForLevel(i);

                Response.AppendInt32(i);
                Response.AppendInt32(BrickEngine.GetEcotronReactor().GetChangeByLevel(i));
                Response.AppendInt32(Items.Count);

                foreach (EcotronReward Item in Items)
                {
                    Response.AppendStringWithBreak(Item.GetBaseItem().InternalType.ToLower());
                    Response.AppendInt32(Item.GetBaseItem().SpriteId);
                }
            }

            Client.SendResponse(Response);
        }
Exemplo n.º 25
0
        public void RedeemPresent(Client Client, Item Item)
        {
            iPoint OldPlace = Item.Point;
            int OldRot = Item.Rotation;

            iPoint NewPlace = new iPoint(-1, -1);
            int NewRot = 0;

            Client.GetUser().GetRoom().GetRoomEngine().HandleIncomingItemPickUp(Item, OldPlace, NewPlace, OldRot, NewRot, Client.GetUser().GetRoomUser());

            Item.RoomId = 0;
            Item.Rotation = NewRot;
            Item.Point = NewPlace;
            Item.BaseId = Item.InsideItemId;
            Item.InsideItemId = -1;

            Response ResponseA = new Response(219);
            ResponseA.AppendInt32(Item.Id);
            Client.SendResponse(ResponseA);

            Response ResponseB = new Response(129);
            ResponseB.AppendStringWithBreak(Item.GetBaseItem().InternalType.ToLower());
            ResponseB.AppendInt32(Item.GetBaseItem().SpriteId);
            ResponseB.AppendStringWithBreak(Item.GetBaseItem().InternalName);
            Client.SendResponse(ResponseB);

            Response Response = new Response(832);
            Response.AppendInt32(1);
            Response.AppendInt32(Item.GetBaseItem().InternalType.ToLower().Equals("s") ? 1 : 2);
            Response.AppendInt32(1);
            Response.AppendInt32(Item.Id);
            Client.SendResponse(Response);

            Client.SendResponse(new Response(101));

            using (QueryReactor Reactor = BrickEngine.GetQueryReactor())
            {
                Reactor.SetQuery("UPDATE items SET base_id = @baseid, inside_base_id = '-1' WHERE id = @itemid LIMIT 1");
                Reactor.AddParam("baseid", Item.BaseId);
                Reactor.AddParam("itemid", Item.Id);
                Reactor.ExcuteQuery();
            }
        }
Exemplo n.º 26
0
        private void GiveRights(Client Client, Request Request)
        {
            if (!Client.GetUser().IsInRoom)
            {
                return;
            }

            if (!Client.GetUser().GetRoom().GetRoomEngine().HasRights(Client.GetUser().HabboId, Rooms.RightsType.Founder))
            {
                return;
            }

            int HabboId = Request.PopWiredInt32();

            VirtualRoomUser TriggeredUser = Client.GetUser().GetRoom().GetRoomEngine().GetUserByHabboId(HabboId);

            if (TriggeredUser == null)
            {
                return;
            }

            if (Client.GetUser().GetRoom().GetRoomEngine().HasRights(HabboId, Rooms.RightsType.Rights))
            {
                return;
            }

            Client.GetUser().GetRoom().GetRoomEngine().AddRights(HabboId, RightsType.Rights);

            Response Response = new Response(510);
            Response.AppendInt32(Client.GetUser().RoomId);
            Response.AppendInt32(HabboId);
            Response.AppendStringWithBreak(BrickEngine.GetUserReactor().GetUsername(HabboId));
            Client.SendResponse(Response);

            TriggeredUser.GetClient().SendResponse(new Response(42));

            TriggeredUser.AddStatus("flatctrl", "");
            TriggeredUser.UpdateStatus(true);

            // Doing Querys
            using (QueryReactor Reactor = BrickEngine.GetQueryReactor())
            {
                Reactor.SetQuery("INSERT INTO private_rooms_rights (user_id, room_id) VALUES (@habboid, @roomid)");
                Reactor.AddParam("habboid", HabboId);
                Reactor.AddParam("roomid", Client.GetUser().RoomId);
                Reactor.ExcuteQuery();
            }
        }
Exemplo n.º 27
0
        public void GiveRespect()
        {
            Respect++;

            if (IsInRoom)
            {
                Response Response = new Response(606);
                Response.AppendInt32(Respect);
                Response.AppendInt32(UserId);
                Response.AppendInt32(Id);
                Response.AppendStringWithBreak(Name);
                Response.AppendBoolean(false);
                Response.AppendInt32(10);
                Response.AppendBoolean(false);
                Response.AppendInt32(-2);
                Response.AppendBoolean(true);
                Response.AppendChar(2);
                GetRoom().GetRoomEngine().BroadcastResponse(Response);
            }

            GiveExpirience(10);

            using (QueryReactor Reactor = BrickEngine.GetQueryReactor())
            {
                Reactor.SetQuery("UPDATE user_pets SET respect = respect + 1 WHERE id = @petid LIMIT 1");
                Reactor.AddParam("petid", Id);
                Reactor.ExcuteQuery();
            }
        }
Exemplo n.º 28
0
 public Response GetPurchaseResponse()
 {
     Response Response = new Response(67);
     Response.AppendInt32(BaseId);
     Response.AppendStringWithBreak(GetBaseItem().InternalName);
     Response.AppendInt32(0);
     Response.AppendInt32(0);
     Response.AppendInt32(0);
     Response.AppendInt32(1);
     Response.AppendStringWithBreak(GetBaseItem().InternalType.ToLower());
     Response.AppendInt32(GetBaseItem().SpriteId);
     Response.AppendChar(2);
     Response.AppendInt32(1);
     Response.AppendInt32(-1);
     Response.AppendInt32(0);
     Response.AppendChar(2);
     return Response;
 }
Exemplo n.º 29
0
        public Response GetUnlockResponse(Client Client)
        {
            int Level = GetNextLevel(Client);
            int OldLevel = (Level - 1);

            if (OldLevel <= 0)
            {
                OldLevel = 1;
            }

            string OldBadge = GetBadgeCode(OldLevel);
            string NewBadge = GetBadgeCode(Level);

            int OldBadgeId = BrickEngine.GetBadgeHandler().GetIdForBadge(OldBadge);
            int NewBadgeId = BrickEngine.GetBadgeHandler().GetIdForBadge(NewBadge);

            int ScoreReward = GetScoreReward(Level);
            int PixelReward = GetPixelReward(Level);

            Response Response = new Response(437);
            Response.AppendInt32(Id);
            Response.AppendInt32(Level);
            Response.AppendInt32(NewBadgeId);
            Response.AppendStringWithBreak(NewBadge);
            Response.AppendInt32(ScoreReward);
            Response.AppendInt32(PixelReward);
            Response.AppendBoolean(false);
            Response.AppendInt32(ExtraScore);
            Response.AppendInt32(OldBadgeId);
            Response.AppendStringWithBreak(OldBadge);
            Response.AppendStringWithBreak(Category.Name.ToLower());

            return Response;
        }
Exemplo n.º 30
0
 public Response GetInfoResponse()
 {
     Response Response = new Response(601);
     Response.AppendInt32(Id);
     Response.AppendStringWithBreak(Name);
     Response.AppendInt32(Level); // Level
     Response.AppendInt32(PetReactor.MAX_LEVEL);
     Response.AppendInt32(Expirience);
     Response.AppendInt32(ExpirienceGoal);
     Response.AppendInt32(Energy);
     Response.AppendInt32(PetReactor.MAX_ENERGY(Level));
     Response.AppendInt32(Happiness);
     Response.AppendInt32(PetReactor.MAX_HAPPINESS);
     Response.AppendStringWithBreak(Color.ToLower());
     Response.AppendInt32(Respect);
     Response.AppendInt32(UserId);
     Response.AppendInt32(DaysOld);
     Response.AppendStringWithBreak(BrickEngine.GetUserReactor().GetUsername(UserId));
     return Response;
 }