🆙 Latest updates from Krews added

This commit is contained in:
DuckieTM 2024-10-20 13:29:14 +02:00
parent 8c59010282
commit 27370ee08b
400 changed files with 3266 additions and 297 deletions

View File

@ -27,6 +27,8 @@ public class Bot implements Runnable {
public static final String NO_CHAT_SET = "${bot.skill.chatter.configuration.text.placeholder}"; public static final String NO_CHAT_SET = "${bot.skill.chatter.configuration.text.placeholder}";
public static String[] PLACEMENT_MESSAGES = "Yo!;Hello I'm a real party animal!;Hello!".split(";"); public static String[] PLACEMENT_MESSAGES = "Yo!;Hello I'm a real party animal!;Hello!".split(";");
public static boolean BOT_LIMIT_WALKING_DISTANCE = true;
public static int BOT_WALKING_DISTANCE_RADIUS = 5;
private final ArrayList<String> chatLines; private final ArrayList<String> chatLines;
private transient int id; private transient int id;
@ -137,30 +139,26 @@ public class Bot implements Runnable {
@Override @Override
public void run() { public void run() {
if (this.needsUpdate) { if (this.needsUpdate) {
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("UPDATE bots SET name = ?, motto = ?, figure = ?, gender = ?, user_id = ?, room_id = ?, x = ?, y = ?, z = ?, rot = ?, dance = ?, freeroam = ?, chat_lines = ?, chat_auto = ?, chat_random = ?, chat_delay = ?, effect = ?, bubble_id = ? WHERE id = ?")) { try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("UPDATE bots SET name = ?, motto = ?, figure = ?, gender = ?, user_id = ?, room_id = ?, dance = ?, freeroam = ?, chat_lines = ?, chat_auto = ?, chat_random = ?, chat_delay = ?, effect = ?, bubble_id = ? WHERE id = ?")) {
statement.setString(1, this.name); statement.setString(1, this.name);
statement.setString(2, this.motto); statement.setString(2, this.motto);
statement.setString(3, this.figure); statement.setString(3, this.figure);
statement.setString(4, this.gender.toString()); statement.setString(4, this.gender.toString());
statement.setInt(5, this.ownerId); statement.setInt(5, this.ownerId);
statement.setInt(6, this.room == null ? 0 : this.room.getId()); statement.setInt(6, this.room == null ? 0 : this.room.getId());
statement.setInt(7, this.roomUnit == null ? 0 : this.roomUnit.getX()); statement.setInt(7, this.roomUnit == null ? 0 : this.roomUnit.getDanceType().getType());
statement.setInt(8, this.roomUnit == null ? 0 : this.roomUnit.getY()); statement.setString(8, this.canWalk ? "1" : "0");
statement.setDouble(9, this.roomUnit == null ? 0 : this.roomUnit.getZ());
statement.setInt(10, this.roomUnit == null ? 0 : this.roomUnit.getBodyRotation().getValue());
statement.setInt(11, this.roomUnit == null ? 0 : this.roomUnit.getDanceType().getType());
statement.setString(12, this.canWalk ? "1" : "0");
StringBuilder text = new StringBuilder(); StringBuilder text = new StringBuilder();
for (String s : this.chatLines) { for (String s : this.chatLines) {
text.append(s).append("\r"); text.append(s).append("\r");
} }
statement.setString(13, text.toString()); statement.setString(9, text.toString());
statement.setString(14, this.chatAuto ? "1" : "0"); statement.setString(10, this.chatAuto ? "1" : "0");
statement.setString(15, this.chatRandom ? "1" : "0"); statement.setString(11, this.chatRandom ? "1" : "0");
statement.setInt(16, this.chatDelay); statement.setInt(12, this.chatDelay);
statement.setInt(17, this.effect); statement.setInt(13, this.effect);
statement.setInt(18, this.bubble); statement.setInt(14, this.bubble);
statement.setInt(19, this.id); statement.setInt(15, this.id);
statement.execute(); statement.execute();
this.needsUpdate = false; this.needsUpdate = false;
} catch (SQLException e) { } catch (SQLException e) {
@ -174,7 +172,15 @@ public class Bot implements Runnable {
if (allowBotsWalk && this.canWalk) { if (allowBotsWalk && this.canWalk) {
if (!this.roomUnit.isWalking()) { if (!this.roomUnit.isWalking()) {
if (this.roomUnit.getWalkTimeOut() < Emulator.getIntUnixTimestamp() && this.followingHabboId == 0) { if (this.roomUnit.getWalkTimeOut() < Emulator.getIntUnixTimestamp() && this.followingHabboId == 0) {
this.roomUnit.setGoalLocation(this.room.getRandomWalkableTile()); this.roomUnit.setGoalLocation(
Bot.BOT_LIMIT_WALKING_DISTANCE
? this.room.getRandomWalkableTilesAround(
this.getRoomUnit(),
this.room.getLayout().getTile(this.roomUnit.getX(), this.roomUnit.getY()),
Bot.BOT_WALKING_DISTANCE_RADIUS)
: this.room.getRandomWalkableTile()
);
int timeOut = Emulator.getRandom().nextInt(20) * 2; int timeOut = Emulator.getRandom().nextInt(20) * 2;
this.roomUnit.setWalkTimeOut((timeOut < 10 ? 5 : timeOut) + Emulator.getIntUnixTimestamp()); this.roomUnit.setWalkTimeOut((timeOut < 10 ? 5 : timeOut) + Emulator.getIntUnixTimestamp());
} }
@ -207,13 +213,14 @@ public class Bot implements Runnable {
} else { } else {
this.lastChatIndex++; this.lastChatIndex++;
if (this.lastChatIndex >= this.chatLines.size()) { if (this.lastChatIndex >= this.chatLines.size()) {
this.lastChatIndex = 0; this.lastChatIndex = 0; // start from scratch :-3
} }
} }
this.chatTimeOut = Emulator.getIntUnixTimestamp() + this.chatDelay; this.chatTimeOut = Emulator.getIntUnixTimestamp() + this.chatDelay;
} }
} }
} }
} }
@ -266,8 +273,7 @@ public class Bot implements Runnable {
if(PLACEMENT_MESSAGES.length > 0) { if(PLACEMENT_MESSAGES.length > 0) {
String message = PLACEMENT_MESSAGES[Emulator.getRandom().nextInt(PLACEMENT_MESSAGES.length)]; String message = PLACEMENT_MESSAGES[Emulator.getRandom().nextInt(PLACEMENT_MESSAGES.length)];
if (!WiredHandler.handle(WiredTriggerType.SAY_SOMETHING, this.getRoomUnit(), room, new Object[]{message})) { if (!WiredHandler.handle(WiredTriggerType.SAY_SOMETHING, this.getRoomUnit(), room, new Object[]{message})) {
if(!habbo.roomBypass) this.talk(message); this.talk(message);
else this.talk("Deliver the drink here, " + habbo.getHabboInfo().getUsername() + "!");
} }
} }
} }
@ -432,6 +438,7 @@ public class Bot implements Runnable {
this.bubble = bubble; this.bubble = bubble;
this.needsUpdate = true; this.needsUpdate = true;
} }
public void setEffect(int effect, int duration) { public void setEffect(int effect, int duration) {
this.effect = effect; this.effect = effect;
this.needsUpdate = true; this.needsUpdate = true;
@ -496,4 +503,36 @@ public class Bot implements Runnable {
this.roomUnit.statusUpdate(true); this.roomUnit.statusUpdate(true);
} }
public void onPlaceUpdate() {
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("UPDATE bots SET name = ?, motto = ?, figure = ?, gender = ?, user_id = ?, room_id = ?, x = ?, y = ?, z = ?, rot = ?, dance = ?, freeroam = ?, chat_lines = ?, chat_auto = ?, chat_random = ?, chat_delay = ?, effect = ?, bubble_id = ? WHERE id = ?")) {
statement.setString(1, this.name);
statement.setString(2, this.motto);
statement.setString(3, this.figure);
statement.setString(4, this.gender.toString());
statement.setInt(5, this.ownerId);
statement.setInt(6, this.room == null ? 0 : this.room.getId());
statement.setInt(7, this.roomUnit == null ? 0 : this.roomUnit.getX());
statement.setInt(8, this.roomUnit == null ? 0 : this.roomUnit.getY());
statement.setDouble(9, this.roomUnit == null ? 0 : this.roomUnit.getZ());
statement.setInt(10, this.roomUnit == null ? 0 : this.roomUnit.getBodyRotation().getValue());
statement.setInt(11, this.roomUnit == null ? 0 : this.roomUnit.getDanceType().getType());
statement.setString(12, this.canWalk ? "1" : "0");
StringBuilder text = new StringBuilder();
for (String s : this.chatLines) {
text.append(s).append("\r");
}
statement.setString(13, text.toString());
statement.setString(14, this.chatAuto ? "1" : "0");
statement.setString(15, this.chatRandom ? "1" : "0");
statement.setInt(16, this.chatDelay);
statement.setInt(17, this.effect);
statement.setInt(18, this.bubble);
statement.setInt(19, this.id);
statement.execute();
} catch (SQLException e) {
LOGGER.error("Caught SQL exception", e);
}
}
} }

