You can now only open highscores with rights or wired. Closes #885

This commit is contained in:
Beny 2020-11-02 02:49:15 +01:00
parent 854333a145
commit 4992b759e4

View File

@ -6,6 +6,9 @@ import com.eu.habbo.habbohotel.items.Item;
import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.rooms.Room;
import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.rooms.RoomUnit;
import com.eu.habbo.habbohotel.users.HabboItem; 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.WiredHighscoreClearType;
import com.eu.habbo.habbohotel.wired.highscores.WiredHighscoreRow; import com.eu.habbo.habbohotel.wired.highscores.WiredHighscoreRow;
import com.eu.habbo.habbohotel.wired.highscores.WiredHighscoreScoreType; import com.eu.habbo.habbohotel.wired.highscores.WiredHighscoreScoreType;
@ -78,6 +81,9 @@ public class InteractionWiredHighscore extends HabboItem {
@Override @Override
public void onClick(GameClient client, Room room, Object[] objects) throws Exception { 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) { if (this.getExtradata() == null || this.getExtradata().isEmpty() || this.getExtradata().length() == 0) {
this.setExtradata("0"); this.setExtradata("0");
} }
@ -89,6 +95,10 @@ public class InteractionWiredHighscore extends HabboItem {
} catch (Exception e) { } catch (Exception e) {
LOGGER.error("Caught 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});
}
} }