From 1912873fe46c1094d22a5ff632c41a68ecb11696 Mon Sep 17 00:00:00 2001 From: nttzx Date: Thu, 6 Aug 2020 12:19:12 -0400 Subject: [PATCH] Verify the length of desc & name of the group --- .../incoming/guilds/GuildChangeNameDescEvent.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildChangeNameDescEvent.java b/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildChangeNameDescEvent.java index fc28261c..e0a44e3e 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildChangeNameDescEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildChangeNameDescEvent.java @@ -2,8 +2,10 @@ package com.eu.habbo.messages.incoming.guilds; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.guilds.Guild; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.messages.incoming.MessageHandler; +import com.eu.habbo.messages.outgoing.guilds.GuildEditFailComposer; import com.eu.habbo.plugin.events.guilds.GuildChangedNameEvent; public class GuildChangeNameDescEvent extends MessageHandler { @@ -14,10 +16,19 @@ public class GuildChangeNameDescEvent extends MessageHandler { Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId); if (guild != null) { - if (guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermission("acc_guild_admin")) { + if (guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermission(Permission.ACC_GUILD_ADMIN)) { GuildChangedNameEvent nameEvent = new GuildChangedNameEvent(guild, this.packet.readString(), this.packet.readString()); Emulator.getPluginManager().fireEvent(nameEvent); + if(nameEvent.name.length() > 29){ + this.client.sendResponse(new GuildEditFailComposer(GuildEditFailComposer.INVALID_GUILD_NAME)); + return; + } + + if(nameEvent.description.length() > 254){ + return; + } + if (nameEvent.isCancelled()) return;