public void Handle(GameClient Session, ClientMessage Event)
		{
			int num = Event.PopWiredInt32();

            ServerMessage Message = new ServerMessage(Outgoing.SongInfo); // Updated
			Message.AppendInt32(num);
			if (num > 0)
			{
				for (int i = 0; i < num; i++)
				{
					int num2 = Event.PopWiredInt32();

                    
                    if (num2 > 0)
                    {
                        Message.AppendInt32(SongManager.GetSong(num2).Id);
                        Message.AppendString(SongManager.GetSong(num2).Name);
                        Message.AppendString(SongManager.GetSong(num2).Track);
                        Message.AppendInt32(SongManager.GetSong(num2).Length);
                        Message.AppendString(SongManager.GetSong(num2).Author);
                    }
                    else
                    {
                        // Ei lähetetä osittaista pakettia!!
                        return;
                    }
                }
            }
          
			Session.SendMessage(Message);
		}
 public void Handle(GameClient Session, ClientMessage Event)
 {
     int guildId = Event.PopWiredInt32();
     //Console.WriteLine(Event.PopWiredInt32() + " | " + Event.PopWiredInt32() + " | " + Event.PopWiredInt32());
     GroupsManager guild = Groups.GetGroupById(guildId);
     if (guild != null)
     {
         if (!guild.UserWithRanks.Contains((int)Session.GetHabbo().Id))
             return;
         Room room = Essential.GetGame().GetRoomManager().method_15(Convert.ToUInt32(guild.RoomId));
         if (room != null)
         {
             int type = Event.PopWiredInt32();
             guild.Locked = Groups.IntToType(type);
             int onlyAdminMove = Event.PopWiredInt32();
             guild.canMove = !Essential.StringToBoolean(onlyAdminMove + "");
             guild.OnlyAdminsCanMove = onlyAdminMove;
             using (DatabaseClient dbClient = Essential.GetDatabase().GetClient())
             {
                 dbClient.ExecuteQuery("UPDATE groups SET locked='" + guild.Locked + "' WHERE id=" + guild.Id);
                 dbClient.ExecuteQuery("UPDATE groups SET members_canmove='" +(guild.canMove ? 1 : 0) + "' WHERE id=" + guild.Id);
             }
             room.SaveSettingsPackets(guild, Session);
         }
     }
 }
		public void Handle(GameClient Session, ClientMessage Event)
		{
			if (Session.GetHabbo().HasFuse("acc_supporttool"))
			{
				uint uint_ = Event.PopWiredUInt();
                bool flag = (Event.PopWiredInt32() == 1);
                bool flag2 = (Event.PopWiredInt32() == 1);
                bool flag3 = (Event.PopWiredInt32() == 1);
				string text = "";
				if (flag)
				{
					text += "Apply Doorbell";
				}
				if (flag2)
				{
					text += " Change Name";
				}
				if (flag3)
				{
					text += " Kick Users";
				}
				Essential.GetGame().GetClientManager().StoreCommand(Session, "ModTool - Room Action", text);
		        Essential.GetGame().GetModerationTool().method_12(Session, uint_, flag3, flag, flag2);
			}
		}
