Exemple #1
0
        internal void GetCatalogPage()
        {
            int PageId = Request.PopWiredInt32();

            Request.PopWiredInt32();
            string CatalogType = Request.PopFixedString();

            if (CatalogType == "NORMAL")
            {
                CatalogPage Page = OtanixEnvironment.GetGame().GetCatalog().GetPage(PageId);

                if (Page == null || !Page.Enabled || !Page.Visible || Page.MinRank > Session.GetHabbo().Rank)
                {
                    return;
                }

                Session.SendMessage(Page.GetMessage);
            }
            else if (CatalogType == "BUILDERS_CLUB")
            {
                CatalogPremiumPage Page = OtanixEnvironment.GetGame().GetCatalogPremium().GetPage(PageId);

                if (Page == null || !Page.Enable || !Page.Visible)
                {
                    return;
                }

                Session.SendMessage(Page.GetMessage());
            }
        }
Exemple #2
0
        internal void GetCatalogPage()
        {
            int PageId = Request.PopWiredInt32();

            Request.PopWiredInt32();
            string CatalogType = Request.PopFixedString();

            if (CatalogType == "NORMAL")
            {
                CatalogPage Page = OtanixEnvironment.GetGame().GetCatalog().GetPage(PageId);

                if (Page == null || !Page.Enabled || !Page.Visible || Page.MinRank > Session.GetHabbo().Rank)
                {
                    return;
                }

                if (Page.Layout.Equals("vip_buy"))
                {
                    ServerMessage Message = new ServerMessage(Outgoing.ClubComposer);
                    Message.AppendInt32(Page.Items.Values.Count);
                    foreach (CatalogItem Item in Page.Items.Values)
                    {
                        Item.SerializeClub(Message, Session);
                    }
                    Message.AppendInt32(1);
                    Session.SendMessage(Page.GetMessage);
                    Session.SendMessage(Message);
                }

                else
                {
                    Session.SendMessage(Page.GetMessage);
                }
            }
            else if (CatalogType == "BUILDERS_CLUB")
            {
                CatalogPremiumPage Page = OtanixEnvironment.GetGame().GetCatalogPremium().GetPage(PageId);

                if (Page == null || !Page.Enable || !Page.Visible)
                {
                    return;
                }

                Session.SendMessage(Page.GetMessage());
            }
        }
Exemple #3
0
        public void PlacePremiumItem(bool FloorItem)
        {
            Room CurrentRoom = Session.GetHabbo().CurrentRoom;

            if (CurrentRoom == null)
            {
                return;
            }

            // Si no es el dueño de sala:
            if (CurrentRoom.RoomData.OwnerId != Session.GetHabbo().Id)
            {
                NotificaStaff.Notifica(Session, true);
                return;
            }

            // Si este usuario no es premium:
            if (!Session.GetHabbo().IsPremium())
            {
                NotificaStaff.Notifica(Session);
                return;
            }

            // Si ha llegado al límite de furnis establecidos:
            if (Session.GetHabbo().GetPremiumManager().GetActualItems() >= Session.GetHabbo().GetPremiumManager().GetMaxItems())
            {
                ServerMessage messageError = new ServerMessage(Outgoing.CustomAlert);
                messageError.AppendString("furni_placement_error");
                messageError.AppendInt32(1);
                messageError.AppendString("message");
                messageError.AppendString("${room.error.max_furniture}");
                Session.SendMessage(messageError);

                return;
            }

            // Obtenemos la página del catálogo.
            int PageId = Request.PopWiredInt32();
            CatalogPremiumPage Page = OtanixEnvironment.GetGame().GetCatalogPremium().GetPage(PageId);

            if (Page == null || !Page.Enable || !Page.Visible)
            {
                return;
            }

            // Obtenemos el item del catálogo.
            uint ItemId             = Request.PopWiredUInt();
            CatalogPremiumItem Item = Page.GetItem(ItemId);

            if (Item == null)
            {
                return;
            }

            Request.PopFixedString();

            if (FloorItem)
            {
                int X   = Request.PopWiredInt32();
                int Y   = Request.PopWiredInt32();
                int Rot = Request.PopWiredInt32();

                RoomItem RoomItem = new RoomItem(EmuSettings.PREMIUM_BASEID + Session.GetHabbo().GetPremiumManager().GetValidPosition(), CurrentRoom.RoomId, Item.BaseId, "", CurrentRoom.RoomData.OwnerId, X, Y, 0, Rot, CurrentRoom, true);

                if (CurrentRoom.GetRoomItemHandler().SetFloorItem(Session, RoomItem, X, Y, Rot, true, false, true, false) == false)
                {
                    Session.GetHabbo().GetPremiumManager().ModifyItemPosition((int)(RoomItem.Id - EmuSettings.PREMIUM_BASEID), false);
                    return;
                }
            }
            else
            {
                string W = Request.PopFixedString();

                WallCoordinate coordinate = new WallCoordinate(W);
                RoomItem       RoomItem   = new RoomItem(EmuSettings.PREMIUM_BASEID + Session.GetHabbo().GetPremiumManager().GetValidPosition(), CurrentRoom.RoomId, Item.BaseId, "", CurrentRoom.RoomData.OwnerId, coordinate, CurrentRoom, true);

                if (CurrentRoom.GetRoomItemHandler().SetWallItem(Session, RoomItem) == false)
                {
                    Session.GetHabbo().GetPremiumManager().ModifyItemPosition((int)(RoomItem.Id - EmuSettings.PREMIUM_BASEID), false);
                    return;
                }
            }

            // Incrementamos en 1 los items usados.
            Session.GetHabbo().GetPremiumManager().IncreaseItems();

            // Actualizamos el packet del catálogo.
            Session.SendMessage(PremiumManager.SerializePremiumItemsCount(Session.GetHabbo()));
        }