View File

@ -109,8 +109,7 @@ public class BotManager {
return; return;
if (room != null && bot != null && habbo != null) { if (room != null && bot != null && habbo != null) {
if (room.getOwnerId() == habbo.getHabboInfo().getId() || habbo.hasPermission(Permission.ACC_ANYROOMOWNER) || habbo.hasPermission(Permission.ACC_PLACEFURNI) || habbo.roomBypass) { if (room.getOwnerId() == habbo.getHabboInfo().getId() || habbo.hasPermission(Permission.ACC_ANYROOMOWNER) || habbo.hasPermission(Permission.ACC_PLACEFURNI)) {
if(!habbo.roomBypass){
if (room.getCurrentBots().size() >= Room.MAXIMUM_BOTS && !habbo.hasPermission(Permission.ACC_UNLIMITED_BOTS)) { if (room.getCurrentBots().size() >= Room.MAXIMUM_BOTS && !habbo.hasPermission(Permission.ACC_UNLIMITED_BOTS)) {
habbo.getClient().sendResponse(new BotErrorComposer(BotErrorComposer.ROOM_ERROR_MAX_BOTS)); habbo.getClient().sendResponse(new BotErrorComposer(BotErrorComposer.ROOM_ERROR_MAX_BOTS));
return; return;
@ -123,13 +122,12 @@ public class BotManager {
habbo.getClient().sendResponse(new BotErrorComposer(BotErrorComposer.ROOM_ERROR_BOTS_SELECTED_TILE_NOT_FREE)); habbo.getClient().sendResponse(new BotErrorComposer(BotErrorComposer.ROOM_ERROR_BOTS_SELECTED_TILE_NOT_FREE));
return; return;
} }
}
RoomUnit roomUnit = new RoomUnit(); RoomUnit roomUnit = new RoomUnit();
roomUnit.setRotation(RoomUserRotation.SOUTH); roomUnit.setRotation(RoomUserRotation.SOUTH);
roomUnit.setLocation(location); roomUnit.setLocation(location);
double stackHeight = location.getStackHeight(); double stackHeight = room.getTopHeightAt(location.x, location.y);
roomUnit.setPreviousLocationZ(stackHeight); roomUnit.setPreviousLocationZ(stackHeight);
roomUnit.setZ(stackHeight); roomUnit.setZ(stackHeight);
@ -138,7 +136,7 @@ public class BotManager {
roomUnit.setCanWalk(room.isAllowBotsWalk()); roomUnit.setCanWalk(room.isAllowBotsWalk());
bot.setRoomUnit(roomUnit); bot.setRoomUnit(roomUnit);
bot.setRoom(room); bot.setRoom(room);
bot.needsUpdate(true); bot.onPlaceUpdate();
room.addBot(bot); room.addBot(bot);
Emulator.getThreading().run(bot); Emulator.getThreading().run(bot);
room.sendComposer(new RoomUsersComposer(bot).compose()); room.sendComposer(new RoomUsersComposer(bot).compose());

View File

@ -470,15 +470,16 @@ public class CatalogManager {
this.giftWrappers.clear(); this.giftWrappers.clear();
this.giftFurnis.clear(); this.giftFurnis.clear();
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); Statement statement = connection.createStatement(); ResultSet set = statement.executeQuery("SELECT * FROM gift_wrappers ORDER BY sprite_id DESC")) {
Statement statement = connection.createStatement();
ResultSet set =
statement.executeQuery("SELECT * FROM gift_wrappers ORDER BY sprite_id DESC")) {
while (set.next()) { while (set.next()) {
if ("wrapper".equals(set.getString("type"))) { switch (set.getString("type")) {
case "wrapper":
this.giftWrappers.put(set.getInt("sprite_id"), set.getInt("item_id")); this.giftWrappers.put(set.getInt("sprite_id"), set.getInt("item_id"));
} else if ("gift".equals(set.getString("type"))) { break;
case "gift":
this.giftFurnis.put(set.getInt("sprite_id"), set.getInt("item_id")); this.giftFurnis.put(set.getInt("sprite_id"), set.getInt("item_id"));
break;
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
@ -488,7 +489,6 @@ public class CatalogManager {
} }
} }
private void loadClothing() { private void loadClothing() {
synchronized (this.clothing) { synchronized (this.clothing) {
this.clothing.clear(); this.clothing.clear();

View File

@ -135,7 +135,10 @@ public class Guild implements Runnable {
public String getOwnerName() { public String getOwnerName() {
return this.ownerName; return this.ownerName;
} }
public void setOwnerName(String ownerName) { this.ownerName = ownerName; }
public void setOwnerName(String ownerName) {
this.ownerName = ownerName;
}
public String getName() { public String getName() {
return this.name; return this.name;

View File

@ -503,6 +503,7 @@ public class GuildManager {
return guilds; return guilds;
} }
public List<Guild> getOwnedGuilds(int userId) { public List<Guild> getOwnedGuilds(int userId) {
List<Guild> guilds = new ArrayList<Guild>(); List<Guild> guilds = new ArrayList<Guild>();
@ -523,6 +524,7 @@ public class GuildManager {
return guilds; return guilds;
} }
public List<Guild> getAllGuilds() { public List<Guild> getAllGuilds() {
List<Guild> guilds = new ArrayList<Guild>(); List<Guild> guilds = new ArrayList<Guild>();

View File

@ -45,7 +45,6 @@ import com.eu.habbo.habbohotel.items.interactions.totems.InteractionTotemPlanet;
import com.eu.habbo.habbohotel.items.interactions.wired.conditions.*; import com.eu.habbo.habbohotel.items.interactions.wired.conditions.*;
import com.eu.habbo.habbohotel.items.interactions.wired.effects.*; import com.eu.habbo.habbohotel.items.interactions.wired.effects.*;
import com.eu.habbo.habbohotel.items.interactions.wired.extra.WiredBlob; import com.eu.habbo.habbohotel.items.interactions.wired.extra.WiredBlob;
import com.eu.habbo.habbohotel.items.interactions.wired.extra.WiredExtraOrEval;
import com.eu.habbo.habbohotel.items.interactions.wired.extra.WiredExtraRandom; import com.eu.habbo.habbohotel.items.interactions.wired.extra.WiredExtraRandom;
import com.eu.habbo.habbohotel.items.interactions.wired.extra.WiredExtraUnseen; import com.eu.habbo.habbohotel.items.interactions.wired.extra.WiredExtraUnseen;
import com.eu.habbo.habbohotel.wired.highscores.WiredHighscoreManager; import com.eu.habbo.habbohotel.wired.highscores.WiredHighscoreManager;
@ -271,7 +270,6 @@ public class ItemManager {
this.interactionsList.add(new ItemInteraction("wf_xtra_random", WiredExtraRandom.class)); this.interactionsList.add(new ItemInteraction("wf_xtra_random", WiredExtraRandom.class));
this.interactionsList.add(new ItemInteraction("wf_xtra_unseen", WiredExtraUnseen.class)); this.interactionsList.add(new ItemInteraction("wf_xtra_unseen", WiredExtraUnseen.class));
this.interactionsList.add(new ItemInteraction("wf_blob", WiredBlob.class)); this.interactionsList.add(new ItemInteraction("wf_blob", WiredBlob.class));
this.interactionsList.add(new ItemInteraction("wf_xtra_or_eval", WiredExtraOrEval.class));
this.interactionsList.add(new ItemInteraction("wf_highscore", InteractionWiredHighscore.class)); this.interactionsList.add(new ItemInteraction("wf_highscore", InteractionWiredHighscore.class));

View File

@ -85,15 +85,16 @@ public class InteractionPressurePlate extends InteractionDefault {
if (tiles == null) return; if (tiles == null) return;
for (RoomTile tile : tiles) { for (RoomTile tile : tiles) {
boolean hasHabbos = room.hasHabbosAt(tile.x, tile.y); THashSet<RoomUnit> tileHasHabboOrBot = room.getHabbosAndBotsAt(tile.x, tile.y);
if (!hasHabbos && this.requiresAllTilesOccupied()) { if (tileHasHabboOrBot.isEmpty() && this.requiresAllTilesOccupied()) {
occupied = false; occupied = false;
break; break;
} }
if (hasHabbos) { if (!tileHasHabboOrBot.isEmpty()) {
occupied = true; occupied = true;
} }
} }
this.setExtradata(occupied ? "1" : "0"); this.setExtradata(occupied ? "1" : "0");

View File

@ -0,0 +1,53 @@
package com.eu.habbo.habbohotel.items.interactions;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.items.Item;
import com.eu.habbo.habbohotel.rooms.Room;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.sql.ResultSet;
import java.sql.SQLException;
public class InteractionSwitchRemoteControl extends InteractionDefault {
private static final Logger LOGGER = LoggerFactory.getLogger(InteractionSwitchRemoteControl.class);
public InteractionSwitchRemoteControl(ResultSet set, Item baseItem) throws SQLException {
super(set, baseItem);
}
public InteractionSwitchRemoteControl(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) {
super(id, userId, item, extradata, limitedStack, limitedSells);
}
@Override
public boolean isUsable() {
return true;
}
@Override
public void onClick(GameClient client, Room room, Object[] objects) throws Exception {
if (room != null) {
super.onClick(client, room, objects);
if (this.getExtradata().isEmpty())
this.setExtradata("0");
if (this.getBaseItem().getStateCount() > 0) {
int currentState = 0;
try {
currentState = Integer.parseInt(this.getExtradata());
} catch (NumberFormatException e) {
LOGGER.error("Incorrect extradata ({}) for item ID ({}) of type ({})", this.getExtradata(), this.getId(), this.getBaseItem().getName());
}
this.setExtradata("" + (currentState + 1) % this.getBaseItem().getStateCount());
this.needsUpdate(true);
room.updateItemState(this);
}
}
}
}

View File

@ -234,7 +234,8 @@ public class InteractionGameTimer extends HabboItem implements Runnable {
state = InteractionGameTimerAction.getByAction((int) objects[0]); state = InteractionGameTimerAction.getByAction((int) objects[0]);
} }
if (state == InteractionGameTimer.InteractionGameTimerAction.START_STOP) { switch (state) {
case START_STOP:
if (this.isRunning) { // a game has been started if (this.isRunning) { // a game has been started
this.isPaused = !this.isPaused; this.isPaused = !this.isPaused;
if (this.isPaused) { if (this.isPaused) {
@ -261,7 +262,10 @@ public class InteractionGameTimer extends HabboItem implements Runnable {
Emulator.getThreading().run(new GameTimer(this), 1000); Emulator.getThreading().run(new GameTimer(this), 1000);
} }
} }
} else if (state == InteractionGameTimer.InteractionGameTimerAction.INCREASE_TIME) {
break;
case INCREASE_TIME:
if (!this.isRunning) { if (!this.isRunning) {
this.increaseTimer(room); this.increaseTimer(room);
} else if (this.isPaused) { } else if (this.isPaused) {
@ -269,13 +273,14 @@ public class InteractionGameTimer extends HabboItem implements Runnable {
this.increaseTimer(room); this.increaseTimer(room);
WiredHandler.handle(WiredTriggerType.GAME_ENDS, null, room, new Object[]{}); WiredHandler.handle(WiredTriggerType.GAME_ENDS, null, room, new Object[]{});
} }
break;
} }
} }
super.onClick(client, room, objects); super.onClick(client, room, objects);
} }
@Override @Override
public void onWalk(RoomUnit roomUnit, Room room, Object[] objects) throws Exception { public void onWalk(RoomUnit roomUnit, Room room, Object[] objects) throws Exception {

View File

@ -109,10 +109,6 @@ public class WiredEffectMoveFurniTo extends InteractionWiredEffect {
tile = room.getLayout().getTileInFront(objectTile, this.direction, indexOffset); tile = room.getLayout().getTileInFront(objectTile, this.direction, indexOffset);
} }
if(tile == null) {
continue;
}
room.sendComposer(new FloorItemOnRollerComposer((HabboItem) object, null, tile, tile.getStackHeight() - ((HabboItem) object).getZ(), room).compose()); room.sendComposer(new FloorItemOnRollerComposer((HabboItem) object, null, tile, tile.getStackHeight() - ((HabboItem) object).getZ(), room).compose());
refreshTiles.addAll(room.getLayout().getTilesAt(room.getLayout().getTile(((HabboItem) object).getX(), ((HabboItem) object).getY()), ((HabboItem) object).getBaseItem().getWidth(), ((HabboItem) object).getBaseItem().getLength(), ((HabboItem) object).getRotation())); refreshTiles.addAll(room.getLayout().getTilesAt(room.getLayout().getTile(((HabboItem) object).getX(), ((HabboItem) object).getY()), ((HabboItem) object).getBaseItem().getWidth(), ((HabboItem) object).getBaseItem().getLength(), ((HabboItem) object).getRotation()));
room.updateTiles(refreshTiles); room.updateTiles(refreshTiles);

View File

@ -11,7 +11,7 @@ public class Rank {
private final int id; private final int id;
private int level; private final int level;
private final THashMap<String, Permission> permissions; private final THashMap<String, Permission> permissions;
private final THashMap<String, String> variables; private final THashMap<String, String> variables;
private String name; private String name;
@ -55,7 +55,6 @@ public class Rank {
this.logCommands = set.getString("log_commands").equals("1"); this.logCommands = set.getString("log_commands").equals("1");
this.prefix = set.getString("prefix"); this.prefix = set.getString("prefix");
this.prefixColor = set.getString("prefix_color"); this.prefixColor = set.getString("prefix_color");
this.level = set.getInt("level");
this.diamondsTimerAmount = set.getInt("auto_points_amount"); this.diamondsTimerAmount = set.getInt("auto_points_amount");
this.creditsTimerAmount = set.getInt("auto_credits_amount"); this.creditsTimerAmount = set.getInt("auto_credits_amount");
this.pixelsTimerAmount = set.getInt("auto_pixels_amount"); this.pixelsTimerAmount = set.getInt("auto_pixels_amount");

View File

@ -865,32 +865,15 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
} }
} }
public void pickupPetsForHabbo(Habbo habbo) { public void pickupPetsForHabbo(Habbo habbo) {
THashSet<Pet> pets = new THashSet<>(); THashSet<Pet> pets = new THashSet<>();
synchronized (this.currentPets) { synchronized (this.currentPets) {
for (Pet pet : this.currentPets.valueCollection()) { for (Pet pet : this.currentPets.valueCollection()) {
if (pet.getUserId() == habbo.getHabboInfo().getId()) { if (pet.getUserId() == habbo.getHabboInfo().getId()) {
pets.add(pet); pets.add(pet);
} }
} }
} }
for (Pet pet : pets) { for (Pet pet : pets) {
@ -3018,8 +3001,6 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
return pets; return pets;
} }
public THashSet<Habbo> getHabbosAt(short x, short y) { public THashSet<Habbo> getHabbosAt(short x, short y) {
return this.getHabbosAt(this.layout.getTile(x, y)); return this.getHabbosAt(this.layout.getTile(x, y));
} }
@ -3658,7 +3639,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
HabboItem item = this.getTopItemAt(x, y); HabboItem item = this.getTopItemAt(x, y);
if (item != null) if (item != null)
return (item.getZ() + Item.getCurrentHeight(item)); return (item.getZ() + Item.getCurrentHeight(item) - (item.getBaseItem().allowSit() ? 1 : 0));
else else
return this.layout.getHeightAtSquare(x, y); return this.layout.getHeightAtSquare(x, y);
} }
@ -3872,6 +3853,37 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
return null; return null;
} }
public RoomTile getRandomWalkableTilesAround(RoomUnit roomUnit, RoomTile tile, int radius) {
if (!layout.tileExists(tile.x, tile.y)) {
tile = layout.getTile(roomUnit.getX(), roomUnit.getY());
this.getBot(roomUnit).needsUpdate(true);
}
List<RoomTile> walkableTiles = new ArrayList<>();
int minX = Math.max(0, tile.x - radius);
int minY = Math.max(0, tile.y - radius);
int maxX = Math.min(this.getLayout().getMapSizeX() - 1, tile.x + radius);
int maxY = Math.min(this.getLayout().getMapSizeY() - 1, tile.y + radius);
for (int x = minX; x <= maxX; x++) {
for (int y = minY; y <= maxY; y++) {
RoomTile candidateTile = this.getLayout().getTile((short) x, (short) y);
if (candidateTile != null && candidateTile.getState() != RoomTileState.BLOCKED && candidateTile.getState() != RoomTileState.INVALID) {
walkableTiles.add(candidateTile);
}
}
}
if (walkableTiles.isEmpty()) {
return tile;
}
Collections.shuffle(walkableTiles);
return walkableTiles.get(0);
}
public Habbo getHabbo(String username) { public Habbo getHabbo(String username) {
for (Habbo habbo : this.getHabbos()) { for (Habbo habbo : this.getHabbos()) {
if (habbo.getHabboInfo().getUsername().equalsIgnoreCase(username)) if (habbo.getHabboInfo().getUsername().equalsIgnoreCase(username))
@ -3930,6 +3942,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
} }
for (Habbo habbo : this.getHabbos()) { for (Habbo habbo : this.getHabbos()) {
if (habbo == null) { continue; }
if (!habbo.getHabboStats().ignoreBots) if (!habbo.getHabboStats().ignoreBots)
habbo.getClient().sendResponse(message); habbo.getClient().sendResponse(message);
} }
@ -4817,17 +4830,28 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
} }
} }
if (height > MAXIMUM_FURNI_HEIGHT) return FurnitureMovementError.CANT_STACK; boolean cantStack = false;
if (height < this.getLayout().getHeightAtSquare(tile.x, tile.y)) boolean pluginHeight = false;
return FurnitureMovementError.CANT_STACK; //prevent furni going under the floor
if(height > MAXIMUM_FURNI_HEIGHT) {
cantStack = true;
}
if(height < this.getLayout().getHeightAtSquare(tile.x, tile.y)) {
cantStack = true;
}
if (Emulator.getPluginManager().isRegistered(FurnitureBuildheightEvent.class, true)) { if (Emulator.getPluginManager().isRegistered(FurnitureBuildheightEvent.class, true)) {
FurnitureBuildheightEvent event = Emulator.getPluginManager().fireEvent(new FurnitureBuildheightEvent(item, actor, 0.00, height)); FurnitureBuildheightEvent event = Emulator.getPluginManager().fireEvent(new FurnitureBuildheightEvent(item, actor, 0.00, height));
if (event.hasChangedHeight()) { if (event.hasChangedHeight()) {
height = event.getUpdatedHeight(); height = event.getUpdatedHeight();
pluginHeight = true;
} }
} }
if(!pluginHeight && cantStack) {
return FurnitureMovementError.CANT_STACK;
}
item.setX(tile.x); item.setX(tile.x);
item.setY(tile.y); item.setY(tile.y);
item.setZ(height); item.setZ(height);
@ -4887,8 +4911,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
boolean magicTile = item instanceof InteractionStackHelper || item instanceof InteractionTileWalkMagic; boolean magicTile = item instanceof InteractionStackHelper || item instanceof InteractionTileWalkMagic;
//Check if can be placed at new position Optional<HabboItem> stackHelper = this.getItemsAt(tile).stream().filter(i -> i instanceof InteractionStackHelper).findAny();THashSet<RoomTile> occupiedTiles = this.layout.getTilesAt(tile, item.getBaseItem().getWidth(), item.getBaseItem().getLength(), rotation);
THashSet<RoomTile> occupiedTiles = this.layout.getTilesAt(tile, item.getBaseItem().getWidth(), item.getBaseItem().getLength(), rotation);
List<Pair<RoomTile, THashSet<HabboItem>>> tileFurniList = new ArrayList<>(); List<Pair<RoomTile, THashSet<HabboItem>>> tileFurniList = new ArrayList<>();
for (RoomTile t : occupiedTiles) { for (RoomTile t : occupiedTiles) {
@ -4923,80 +4946,6 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
return FurnitureMovementError.NONE; return FurnitureMovementError.NONE;
} }
public FurnitureMovementError moveFurniTo(HabboItem item, RoomTile tile, int rotation, double z, Habbo actor, boolean sendUpdates, boolean checkForUnits) {
if (tile == null) {
return FurnitureMovementError.INVALID_MOVE;
}
RoomTile oldLocation = this.layout.getTile(item.getX(), item.getY());
boolean pluginHelper = false;
if (Emulator.getPluginManager().isRegistered(FurnitureMovedEvent.class, true)) {
FurnitureMovedEvent event = Emulator.getPluginManager().fireEvent(new FurnitureMovedEvent(item, actor, oldLocation, tile));
if(event.isCancelled()) {
return FurnitureMovementError.CANCEL_PLUGIN_MOVE;
}
pluginHelper = event.hasPluginHelper();
}
boolean magicTile = item instanceof InteractionStackHelper;
THashSet<RoomTile> occupiedTiles = this.layout.getTilesAt(tile, item.getBaseItem().getWidth(), item.getBaseItem().getLength(), rotation);
THashSet<RoomTile> oldOccupiedTiles = this.layout.getTilesAt(this.layout.getTile(item.getX(), item.getY()), item.getBaseItem().getWidth(), item.getBaseItem().getLength(), item.getRotation());
if (item.getRotation() != rotation) {
item.setRotation(rotation);
}
if(z > MAXIMUM_FURNI_HEIGHT) return FurnitureMovementError.CANT_STACK;
if(z < this.getLayout().getHeightAtSquare(tile.x, tile.y)) return FurnitureMovementError.CANT_STACK; //prevent furni going under the floor
if (Emulator.getPluginManager().isRegistered(FurnitureBuildheightEvent.class, true)) {
FurnitureBuildheightEvent event = Emulator.getPluginManager().fireEvent(new FurnitureBuildheightEvent(item, actor, 0.00, z));
if (event.hasChangedHeight()) {
z = event.getUpdatedHeight();
}
}
item.setX(tile.x);
item.setY(tile.y);
item.setZ(z);
if (magicTile) {
item.setZ(tile.z);
item.setExtradata("" + item.getZ() * 100);
}
if (item.getZ() > MAXIMUM_FURNI_HEIGHT) {
item.setZ(MAXIMUM_FURNI_HEIGHT);
}
//Update Furniture
item.onMove(this, oldLocation, tile);
item.needsUpdate(true);
Emulator.getThreading().run(item);
if(sendUpdates) {
this.sendComposer(new FloorItemUpdateComposer(item).compose());
}
//Update old & new tiles
occupiedTiles.removeAll(oldOccupiedTiles);
occupiedTiles.addAll(oldOccupiedTiles);
this.updateTiles(occupiedTiles);
//Update Habbos at old position
for (RoomTile t : occupiedTiles) {
this.updateHabbosAt(
t.x,
t.y,
this.getHabbosAt(t.x, t.y)
/*.stream()
.filter(h -> !h.getRoomUnit().hasStatus(RoomUnitStatus.MOVE) || h.getRoomUnit().getGoal() == t)
.collect(Collectors.toCollection(THashSet::new))*/
);
this.updateBotsAt(t.x, t.y);
}
return FurnitureMovementError.NONE;
}
public THashSet<RoomUnit> getRoomUnits() { public THashSet<RoomUnit> getRoomUnits() {
return getRoomUnits(null); return getRoomUnits(null);
} }

View File

@ -333,12 +333,10 @@ public class RoomUnit {
} }
Optional<HabboItem> stackHelper = this.room.getItemsAt(next).stream().filter(i -> i instanceof InteractionTileWalkMagic).findAny(); Optional<HabboItem> stackHelper = this.room.getItemsAt(next).stream().filter(i -> i instanceof InteractionTileWalkMagic).findAny();
if (stackHelper.isPresent()) { if (stackHelper.isPresent()) {
zHeight = stackHelper.get().getZ(); zHeight = stackHelper.get().getZ();
} }
this.setPreviousLocation(this.getCurrentLocation()); this.setPreviousLocation(this.getCurrentLocation());
if(this.getIsGameSnow()){ if(this.getIsGameSnow()){

View File

@ -10,7 +10,6 @@ import com.eu.habbo.habbohotel.items.interactions.InteractionWiredTrigger;
import com.eu.habbo.habbohotel.items.interactions.wired.WiredTriggerReset; import com.eu.habbo.habbohotel.items.interactions.wired.WiredTriggerReset;
import com.eu.habbo.habbohotel.items.interactions.wired.effects.WiredEffectGiveReward; import com.eu.habbo.habbohotel.items.interactions.wired.effects.WiredEffectGiveReward;
import com.eu.habbo.habbohotel.items.interactions.wired.effects.WiredEffectTriggerStacks; import com.eu.habbo.habbohotel.items.interactions.wired.effects.WiredEffectTriggerStacks;
import com.eu.habbo.habbohotel.items.interactions.wired.extra.WiredExtraOrEval;
import com.eu.habbo.habbohotel.items.interactions.wired.extra.WiredExtraRandom; import com.eu.habbo.habbohotel.items.interactions.wired.extra.WiredExtraRandom;
import com.eu.habbo.habbohotel.items.interactions.wired.extra.WiredExtraUnseen; import com.eu.habbo.habbohotel.items.interactions.wired.extra.WiredExtraUnseen;
import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.rooms.Room;
@ -167,23 +166,10 @@ public class WiredHandler {
THashSet<InteractionWiredCondition> conditions = room.getRoomSpecialTypes().getConditions(trigger.getX(), trigger.getY()); THashSet<InteractionWiredCondition> conditions = room.getRoomSpecialTypes().getConditions(trigger.getX(), trigger.getY());
THashSet<InteractionWiredEffect> effects = room.getRoomSpecialTypes().getEffects(trigger.getX(), trigger.getY()); THashSet<InteractionWiredEffect> effects = room.getRoomSpecialTypes().getEffects(trigger.getX(), trigger.getY());
if (Emulator.getPluginManager().fireEvent(new WiredStackTriggeredEvent(room, roomUnit, trigger, effects, conditions)).isCancelled())
boolean hasExtraOrEval = room.getRoomSpecialTypes().hasExtraType(trigger.getX(), trigger.getY(), WiredExtraOrEval.class);
if (!conditions.isEmpty() && hasExtraOrEval) {
ArrayList<WiredConditionType> matchedConditions = new ArrayList<>(conditions.size());
for (InteractionWiredCondition searchMatched : conditions) {
if (!matchedConditions.contains(searchMatched.getType()) && searchMatched.execute(roomUnit, room, stuff)) {
matchedConditions.add(searchMatched.getType());
}
}
if(matchedConditions.size() == 0) {
return false; return false;
}
}
if (!conditions.isEmpty() && !hasExtraOrEval) { if (!conditions.isEmpty()) {
ArrayList<WiredConditionType> matchedConditions = new ArrayList<>(conditions.size()); ArrayList<WiredConditionType> matchedConditions = new ArrayList<>(conditions.size());
for (InteractionWiredCondition searchMatched : conditions) { for (InteractionWiredCondition searchMatched : conditions) {
if (!matchedConditions.contains(searchMatched.getType()) && searchMatched.operator() == WiredConditionOperator.OR && searchMatched.execute(roomUnit, room, stuff)) { if (!matchedConditions.contains(searchMatched.getType()) && searchMatched.operator() == WiredConditionOperator.OR && searchMatched.execute(roomUnit, room, stuff)) {
@ -201,9 +187,6 @@ public class WiredHandler {
} }
} }
if (Emulator.getPluginManager().fireEvent(new WiredStackTriggeredEvent(room, roomUnit, trigger, effects, conditions)).isCancelled())
return false;
trigger.setCooldown(millis); trigger.setCooldown(millis);
boolean hasExtraRandom = room.getRoomSpecialTypes().hasExtraType(trigger.getX(), trigger.getY(), WiredExtraRandom.class); boolean hasExtraRandom = room.getRoomSpecialTypes().hasExtraType(trigger.getX(), trigger.getY(), WiredExtraRandom.class);

View File

@ -1,5 +1,6 @@
package com.eu.habbo.messages; package com.eu.habbo.messages;
import com.eu.habbo.messages.outgoing.MessageComposer;
import com.eu.habbo.util.PacketUtils; import com.eu.habbo.util.PacketUtils;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufOutputStream; import io.netty.buffer.ByteBufOutputStream;
@ -19,6 +20,7 @@ public class ServerMessage {
private AtomicInteger refs; private AtomicInteger refs;
private ByteBufOutputStream stream; private ByteBufOutputStream stream;
private ByteBuf channelBuffer; private ByteBuf channelBuffer;
private MessageComposer composer;
public ServerMessage() { public ServerMessage() {
@ -38,6 +40,7 @@ public class ServerMessage {
this.refs = new AtomicInteger(0); this.refs = new AtomicInteger(0);
this.channelBuffer = Unpooled.buffer(); this.channelBuffer = Unpooled.buffer();
this.stream = new ByteBufOutputStream(this.channelBuffer); this.stream = new ByteBufOutputStream(this.channelBuffer);
this.composer = null;
try { try {
this.stream.writeInt(0); this.stream.writeInt(0);
@ -185,4 +188,12 @@ public class ServerMessage {
return this.channelBuffer.copy(); return this.channelBuffer.copy();
} }
public MessageComposer getComposer() {
return composer;
}
public void setComposer(MessageComposer composer) {
this.composer = composer;
}
} }

View File

@ -61,7 +61,7 @@ public class CatalogBuyItemAsGiftEvent extends MessageHandler {
int itemId = this.packet.readInt(); int itemId = this.packet.readInt();
String extraData = this.packet.readString(); String extraData = this.packet.readString();
String username = this.packet.readString(); String username = this.packet.readString();
String message = this.packet.readString(); String message = Emulator.getGameEnvironment().getWordFilter().filter(this.packet.readString(), this.client.getHabbo());
int spriteId = this.packet.readInt(); int spriteId = this.packet.readInt();
int color = this.packet.readInt(); int color = this.packet.readInt();
int ribbonId = this.packet.readInt(); int ribbonId = this.packet.readInt();

View File

@ -21,8 +21,8 @@ public class RequestGuildBuyEvent extends MessageHandler {
@Override @Override
public void handle() throws Exception { public void handle() throws Exception {
String name = this.packet.readString(); String name = Emulator.getGameEnvironment().getWordFilter().filter(this.packet.readString(), this.client.getHabbo());
String description = this.packet.readString(); String description = Emulator.getGameEnvironment().getWordFilter().filter(this.packet.readString(), this.client.getHabbo());
if(name.length() > 29 || description.length() > 254) if(name.length() > 29 || description.length() > 254)
return; return;

View File

@ -24,8 +24,8 @@ public class GuildForumPostThreadEvent extends MessageHandler {
public void handle() throws Exception { public void handle() throws Exception {
int guildId = this.packet.readInt(); int guildId = this.packet.readInt();
int threadId = this.packet.readInt(); int threadId = this.packet.readInt();
String subject = this.packet.readString(); String subject = Emulator.getGameEnvironment().getWordFilter().filter(this.packet.readString(), this.client.getHabbo());
String message = this.packet.readString(); String message = Emulator.getGameEnvironment().getWordFilter().filter(this.packet.readString(), this.client.getHabbo());
Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId); Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId);

View File

@ -25,7 +25,7 @@ public class YoutubeRequestPlaylists extends MessageHandler {
if (item instanceof InteractionYoutubeTV) { if (item instanceof InteractionYoutubeTV) {
InteractionYoutubeTV tv = (InteractionYoutubeTV) item; InteractionYoutubeTV tv = (InteractionYoutubeTV) item;
ArrayList<YoutubeManager.YoutubePlaylist> playlists = Emulator.getGameEnvironment().getItemManager().getYoutubeManager().getPlaylistsForItemId(itemId); ArrayList<YoutubeManager.YoutubePlaylist> playlists = Emulator.getGameEnvironment().getItemManager().getYoutubeManager().getPlaylistsForItemId(item.getBaseItem().getId());
if (playlists == null) { if (playlists == null) {
LOGGER.error("No YouTube playlists set for base item #" + item.getBaseItem().getId()); LOGGER.error("No YouTube playlists set for base item #" + item.getBaseItem().getId());

View File

@ -3,7 +3,14 @@ package com.eu.habbo.messages.incoming.rooms.pets;
import com.eu.habbo.Emulator; import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.pets.MonsterplantPet; import com.eu.habbo.habbohotel.pets.MonsterplantPet;
import com.eu.habbo.habbohotel.pets.Pet; import com.eu.habbo.habbohotel.pets.Pet;
import com.eu.habbo.habbohotel.rooms.Room;
import com.eu.habbo.habbohotel.rooms.RoomTile;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.incoming.MessageHandler; import com.eu.habbo.messages.incoming.MessageHandler;
import com.eu.habbo.threading.runnables.RoomUnitWalkToLocation;
import java.util.ArrayList;
import java.util.List;
public class ScratchPetEvent extends MessageHandler { public class ScratchPetEvent extends MessageHandler {
@ -11,21 +18,34 @@ public class ScratchPetEvent extends MessageHandler {
public void handle() throws Exception { public void handle() throws Exception {
final int petId = this.packet.readInt(); final int petId = this.packet.readInt();
if (this.client.getHabbo().getHabboInfo().getCurrentRoom() == null) { final Habbo habbo = this.client.getHabbo();
if (habbo == null) {
return; return;
} }
final Pet pet = this.client.getHabbo().getHabboInfo().getCurrentRoom().getPet(petId); final Room room = habbo.getHabboInfo().getCurrentRoom();
if (room == null) {
return;
}
final Pet pet = room.getPet(petId);
if (pet == null) { if (pet == null) {
return; return;
} }
if (this.client.getHabbo().getHabboStats().petRespectPointsToGive > 0 || pet instanceof MonsterplantPet) { if (habbo.getHabboStats().petRespectPointsToGive > 0 || pet instanceof MonsterplantPet) {
pet.scratched(this.client.getHabbo());
// Update the stats to the database. List<Runnable> tasks = new ArrayList<>();
tasks.add(() -> {
pet.scratched(habbo);
Emulator.getThreading().run(pet); Emulator.getThreading().run(pet);
});
RoomTile closestTile = habbo.getRoomUnit().getClosestAdjacentTile(pet.getRoomUnit().getX(), pet.getRoomUnit().getY(), true);
if (closestTile != null) {
habbo.getRoomUnit().setGoalLocation(closestTile);
Emulator.getThreading().run(new RoomUnitWalkToLocation(habbo.getRoomUnit(), closestTile, room, tasks, tasks));
}
} }
} }
} }

View File

@ -9,7 +9,7 @@ import com.eu.habbo.plugin.events.users.UserSavedMottoEvent;
public class SaveMottoEvent extends MessageHandler { public class SaveMottoEvent extends MessageHandler {
@Override @Override
public void handle() throws Exception { public void handle() throws Exception {
String motto = this.packet.readString(); String motto = Emulator.getGameEnvironment().getWordFilter().filter(this.packet.readString(), this.client.getHabbo());
UserSavedMottoEvent event = new UserSavedMottoEvent(this.client.getHabbo(), this.client.getHabbo().getHabboInfo().getMotto(), motto); UserSavedMottoEvent event = new UserSavedMottoEvent(this.client.getHabbo(), this.client.getHabbo().getHabboInfo().getMotto(), motto);
Emulator.getPluginManager().fireEvent(event); Emulator.getPluginManager().fireEvent(event);
motto = event.newMotto; motto = event.newMotto;

View File

@ -17,6 +17,11 @@ public abstract class MessageComposer {
public ServerMessage compose() { public ServerMessage compose() {
if (this.composed == null) { if (this.composed == null) {
this.composed = this.composeInternal(); this.composed = this.composeInternal();
if(this.composed != null) {
if(this.composed.getComposer() == null) {
this.composed.setComposer(this);
}
}
} }
return this.composed; return this.composed;

View File

@ -58,4 +58,8 @@ public class AchievementListComposer extends MessageComposer {
return this.response; return this.response;
} }
public Habbo getHabbo() {
return habbo;
}
} }

View File

@ -56,4 +56,12 @@ public class AchievementProgressComposer extends MessageComposer {
return this.response; return this.response;
} }
public Habbo getHabbo() {
return habbo;
}
public Achievement getAchievement() {
return achievement;
}
} }

View File

@ -35,4 +35,12 @@ public class AchievementUnlockedComposer extends MessageComposer {
this.response.appendBoolean(true); this.response.appendBoolean(true);
return this.response; return this.response;
} }
public Achievement getAchievement() {
return achievement;
}
public Habbo getHabbo() {
return habbo;
}
} }

View File

@ -38,4 +38,12 @@ public class TalentLevelUpdateComposer extends MessageComposer {
} }
return this.response; return this.response;
} }
public TalentTrackType getTalentTrackType() {
return talentTrackType;
}
public TalentTrackLevel getTalentTrackLevel() {
return talentTrackLevel;
}
} }

View File

@ -127,4 +127,12 @@ public class TalentTrackComposer extends MessageComposer {
this.id = id; this.id = id;
} }
} }
public Habbo getHabbo() {
return habbo;
}
public TalentTrackType getType() {
return type;
}
} }

View File

@ -20,4 +20,12 @@ public class CameraCompetitionStatusComposer extends MessageComposer {
this.response.appendString(this.unknownString); this.response.appendString(this.unknownString);
return this.response; return this.response;
} }
public boolean isUnknownBoolean() {
return unknownBoolean;
}
public String getUnknownString() {
return unknownString;
}
} }

View File

@ -23,4 +23,16 @@ public class CameraPriceComposer extends MessageComposer {
this.response.appendInt(this.pointsType); this.response.appendInt(this.pointsType);
return this.response; return this.response;
} }
public int getCredits() {
return credits;
}
public int getPoints() {
return points;
}
public int getPointsType() {
return pointsType;
}
} }

View File

@ -28,4 +28,16 @@ public class CameraPublishWaitMessageComposer extends MessageComposer {
return this.response; return this.response;
} }
public boolean isOk() {
return isOk;
}
public int getCooldownSeconds() {
return cooldownSeconds;
}
public String getExtraDataId() {
return extraDataId;
}
} }

View File

@ -17,4 +17,8 @@ public class CameraURLComposer extends MessageComposer {
this.response.appendString(this.URL); this.response.appendString(this.URL);
return this.response; return this.response;
} }
public String getURL() {
return URL;
}
} }

View File

@ -20,4 +20,8 @@ public class AlertPurchaseFailedComposer extends MessageComposer {
this.response.appendInt(this.error); this.response.appendInt(this.error);
return this.response; return this.response;
} }
public int getError() {
return error;
}
} }

View File

@ -20,4 +20,8 @@ public class AlertPurchaseUnavailableComposer extends MessageComposer {
this.response.appendInt(this.code); this.response.appendInt(this.code);
return this.response; return this.response;
} }
public int getCode() {
return code;
}
} }

