From f4a0fb491bb0418af8e81fcb0178017b66970908 Mon Sep 17 00:00:00 2001 From: nttzx Date: Thu, 6 Aug 2020 12:18:02 -0400 Subject: [PATCH 1/3] Verify the length of the name group --- .../incoming/guilds/RequestGuildBuyEvent.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/eu/habbo/messages/incoming/guilds/RequestGuildBuyEvent.java b/src/main/java/com/eu/habbo/messages/incoming/guilds/RequestGuildBuyEvent.java index ea5e530b..280fa089 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/guilds/RequestGuildBuyEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/guilds/RequestGuildBuyEvent.java @@ -3,6 +3,7 @@ package com.eu.habbo.messages.incoming.guilds; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.guilds.Guild; import com.eu.habbo.habbohotel.modtool.ScripterManager; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.messages.incoming.MessageHandler; @@ -12,11 +13,15 @@ import com.eu.habbo.messages.outgoing.guilds.GuildBoughtComposer; import com.eu.habbo.messages.outgoing.guilds.GuildEditFailComposer; import com.eu.habbo.messages.outgoing.guilds.GuildInfoComposer; import com.eu.habbo.plugin.events.guilds.GuildPurchasedEvent; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class RequestGuildBuyEvent extends MessageHandler { + private static final Logger LOGGER = LoggerFactory.getLogger(RequestGuildBuyEvent.class); + @Override public void handle() throws Exception { - if (!this.client.getHabbo().hasPermission("acc_infinite_credits")) { + if (!this.client.getHabbo().hasPermission(Permission.ACC_INFINITE_CREDITS)) { int guildPrice = Emulator.getConfig().getInt("catalog.guild.price"); if (this.client.getHabbo().getHabboInfo().getCredits() >= guildPrice) { this.client.getHabbo().giveCredits(-guildPrice); @@ -71,6 +76,13 @@ public class RequestGuildBuyEvent extends MessageHandler { base += 3; } + if(name.length() > 29){ + this.client.sendResponse(new GuildEditFailComposer(GuildEditFailComposer.INVALID_GUILD_NAME)); + return; + } + if(description.length() > 254){ + return; + } Guild guild = Emulator.getGameEnvironment().getGuildManager().createGuild(this.client.getHabbo(), roomId, r.getName(), name, description, badge, colorOne, colorTwo); r.setGuild(guild.getId()); @@ -95,7 +107,7 @@ public class RequestGuildBuyEvent extends MessageHandler { } else { String message = Emulator.getTexts().getValue("scripter.warning.guild.buy.owner").replace("%username%", this.client.getHabbo().getHabboInfo().getUsername()).replace("%roomname%", r.getName().replace("%owner%", r.getOwnerName())); ScripterManager.scripterDetected(this.client, message); - Emulator.getLogging().logUserLine(message); + LOGGER.info(message); } } } From b64e837535fb3e86a190a23c48f7479b860b805c Mon Sep 17 00:00:00 2001 From: Kitt Mustang Date: Wed, 23 Sep 2020 08:52:51 -0400 Subject: [PATCH 2/3] The sphere now flashes blue when the timer starts --- .../games/battlebanzai/BattleBanzaiGame.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/eu/habbo/habbohotel/games/battlebanzai/BattleBanzaiGame.java b/src/main/java/com/eu/habbo/habbohotel/games/battlebanzai/BattleBanzaiGame.java index 31a561b5..07b83048 100644 --- a/src/main/java/com/eu/habbo/habbohotel/games/battlebanzai/BattleBanzaiGame.java +++ b/src/main/java/com/eu/habbo/habbohotel/games/battlebanzai/BattleBanzaiGame.java @@ -44,6 +44,7 @@ public class BattleBanzaiGame extends Game { private final THashMap gameTiles; private int tileCount; private int countDown; + private int countDown2; public BattleBanzaiGame(Room room) { super(BattleBanzaiGameTeam.class, BattleBanzaiGamePlayer.class, room, true); @@ -58,8 +59,12 @@ public class BattleBanzaiGame extends Game { public void initialise() { if (!this.state.equals(GameState.IDLE)) return; - + + /* The first countdown is activated for the first two seconds emitting only the blue light (second interaction), + the second, after another two seconds, completely activates the sphere (third interaction). + */ this.countDown = 3; + this.countDown2 = 2; this.resetMap(); @@ -105,8 +110,15 @@ public class BattleBanzaiGame extends Game { if (this.countDown == 0) { for (HabboItem item : this.room.getRoomSpecialTypes().getItemsOfType(InteractionBattleBanzaiSphere.class)) { - item.setExtradata("2"); + item.setExtradata("1"); this.room.updateItemState(item); + if(this.countDown2 > 0) { + this.countDown2--; + if(this.countDown2 == 0) { + item.setExtradata("2"); + this.room.updateItemState(item); + } + } } } From c6ea16fe7db3d843a555d4440e1a8450daff43f9 Mon Sep 17 00:00:00 2001 From: Mikkel Friis Date: Fri, 25 Sep 2020 04:41:16 +0200 Subject: [PATCH 3/3] mannequin fix for jackets --- .../interactions/InteractionMannequin.java | 38 ++++++++++--------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionMannequin.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionMannequin.java index 2901a7b9..cc291a67 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionMannequin.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionMannequin.java @@ -60,26 +60,30 @@ public class InteractionMannequin extends HabboItem { @Override public void onClick(GameClient client, Room room, Object[] objects) throws Exception { - String[] lookCode = this.getExtradata().split(":")[1].split("\\."); + String lookCode = this.getExtradata().split(":")[1]; + String newFigure = ""; - StringBuilder look = new StringBuilder(); - for (String part : client.getHabbo().getHabboInfo().getLook().split("\\.")) { - String type = part.split("-")[0]; - - boolean found = false; - for (String s : lookCode) { - if (s.contains(type)) { - found = true; - look.append(s).append("."); - } - } - - if (!found) { - look.append(part).append("."); - } + for (String playerFigurePart : client.getHabbo().getHabboInfo().getLook().split("\\.")) { + if (!playerFigurePart.startsWith("ch") && !playerFigurePart.startsWith("lg")) + newFigure += playerFigurePart + "."; } - client.getHabbo().getHabboInfo().setLook(look.substring(0, look.length() - 1)); + if (lookCode.isEmpty()) return; + String newFigureParts = lookCode; + + for (String newFigurePart : newFigureParts.split("\\.")) { + if (newFigurePart.startsWith("hd")) + newFigureParts = newFigureParts.replace(newFigurePart, ""); + } + + if (newFigureParts.equals("")) return; + + final String figure = newFigure + newFigureParts; + + if (figure.length() > 512) + return; + + client.getHabbo().getHabboInfo().setLook(figure); room.sendComposer(new RoomUserDataComposer(client.getHabbo()).compose()); client.sendResponse(new UserDataComposer(client.getHabbo())); }