コード例 #1
0
ファイル: ModerationTool.cs プロジェクト: fuding/Coolmemes
        internal void SendNewTicket(GameClient Session, int Category, int ReportedUser, String Message, string[] Chats)
        {
            if (Session.GetHabbo().CurrentRoomId <= 0)
            {
                return;
            }

            var Data = OtanixEnvironment.GetGame().GetRoomManager().GenerateRoomData(Session.GetHabbo().CurrentRoomId);

            if (Data == null)
            {
                return;
            }

            using (var dbClient = OtanixEnvironment.GetDatabaseManager().getQueryreactor())
            {
                dbClient.runFastQuery("UPDATE user_info SET cfhs = cfhs + 1 WHERE user_id = " + Session.GetHabbo().Id + "");
            }

            var Ticket = new SupportTicket((Tickets.Count + 1), 1, Category, Session.GetHabbo().Id, Session.GetHabbo().Username, ReportedUser, Message, Data.Id, Data.Name, OtanixEnvironment.GetUnixTimestamp(), Chats);


            NotificaStaff.Notifica(LanguageLocale.GetValue("alertastaff.imagem"), LanguageLocale.GetValue("alertastaff.mensagem"));

            Tickets.Add(Ticket);
            SendTicketToModerators(Ticket);
        }
コード例 #2
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()));
        }