View File

@ -17,4 +17,8 @@ public class CatalogModeComposer extends MessageComposer {
this.response.appendInt(this.mode); this.response.appendInt(this.mode);
return this.response; return this.response;
} }
public int getMode() {
return mode;
}
} }

View File

@ -68,4 +68,20 @@ public class CatalogPageComposer extends MessageComposer {
page.serialize(message); page.serialize(message);
} }
} }
public CatalogPage getPage() {
return page;
}
public Habbo getHabbo() {
return habbo;
}
public int getOfferId() {
return offerId;
}
public String getMode() {
return mode;
}
} }

View File

@ -75,4 +75,17 @@ public class CatalogPagesListComposer extends MessageComposer {
this.append(page); this.append(page);
} }
} }
public Habbo getHabbo() {
return habbo;
}
public String getMode() {
return mode;
}
public boolean isHasPermission() {
return hasPermission;
}
} }

View File

@ -18,4 +18,8 @@ public class CatalogSearchResultComposer extends MessageComposer {
this.item.serialize(this.response); this.item.serialize(this.response);
return this.response; return this.response;
} }
public CatalogItem getItem() {
return item;
}
} }

View File

@ -50,5 +50,39 @@ public class ClubCenterDataComposer extends MessageComposer {
return this.response; return this.response;
} }
public int getCurrentHcStreak() {
return currentHcStreak;
}
public String getFirstSubDate() {
return firstSubDate;
}
public double getKickbackPercentage() {
return kickbackPercentage;
}
public int getTotalCreditsMissed() {
return totalCreditsMissed;
}
public int getTotalCreditsRewarded() {
return totalCreditsRewarded;
}
public int getTotalCreditsSpent() {
return totalCreditsSpent;
}
public int getCreditRewardForStreakBonus() {
return creditRewardForStreakBonus;
}
public int getCreditRewardForMonthlySpent() {
return creditRewardForMonthlySpent;
}
public int getTimeUntilPayday() {
return timeUntilPayday;
}
} }

