Checks the length of name and description for guilds/groups

This commit is contained in:
ArpyAge 2020-07-30 16:42:06 +02:00
parent cfcc2d0f7c
commit f1ada781d7
2 changed files with 9 additions and 3 deletions

View File

@ -25,6 +25,9 @@ public class GuildChangeNameDescEvent extends MessageHandler {
if (guild.getName().equals(nameEvent.name) && guild.getDescription().equals(nameEvent.description)) if (guild.getName().equals(nameEvent.name) && guild.getDescription().equals(nameEvent.description))
return; return;
if(nameEvent.name.length() > 29 || nameEvent.description.length() > 254)
return;
guild.setName(nameEvent.name); guild.setName(nameEvent.name);
guild.setDescription(nameEvent.description); guild.setDescription(nameEvent.description);
guild.needsUpdate = true; guild.needsUpdate = true;

View File

@ -21,6 +21,12 @@ public class RequestGuildBuyEvent extends MessageHandler {
@Override @Override
public void handle() throws Exception { public void handle() throws Exception {
String name = this.packet.readString();
String description = this.packet.readString();
if(name.length() > 29 || description.length() > 254)
return;
if (Emulator.getConfig().getBoolean("catalog.guild.hc_required", true) && this.client.getHabbo().getHabboStats().getClubExpireTimestamp() < Emulator.getIntUnixTimestamp()) { if (Emulator.getConfig().getBoolean("catalog.guild.hc_required", true) && this.client.getHabbo().getHabboStats().getClubExpireTimestamp() < Emulator.getIntUnixTimestamp()) {
this.client.sendResponse(new GuildEditFailComposer(GuildEditFailComposer.HC_REQUIRED)); this.client.sendResponse(new GuildEditFailComposer(GuildEditFailComposer.HC_REQUIRED));
return; return;
@ -36,9 +42,6 @@ public class RequestGuildBuyEvent extends MessageHandler {
} }
} }
String name = this.packet.readString();
String description = this.packet.readString();
int roomId = this.packet.readInt(); int roomId = this.packet.readInt();
Room r = Emulator.getGameEnvironment().getRoomManager().getRoom(roomId); Room r = Emulator.getGameEnvironment().getRoomManager().getRoom(roomId);