Ejemplo n.º 1
0
        internal void GoToHotelView()
        {
            if (Session == null || Session.GetHabbo() == null)
            {
                return;
            }

            if (Session.GetHabbo().roomIdQueue > 0)
            {
                RoomQueue rQueue = OtanixEnvironment.GetGame().GetRoomQueueManager().GetRoomQueue(Session.GetHabbo().roomIdQueue);
                if (rQueue != null)
                {
                    rQueue.RemoveUserToQueue(Session.GetHabbo().Id);
                }

                Session.GetHabbo().roomIdQueue = 0;

                Session.GetMessageHandler().GetResponse().Init(Outgoing.OutOfRoom);
                Session.GetMessageHandler().SendResponse();

                return;
            }

            if (Session.GetHabbo().InRoom)
            {
                var currentRoom = Session.GetHabbo().CurrentRoom;
                if (currentRoom != null && currentRoom.GetRoomUserManager() != null)
                {
                    currentRoom.GetRoomUserManager().RemoveUserFromRoom(Session, true, false);
                }
            }
            else
            {
                Session.GetMessageHandler().GetResponse().Init(Outgoing.OutOfRoom);
                Session.GetMessageHandler().SendResponse();
            }
            Session.SendMessage(BonusManager.GenerateMessage(Session));
        }
Ejemplo n.º 2
0
        internal void GoToHotelView()
        {
            if (Session == null || Session.GetHabbo() == null)
            {
                return;
            }

            if (Session.GetHabbo().roomIdQueue > 0)
            {
                RoomQueue rQueue = OtanixEnvironment.GetGame().GetRoomQueueManager().GetRoomQueue(Session.GetHabbo().roomIdQueue);
                if (rQueue != null)
                {
                    rQueue.RemoveUserToQueue(Session.GetHabbo().Id);
                }

                Session.GetHabbo().roomIdQueue = 0;

                Session.GetMessageHandler().GetResponse().Init(Outgoing.OutOfRoom);
                Session.GetMessageHandler().SendResponse();

                return;
            }

            if (Session.GetHabbo().InRoom)
            {
                var currentRoom = Session.GetHabbo().CurrentRoom;
                if (currentRoom != null && currentRoom.GetRoomUserManager() != null)
                {
                    currentRoom.GetRoomUserManager().RemoveUserFromRoom(Session, true, false);
                }
            }

            else
            {
                Session.GetMessageHandler().GetResponse().Init(Outgoing.OutOfRoom);
                Session.GetMessageHandler().SendResponse();
            }

            if (DateTime.Now.Day == 15 && Session.GetHabbo().GetClubManager().UserHasSubscription("club_habbo") && Session.GetHabbo().GetClubManager().GetSubscription("club_habbo").TotalSpent(Session.GetHabbo().SpentCredits) > 0)
            {
                string c = "";

                if (Session.GetHabbo().GetClubManager().GetSubscription("club_habbo").TotalSpent(Session.GetHabbo().SpentCredits) == 1)
                {
                    c = "credito";
                }

                else
                {
                    c = "crediti";
                }

                Session.SendNotifWithImage2("Hai ricevuto " + Session.GetHabbo().GetClubManager().GetSubscription("club_habbo").TotalSpent(Session.GetHabbo().SpentCredits) + " " + c + " nel tuo Borsellino. Complimenti!", LanguageLocale.GetValue("frank.wave.image"), "Wooooow è arrivata la paga HC");

                Session.GetHabbo().Moedas += Session.GetHabbo().GetClubManager().GetSubscription("club_habbo").TotalSpent(Session.GetHabbo().SpentCredits);
                Session.GetHabbo().UpdateCreditsBalance();

                using (var dbClient = OtanixEnvironment.GetDatabaseManager().getQueryreactor())
                {
                    dbClient.runFastQuery("UPDATE users SET spent_credits = 0 WHERE id = " + Session.GetHabbo().Id);
                    dbClient.runFastQuery("UPDATE user_subscriptions SET received_pay = 1 WHERE user_id = " + Session.GetHabbo().Id);
                }
                Session.GetHabbo().SpentCredits = 0;
                Session.GetHabbo().GetClubManager().GetSubscription("club_habbo").ReceivedPay = true;
            }

            if (DateTime.Now.Day == 16)
            {
                using (var dbClient = OtanixEnvironment.GetDatabaseManager().getQueryreactor())
                {
                    dbClient.runFastQuery("UPDATE user_subscriptions SET received_pay = 0");
                }
                Session.GetHabbo().GetClubManager().GetSubscription("club_habbo").ReceivedPay = false;
            }

            Session.SendMessage(BonusManager.GenerateMessage(Session));
        }