View File

@ -34,4 +34,12 @@ public class ClubDataComposer extends MessageComposer {
this.response.appendInt(this.windowId); this.response.appendInt(this.windowId);
return this.response; return this.response;
} }
public int getWindowId() {
return windowId;
}
public Habbo getHabbo() {
return habbo;
}
} }

View File

@ -65,4 +65,16 @@ public class ClubGiftsComposer extends MessageComposer {
return this.response; return this.response;
} }
public int getDaysTillNextGift() {
return daysTillNextGift;
}
public int getAvailableGifts() {
return availableGifts;
}
public int getDaysAsHc() {
return daysAsHc;
}
} }

View File

@ -23,4 +23,16 @@ public class NotEnoughPointsTypeComposer extends MessageComposer {
this.response.appendInt(this.pointsType); this.response.appendInt(this.pointsType);
return this.response; return this.response;
} }
public boolean isCredits() {
return isCredits;
}
public boolean isPixels() {
return isPixels;
}
public int getPointsType() {
return pointsType;
}
} }

View File

@ -21,4 +21,12 @@ public class PetBoughtNotificationComposer extends MessageComposer {
this.pet.serialize(this.response); this.pet.serialize(this.response);
return this.response; return this.response;
} }
public Pet getPet() {
return pet;
}
public boolean isGift() {
return gift;
}
} }

