Exemplo n.º 1
0
        public void Parse(HabboHotel.GameClients.GameClient Session, Messages.ClientMessage Packet)
        {
            Silverwave.HabboHotel.Users.Habbo targetHabbo = Session.GetHabbo();
            if (targetHabbo == null)
            {
                return;
            }

            uint Id = Packet.PopWiredUInt();

            RoomData Data = SilverwaveEnvironment.GetGame().GetRoomManager().GenerateRoomData(Id);

            if (Data == null || Session.GetHabbo().FavoriteRooms.Count >= 30 || Session.GetHabbo().FavoriteRooms.Contains(Id))
            {
                // send packet that favourites is full.
                return;
            }

            Session.GetHabbo().FavoriteRooms.Add(Id);
            Session.SendMessage(new UpdateFavouriteRoomComposer(Id, true));

            using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
            {
                dbClient.runFastQuery("INSERT INTO user_favorites (user_id,room_id) VALUES (" + Session.GetHabbo().Id + "," + Id + ")");
            }
        }
Exemplo n.º 2
0
        public void Parse(HabboHotel.GameClients.GameClient Session, Messages.ClientMessage Packet)
        {
            uint RoomId = Packet.PopWiredUInt();
            string Password = Packet.PopFixedString();

            Session.GetMessageHandler().PrepareRoomForUser(RoomId, Password);
        }
        public void Parse(HabboHotel.GameClients.GameClient Session, Messages.ClientMessage Packet)
        {
            int junk1 = Packet.PopWiredInt32();
            int junk2 = Packet.PopWiredInt32();
            uint RoomId = Packet.PopWiredUInt();
            string Name = Packet.PopFixedString();
            bool junk3 = Packet.PopWiredBoolean();
            string Desc = Packet.PopFixedString();
            SilverwaveEnvironment.GetGame().GetRoomEvents().AddNewEvent(RoomId, Name, Desc, Session);
            Session.SendMessage(new PurchaseOKComposer());

            Session.GetHabbo().Credits -= 500;
            Session.GetHabbo().UpdateCreditsBalance();
        }
Exemplo n.º 4
0
        public void Parse(HabboHotel.GameClients.GameClient Session, Messages.ClientMessage Packet)
        {
            Silverwave.HabboHotel.Users.Habbo targetHabbo = Session.GetHabbo();

            if (targetHabbo == null)
            {
                return;
            }

            uint Id = Packet.PopWiredUInt();

            Session.GetHabbo().FavoriteRooms.Remove(Id);
            Session.SendMessage(new UpdateFavouriteRoomComposer(Id, false));

            using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
            {
                dbClient.runFastQuery("DELETE FROM user_favorites WHERE user_id = " + Session.GetHabbo().Id + " AND room_id = " + Id + "");
            }
        }