示例#1
0
        internal void SendInstantInvite()
        {
            int count = Request.ReadInt32();

            List <int> UserIds = new List <int>();

            for (int i = 0; i < count; i++)
            {
                UserIds.Add(Request.ReadInt32());
            }

            string message = FirewindEnvironment.FilterInjectionChars(Request.ReadString(), true);

            ServerMessage Message = new ServerMessage(Outgoing.InstantInvite);

            Message.AppendInt32(Session.GetHabbo().Id);
            Message.AppendString(message);

            foreach (int Id in UserIds)
            {
                if (!Session.GetHabbo().GetMessenger().FriendshipExists(Id))
                {
                    continue;
                }

                GameClient Client = FirewindEnvironment.GetGame().GetClientManager().GetClientByUserID(Id);

                if (Client == null)
                {
                    return;
                }

                Client.SendMessage(Message);
            }
        }
示例#2
0
        internal void ChangeMotto()
        {
            string Motto = FirewindEnvironment.FilterInjectionChars(Request.ReadString());

            if (Motto.Length == 0 || Motto == Session.GetHabbo().Motto) // Prevents spam?
            {
                return;
            }

            //if (Motto.Length < 0)
            //{
            //    return; // trying to fk the client :D
            //} Congratulations. The string length can not hold calue < 0. Stupid -_-"

            Session.GetHabbo().Motto = Motto;


            using (IQueryAdapter dbClient = FirewindEnvironment.GetDatabaseManager().getQueryreactor())
            {
                dbClient.setQuery("UPDATE users SET motto = @motto WHERE id = '" + Session.GetHabbo().Id + "'");
                dbClient.addParameter("motto", Motto);
                dbClient.runQuery();
            }

            FirewindEnvironment.GetGame().GetQuestManager().ProgressUserQuest(Session, HabboHotel.Quests.QuestType.PROFILE_CHANGE_MOTTO);

            if (Session.GetHabbo().InRoom)
            {
                Room Room = Session.GetHabbo().CurrentRoom;

                if (Room == null)
                {
                    return;
                }

                RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);

                if (User == null)
                {
                    return;
                }

                ServerMessage RoomUpdate = new ServerMessage(Outgoing.UpdateUserInformation);
                RoomUpdate.AppendInt32(User.VirtualId);
                RoomUpdate.AppendString(Session.GetHabbo().Look);
                RoomUpdate.AppendString(Session.GetHabbo().Gender.ToLower());
                RoomUpdate.AppendString(Session.GetHabbo().Motto);
                RoomUpdate.AppendInt32(Session.GetHabbo().AchievementPoints);
                Room.SendMessage(RoomUpdate);
            }

            FirewindEnvironment.GetGame().GetAchievementManager().ProgressUserAchievement(Session, "ACH_Motto", 1);
        }
示例#3
0
        internal void PurchaseFromCatalogAsGift()       // (k:int, k:int, k:String, k:String, k:String, k:int, k:int, k:int, k:Boolean)
        {
            int    PageId       = Request.ReadInt32();  // pageId
            uint   ItemId       = Request.ReadUInt32(); // offerId
            string ExtraData    = Request.ReadString(); // extraParameter
            string GiftUser     = FirewindEnvironment.FilterInjectionChars(Request.ReadString());
            string GiftMessage  = FirewindEnvironment.FilterInjectionChars(Request.ReadString());
            int    SpriteId     = Request.ReadInt32();
            int    Lazo         = Request.ReadInt32();
            int    Color        = Request.ReadInt32();
            bool   showIdentity = Request.ReadBoolean();

            //bool dnow = Request.PopWiredBoolean();
            //Logging.WriteLine("PageId: " + PageId + "; ItemId: " + ItemId + "; ExtraData: " + ExtraData + "; User: "******"; Message: " + GiftMessage + "; SpriteId: " + SpriteId + "; Color: " + Color + "; Lazo: " + Lazo);
            FirewindEnvironment.GetGame().GetCatalog().HandlePurchase(Session, PageId, ItemId, ExtraData, 1, true, GiftUser, GiftMessage, SpriteId, Lazo, Color, showIdentity);
        }
示例#4
0
        internal void SendInstantMessenger()
        {
            if (FirewindEnvironment.SystemMute)
            {
                return;
            }
            //if the user we are sending an IM to is on IRC, get the IRC client / connection and send the data there instead of here. Then gtfo.
            int    userId  = Request.ReadInt32();
            string message = FirewindEnvironment.FilterInjectionChars(Request.ReadString());

            if (Session.GetHabbo().GetMessenger() == null)
            {
                return;
            }

            Session.GetHabbo().GetMessenger().SendInstantMessage(userId, message);
        }