View File

@ -31,4 +31,12 @@ public class PetBreedsComposer extends MessageComposer {
} }
return this.response; return this.response;
} }
public String getPetName() {
return petName;
}
public THashSet<PetRace> getPetRaces() {
return petRaces;
}
} }

View File

@ -26,4 +26,12 @@ public class PetNameErrorComposer extends MessageComposer {
this.response.appendString(this.value); this.response.appendString(this.value);
return this.response; return this.response;
} }
public int getType() {
return type;
}
public String getValue() {
return value;
}
} }

View File

@ -40,4 +40,8 @@ public class PurchaseOKComposer extends MessageComposer {
} }
return this.response; return this.response;
} }
public CatalogItem getCatalogItem() {
return catalogItem;
}
} }

View File

@ -21,4 +21,8 @@ public class RecyclerCompleteComposer extends MessageComposer {
this.response.appendInt(0); //prize ID. this.response.appendInt(0); //prize ID.
return this.response; return this.response;
} }
public int getCode() {
return code;
}
} }

View File

@ -20,4 +20,8 @@ public class RedeemVoucherErrorComposer extends MessageComposer {
this.response.appendString(this.code + ""); this.response.appendString(this.code + "");
return this.response; return this.response;
} }
public int getCode() {
return code;
}
} }