Exemplo n.º 4
0
 public void Handle(GameClient Session, ClientMessage Event)
 {
     if (Session != null && Session.GetHabbo() != null)
     {
         Room @class = Essential.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
         if (@class != null)
         {
             RoomUser class2 = @class.GetRoomUserByHabbo(Session.GetHabbo().Id);
             if (class2 != null)
             {
                 class2.Unidle();
                 int num = Event.PopWiredInt32();
                 int num2 = Event.PopWiredInt32();
                 if (num != class2.X || num2 != class2.Y)
                 {
                     int int_ = Rotation.GetRotation(class2.X, class2.Y, num, num2);
                     class2.method_9(int_);
                     if (class2.class34_1 != null && class2.RoomUser_0 != null)
                     {
                         class2.RoomUser_0.method_9(int_);
                     }
                 }
             }
         }
     }
 }
		public void Handle(GameClient Session, ClientMessage Event)
		{
			int int_ = Event.PopWiredInt32();
			int int_2 = Event.PopWiredInt32();
			string string_ = Event.PopFixedString();
			int int_3 = Event.PopWiredInt32();
			Session.SendMessage(Essential.GetGame().GetCatalog().GetMarketplace().GetMarketPlaceOffers(int_, int_2, string_, int_3,Session));
		}
		public void Handle(GameClient Session, ClientMessage Event)
		{
			if (Session.GetHabbo().HasFuse("acc_supporttool"))
			{
				int int_ = Event.PopWiredInt32();
				Event.PopWiredInt32();
				uint uint_ = Event.PopWiredUInt();
				Essential.GetGame().GetModerationTool().method_8(Session, uint_, int_);
			}
		}
		public void Handle(GameClient Session, ClientMessage Event)
		{
			Room @class = Essential.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
			if (@class != null && @class.method_26(Session))
			{
				RoomItem class2 = @class.method_28(Event.PopWiredUInt());
				if (class2 != null)
				{
					int num = Event.PopWiredInt32();
					int num2 = Event.PopWiredInt32();
					int num3 = Event.PopWiredInt32();
					Event.PopWiredInt32();
                    if (Session.GetHabbo().CurrentQuestId > 0 && Essential.GetGame().GetQuestManager().GetQuestAction(Session.GetHabbo().CurrentQuestId) == "MOVE_ITEM" && (num != class2.GetX || num2 != class2.Int32_1))
					{
                        Essential.GetGame().GetQuestManager().ProgressUserQuest(Session.GetHabbo().CurrentQuestId, Session);
					}
					else
					{
                        if (Session.GetHabbo().CurrentQuestId > 0 && Essential.GetGame().GetQuestManager().GetQuestAction(Session.GetHabbo().CurrentQuestId) == "ROTATE_ITEM" && num3 != class2.int_3)
						{
                            Essential.GetGame().GetQuestManager().ProgressUserQuest(Session.GetHabbo().CurrentQuestId, Session);
						}
						else
						{
                            if (Session.GetHabbo().CurrentQuestId > 0 && Essential.GetGame().GetQuestManager().GetQuestAction(Session.GetHabbo().CurrentQuestId) == "STACKITEM" && class2.Double_0 > 0.0)
							{
                                Essential.GetGame().GetQuestManager().ProgressUserQuest(Session.GetHabbo().CurrentQuestId, Session);
							}
						}
					}
					bool flag = false;
					string text = class2.GetBaseItem().InteractionType.ToLower();
					if (text != null && text == "teleport")
					{
						flag = true;
					}
                    if (text != null && text == "instant_teleport")
                    {
                        flag = true;
                    }
                    if (text != null && text == "hopper")
                    {
                        flag = true;
                    }
               
					@class.method_79(Session, class2, num, num2, num3, false, false, false);
					if (flag)
					{
						@class.method_64();
					}
				}
			}
		}
        public void Handle(GameClient Session, ClientMessage Event)
        {
            int botId = Event.PopWiredInt32();
            int skillType = Event.PopWiredInt32();
            switch (skillType)
            {
                case 2:
                    {
                        string truncatedText = "";
                        using (DatabaseClient dbClient = Essential.GetDatabase().GetClient())
                        {
                            DataTable dt;
                            DataRow speakingRow;
                            dt = dbClient.ReadDataTable("SELECT * FROM bots_speech WHERE bot_id = " + botId);
                            if (dt != null)
                            {
                                foreach (DataRow dr in dt.Rows)
                                {
                                    truncatedText += (dr["text"] + "\n");
                                }
                                speakingRow = dbClient.ReadDataRow("SELECT * FROM user_bots WHERE id = " + botId);
                                truncatedText += ";#;";
                                truncatedText += Convert.ToString(speakingRow["automatic_chat"]);
                                truncatedText += ";#;";
                                truncatedText += Convert.ToString(speakingRow["speaking_interval"]);
                            }
                        }
                        ServerMessage message = new ServerMessage(Outgoing.SerializeSpeechList);
                        message.AppendInt32(botId);
                        message.AppendInt32(skillType);
                        message.AppendString(truncatedText);
                        Session.SendMessage(message);
                        break;
                    }
                case 5:
                    {

                        ServerMessage message = new ServerMessage(Outgoing.SerializeSpeechList);
                        message.AppendInt32(botId);
                        message.AppendInt32(skillType);
                        using (DatabaseClient dbClient = Essential.GetDatabase().GetClient())
                        {
                            message.AppendString(dbClient.ReadString("SELECT name FROM user_bots WHERE id = " + botId));
                        }
                        Session.SendMessage(message);
                        break;
                    }
                default:
                    return;

            }
        }
		public void Handle(GameClient Session, ClientMessage Event)
		{
            if (!Essential.GetGame().GetModerationTool().method_9(Session.GetHabbo().Id))
			{
				string string_ = Essential.FilterString(Event.PopFixedString());
				Event.PopWiredInt32();
				int int_ = Event.PopWiredInt32();
				uint uint_ = Event.PopWiredUInt();
				Essential.GetGame().GetModerationTool().method_3(Session, int_, uint_, string_);
			}
            ServerMessage Message = new ServerMessage(Outgoing.HelpRequestAlert); // 321 old UPDATED
            Message.AppendInt32(0);
			Session.SendMessage(Message);
		}
 public void Handle(GameClient Session, ClientMessage Event)
 {
     if (Session != null && Session.GetHabbo() != null)
     {
         Room class14_ = Session.GetHabbo().CurrentRoom;
         if (class14_ != null)
         {
             RoomUser @class = class14_.GetRoomUserByHabbo(Session.GetHabbo().Id);
             if (@class != null && @class.bool_0)
             {
                 int num = Event.PopWiredInt32();
                 int num2 = Event.PopWiredInt32();
                 if (num != @class.X || num2 != @class.Y)
                 {
                     if (@class.RoomUser_0 != null)
                     {
                         try
                         {
                             if (@class.RoomUser_0.IsBot)
                             {
                                 @class.Unidle();
                             }
                             @class.RoomUser_0.MoveTo(num, num2);
                             return;
                         }
                         catch
                         {
                             @class.RoomUser_0 = null;
                             @class.class34_1 = null;
                             @class.MoveTo(num, num2);
                             Session.GetHabbo().GetEffectsInventoryComponent().method_2(-1, true);
                             return;
                         }
                     }
                     if (@class.TeleportMode)
                     {
                         @class.X = num;
                         @class.Y = num2;
                         @class.UpdateNeeded = true;
                     }
                     else
                     {
                         @class.MoveTo(num, num2);
                     }
                 }
             }
         }
     }
 }
 public void Handle(GameClient Session, ClientMessage Event)
 {
     if (Session != null && Session.GetHabbo() != null)
     {
         Event.PopWiredInt32();
         Room @class = Essential.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
         if (@class != null && @class.CheckRights(Session, true))
         {
             RoomItem class2 = @class.method_28(Event.PopWiredUInt());
             if (class2 != null)
             {
                 string text = class2.GetBaseItem().InteractionType.ToLower();
                 if (text == null || !(text == "postit"))
                 {
                     @class.method_29(Session, class2.uint_0, false, true);
                     Session.GetHabbo().GetInventoryComponent().method_11(class2.uint_0, class2.uint_2, class2.ExtraData, false, 0, 0, class2.GuildData);
                     Session.GetHabbo().GetInventoryComponent().method_9(true);
                     if (Session.GetHabbo().CurrentQuestId > 0 && Essential.GetGame().GetQuestManager().GetQuestAction(Session.GetHabbo().CurrentQuestId) == "PICKUPITEM")
                     {
                         Essential.GetGame().GetQuestManager().ProgressUserQuest(Session.GetHabbo().CurrentQuestId, Session);
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 12
0
		public void Handle(GameClient Session, ClientMessage Event)
		{
            Room room = Essential.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
            if (room != null)
            {
                RoomUser roomUserByHabbo = room.GetRoomUserByHabbo(Session.GetHabbo().Id);
                if (roomUserByHabbo != null)
                {
                    roomUserByHabbo.Unidle();
                    int num = Event.PopWiredInt32();
                    /*if (num < 0 || num > 4 || (!Session.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_club") && num > 1))
                    {
                        num = 0;
                    }*/
                    if (num > 0 && roomUserByHabbo.CarryItemID > 0)
                    {
                        roomUserByHabbo.CarryItem(0);
                    }
                    roomUserByHabbo.DanceId = num;
                    ServerMessage serverMessage = new ServerMessage(Outgoing.Dance);
                    serverMessage.AppendInt32(roomUserByHabbo.VirtualId);
                    serverMessage.AppendInt32(num);
                    room.SendMessage(serverMessage, null);
                    if (Session.GetHabbo().CurrentQuestId > 0 && Essential.GetGame().GetQuestManager().GetQuestAction(Session.GetHabbo().CurrentQuestId) == "DANCE")
                    {
                        Essential.GetGame().GetQuestManager().ProgressUserQuest(Session.GetHabbo().CurrentQuestId, Session);
                    }
                }
            }
		}
		public void Handle(GameClient Session, ClientMessage Event)
		{
			if (Session.GetHabbo().GetMessenger() != null)
			{
				int num = Event.PopWiredInt32();
				for (int i = 0; i < num; i++)
				{
					uint uint_ = Event.PopWiredUInt();
					MessengerRequest @class = Session.GetHabbo().GetMessenger().method_4(uint_);
					if (@class != null)
					{
						if (@class.To != Session.GetHabbo().Id)
						{
							break;
						}

						if (!Session.GetHabbo().GetMessenger().method_9(@class.To, @class.From))
						{
							Session.GetHabbo().GetMessenger().method_12(@class.From);
						}

						Session.GetHabbo().GetMessenger().method_11(uint_);

                       
					}
				}
			}
		}
		public void Handle(GameClient Session, ClientMessage Event)
		{
			int num = Event.PopWiredInt32();
			List<uint> list = new List<uint>();
			for (int i = 0; i < num; i++)
			{
				list.Add(Event.PopWiredUInt());
			}
			string text = Event.PopFixedString();
			
				text = Essential.DoFilter(text, true, false);
				text = ChatCommandHandler.ApplyFilter(text);
                ServerMessage Message = new ServerMessage(Outgoing.InstantInvite); // Update
				Message.AppendUInt(Session.GetHabbo().Id);
				Message.AppendStringWithBreak(text);
				foreach (uint current in list)
				{
					if (Session.GetHabbo().GetMessenger().method_9(Session.GetHabbo().Id, current))
					{
						GameClient @class = Essential.GetGame().GetClientManager().GetClient(current);
						if (@class == null)
						{
							break;
						}
						@class.SendMessage(Message);
					}
				}
		}
		public void Handle(GameClient Session, ClientMessage Event)
		{
			Room @class = Essential.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
			if (@class != null && @class.method_26(Session))
			{
                int num = Event.PopWiredInt32();
                uint Data = Event.PopWiredUInt();
                string BrandData = "state" + Convert.ToChar(9) + "0";
                for (int i = 1; i <= Data; i++)
                {
                    BrandData = BrandData + Convert.ToChar(9) + Event.PopFixedString();
                }
                using (DatabaseClient class2 = Essential.GetDatabase().GetClient())
                {
                    class2.AddParamWithValue("extradata", BrandData);
                    class2.ExecuteQuery("UPDATE items_extra_data SET extra_data = @extradata WHERE item_id = '" + num + "' LIMIT 1");
                }
                /*ServerMessage Message = new ServerMessage();
                Message.Init(Outgoing.ObjectDataUpdate); // Update
                Message.AppendStringWithBreak(num.ToString());
                Message.AppendInt32(0);
                Message.AppendInt32(1);
                Message.AppendStringWithBreak(BrandData);
                @class.SendMessage(Message, null);*/
                @class.method_28((uint)num).ExtraData = BrandData;
                @class.method_79(Session, @class.method_28((uint)num), @class.method_28((uint)num).GetX, @class.method_28((uint)num).Int32_1, @class.method_28((uint)num).int_3, false, false, true);
                @class.method_28((uint)num).UpdateState(true, false, true);
				}
			
		}
		public void Handle(GameClient Session, ClientMessage Event)
		{
            if (Session.GetHabbo().InRoom)
			{
				int num = Event.PopWiredInt32();
				if (num >= 3)
				{
					for (int i = 0; i < num; i++)
					{
						UserItem @class = Session.GetHabbo().GetInventoryComponent().GetItemById(Event.PopWiredUInt());
						if (@class == null || [email protected]().AllowRecycle)
						{
							return;
						}
                        Session.GetHabbo().GetInventoryComponent().method_12(@class.uint_0, 0u, false);
					}
					uint num2 = Essential.GetGame().GetCatalog().GetNextId();
					EcotronReward class2 = Essential.GetGame().GetCatalog().GetEcotronReward();
					using (DatabaseClient class3 = Essential.GetDatabase().GetClient())
					{
						class3.ExecuteQuery(string.Concat(new object[]
						{
							"INSERT INTO items (Id,user_id,base_item,wall_pos) VALUES ('",
							num2,
							"','",
							Session.GetHabbo().Id,
							"','1478','')"
						}));
                        class3.ExecuteQuery(string.Concat(new object[]
						{
							"INSERT INTO items_extra_data (item_id,extra_data) VALUES ('",
							num2,
							"','",
							DateTime.Now.ToLongDateString(),
							"')"
						}));
						class3.ExecuteQuery(string.Concat(new object[]
						{
							"INSERT INTO user_presents (item_id,base_id,amount,extra_data) VALUES ('",
							num2,
							"','",
							class2.uint_2,
							"','1','')"
						}));
					}
					Session.GetHabbo().GetInventoryComponent().method_9(true);
                    ServerMessage Response = new ServerMessage(Outgoing.SendPurchaseAlert);
                    Response.AppendInt32(1);
                    Response.AppendInt32(1);
                    Response.AppendInt32(1);
                    Response.AppendInt32(class2.GetBaseItem().Sprite);
                    Session.SendMessage(Response);
                    ServerMessage Response2 = new ServerMessage(Outgoing.RecycleState);
                    Response2.AppendInt32(1);
                    Response2.AppendInt32(class2.GetBaseItem().Sprite);
                    Session.SendMessage(Response2);
				}
			}
		}
Exemplo n.º 17
0
        public void Handle(GameClient Session, ClientMessage Event)
        {
            int GameId = Event.PopWiredInt32();


            ServerMessage InitGame = new ServerMessage(Outgoing.GameID);
            InitGame.AppendInt32(GameId);
            InitGame.AppendInt32(0);
            Session.SendMessage(InitGame);


           ServerMessage Game2WeeklyLeaderboardEvent = new ServerMessage(Outgoing.Game2WeeklyLeaderboard);
            Game2WeeklyLeaderboardEvent.AppendInt32(DateTime.Now.Year);
            Game2WeeklyLeaderboardEvent.AppendInt32(1); // ??
            Game2WeeklyLeaderboardEvent.AppendInt32(0); // ??
            Game2WeeklyLeaderboardEvent.AppendInt32(0); // ??
            Game2WeeklyLeaderboardEvent.AppendInt32(5231); // ??
            Game2WeeklyLeaderboardEvent.AppendInt32(1); // count:
            // foreach...
            Game2WeeklyLeaderboardEvent.AppendUInt(Session.GetHabbo().Id); // user id
            Game2WeeklyLeaderboardEvent.AppendInt32(DateTime.Now.Year); // time of clasification
            Game2WeeklyLeaderboardEvent.AppendInt32(1); // position
            Game2WeeklyLeaderboardEvent.AppendString(Session.GetHabbo().Username); // username
            Game2WeeklyLeaderboardEvent.AppendString(Session.GetHabbo().Figure);
            Game2WeeklyLeaderboardEvent.AppendString(Session.GetHabbo().Gender.ToLower());

            Game2WeeklyLeaderboardEvent.AppendInt32(3);
            Game2WeeklyLeaderboardEvent.AppendInt32(GameId);
            Session.SendMessage(Game2WeeklyLeaderboardEvent);


            ServerMessage Game2AccountGameStatusMessageEvent = new ServerMessage(Outgoing.Game2AccountGameStatus); 
            Game2AccountGameStatusMessageEvent.AppendInt32(GameId);
            Game2AccountGameStatusMessageEvent.AppendInt32(-1);
            Game2AccountGameStatusMessageEvent.AppendInt32(132);
            Session.SendMessage(Game2AccountGameStatusMessageEvent);

            ServerMessage InitGame2 = new ServerMessage(Outgoing.InitGame);
            InitGame2.AppendInt32(GameId);
            InitGame2.AppendInt32(0);
            Session.SendMessage(InitGame2);


            ServerMessage GameCenterLayoutBestOfWeek = new ServerMessage(Outgoing.BestOfWeek);
            GameCenterLayoutBestOfWeek.AppendInt32(GameId);
            GameCenterLayoutBestOfWeek.AppendInt32(0); // enabled 0 : 1
            // if enabled
            GameCenterLayoutBestOfWeek.AppendString("s");
            GameCenterLayoutBestOfWeek.AppendInt32(4313);
            GameCenterLayoutBestOfWeek.AppendString("200");
            GameCenterLayoutBestOfWeek.AppendInt32(1);
            GameCenterLayoutBestOfWeek.AppendInt32(-1);
            GameCenterLayoutBestOfWeek.AppendBoolean(false);
            //
            GameCenterLayoutBestOfWeek.AppendInt32(5231); // minutos que quedan.
            GameCenterLayoutBestOfWeek.AppendBoolean(false); // enabled??
            Session.SendMessage(GameCenterLayoutBestOfWeek);

        }
 public void Handle(GameClient Session, ClientMessage Event)
 {
     Event.PopWiredInt32();
     string str = Event.PopFixedString();
     string str2 = Event.PopFixedString();
     Session.ClientVar = str;
    // Console.WriteLine(Session.ClientVar);
 }
		public void Handle(GameClient Session, ClientMessage Event)
		{
            try
            {
                int int_ = Event.PopWiredInt32();
                uint uint_ = Event.PopWiredUInt();
                string string_ = Event.PopFixedString();
                int Amount = Event.PopWiredInt32();
                //Console.WriteLine(int_ + "    " + uint_ + "     " + string_ + "     " + Amount);
                if (Session == null || Session.GetHabbo() == null)
                    return;
                if (Amount < 0 || Amount > 100) //BIG EXPLOIT..
                    return;
                Essential.GetGame().GetCatalog().HandlePurchase(Session, int_, uint_, string_, false, "", "", true, Amount);
            }
            catch (Exception ex) { Console.WriteLine(ex.ToString()); }
		}
		public void Handle(GameClient Session, ClientMessage Event)
		{
			if (Session.GetHabbo().HasFuse("acc_supporttool"))
			{
				Event.PopWiredInt32();
				int num = Event.PopWiredInt32();
				string text = Event.PopFixedString();
				string text2 = "";
				if (num.Equals(3))
				{
					text2 += "Room Cautioned.";
				}
				text2 = text2 + " Message: " + text;
				Essential.GetGame().GetClientManager().StoreCommand(Session, "ModTool - Room Alert", text2);
				Essential.GetGame().GetModerationTool().method_13(Session.GetHabbo().CurrentRoomId, !num.Equals(3), text);
			}
		}
Exemplo n.º 21
0
 public void Handle(GameClient Session, ClientMessage Event)
 {
     int ShieldId = Event.PopWiredInt32();
     if (ShieldId > 4)
     {
         return;
     }
     Essential.GetGame().GetGamesManager().ActivateShield(Session.Basejump_LobbyId, ShieldId, Session.Basejump_UserId);
 }
Exemplo n.º 22
0
		public void Handle(GameClient Session, ClientMessage Event)
		{
			if (Session.GetHabbo().HasFuse("acc_supporttool"))
			{
				uint uint_ = Event.PopWiredUInt();
				string string_ = Event.PopFixedString();
				int int_ = Event.PopWiredInt32() * 3600;
				Essential.GetGame().GetModerationTool().method_17(Session, uint_, int_, string_);
			}
		}
		public void Handle(GameClient Session, ClientMessage Event)
		{
            try
            {
                int pageId = Event.PopWiredInt32();
                uint itemId = Event.PopWiredUInt();
                string extraData = Event.PopFixedString();
                string giftUser = Essential.FilterString(Event.PopFixedString());
                string giftMessage = Essential.FilterString(Event.PopFixedString());
                int giftSpriteId = Event.PopWiredInt32();
                int giftLazo = Event.PopWiredInt32();
                int giftColor = Event.PopWiredInt32();
                bool undef = Event.PopWiredBoolean();
                Essential.GetGame().GetCatalog().HandlePurchase(Session, pageId, itemId, extraData, true, giftUser, giftMessage, true, 0, undef);
            }catch(Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
            }
		public void Handle(GameClient Session, ClientMessage Event)
		{
			uint num = Event.PopWiredUInt();
			string string_ = Event.PopFixedString();
			Event.PopWiredInt32();
            Session.GetHabbo().uint_2 = num;
            if (Session.GetClientMessageHandler() == null)
                Session.CreateClientMessageHandler();
            Session.GetClientMessageHandler().method_5(num, string_);
		}
Exemplo n.º 25
0
		public void Handle(GameClient session, ClientMessage message)
		{
			Room room = Essential.GetGame().GetRoomManager().GetRoom(session.GetHabbo().CurrentRoomId);

            if (room != null && (room.AllowPet || room.CheckRights(session, true)))
			{
				uint petId = message.PopWiredUInt();

				Pet pet = session.GetHabbo().GetInventoryComponent().GetPetById(petId);

				if (pet != null && !pet.PlacedInRoom)
				{
					int num = message.PopWiredInt32();
					int num2 = message.PopWiredInt32();

					if (room.method_30(num, num2, 0.0, true, false))
					{
						if (room.PetCount >= ServerConfiguration.PetsPerRoomLimit)
						{
							session.SendNotification(EssentialEnvironment.GetExternalText("error_maxpets") + ServerConfiguration.PetsPerRoomLimit);
						}
						else
						{
                            try
                            {
                                pet.PlacedInRoom = true;
                                pet.RoomId = room.Id;

                                List<RandomSpeech> list = new List<RandomSpeech>();
                                List<BotResponse> list2 = new List<BotResponse>();

                                room.method_4(new RoomBot(pet.PetId, pet.RoomId, AIType.Pet, "freeroam", pet.Name, "", pet.Look, num, num2, 0, 0, 0, 0, 0, 0, ref list, ref list2, 0), pet);
                                session.GetHabbo().GetInventoryComponent().RemovePetById(pet.PetId);

                            }catch(Exception ex)
                            {
                                Console.WriteLine(ex.ToString());
                            }
						}
					}
				}
			}
		}
		public void Handle(GameClient Session, ClientMessage Event)
		{
			Session.GetHabbo().GetBadgeComponent().ResetBadgeSlots();
			using (DatabaseClient @class = Essential.GetDatabase().GetClient())
			{
				@class.ExecuteQuery("UPDATE user_badges SET badge_slot = '0' WHERE user_id = '" + Session.GetHabbo().Id + "'");
				goto IL_131;
			}
			IL_52:
			int num = Event.PopWiredInt32();
			string text = Event.PopFixedString();
			if (text.Length != 0)
			{
				if (!Session.GetHabbo().GetBadgeComponent().HasBadge(text) || num < 1 || num > 5)
				{
					return;
				}
                if (Session.GetHabbo().CurrentQuestId > 0 && Essential.GetGame().GetQuestManager().GetQuestAction(Session.GetHabbo().CurrentQuestId) == "WEARBADGE")
				{
                    Essential.GetGame().GetQuestManager().ProgressUserQuest(Session.GetHabbo().CurrentQuestId, Session);
				}
				Session.GetHabbo().GetBadgeComponent().GetBadgeByCode(text).Slot = num;
				using (DatabaseClient @class = Essential.GetDatabase().GetClient())
				{
					@class.AddParamWithValue("slotid", num);
					@class.AddParamWithValue("badge", text);
					@class.AddParamWithValue("userid", Session.GetHabbo().Id);
					@class.ExecuteQuery("UPDATE user_badges SET badge_slot = @slotid WHERE badge_id = @badge AND user_id = @userid LIMIT 1");
				}
			}
			IL_131:
			if (Event.RemainingLength > 0)
			{
				goto IL_52;
			}
            ServerMessage Message = new ServerMessage(Outgoing.UpdateBadges); // Updated
			Message.AppendUInt(Session.GetHabbo().Id);
			Message.AppendInt32(Session.GetHabbo().GetBadgeComponent().VisibleBadges);
			foreach (Badge current in Session.GetHabbo().GetBadgeComponent().GetBadges())
			{
				if (current.Slot > 0)
				{
					Message.AppendInt32(current.Slot);
					Message.AppendStringWithBreak(current.Code);
				}
			}
            if (Session.GetHabbo().InRoom && Essential.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId) != null)
			{
				Essential.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId).SendMessage(Message, null);
			}
			else
			{
				Session.SendMessage(Message);
			}
		}
		public void Handle(GameClient Session, ClientMessage Event)
		{
			if (Session.GetHabbo().GetMessenger() != null)
			{
				int num = Event.PopWiredInt32();
				for (int i = 0; i < num; i++)
				{
					Session.GetHabbo().GetMessenger().method_13(Event.PopWiredUInt());
				}
			}
		}
Exemplo n.º 28
0
		public void Handle(GameClient Session, ClientMessage Event)
		{
			Room @class = Essential.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
            if (@class != null && @class.CheckRights(Session, true) && @class.Event != null)
			{
				int int_ = Event.PopWiredInt32();
				string string_ = Essential.FilterString(Event.PopFixedString());
				string string_2 = Essential.FilterString(Event.PopFixedString());
				int num = Event.PopWiredInt32();
				@class.Event.Category = int_;
				@class.Event.Name = string_;
				@class.Event.Description = string_2;
				@class.Event.Tags = new List<string>();
				for (int i = 0; i < num; i++)
				{
					@class.Event.Tags.Add(Essential.FilterString(Event.PopFixedString()));
				}
				@class.SendMessage(@class.Event.Serialize(Session), null);
			}
		}
Exemplo n.º 29
0
		public void Handle(GameClient Session, ClientMessage Event)
		{
			Room @class = Essential.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
            if (@class != null && @class.CheckRights(Session, true))
			{
				RoomUser class2 = @class.method_52(Event.PopWiredInt32());
				if (class2 != null && class2.IsBot)
				{
					@class.method_6(class2.VirtualId, true);
				}
			}
		}
		public void Handle(GameClient Session, ClientMessage Event)
		{
			if (Session.GetHabbo().HasFuse("acc_chatlogs"))
			{
				Event.PopWiredInt32();
				uint uint_ = Event.PopWiredUInt();
				if (Essential.GetGame().GetRoomManager().GetRoom(uint_) != null)
				{
					Session.SendMessage(Essential.GetGame().GetModerationTool().method_22(uint_));
				}
			}
		}