🆕 Infostand Borders

This commit is contained in:
duckietm
2026-05-19 16:57:34 +02:00
parent 9c94402f78
commit 54259f89bd
6 changed files with 65 additions and 5 deletions
@@ -0,0 +1,33 @@
ALTER TABLE users
ADD COLUMN `background_border_id` INT(11) NOT NULL DEFAULT 0 AFTER `background_id`;
ALTER TABLE infostand_backgrounds
CHANGE COLUMN `category` `category` ENUM('background', 'stand', 'overlay', 'card', 'border') NOT NULL ;
INSERT IGNORE INTO `infostand_backgrounds` (`id`, `category`, `min_rank`, `is_hc_only`, `is_ambassador_only`) VALUES
(1, 'border', 1, 0, 0),
(2, 'border', 1, 0, 0),
(3, 'border', 1, 0, 0),
(4, 'border', 1, 0, 0),
(5, 'border', 1, 0, 0),
(6, 'border', 1, 0, 0),
(7, 'border', 1, 0, 0),
(8, 'border', 1, 0, 0),
(9, 'border', 1, 0, 0),
(10, 'border', 1, 0, 0),
(11, 'border', 1, 0, 0),
(12, 'border', 1, 0, 0),
(13, 'border', 1, 0, 0),
(14, 'border', 1, 0, 0),
(15, 'border', 1, 0, 0),
(16, 'border', 1, 0, 0),
(17, 'border', 1, 0, 0),
(18, 'border', 1, 0, 0),
(19, 'border', 1, 0, 0),
(20, 'border', 1, 0, 0),
(21, 'border', 1, 0, 0),
(22, 'border', 1, 0, 0),
(23, 'border', 1, 0, 0),
(24, 'border', 1, 0, 0),
(25, 'border', 1, 0, 0);
@@ -46,6 +46,7 @@ public class HabboInfo implements Runnable {
private int InfostandStand; private int InfostandStand;
private int InfostandOverlay; private int InfostandOverlay;
private int InfostandCardBg; private int InfostandCardBg;
private int InfostandBorder;
private int loadingRoom; private int loadingRoom;
private Room currentRoom; private Room currentRoom;
private String roomEntryMethod = "door"; private String roomEntryMethod = "door";
@@ -93,6 +94,11 @@ public class HabboInfo implements Runnable {
this.InfostandStand = set.getInt("background_stand_id"); this.InfostandStand = set.getInt("background_stand_id");
this.InfostandOverlay = set.getInt("background_overlay_id"); this.InfostandOverlay = set.getInt("background_overlay_id");
this.InfostandCardBg = set.getInt("background_card_id"); this.InfostandCardBg = set.getInt("background_card_id");
try {
this.InfostandBorder = set.getInt("background_border_id");
} catch (SQLException ignored) {
this.InfostandBorder = 0;
}
this.currentRoom = null; this.currentRoom = null;
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.error("Caught SQL exception", e); LOGGER.error("Caught SQL exception", e);
@@ -300,6 +306,15 @@ public class HabboInfo implements Runnable {
public void setInfostandCardBg(int infostandCardBg) { public void setInfostandCardBg(int infostandCardBg) {
InfostandCardBg = infostandCardBg; InfostandCardBg = infostandCardBg;
} }
public int getInfostandBorder() {
return InfostandBorder;
}
public void setInfostandBorder(int infostandBorder) {
InfostandBorder = infostandBorder;
}
public Rank getRank() { public Rank getRank() {
return this.rank; return this.rank;
} }
@@ -587,7 +602,7 @@ public class HabboInfo implements Runnable {
try { try {
SqlQueries.update( SqlQueries.update(
"UPDATE users SET motto = ?, online = ?, look = ?, gender = ?, credits = ?, last_login = ?, last_online = ?, home_room = ?, ip_current = ?, `rank` = ?, machine_id = ?, username = ?, background_id = ?, background_stand_id = ?, background_overlay_id = ?, background_card_id = ? WHERE id = ?", "UPDATE users SET motto = ?, online = ?, look = ?, gender = ?, credits = ?, last_login = ?, last_online = ?, home_room = ?, ip_current = ?, `rank` = ?, machine_id = ?, username = ?, background_id = ?, background_stand_id = ?, background_overlay_id = ?, background_card_id = ?, background_border_id = ? WHERE id = ?",
this.motto, this.motto,
this.online ? "1" : "0", this.online ? "1" : "0",
this.look, this.look,
@@ -604,6 +619,7 @@ public class HabboInfo implements Runnable {
this.InfostandStand, this.InfostandStand,
this.InfostandOverlay, this.InfostandOverlay,
this.InfostandCardBg, this.InfostandCardBg,
this.InfostandBorder,
this.id); this.id);
} catch (SqlQueries.DataAccessException e) { } catch (SqlQueries.DataAccessException e) {
LOGGER.error("Caught SQL exception", e); LOGGER.error("Caught SQL exception", e);
@@ -24,7 +24,8 @@ public class InfostandBackgroundManager {
BACKGROUND("background"), BACKGROUND("background"),
STAND("stand"), STAND("stand"),
OVERLAY("overlay"), OVERLAY("overlay"),
CARD("card"); CARD("card"),
BORDER("border");
public final String dbValue; public final String dbValue;
@@ -89,11 +90,12 @@ public class InfostandBackgroundManager {
this.enforce = loaded > 0; this.enforce = loaded > 0;
if (this.enforce) { if (this.enforce) {
LOGGER.info("InfostandBackgroundManager -> Loaded {} backgrounds, {} stands, {} overlays, {} cards from infostand_backgrounds.", LOGGER.info("InfostandBackgroundManager -> Loaded {} backgrounds, {} stands, {} overlays, {} cards, {} borders from infostand_backgrounds.",
this.entries.get(Category.BACKGROUND).size(), this.entries.get(Category.BACKGROUND).size(),
this.entries.get(Category.STAND).size(), this.entries.get(Category.STAND).size(),
this.entries.get(Category.OVERLAY).size(), this.entries.get(Category.OVERLAY).size(),
this.entries.get(Category.CARD).size()); this.entries.get(Category.CARD).size(),
this.entries.get(Category.BORDER).size());
} else { } else {
LOGGER.info("InfostandBackgroundManager -> infostand_backgrounds is empty, server-side validation disabled (only range clamp will apply)."); LOGGER.info("InfostandBackgroundManager -> infostand_backgrounds is empty, server-side validation disabled (only range clamp will apply).");
} }
@@ -37,6 +37,7 @@ public class ChangeInfostandBgEvent extends MessageHandler {
int requestedStand = sanitize(this.packet.readInt()); int requestedStand = sanitize(this.packet.readInt());
int requestedOverlay = sanitize(this.packet.readInt()); int requestedOverlay = sanitize(this.packet.readInt());
int requestedCard = this.packet.bytesAvailable() >= 4 ? sanitize(this.packet.readInt()) : 0; int requestedCard = this.packet.bytesAvailable() >= 4 ? sanitize(this.packet.readInt()) : 0;
int requestedBorder = this.packet.bytesAvailable() >= 4 ? sanitize(this.packet.readInt()) : 0;
InfostandBackgroundManager manager = Emulator.getGameEnvironment() != null ? Emulator.getGameEnvironment().getInfostandBackgroundManager() : null; InfostandBackgroundManager manager = Emulator.getGameEnvironment() != null ? Emulator.getGameEnvironment().getInfostandBackgroundManager() : null;
@@ -44,11 +45,13 @@ public class ChangeInfostandBgEvent extends MessageHandler {
int backgroundStand = resolve(manager, habbo, Category.STAND, requestedStand, info.getInfostandStand()); int backgroundStand = resolve(manager, habbo, Category.STAND, requestedStand, info.getInfostandStand());
int backgroundOverlay = resolve(manager, habbo, Category.OVERLAY, requestedOverlay, info.getInfostandOverlay()); int backgroundOverlay = resolve(manager, habbo, Category.OVERLAY, requestedOverlay, info.getInfostandOverlay());
int backgroundCard = resolve(manager, habbo, Category.CARD, requestedCard, info.getInfostandCardBg()); int backgroundCard = resolve(manager, habbo, Category.CARD, requestedCard, info.getInfostandCardBg());
int backgroundBorder = resolve(manager, habbo, Category.BORDER, requestedBorder, info.getInfostandBorder());
if (info.getInfostandBg() == backgroundImage if (info.getInfostandBg() == backgroundImage
&& info.getInfostandStand() == backgroundStand && info.getInfostandStand() == backgroundStand
&& info.getInfostandOverlay() == backgroundOverlay && info.getInfostandOverlay() == backgroundOverlay
&& info.getInfostandCardBg() == backgroundCard) { && info.getInfostandCardBg() == backgroundCard
&& info.getInfostandBorder() == backgroundBorder) {
return; return;
} }
@@ -56,6 +59,7 @@ public class ChangeInfostandBgEvent extends MessageHandler {
info.setInfostandStand(backgroundStand); info.setInfostandStand(backgroundStand);
info.setInfostandOverlay(backgroundOverlay); info.setInfostandOverlay(backgroundOverlay);
info.setInfostandCardBg(backgroundCard); info.setInfostandCardBg(backgroundCard);
info.setInfostandBorder(backgroundBorder);
info.run(); info.run();
if (info.getCurrentRoom() != null) { if (info.getCurrentRoom() != null) {
@@ -33,6 +33,7 @@ public class RoomUserDataComposer extends MessageComposer {
this.response.appendString(customizationData.prefixEffect); this.response.appendString(customizationData.prefixEffect);
this.response.appendString(customizationData.prefixFont); this.response.appendString(customizationData.prefixFont);
this.response.appendString(customizationData.displayOrder); this.response.appendString(customizationData.displayOrder);
this.response.appendInt(this.habbo.getHabboInfo().getInfostandBorder());
return this.response; return this.response;
} }
@@ -78,6 +78,7 @@ public class RoomUsersComposer extends MessageComposer {
this.response.appendString(customizationData.displayOrder); this.response.appendString(customizationData.displayOrder);
this.response.appendString(this.habbo.getHabboInfo().getRoomEntryMethod()); this.response.appendString(this.habbo.getHabboInfo().getRoomEntryMethod());
this.response.appendInt(this.habbo.getHabboInfo().getRoomEntryTeleportId()); this.response.appendInt(this.habbo.getHabboInfo().getRoomEntryTeleportId());
this.response.appendInt(this.habbo.getHabboInfo().getInfostandBorder());
} else if (this.habbos != null) { } else if (this.habbos != null) {
this.response.appendInt(this.habbos.size()); this.response.appendInt(this.habbos.size());
for (Habbo habbo : this.habbos) { for (Habbo habbo : this.habbos) {
@@ -120,6 +121,7 @@ public class RoomUsersComposer extends MessageComposer {
this.response.appendString(customizationData.displayOrder); this.response.appendString(customizationData.displayOrder);
this.response.appendString(habbo.getHabboInfo().getRoomEntryMethod()); this.response.appendString(habbo.getHabboInfo().getRoomEntryMethod());
this.response.appendInt(habbo.getHabboInfo().getRoomEntryTeleportId()); this.response.appendInt(habbo.getHabboInfo().getRoomEntryTeleportId());
this.response.appendInt(habbo.getHabboInfo().getInfostandBorder());
} }
} }
} else if (this.bot != null) { } else if (this.bot != null) {
@@ -154,6 +156,7 @@ public class RoomUsersComposer extends MessageComposer {
this.response.appendShort(9); this.response.appendShort(9);
this.response.appendString("unknown"); this.response.appendString("unknown");
this.response.appendInt(0); this.response.appendInt(0);
this.response.appendInt(0);
} else if (this.bots != null) { } else if (this.bots != null) {
this.response.appendInt(this.bots.size()); this.response.appendInt(this.bots.size());
for (Bot bot : this.bots) { for (Bot bot : this.bots) {
@@ -187,6 +190,7 @@ public class RoomUsersComposer extends MessageComposer {
this.response.appendShort(9); this.response.appendShort(9);
this.response.appendString("unknown"); this.response.appendString("unknown");
this.response.appendInt(0); this.response.appendInt(0);
this.response.appendInt(0);
} }
} }
return this.response; return this.response;