View File

@ -23,4 +23,12 @@ public class TargetedOfferComposer extends MessageComposer {
this.offer.serialize(this.response, purchase); this.offer.serialize(this.response, purchase);
return this.response; return this.response;
} }
public Habbo getHabbo() {
return habbo;
}
public TargetOffer getOffer() {
return offer;
}
} }

View File

@ -31,4 +31,20 @@ public class MarketplaceBuyErrorComposer extends MessageComposer {
this.response.appendInt(this.price); //requestedOfferId this.response.appendInt(this.price); //requestedOfferId
return this.response; return this.response;
} }
public int getErrorCode() {
return errorCode;
}
public int getUnknown() {
return unknown;
}
public int getOfferId() {
return offerId;
}
public int getPrice() {
return price;
}
} }

View File

@ -21,4 +21,12 @@ public class MarketplaceCancelSaleComposer extends MessageComposer {
this.response.appendBoolean(this.success); this.response.appendBoolean(this.success);
return this.response; return this.response;
} }
public MarketPlaceOffer getOffer() {
return offer;
}
public boolean isSuccess() {
return success;
}
} }

View File

@ -18,4 +18,8 @@ public class MarketplaceItemInfoComposer extends MessageComposer {
MarketPlace.serializeItemInfo(this.itemId, this.response); MarketPlace.serializeItemInfo(this.itemId, this.response);
return this.response; return this.response;
} }
public int getItemId() {
return itemId;
}
} }