示例#5
0
        internal RoomData CreateRoom(GameClient Session, string Name, string Model)
        {
            Name = FirewindEnvironment.FilterInjectionChars(Name);

            if (!roomModels.ContainsKey(Model))
            {
                Session.SendNotif(LanguageLocale.GetValue("room.modelmissing"));
                return(null);
            }

            if (((RoomModel)roomModels[Model]).ClubOnly && !Session.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_vip"))
            {
                Session.SendNotif(LanguageLocale.GetValue("room.missingclub"));
                return(null);
            }

            if (Name.Length < 3)
            {
                Session.SendNotif(LanguageLocale.GetValue("room.namelengthshort"));
                return(null);
            }

            UInt32 RoomId = 0;

            using (IQueryAdapter dbClient = FirewindEnvironment.GetDatabaseManager().getQueryreactor())
            {
                dbClient.setQuery("INSERT INTO rooms (caption,owner,model_name) VALUES (@caption,@username,@model)");
                dbClient.addParameter("caption", Name);
                dbClient.addParameter("model", Model);
                dbClient.addParameter("username", Session.GetHabbo().Username);

                RoomId = (UInt32)dbClient.insertQuery();
            }

            RoomData newRoomData = GenerateRoomData(RoomId);

            Session.GetHabbo().UsersRooms.Add(newRoomData);

            return(newRoomData);
        }
示例#6
0
        internal void SubmitHelpTicket()
        {
            Boolean errorOccured = false;

            if (FirewindEnvironment.GetGame().GetModerationTool().UsersHasPendingTicket(Session.GetHabbo().Id))
            {
                errorOccured = true;
            }

            if (!errorOccured)
            {
                String Message = FirewindEnvironment.FilterInjectionChars(Request.ReadString());

                int Junk         = Request.ReadInt32();
                int Type         = Request.ReadInt32();
                int ReportedUser = Request.ReadInt32();

                FirewindEnvironment.GetGame().GetModerationTool().SendNewTicket(Session, Type, ReportedUser, Message);
            }

            GetResponse().Init(1693);
            GetResponse().AppendInt32(0);
            SendResponse();
        }
示例#7
0
        internal void ChangeLook()
        {
            if (Session.GetHabbo().MutantPenalty)
            {
                Session.SendNotif("Because of a penalty or restriction on your account, you are not allowed to change your look.");
                return;
            }

            string Gender = Request.ReadString().ToUpper();
            string Look   = FirewindEnvironment.FilterInjectionChars(Request.ReadString());

            //if (!AntiMutant.ValidateLook(Look, Gender))
            //{
            //    return;
            //}

            FirewindEnvironment.GetGame().GetQuestManager().ProgressUserQuest(Session, HabboHotel.Quests.QuestType.PROFILE_CHANGE_LOOK);

            Session.GetHabbo().Look   = FirewindEnvironment.FilterFigure(Look);
            Session.GetHabbo().Gender = Gender.ToLower();

            using (IQueryAdapter dbClient = FirewindEnvironment.GetDatabaseManager().getQueryreactor())
            {
                dbClient.setQuery("UPDATE users SET look = @look, gender = @gender WHERE id = " + Session.GetHabbo().Id);
                dbClient.addParameter("look", Look);
                dbClient.addParameter("gender", Gender);
                dbClient.runQuery();
            }

            FirewindEnvironment.GetGame().GetAchievementManager().ProgressUserAchievement(Session, "ACH_AvatarLooks", 1);

            Session.GetMessageHandler().GetResponse().Init(Outgoing.UpdateUserInformation);
            Session.GetMessageHandler().GetResponse().AppendInt32(-1);
            Session.GetMessageHandler().GetResponse().AppendString(Session.GetHabbo().Look);
            Session.GetMessageHandler().GetResponse().AppendString(Session.GetHabbo().Gender.ToLower());
            Session.GetMessageHandler().GetResponse().AppendString(Session.GetHabbo().Motto);
            Session.GetMessageHandler().GetResponse().AppendInt32(Session.GetHabbo().AchievementPoints);
            Session.GetMessageHandler().SendResponse();

            if (Session.GetHabbo().InRoom)
            {
                Room Room = Session.GetHabbo().CurrentRoom;

                if (Room == null)
                {
                    return;
                }

                RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);

                if (User == null)
                {
                    return;
                }

                ServerMessage RoomUpdate = new ServerMessage(Outgoing.UpdateUserInformation);
                RoomUpdate.AppendInt32(User.VirtualId);
                RoomUpdate.AppendString(Session.GetHabbo().Look);
                RoomUpdate.AppendString(Session.GetHabbo().Gender.ToLower());
                RoomUpdate.AppendString(Session.GetHabbo().Motto);
                RoomUpdate.AppendInt32(Session.GetHabbo().AchievementPoints);
                Room.SendMessage(RoomUpdate);
            }
        }