From 4992b759e4867813b0254907d6e347f2e619d351 Mon Sep 17 00:00:00 2001 From: Beny Date: Mon, 2 Nov 2020 02:49:15 +0100 Subject: [PATCH] You can now only open highscores with rights or wired. Closes #885 --- .../items/interactions/InteractionWiredHighscore.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWiredHighscore.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWiredHighscore.java index 9708c565..8fb95dd4 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWiredHighscore.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWiredHighscore.java @@ -6,6 +6,9 @@ import com.eu.habbo.habbohotel.items.Item; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.users.HabboItem; +import com.eu.habbo.habbohotel.wired.WiredEffectType; +import com.eu.habbo.habbohotel.wired.WiredHandler; +import com.eu.habbo.habbohotel.wired.WiredTriggerType; import com.eu.habbo.habbohotel.wired.highscores.WiredHighscoreClearType; import com.eu.habbo.habbohotel.wired.highscores.WiredHighscoreRow; import com.eu.habbo.habbohotel.wired.highscores.WiredHighscoreScoreType; @@ -78,6 +81,9 @@ public class InteractionWiredHighscore extends HabboItem { @Override public void onClick(GameClient client, Room room, Object[] objects) throws Exception { + if (!((client != null && room != null && room.hasRights(client.getHabbo())) || (objects.length >= 2 && objects[1] instanceof WiredEffectType))) + return; + if (this.getExtradata() == null || this.getExtradata().isEmpty() || this.getExtradata().length() == 0) { this.setExtradata("0"); } @@ -89,6 +95,10 @@ public class InteractionWiredHighscore extends HabboItem { } catch (Exception e) { LOGGER.error("Caught exception", e); } + + if(client != null && !(objects.length >= 2 && objects[1] instanceof WiredEffectType)) { + WiredHandler.handle(WiredTriggerType.STATE_CHANGED, client.getHabbo().getRoomUnit(), room, new Object[]{this}); + } }