View File

@ -22,4 +22,8 @@ public class MarketplaceItemPostedComposer extends MessageComposer {
this.response.appendInt(this.code); this.response.appendInt(this.code);
return this.response; return this.response;
} }
public int getCode() {
return code;
}
} }

View File

@ -45,4 +45,8 @@ public class MarketplaceOffersComposer extends MessageComposer {
this.response.appendInt(this.offers.size()); this.response.appendInt(this.offers.size());
return this.response; return this.response;
} }
public List<MarketPlaceOffer> getOffers() {
return offers;
}
} }

View File

@ -64,4 +64,8 @@ public class MarketplaceOwnItemsComposer extends MessageComposer {
return this.response; return this.response;
} }
public Habbo getHabbo() {
return habbo;
}
} }

View File

@ -27,4 +27,16 @@ public class MarketplaceSellItemComposer extends MessageComposer {
this.response.appendInt(this.valueB); this.response.appendInt(this.valueB);
return this.response; return this.response;
} }
public int getErrorCode() {
return errorCode;
}
public int getValueA() {
return valueA;
}
public int getValueB() {
return valueB;
}
} }

View File

@ -35,4 +35,12 @@ public class CraftableProductsComposer extends MessageComposer {
return this.response; return this.response;
} }
public List<CraftingRecipe> getRecipes() {
return recipes;
}
public Collection<Item> getIngredients() {
return ingredients;
}
} }

View File

@ -26,4 +26,8 @@ public class CraftingRecipeComposer extends MessageComposer {
} }
return this.response; return this.response;
} }
public CraftingRecipe getRecipe() {
return recipe;
}
} }

View File

@ -20,4 +20,12 @@ public class CraftingRecipesAvailableComposer extends MessageComposer {
this.response.appendBoolean(this.found); this.response.appendBoolean(this.found);
return this.response; return this.response;
} }
public int getCount() {
return count;
}
public boolean isFound() {
return found;
}
} }

View File

@ -32,4 +32,12 @@ public class CraftingResultComposer extends MessageComposer {
return this.response; return this.response;
} }
public CraftingRecipe getRecipe() {
return recipe;
}
public boolean isSucces() {
return succes;
}
} }

View File

@ -61,4 +61,28 @@ public class AdventCalendarDataComposer extends MessageComposer {
return this.response; return this.response;
} }
public String getEventName() {
return eventName;
}
public String getCampaignImage() {
return campaignImage;
}
public int getTotalDays() {
return totalDays;
}
public int getCurrentDay() {
return currentDay;
}
public ArrayList<CalendarRewardClaimed> getUnlocked() {
return unlocked;
}
public boolean isLockExpired() {
return lockExpired;
}
} }

View File

@ -46,4 +46,16 @@ public class AdventCalendarProductComposer extends MessageComposer {
return this.response; return this.response;
} }
public boolean isVisible() {
return visible;
}
public CalendarRewardObject getRewardObject() {
return rewardObject;
}
public Habbo getHabbo() {
return habbo;
}
} }

View File

@ -20,4 +20,12 @@ public class MysticBoxPrizeComposer extends MessageComposer {
this.response.appendInt(this.itemId); this.response.appendInt(this.itemId);
return this.response; return this.response;
} }
public String getType() {
return type;
}
public int getItemId() {
return itemId;
}
} }

View File

@ -18,4 +18,8 @@ public class NewYearResolutionCompletedComposer extends MessageComposer {
this.response.appendString(this.badge); this.response.appendString(this.badge);
return this.response; return this.response;
} }
public String getBadge() {
return badge;
}
} }

View File

@ -32,4 +32,28 @@ public class NewYearResolutionProgressComposer extends MessageComposer {
this.response.appendInt(this.timeLeft); this.response.appendInt(this.timeLeft);
return this.response; return this.response;
} }
public int getStuffId() {
return stuffId;
}
public int getAchievementId() {
return achievementId;
}
public String getAchievementName() {
return achievementName;
}
public int getCurrentProgress() {
return currentProgress;
}
public int getProgressNeeded() {
return progressNeeded;
}
public int getTimeLeft() {
return timeLeft;
}
} }

View File

@ -28,4 +28,8 @@ public class FloorPlanEditorBlockedTilesComposer extends MessageComposer {
return this.response; return this.response;
} }
public Room getRoom() {
return room;
}
} }

View File

@ -20,4 +20,8 @@ public class FloorPlanEditorDoorSettingsComposer extends MessageComposer {
this.response.appendInt(this.room.getLayout().getDoorDirection()); this.response.appendInt(this.room.getLayout().getDoorDirection());
return this.response; return this.response;
} }
public Room getRoom() {
return room;
}
} }

View File

@ -50,4 +50,16 @@ public class FriendChatMessageComposer extends MessageComposer {
return this.response; return this.response;
} }
public Message getMessage() {
return message;
}
public int getToId() {
return toId;
}
public int getFromId() {
return fromId;
}
} }

View File

@ -20,4 +20,8 @@ public class FriendFindingRoomComposer extends MessageComposer {
this.response.appendInt(this.errorCode); this.response.appendInt(this.errorCode);
return this.response; return this.response;
} }
public int getErrorCode() {
return errorCode;
}
} }

View File

@ -31,4 +31,16 @@ public class FriendNotificationComposer extends MessageComposer {
this.response.appendString(this.data); this.response.appendString(this.data);
return this.response; return this.response;
} }
public int getUserId() {
return userId;
}
public int getType() {
return type;
}
public String getData() {
return data;
}
} }

View File

@ -22,4 +22,8 @@ public class FriendRequestComposer extends MessageComposer {
return this.response; return this.response;
} }
public Habbo getHabbo() {
return habbo;
}
} }

View File

@ -23,4 +23,8 @@ public class FriendRequestErrorComposer extends MessageComposer {
this.response.appendInt(this.errorCode); this.response.appendInt(this.errorCode);
return this.response; return this.response;
} }
public int getErrorCode() {
return errorCode;
}
} }

View File

@ -80,4 +80,16 @@ public class FriendsComposer extends MessageComposer {
return messages; return messages;
} }
public int getTotalPages() {
return totalPages;
}
public int getPageIndex() {
return pageIndex;
}
public Collection<MessengerBuddy> getFriends() {
return friends;
}
} }

View File

@ -30,4 +30,8 @@ public class LoadFriendRequestsComposer extends MessageComposer {
return this.response; return this.response;
} }
public Habbo getHabbo() {
return habbo;
}
} }

View File

@ -44,5 +44,9 @@ public class MessengerInitComposer extends MessageComposer {
} }
return this.response; return this.response;
} }
public Habbo getHabbo() {
return habbo;
}
} }

View File

@ -30,4 +30,8 @@ public class RemoveFriendComposer extends MessageComposer {
return this.response; return this.response;
} }
public TIntArrayList getUnfriendIds() {
return unfriendIds;
}
} }

View File

@ -20,4 +20,12 @@ public class RoomInviteComposer extends MessageComposer {
this.response.appendString(this.message); this.response.appendString(this.message);
return this.response; return this.response;
} }
public int getUserId() {
return userId;
}
public String getMessage() {
return message;
}
} }

View File

@ -30,4 +30,12 @@ public class RoomInviteErrorComposer extends MessageComposer {
}); });
return this.response; return this.response;
} }
public int getErrorCode() {
return errorCode;
}
public THashSet<MessengerBuddy> getBuddies() {
return buddies;
}
} }

View File

@ -22,4 +22,8 @@ public class StalkErrorComposer extends MessageComposer {
this.response.appendInt(this.errorCode); this.response.appendInt(this.errorCode);
return this.response; return this.response;
} }
public int getErrorCode() {
return errorCode;
}
} }

View File

@ -74,4 +74,16 @@ public class UpdateFriendComposer extends MessageComposer {
} }
return this.response; return this.response;
} }
public Collection<MessengerBuddy> getBuddies() {
return buddies;
}
public Habbo getHabbo() {
return habbo;
}
public int getAction() {
return action;
}
} }

View File

@ -77,4 +77,16 @@ public class UserSearchResultComposer extends MessageComposer {
return false; return false;
} }
public THashSet<MessengerBuddy> getUsers() {
return users;
}
public THashSet<MessengerBuddy> getFriends() {
return friends;
}
public Habbo getHabbo() {
return habbo;
}
} }

View File

@ -21,4 +21,12 @@ public class GameCenterAccountInfoComposer extends MessageComposer {
this.response.appendInt(1); this.response.appendInt(1);
return this.response; return this.response;
} }
public int getGameId() {
return gameId;
}
public int getGamesLeft() {
return gamesLeft;
}
} }

View File

@ -23,4 +23,12 @@ public class GameCenterGameComposer extends MessageComposer {
this.response.appendInt(this.status); this.response.appendInt(this.status);
return this.response; return this.response;
} }
public int getGameId() {
return gameId;
}
public int getStatus() {
return status;
}
} }

View File

@ -17,4 +17,8 @@ public class BaseJumpJoinQueueComposer extends MessageComposer {
this.response.appendInt(this.gameId); this.response.appendInt(this.gameId);
return this.response; return this.response;
} }
public int getGameId() {
return gameId;
}
} }

View File

@ -48,4 +48,12 @@ public class BaseJumpLoadGameComposer extends MessageComposer {
} }
return this.response; return this.response;
} }
public GameClient getClient() {
return client;
}
public int getGame() {
return game;
}
} }

View File

@ -17,4 +17,8 @@ public class PickMonthlyClubGiftNotificationComposer extends MessageComposer {
this.response.appendInt(this.count); this.response.appendInt(this.count);
return this.response; return this.response;
} }
public int getCount() {
return count;
}
} }

View File

@ -23,4 +23,8 @@ public class BotErrorComposer extends MessageComposer {
this.response.appendInt(this.errorCode); this.response.appendInt(this.errorCode);
return this.response; return this.response;
} }
public int getErrorCode() {
return errorCode;
}
} }

View File

@ -38,4 +38,12 @@ public class BubbleAlertComposer extends MessageComposer {
} }
return this.response; return this.response;
} }
public String getErrorKey() {
return errorKey;
}
public THashMap<String, String> getKeys() {
return keys;
}
} }

View File

@ -23,4 +23,8 @@ public class CustomNotificationComposer extends MessageComposer {
this.response.appendInt(this.type); this.response.appendInt(this.type);
return this.response; return this.response;
} }
public int getType() {
return type;
}
} }

View File

@ -24,4 +24,8 @@ public class GenericAlertComposer extends MessageComposer {
return this.response; return this.response;
} }
public String getMessage() {
return message;
}
} }

View File

@ -25,4 +25,8 @@ public class GenericErrorMessagesComposer extends MessageComposer {
this.response.appendInt(this.errorCode); this.response.appendInt(this.errorCode);
return this.response; return this.response;
} }
public int getErrorCode() {
return errorCode;
}
} }

View File

@ -20,4 +20,12 @@ public class HotelClosedAndOpensComposer extends MessageComposer {
this.response.appendInt(this.minute); this.response.appendInt(this.minute);
return this.response; return this.response;
} }
public int getHour() {
return hour;
}
public int getMinute() {
return minute;
}
} }

View File

@ -23,4 +23,16 @@ public class HotelClosesAndWillOpenAtComposer extends MessageComposer {
this.response.appendBoolean(this.disconnected); this.response.appendBoolean(this.disconnected);
return this.response; return this.response;
} }
public int getHour() {
return hour;
}
public int getMinute() {
return minute;
}
public boolean isDisconnected() {
return disconnected;
}
} }

View File

@ -21,4 +21,12 @@ public class HotelWillCloseInMinutesAndBackInComposer extends MessageComposer {
this.response.appendInt(this.reopenInMinutes); this.response.appendInt(this.reopenInMinutes);
return this.response; return this.response;
} }
public int getCloseInMinutes() {
return closeInMinutes;
}
public int getReopenInMinutes() {
return reopenInMinutes;
}
} }

View File

@ -17,4 +17,8 @@ public class HotelWillCloseInMinutesComposer extends MessageComposer {
this.response.appendInt(this.minutes); this.response.appendInt(this.minutes);
return this.response; return this.response;
} }
public int getMinutes() {
return minutes;
}
} }

View File

@ -36,4 +36,12 @@ public class MessagesForYouComposer extends MessageComposer {
return this.response; return this.response;
} }
public String[] getMessages() {
return messages;
}
public List<String> getNewMessages() {
return newMessages;
}
} }

View File

@ -24,4 +24,8 @@ public class PetErrorComposer extends MessageComposer {
this.response.appendInt(this.errorCode); this.response.appendInt(this.errorCode);
return this.response; return this.response;
} }
public int getErrorCode() {
return errorCode;
}
} }

View File

@ -17,4 +17,8 @@ public class StaffAlertAndOpenHabboWayComposer extends MessageComposer {
this.response.appendString(this.message); this.response.appendString(this.message);
return this.response; return this.response;
} }
public String getMessage() {
return message;
}
} }

View File

@ -20,4 +20,12 @@ public class StaffAlertWIthLinkAndOpenHabboWayComposer extends MessageComposer {
this.response.appendString(this.link); this.response.appendString(this.link);
return this.response; return this.response;
} }
public String getMessage() {
return message;
}
public String getLink() {
return link;
}
} }

View File

@ -20,4 +20,12 @@ public class StaffAlertWithLinkComposer extends MessageComposer {
this.response.appendString(this.link); this.response.appendString(this.link);
return this.response; return this.response;
} }
public String getMessage() {
return message;
}
public String getLink() {
return link;
}
} }

View File

@ -17,4 +17,8 @@ public class UpdateFailedComposer extends MessageComposer {
this.response.appendString(this.message); this.response.appendString(this.message);
return this.response; return this.response;
} }
public String getMessage() {
return message;
}
} }

Some files were not shown because too many files have changed in this diff Show More