mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-27 00:40:52 +01:00
Code optimisations and readability
This commit is contained in:
parent
c4b9e0546d
commit
f973f7885d
1
pom.xml
1
pom.xml
@ -36,7 +36,6 @@
|
|||||||
<configuration>
|
<configuration>
|
||||||
<source>19</source>
|
<source>19</source>
|
||||||
<target>19</target>
|
<target>19</target>
|
||||||
<compilerArgs>--enable-preview</compilerArgs>
|
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.eu.habbo.habbohotel.bots;
|
package com.eu.habbo.habbohotel.bots;
|
||||||
|
|
||||||
import com.eu.habbo.Emulator;
|
import com.eu.habbo.Emulator;
|
||||||
|
import com.eu.habbo.database.DatabaseConstants;
|
||||||
import com.eu.habbo.habbohotel.rooms.*;
|
import com.eu.habbo.habbohotel.rooms.*;
|
||||||
import com.eu.habbo.habbohotel.users.Habbo;
|
import com.eu.habbo.habbohotel.users.Habbo;
|
||||||
import com.eu.habbo.habbohotel.users.HabboGender;
|
import com.eu.habbo.habbohotel.users.HabboGender;
|
||||||
@ -82,7 +83,7 @@ public class Bot implements Runnable {
|
|||||||
this.motto = set.getString("motto");
|
this.motto = set.getString("motto");
|
||||||
this.figure = set.getString("figure");
|
this.figure = set.getString("figure");
|
||||||
this.gender = HabboGender.valueOf(set.getString("gender"));
|
this.gender = HabboGender.valueOf(set.getString("gender"));
|
||||||
this.ownerId = set.getInt("user_id");
|
this.ownerId = set.getInt(DatabaseConstants.USER_ID);
|
||||||
this.ownerName = set.getString("owner_name");
|
this.ownerName = set.getString("owner_name");
|
||||||
this.chatAuto = set.getString("chat_auto").equals("1");
|
this.chatAuto = set.getString("chat_auto").equals("1");
|
||||||
this.chatRandom = set.getString("chat_random").equals("1");
|
this.chatRandom = set.getString("chat_random").equals("1");
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.eu.habbo.habbohotel.campaign;
|
package com.eu.habbo.habbohotel.campaign;
|
||||||
|
|
||||||
|
import com.eu.habbo.database.DatabaseConstants;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
@ -17,7 +18,7 @@ public class CalendarRewardClaimed {
|
|||||||
private final Timestamp timestamp;
|
private final Timestamp timestamp;
|
||||||
|
|
||||||
public CalendarRewardClaimed(ResultSet set) throws SQLException {
|
public CalendarRewardClaimed(ResultSet set) throws SQLException {
|
||||||
this.userId = set.getInt("user_id");
|
this.userId = set.getInt(DatabaseConstants.USER_ID);
|
||||||
this.campaignId = set.getInt("campaign_id");
|
this.campaignId = set.getInt("campaign_id");
|
||||||
this.day = set.getInt("day");
|
this.day = set.getInt("day");
|
||||||
this.rewardId = set.getInt("reward_id");
|
this.rewardId = set.getInt("reward_id");
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.eu.habbo.habbohotel.catalog;
|
package com.eu.habbo.habbohotel.catalog;
|
||||||
|
|
||||||
import com.eu.habbo.Emulator;
|
import com.eu.habbo.Emulator;
|
||||||
|
import com.eu.habbo.database.DatabaseConstants;
|
||||||
import com.eu.habbo.habbohotel.achievements.AchievementManager;
|
import com.eu.habbo.habbohotel.achievements.AchievementManager;
|
||||||
import com.eu.habbo.habbohotel.bots.Bot;
|
import com.eu.habbo.habbohotel.bots.Bot;
|
||||||
import com.eu.habbo.habbohotel.catalog.layouts.*;
|
import com.eu.habbo.habbohotel.catalog.layouts.*;
|
||||||
@ -249,7 +250,7 @@ public class CatalogManager {
|
|||||||
|
|
||||||
totals.adjustOrPutValue(set.getInt("catalog_item_id"), 1, 1);
|
totals.adjustOrPutValue(set.getInt("catalog_item_id"), 1, 1);
|
||||||
|
|
||||||
if (set.getInt("user_id") == 0) {
|
if (set.getInt(DatabaseConstants.USER_ID) == 0) {
|
||||||
limiteds.get(set.getInt("catalog_item_id")).push(set.getInt("number"));
|
limiteds.get(set.getInt("catalog_item_id")).push(set.getInt("number"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.eu.habbo.habbohotel.catalog;
|
package com.eu.habbo.habbohotel.catalog;
|
||||||
|
|
||||||
|
import com.eu.habbo.database.DatabaseConstants;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
@ -17,7 +18,7 @@ public class VoucherHistoryEntry {
|
|||||||
|
|
||||||
public VoucherHistoryEntry(ResultSet set) throws SQLException {
|
public VoucherHistoryEntry(ResultSet set) throws SQLException {
|
||||||
this.voucherId = set.getInt("voucher_id");
|
this.voucherId = set.getInt("voucher_id");
|
||||||
this.userId = set.getInt("user_id");
|
this.userId = set.getInt(DatabaseConstants.USER_ID);
|
||||||
this.timestamp = set.getInt("timestamp");
|
this.timestamp = set.getInt("timestamp");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.eu.habbo.habbohotel.catalog.marketplace;
|
package com.eu.habbo.habbohotel.catalog.marketplace;
|
||||||
|
|
||||||
import com.eu.habbo.Emulator;
|
import com.eu.habbo.Emulator;
|
||||||
|
import com.eu.habbo.database.DatabaseConstants;
|
||||||
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
||||||
import com.eu.habbo.habbohotel.users.Habbo;
|
import com.eu.habbo.habbohotel.users.Habbo;
|
||||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
import com.eu.habbo.habbohotel.users.HabboItem;
|
||||||
@ -262,7 +263,7 @@ public class MarketPlace {
|
|||||||
updateOffer.setInt(2, offerId);
|
updateOffer.setInt(2, offerId);
|
||||||
updateOffer.execute();
|
updateOffer.execute();
|
||||||
}
|
}
|
||||||
Habbo habbo = Emulator.getGameServer().getGameClientManager().getHabbo(set.getInt("user_id"));
|
Habbo habbo = Emulator.getGameServer().getGameClientManager().getHabbo(set.getInt(DatabaseConstants.USER_ID));
|
||||||
HabboItem item = Emulator.getGameEnvironment().getItemManager().loadHabboItem(itemSet);
|
HabboItem item = Emulator.getGameEnvironment().getItemManager().loadHabboItem(itemSet);
|
||||||
|
|
||||||
MarketPlaceItemSoldEvent event = new MarketPlaceItemSoldEvent(habbo, client.getHabbo(), item, set.getInt("price"));
|
MarketPlaceItemSoldEvent event = new MarketPlaceItemSoldEvent(habbo, client.getHabbo(), item, set.getInt("price"));
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.eu.habbo.habbohotel.guilds;
|
package com.eu.habbo.habbohotel.guilds;
|
||||||
|
|
||||||
import com.eu.habbo.Emulator;
|
import com.eu.habbo.Emulator;
|
||||||
|
import com.eu.habbo.database.DatabaseConstants;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@ -65,7 +66,7 @@ public class Guild implements Runnable {
|
|||||||
|
|
||||||
public Guild(ResultSet set) throws SQLException {
|
public Guild(ResultSet set) throws SQLException {
|
||||||
this.id = set.getInt("id");
|
this.id = set.getInt("id");
|
||||||
this.ownerId = set.getInt("user_id");
|
this.ownerId = set.getInt(DatabaseConstants.USER_ID);
|
||||||
this.ownerName = set.getString("username");
|
this.ownerName = set.getString("username");
|
||||||
this.name = set.getString("name");
|
this.name = set.getString("name");
|
||||||
this.description = set.getString("description");
|
this.description = set.getString("description");
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.eu.habbo.habbohotel.guilds;
|
package com.eu.habbo.habbohotel.guilds;
|
||||||
|
|
||||||
import com.eu.habbo.Emulator;
|
import com.eu.habbo.Emulator;
|
||||||
|
import com.eu.habbo.database.DatabaseConstants;
|
||||||
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
||||||
import com.eu.habbo.habbohotel.guilds.forums.ForumView;
|
import com.eu.habbo.habbohotel.guilds.forums.ForumView;
|
||||||
import com.eu.habbo.habbohotel.items.interactions.InteractionGuildFurni;
|
import com.eu.habbo.habbohotel.items.interactions.InteractionGuildFurni;
|
||||||
@ -433,7 +434,7 @@ public class GuildManager {
|
|||||||
statement.setInt(1, guild.getId());
|
statement.setInt(1, guild.getId());
|
||||||
try (ResultSet set = statement.executeQuery()) {
|
try (ResultSet set = statement.executeQuery()) {
|
||||||
while (set.next()) {
|
while (set.next()) {
|
||||||
guildAdmins.put(set.getInt("user_id"), new GuildMember(set));
|
guildAdmins.put(set.getInt(DatabaseConstants.USER_ID), new GuildMember(set));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.eu.habbo.habbohotel.guilds;
|
package com.eu.habbo.habbohotel.guilds;
|
||||||
|
|
||||||
|
import com.eu.habbo.database.DatabaseConstants;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
@ -22,7 +23,7 @@ public class GuildMember implements Comparable<GuildMember> {
|
|||||||
private GuildRank rank;
|
private GuildRank rank;
|
||||||
|
|
||||||
public GuildMember(ResultSet set) throws SQLException {
|
public GuildMember(ResultSet set) throws SQLException {
|
||||||
this.userId = set.getInt("user_id");
|
this.userId = set.getInt(DatabaseConstants.USER_ID);
|
||||||
this.username = set.getString("username");
|
this.username = set.getString("username");
|
||||||
this.look = set.getString("look");
|
this.look = set.getString("look");
|
||||||
this.joinDate = set.getInt("member_since");
|
this.joinDate = set.getInt("member_since");
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.eu.habbo.habbohotel.guilds.forums;
|
package com.eu.habbo.habbohotel.guilds.forums;
|
||||||
|
|
||||||
import com.eu.habbo.Emulator;
|
import com.eu.habbo.Emulator;
|
||||||
|
import com.eu.habbo.database.DatabaseConstants;
|
||||||
import com.eu.habbo.habbohotel.users.Habbo;
|
import com.eu.habbo.habbohotel.users.Habbo;
|
||||||
import com.eu.habbo.habbohotel.users.HabboInfo;
|
import com.eu.habbo.habbohotel.users.HabboInfo;
|
||||||
import com.eu.habbo.messages.ISerialize;
|
import com.eu.habbo.messages.ISerialize;
|
||||||
@ -50,7 +51,7 @@ public class ForumThreadComment implements Runnable, ISerialize {
|
|||||||
public ForumThreadComment(ResultSet set) throws SQLException {
|
public ForumThreadComment(ResultSet set) throws SQLException {
|
||||||
this.commentId = set.getInt("id");
|
this.commentId = set.getInt("id");
|
||||||
this.threadId = set.getInt("thread_id");
|
this.threadId = set.getInt("thread_id");
|
||||||
this.userId = set.getInt("user_id");
|
this.userId = set.getInt(DatabaseConstants.USER_ID);
|
||||||
this.message = set.getString("message");
|
this.message = set.getString("message");
|
||||||
this.createdAt = set.getInt("created_at");
|
this.createdAt = set.getInt("created_at");
|
||||||
this.state = ForumThreadState.fromValue(set.getInt("state"));
|
this.state = ForumThreadState.fromValue(set.getInt("state"));
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.eu.habbo.habbohotel.guilds.forums;
|
package com.eu.habbo.habbohotel.guilds.forums;
|
||||||
|
|
||||||
|
import com.eu.habbo.database.DatabaseConstants;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
@ -16,7 +17,7 @@ public class ForumView {
|
|||||||
private final int timestamp;
|
private final int timestamp;
|
||||||
|
|
||||||
public ForumView(ResultSet set) throws SQLException {
|
public ForumView(ResultSet set) throws SQLException {
|
||||||
this.userId = set.getInt("user_id");
|
this.userId = set.getInt(DatabaseConstants.USER_ID);
|
||||||
this.guildId = set.getInt("guild_id");
|
this.guildId = set.getInt("guild_id");
|
||||||
this.timestamp = set.getInt("timestamp");
|
this.timestamp = set.getInt("timestamp");
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,7 @@ public class InteractionMultiHeight extends HabboItem {
|
|||||||
Collection<RoomUnit> unitsOnItem = room.getRoomUnitsAt(room.getLayout().getTile(tile.getX(), tile.getY()));
|
Collection<RoomUnit> unitsOnItem = room.getRoomUnitsAt(room.getLayout().getTile(tile.getX(), tile.getY()));
|
||||||
|
|
||||||
for (RoomUnit unit : unitsOnItem) {
|
for (RoomUnit unit : unitsOnItem) {
|
||||||
if (unit.hasStatus(RoomUnitStatus.MOVE) && unit.getGoal() != tile)
|
if (unit.hasStatus(RoomUnitStatus.MOVE) && unit.getGoalLocation() != tile)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (this.getBaseItem().allowSit() || unit.hasStatus(RoomUnitStatus.SIT)) {
|
if (this.getBaseItem().allowSit() || unit.hasStatus(RoomUnitStatus.SIT)) {
|
||||||
|
@ -83,7 +83,7 @@ public abstract class InteractionPushable extends InteractionDefault {
|
|||||||
boolean isDrag = false;
|
boolean isDrag = false;
|
||||||
RoomUserRotation direction;
|
RoomUserRotation direction;
|
||||||
|
|
||||||
if (this.getX() == roomUnit.getGoal().getX() && this.getY() == roomUnit.getGoal().getY()) //User clicked on the tile the ball is on, they want to kick it
|
if (this.getX() == roomUnit.getGoalLocation().getX() && this.getY() == roomUnit.getGoalLocation().getY()) //User clicked on the tile the ball is on, they want to kick it
|
||||||
{
|
{
|
||||||
velocity = this.getWalkOnVelocity(roomUnit, room);
|
velocity = this.getWalkOnVelocity(roomUnit, room);
|
||||||
direction = this.getWalkOnDirection(roomUnit, room);
|
direction = this.getWalkOnDirection(roomUnit, room);
|
||||||
|
@ -69,7 +69,7 @@ public class InteractionFootball extends InteractionPushable {
|
|||||||
@Override
|
@Override
|
||||||
public RoomUserRotation getWalkOffDirection(RoomUnit roomUnit, Room room) {
|
public RoomUserRotation getWalkOffDirection(RoomUnit roomUnit, Room room) {
|
||||||
RoomTile peek = roomUnit.getPath().peek();
|
RoomTile peek = roomUnit.getPath().peek();
|
||||||
RoomTile nextWalkTile = peek != null ? room.getLayout().getTile(peek.getX(), peek.getY()) : roomUnit.getGoal();
|
RoomTile nextWalkTile = peek != null ? room.getLayout().getTile(peek.getX(), peek.getY()) : roomUnit.getGoalLocation();
|
||||||
return RoomUserRotation.values()[(RoomUserRotation.values().length + Rotation.Calculate(roomUnit.getX(), roomUnit.getY(), nextWalkTile.getX(), nextWalkTile.getY()) + 4) % 8];
|
return RoomUserRotation.values()[(RoomUserRotation.values().length + Rotation.Calculate(roomUnit.getX(), roomUnit.getY(), nextWalkTile.getX(), nextWalkTile.getY()) + 4) % 8];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ public class InteractionPetBreedingNest extends HabboItem {
|
|||||||
Pet offspring = Emulator.getGameEnvironment().getPetManager().createPet(petOne.getPetData().getOffspringType(), (int) Math.min(Math.round(Math.max(1d, PetManager.getNormalDistributionForBreeding(petOne.getLevel(), petTwo.getLevel()).sample())), 20), name, habbo.getClient());
|
Pet offspring = Emulator.getGameEnvironment().getPetManager().createPet(petOne.getPetData().getOffspringType(), (int) Math.min(Math.round(Math.max(1d, PetManager.getNormalDistributionForBreeding(petOne.getLevel(), petTwo.getLevel()).sample())), 20), name, habbo.getClient());
|
||||||
|
|
||||||
//habbo.getClient().sendResponse(new PetPackageNameValidationComposer(box.getId(), PetPackageNameValidationComposer.CLOSE_WIDGET, ""));
|
//habbo.getClient().sendResponse(new PetPackageNameValidationComposer(box.getId(), PetPackageNameValidationComposer.CLOSE_WIDGET, ""));
|
||||||
habbo.getHabboInfo().getCurrentRoom().placePet(offspring, box.getX(), box.getY(), box.getZ(), box.getRotation());
|
habbo.getHabboInfo().getCurrentRoom().placePet(offspring, box.getX(), box.getY(), box.getZ());
|
||||||
offspring.needsUpdate = true;
|
offspring.needsUpdate = true;
|
||||||
offspring.run();
|
offspring.run();
|
||||||
InteractionPetBreedingNest.this.freePets();
|
InteractionPetBreedingNest.this.freePets();
|
||||||
|
@ -52,7 +52,7 @@ public class InteractionPetToy extends InteractionDefault {
|
|||||||
|
|
||||||
Pet pet = room.getPet(roomUnit);
|
Pet pet = room.getPet(roomUnit);
|
||||||
|
|
||||||
if (pet != null && pet.getPetData().haveToyItem(this.getBaseItem()) && this.getOccupyingTiles(room.getLayout()).contains(pet.getRoomUnit().getGoal())) {
|
if (pet != null && pet.getPetData().haveToyItem(this.getBaseItem()) && this.getOccupyingTiles(room.getLayout()).contains(pet.getRoomUnit().getGoalLocation())) {
|
||||||
if (pet.getEnergy() <= 35) {
|
if (pet.getEnergy() <= 35) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ public class InteractionPetTrampoline extends InteractionDefault {
|
|||||||
|
|
||||||
Pet pet = room.getPet(roomUnit);
|
Pet pet = room.getPet(roomUnit);
|
||||||
|
|
||||||
if (pet != null && pet.getPetData().haveToyItem(this.getBaseItem()) && this.getOccupyingTiles(room.getLayout()).contains(pet.getRoomUnit().getGoal())) {
|
if (pet != null && pet.getPetData().haveToyItem(this.getBaseItem()) && this.getOccupyingTiles(room.getLayout()).contains(pet.getRoomUnit().getGoalLocation())) {
|
||||||
if (pet.getEnergy() <= 35) {
|
if (pet.getEnergy() <= 35) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ public class InteractionPetTree extends InteractionDefault {
|
|||||||
super.onWalkOn(roomUnit, room, objects);
|
super.onWalkOn(roomUnit, room, objects);
|
||||||
|
|
||||||
Pet pet = room.getPet(roomUnit);
|
Pet pet = room.getPet(roomUnit);
|
||||||
if (pet != null && pet.getPetData().haveToyItem(this.getBaseItem()) && this.getOccupyingTiles(room.getLayout()).contains(pet.getRoomUnit().getGoal())) {
|
if (pet != null && pet.getPetData().haveToyItem(this.getBaseItem()) && this.getOccupyingTiles(room.getLayout()).contains(pet.getRoomUnit().getGoalLocation())) {
|
||||||
RoomUnitStatus task = switch (pet.getTask()) {
|
RoomUnitStatus task = switch (pet.getTask()) {
|
||||||
case RING_OF_FIRE -> RoomUnitStatus.RINGOFFIRE;
|
case RING_OF_FIRE -> RoomUnitStatus.RINGOFFIRE;
|
||||||
case SWING -> RoomUnitStatus.SWING;
|
case SWING -> RoomUnitStatus.SWING;
|
||||||
|
@ -271,7 +271,8 @@ public class WiredEffectChangeFurniDirection extends InteractionWiredEffect {
|
|||||||
case ACTION_TURN_RIGHT_45 -> RoomUserRotation.clockwise(currentRotation);
|
case ACTION_TURN_RIGHT_45 -> RoomUserRotation.clockwise(currentRotation);
|
||||||
case ACTION_TURN_RIGHT_90 -> RoomUserRotation.clockwise(RoomUserRotation.clockwise(currentRotation));
|
case ACTION_TURN_RIGHT_90 -> RoomUserRotation.clockwise(RoomUserRotation.clockwise(currentRotation));
|
||||||
case ACTION_TURN_RANDOM -> RoomUserRotation.fromValue(Emulator.getRandom().nextInt(8));
|
case ACTION_TURN_RANDOM -> RoomUserRotation.fromValue(Emulator.getRandom().nextInt(8));
|
||||||
case ACTION_WAIT, default -> currentRotation;
|
case ACTION_WAIT -> currentRotation;
|
||||||
|
default -> currentRotation;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.eu.habbo.habbohotel.modtool;
|
package com.eu.habbo.habbohotel.modtool;
|
||||||
|
|
||||||
import com.eu.habbo.Emulator;
|
import com.eu.habbo.Emulator;
|
||||||
|
import com.eu.habbo.database.DatabaseConstants;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
@ -28,7 +29,7 @@ public class ModToolBan implements Runnable {
|
|||||||
private final boolean needsInsert;
|
private final boolean needsInsert;
|
||||||
|
|
||||||
public ModToolBan(ResultSet set) throws SQLException {
|
public ModToolBan(ResultSet set) throws SQLException {
|
||||||
this.userId = set.getInt("user_id");
|
this.userId = set.getInt(DatabaseConstants.USER_ID);
|
||||||
this.ip = set.getString("ip");
|
this.ip = set.getString("ip");
|
||||||
this.machineId = set.getString("machine_id");
|
this.machineId = set.getString("machine_id");
|
||||||
this.staffId = set.getInt("user_staff_id");
|
this.staffId = set.getInt("user_staff_id");
|
||||||
|
@ -167,7 +167,7 @@ public class MonsterplantPet extends Pet implements IPetLook {
|
|||||||
if (difference >= growTime) {
|
if (difference >= growTime) {
|
||||||
this.growthStage = 7;
|
this.growthStage = 7;
|
||||||
boolean clear = false;
|
boolean clear = false;
|
||||||
for (RoomUnitStatus s : this.roomUnit.getStatusMap().keySet()) {
|
for (RoomUnitStatus s : this.roomUnit.getStatus().keySet()) {
|
||||||
if (s.equals(RoomUnitStatus.GROW)) {
|
if (s.equals(RoomUnitStatus.GROW)) {
|
||||||
clear = true;
|
clear = true;
|
||||||
break;
|
break;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.eu.habbo.habbohotel.pets;
|
package com.eu.habbo.habbohotel.pets;
|
||||||
|
|
||||||
import com.eu.habbo.Emulator;
|
import com.eu.habbo.Emulator;
|
||||||
|
import com.eu.habbo.database.DatabaseConstants;
|
||||||
import com.eu.habbo.habbohotel.achievements.AchievementManager;
|
import com.eu.habbo.habbohotel.achievements.AchievementManager;
|
||||||
import com.eu.habbo.habbohotel.rooms.*;
|
import com.eu.habbo.habbohotel.rooms.*;
|
||||||
import com.eu.habbo.habbohotel.users.Habbo;
|
import com.eu.habbo.habbohotel.users.Habbo;
|
||||||
@ -138,7 +139,7 @@ public class Pet implements ISerialize, Runnable {
|
|||||||
public Pet(ResultSet set) throws SQLException {
|
public Pet(ResultSet set) throws SQLException {
|
||||||
super();
|
super();
|
||||||
this.id = set.getInt("id");
|
this.id = set.getInt("id");
|
||||||
this.userId = set.getInt("user_id");
|
this.userId = set.getInt(DatabaseConstants.USER_ID);
|
||||||
this.room = null;
|
this.room = null;
|
||||||
this.name = set.getString("name");
|
this.name = set.getString("name");
|
||||||
this.petData = Emulator.getGameEnvironment().getPetManager().getPetData(set.getInt("type"));
|
this.petData = Emulator.getGameEnvironment().getPetManager().getPetData(set.getInt("type"));
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,7 @@
|
|||||||
package com.eu.habbo.habbohotel.rooms;
|
package com.eu.habbo.habbohotel.rooms;
|
||||||
|
|
||||||
import com.eu.habbo.Emulator;
|
import com.eu.habbo.Emulator;
|
||||||
|
import com.eu.habbo.database.DatabaseConstants;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@ -22,7 +23,7 @@ public class RoomBan {
|
|||||||
|
|
||||||
public RoomBan(ResultSet set) throws SQLException {
|
public RoomBan(ResultSet set) throws SQLException {
|
||||||
this.roomId = set.getInt("room_id");
|
this.roomId = set.getInt("room_id");
|
||||||
this.userId = set.getInt("user_id");
|
this.userId = set.getInt(DatabaseConstants.USER_ID);
|
||||||
this.username = set.getString("username");
|
this.username = set.getString("username");
|
||||||
this.endTimestamp = set.getInt("ends");
|
this.endTimestamp = set.getInt("ends");
|
||||||
}
|
}
|
||||||
|
@ -68,6 +68,7 @@ public class RoomManager {
|
|||||||
public static int MAXIMUM_ROOMS_HC = 35;
|
public static int MAXIMUM_ROOMS_HC = 35;
|
||||||
public static int HOME_ROOM_ID = 0;
|
public static int HOME_ROOM_ID = 0;
|
||||||
public static boolean SHOW_PUBLIC_IN_POPULAR_TAB = false;
|
public static boolean SHOW_PUBLIC_IN_POPULAR_TAB = false;
|
||||||
|
@Getter
|
||||||
private final THashMap<Integer, RoomCategory> roomCategories;
|
private final THashMap<Integer, RoomCategory> roomCategories;
|
||||||
private final List<String> mapNames;
|
private final List<String> mapNames;
|
||||||
private final ConcurrentHashMap<Integer, Room> activeRooms;
|
private final ConcurrentHashMap<Integer, Room> activeRooms;
|
||||||
@ -151,9 +152,8 @@ public class RoomManager {
|
|||||||
|
|
||||||
public THashMap<Integer, List<Room>> findRooms(NavigatorFilterField filterField, String value, int category, boolean showInvisible) {
|
public THashMap<Integer, List<Room>> findRooms(NavigatorFilterField filterField, String value, int category, boolean showInvisible) {
|
||||||
THashMap<Integer, List<Room>> rooms = new THashMap<>();
|
THashMap<Integer, List<Room>> rooms = new THashMap<>();
|
||||||
String query = filterField.getDatabaseQuery() + " AND rooms.state NOT LIKE " + (showInvisible ? "''" : "'invisible'") + (category >= 0 ? "AND rooms.category = '" + category + "'" : "") + " ORDER BY rooms.users, rooms.id DESC LIMIT " + (/* TODO: This is always 0?*/page * NavigatorManager.MAXIMUM_RESULTS_PER_PAGE) + "" + ((page * NavigatorManager.MAXIMUM_RESULTS_PER_PAGE) + NavigatorManager.MAXIMUM_RESULTS_PER_PAGE);
|
String query = filterField.getDatabaseQuery() + " AND rooms.state NOT LIKE " + (showInvisible ? "''" : "'invisible'") + (category >= 0 ? "AND rooms.category = '" + category + "'" : "") + " ORDER BY rooms.users, rooms.id DESC LIMIT " + NavigatorManager.MAXIMUM_RESULTS_PER_PAGE;
|
||||||
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement(query)) {
|
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement(query)) {
|
||||||
statement.setString(1, (filterField.getComparator() == NavigatorFilterComparator.EQUALS ? value : "%" + value + "%"));
|
|
||||||
try (ResultSet set = statement.executeQuery()) {
|
try (ResultSet set = statement.executeQuery()) {
|
||||||
while (set.next()) {
|
while (set.next()) {
|
||||||
Room room = this.activeRooms.get(set.getInt("id"));
|
Room room = this.activeRooms.get(set.getInt("id"));
|
||||||
@ -178,32 +178,15 @@ public class RoomManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public RoomCategory getCategory(int id) {
|
public RoomCategory getCategory(int id) {
|
||||||
for (RoomCategory category : this.roomCategories.values()) {
|
return roomCategories.values().stream().filter(c -> c.getId() == id).findFirst().orElse(null);
|
||||||
if (category.getId() == id)
|
|
||||||
return category;
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public RoomCategory getCategory(String name) {
|
public RoomCategory getCategory(String name) {
|
||||||
for (RoomCategory category : this.roomCategories.values()) {
|
return roomCategories.values().stream().filter(c -> c.getCaption().equalsIgnoreCase(name)).findFirst().orElse(null);
|
||||||
if (category.getCaption().equalsIgnoreCase(name)) {
|
|
||||||
return category;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public RoomCategory getCategoryBySafeCaption(String safeCaption) {
|
public RoomCategory getCategoryBySafeCaption(String safeCaption) {
|
||||||
for (RoomCategory category : this.roomCategories.values()) {
|
return roomCategories.values().stream().filter(c -> c.getCaptionSave().equalsIgnoreCase(safeCaption)).findFirst().orElse(null);
|
||||||
if (category.getCaptionSave().equalsIgnoreCase(safeCaption)) {
|
|
||||||
return category;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<RoomCategory> roomCategoriesForHabbo(Habbo habbo) {
|
public List<RoomCategory> roomCategoriesForHabbo(Habbo habbo) {
|
||||||
@ -219,19 +202,7 @@ public class RoomManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasCategory(int categoryId, Habbo habbo) {
|
public boolean hasCategory(int categoryId, Habbo habbo) {
|
||||||
for (RoomCategory category : this.roomCategories.values()) {
|
return roomCategories.values().stream().anyMatch(c -> c.getId() == categoryId && c.getMinRank() <= habbo.getHabboInfo().getRank().getId());
|
||||||
if (category.getId() == categoryId) {
|
|
||||||
if (category.getMinRank() <= habbo.getHabboInfo().getRank().getId()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public THashMap<Integer, RoomCategory> getRoomCategories() {
|
|
||||||
return this.roomCategories;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Room> getRoomsByScore() {
|
public List<Room> getRoomsByScore() {
|
||||||
@ -294,10 +265,8 @@ public class RoomManager {
|
|||||||
if (this.activeRooms.containsKey(id)) {
|
if (this.activeRooms.containsKey(id)) {
|
||||||
room = this.activeRooms.get(id);
|
room = this.activeRooms.get(id);
|
||||||
|
|
||||||
if (loadData) {
|
if (loadData && (room.isPreLoaded() && !room.isLoaded())) {
|
||||||
if (room.isPreLoaded() && !room.isLoaded()) {
|
room.loadData();
|
||||||
room.loadData();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return room;
|
return room;
|
||||||
@ -602,7 +571,8 @@ public class RoomManager {
|
|||||||
habbo.getRoomUnit().clearStatus();
|
habbo.getRoomUnit().clearStatus();
|
||||||
if (habbo.getRoomUnit().getCurrentLocation() == null) {
|
if (habbo.getRoomUnit().getCurrentLocation() == null) {
|
||||||
habbo.getRoomUnit().setLocation(doorLocation != null ? doorLocation : room.getLayout().getDoorTile());
|
habbo.getRoomUnit().setLocation(doorLocation != null ? doorLocation : room.getLayout().getDoorTile());
|
||||||
if (habbo.getRoomUnit().getCurrentLocation() != null) habbo.getRoomUnit().setZ(habbo.getRoomUnit().getCurrentLocation().getStackHeight());
|
if (habbo.getRoomUnit().getCurrentLocation() != null)
|
||||||
|
habbo.getRoomUnit().setZ(habbo.getRoomUnit().getCurrentLocation().getStackHeight());
|
||||||
|
|
||||||
if (doorLocation == null) {
|
if (doorLocation == null) {
|
||||||
habbo.getRoomUnit().setBodyRotation(RoomUserRotation.values()[room.getLayout().getDoorDirection()]);
|
habbo.getRoomUnit().setBodyRotation(RoomUserRotation.values()[room.getLayout().getDoorDirection()]);
|
||||||
@ -899,10 +869,10 @@ public class RoomManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (room.hasActiveWordQuiz()) {
|
if (room.hasActiveWordQuiz()) {
|
||||||
habbo.getClient().sendResponse(new QuestionComposer((Emulator.getIntUnixTimestamp() - room.wordQuizEnd) * 1000, room.wordQuiz));
|
habbo.getClient().sendResponse(new QuestionComposer((Emulator.getIntUnixTimestamp() - room.getWordQuizEnd()) * 1000, room.getWordQuiz()));
|
||||||
|
|
||||||
if (room.hasVotedInWordQuiz(habbo)) {
|
if (room.hasVotedInWordQuiz(habbo)) {
|
||||||
habbo.getClient().sendResponse(new QuestionFinishedComposer(room.noVotes, room.yesVotes));
|
habbo.getClient().sendResponse(new QuestionFinishedComposer(room.getNoVotes(), room.getYesVotes()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,6 +22,9 @@ import com.eu.habbo.util.pathfinding.Rotation;
|
|||||||
import gnu.trove.map.TMap;
|
import gnu.trove.map.TMap;
|
||||||
import gnu.trove.map.hash.THashMap;
|
import gnu.trove.map.hash.THashMap;
|
||||||
import gnu.trove.set.hash.THashSet;
|
import gnu.trove.set.hash.THashSet;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@ -35,6 +38,7 @@ public class RoomUnit {
|
|||||||
public boolean isWiredTeleporting = false;
|
public boolean isWiredTeleporting = false;
|
||||||
public boolean isLeavingTeleporter = false;
|
public boolean isLeavingTeleporter = false;
|
||||||
public boolean isSwimming = false;
|
public boolean isSwimming = false;
|
||||||
|
@Getter
|
||||||
private final ConcurrentHashMap<RoomUnitStatus, String> status;
|
private final ConcurrentHashMap<RoomUnitStatus, String> status;
|
||||||
private final THashMap<String, Object> cacheable;
|
private final THashMap<String, Object> cacheable;
|
||||||
public boolean canRotate = true;
|
public boolean canRotate = true;
|
||||||
@ -48,22 +52,42 @@ public class RoomUnit {
|
|||||||
public boolean isKicked;
|
public boolean isKicked;
|
||||||
public int kickCount = 0;
|
public int kickCount = 0;
|
||||||
private int id;
|
private int id;
|
||||||
|
@Getter
|
||||||
private RoomTile startLocation;
|
private RoomTile startLocation;
|
||||||
|
@Getter
|
||||||
private RoomTile previousLocation;
|
private RoomTile previousLocation;
|
||||||
|
@Getter
|
||||||
|
@Setter @Accessors(chain = true)
|
||||||
private double previousLocationZ;
|
private double previousLocationZ;
|
||||||
private RoomTile currentLocation;
|
private RoomTile currentLocation;
|
||||||
|
@Getter
|
||||||
private RoomTile goalLocation;
|
private RoomTile goalLocation;
|
||||||
|
@Getter
|
||||||
private double z;
|
private double z;
|
||||||
private int tilesWalked;
|
private int tilesWalked;
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
private boolean inRoom;
|
private boolean inRoom;
|
||||||
|
@Setter
|
||||||
|
@Accessors(chain = true)
|
||||||
private boolean canWalk;
|
private boolean canWalk;
|
||||||
|
@Setter
|
||||||
|
@Getter
|
||||||
private boolean fastWalk = false;
|
private boolean fastWalk = false;
|
||||||
private boolean statusUpdate = false;
|
private boolean statusUpdate = false;
|
||||||
private boolean invisible = false;
|
private boolean invisible = false;
|
||||||
private boolean canLeaveRoomByDoor = true;
|
private boolean canLeaveRoomByDoor = true;
|
||||||
|
@Setter
|
||||||
private RoomUserRotation bodyRotation = RoomUserRotation.NORTH;
|
private RoomUserRotation bodyRotation = RoomUserRotation.NORTH;
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
private RoomUserRotation headRotation = RoomUserRotation.NORTH;
|
private RoomUserRotation headRotation = RoomUserRotation.NORTH;
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
private DanceType danceType;
|
private DanceType danceType;
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Accessors(chain = true)
|
||||||
private RoomUnitType roomUnitType;
|
private RoomUnitType roomUnitType;
|
||||||
private Deque<RoomTile> path = new LinkedList<>();
|
private Deque<RoomTile> path = new LinkedList<>();
|
||||||
private int handItem;
|
private int handItem;
|
||||||
@ -129,7 +153,7 @@ public class RoomUnit {
|
|||||||
|
|
||||||
if (rider != null) {
|
if (rider != null) {
|
||||||
// copy things from rider
|
// copy things from rider
|
||||||
if (this.status.containsKey(RoomUnitStatus.MOVE) && !rider.getRoomUnit().getStatusMap().containsKey(RoomUnitStatus.MOVE)) {
|
if (this.status.containsKey(RoomUnitStatus.MOVE) && !rider.getRoomUnit().getStatus().containsKey(RoomUnitStatus.MOVE)) {
|
||||||
this.status.remove(RoomUnitStatus.MOVE);
|
this.status.remove(RoomUnitStatus.MOVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -341,7 +365,7 @@ public class RoomUnit {
|
|||||||
this.setZ(zHeight - 1.0);
|
this.setZ(zHeight - 1.0);
|
||||||
ridingUnit.setRotation(RoomUserRotation.values()[Rotation.Calculate(this.getX(), this.getY(), next.getX(), next.getY())]);
|
ridingUnit.setRotation(RoomUserRotation.values()[Rotation.Calculate(this.getX(), this.getY(), next.getX(), next.getY())]);
|
||||||
ridingUnit.setPreviousLocation(this.getCurrentLocation());
|
ridingUnit.setPreviousLocation(this.getCurrentLocation());
|
||||||
ridingUnit.setGoalLocation(this.getGoal());
|
ridingUnit.setGoalLocation(this.getGoalLocation());
|
||||||
ridingUnit.setStatus(RoomUnitStatus.MOVE, next.getX() + "," + next.getY() + "," + (zHeight - 1.0));
|
ridingUnit.setStatus(RoomUnitStatus.MOVE, next.getX() + "," + next.getY() + "," + (zHeight - 1.0));
|
||||||
room.sendComposer(new UserUpdateComposer(ridingUnit).compose());
|
room.sendComposer(new UserUpdateComposer(ridingUnit).compose());
|
||||||
//ridingUnit.setZ(zHeight - 1.0);
|
//ridingUnit.setZ(zHeight - 1.0);
|
||||||
@ -404,10 +428,6 @@ public class RoomUnit {
|
|||||||
return this.currentLocation.getY();
|
return this.currentLocation.getY();
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getZ() {
|
|
||||||
return this.z;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setZ(double z) {
|
public void setZ(double z) {
|
||||||
this.z = z;
|
this.z = z;
|
||||||
|
|
||||||
@ -419,22 +439,6 @@ public class RoomUnit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized boolean isInRoom() {
|
|
||||||
return this.inRoom;
|
|
||||||
}
|
|
||||||
|
|
||||||
public synchronized void setInRoom(boolean inRoom) {
|
|
||||||
this.inRoom = inRoom;
|
|
||||||
}
|
|
||||||
|
|
||||||
public synchronized RoomUnitType getRoomUnitType() {
|
|
||||||
return this.roomUnitType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public synchronized void setRoomUnitType(RoomUnitType roomUnitType) {
|
|
||||||
this.roomUnitType = roomUnitType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRotation(RoomUserRotation rotation) {
|
public void setRotation(RoomUserRotation rotation) {
|
||||||
this.bodyRotation = rotation;
|
this.bodyRotation = rotation;
|
||||||
this.headRotation = rotation;
|
this.headRotation = rotation;
|
||||||
@ -444,60 +448,19 @@ public class RoomUnit {
|
|||||||
return this.bodyRotation;
|
return this.bodyRotation;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBodyRotation(RoomUserRotation bodyRotation) {
|
|
||||||
this.bodyRotation = bodyRotation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public RoomUserRotation getHeadRotation() {
|
|
||||||
return this.headRotation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setHeadRotation(RoomUserRotation headRotation) {
|
|
||||||
this.headRotation = headRotation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public synchronized DanceType getDanceType() {
|
|
||||||
return this.danceType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public synchronized void setDanceType(DanceType danceType) {
|
|
||||||
this.danceType = danceType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCanWalk(boolean value) {
|
|
||||||
this.canWalk = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean canWalk() {
|
public boolean canWalk() {
|
||||||
return this.canWalk;
|
return this.canWalk;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isFastWalk() {
|
|
||||||
return this.fastWalk;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFastWalk(boolean fastWalk) {
|
|
||||||
this.fastWalk = fastWalk;
|
|
||||||
}
|
|
||||||
|
|
||||||
public RoomTile getStartLocation() {
|
|
||||||
return this.startLocation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int tilesWalked() {
|
public int tilesWalked() {
|
||||||
return this.tilesWalked;
|
return this.tilesWalked;
|
||||||
}
|
}
|
||||||
|
|
||||||
public RoomTile getGoal() {
|
public RoomUnit setGoalLocation(RoomTile goalLocation) {
|
||||||
return this.goalLocation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGoalLocation(RoomTile goalLocation) {
|
|
||||||
if (goalLocation != null) {
|
if (goalLocation != null) {
|
||||||
// if (goalLocation.state != RoomTileState.INVALID) {
|
|
||||||
this.setGoalLocation(goalLocation, false);
|
this.setGoalLocation(goalLocation, false);
|
||||||
}
|
}
|
||||||
//}
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setGoalLocation(RoomTile goalLocation, boolean noReset) {
|
public void setGoalLocation(RoomTile goalLocation, boolean noReset) {
|
||||||
@ -525,17 +488,14 @@ public class RoomUnit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLocation(RoomTile location) {
|
public RoomUnit setLocation(RoomTile location) {
|
||||||
if (location != null) {
|
if (location != null) {
|
||||||
this.startLocation = location;
|
this.startLocation = location;
|
||||||
setPreviousLocation(location);
|
setPreviousLocation(location);
|
||||||
setCurrentLocation(location);
|
setCurrentLocation(location);
|
||||||
this.goalLocation = location;
|
this.goalLocation = location;
|
||||||
}
|
}
|
||||||
}
|
return this;
|
||||||
|
|
||||||
public RoomTile getPreviousLocation() {
|
|
||||||
return this.previousLocation;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPreviousLocation(RoomTile previousLocation) {
|
public void setPreviousLocation(RoomTile previousLocation) {
|
||||||
@ -543,16 +503,9 @@ public class RoomUnit {
|
|||||||
this.previousLocationZ = this.z;
|
this.previousLocationZ = this.z;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getPreviousLocationZ() {
|
public RoomUnit setPathFinderRoom(Room room) {
|
||||||
return this.previousLocationZ;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPreviousLocationZ(double z) {
|
|
||||||
this.previousLocationZ = z;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPathFinderRoom(Room room) {
|
|
||||||
this.room = room;
|
this.room = room;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void findPath() {
|
public void findPath() {
|
||||||
@ -574,10 +527,6 @@ public class RoomUnit {
|
|||||||
return this.status.get(key);
|
return this.status.get(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConcurrentHashMap<RoomUnitStatus, String> getStatusMap() {
|
|
||||||
return this.status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void removeStatus(RoomUnitStatus key) {
|
public void removeStatus(RoomUnitStatus key) {
|
||||||
this.status.remove(key);
|
this.status.remove(key);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.eu.habbo.habbohotel.users;
|
package com.eu.habbo.habbohotel.users;
|
||||||
|
|
||||||
import com.eu.habbo.Emulator;
|
import com.eu.habbo.Emulator;
|
||||||
|
import com.eu.habbo.database.DatabaseConstants;
|
||||||
import com.eu.habbo.habbohotel.catalog.CatalogItem;
|
import com.eu.habbo.habbohotel.catalog.CatalogItem;
|
||||||
import com.eu.habbo.habbohotel.games.Game;
|
import com.eu.habbo.habbohotel.games.Game;
|
||||||
import com.eu.habbo.habbohotel.games.GamePlayer;
|
import com.eu.habbo.habbohotel.games.GamePlayer;
|
||||||
@ -211,7 +212,7 @@ public class HabboInfo implements Runnable {
|
|||||||
statement.setInt(1, this.id);
|
statement.setInt(1, this.id);
|
||||||
try (ResultSet set = statement.executeQuery()) {
|
try (ResultSet set = statement.executeQuery()) {
|
||||||
while (set.next()) {
|
while (set.next()) {
|
||||||
this.messengerCategories.add(new MessengerCategory(set.getString("name"), set.getInt("user_id"), set.getInt("id")));
|
this.messengerCategories.add(new MessengerCategory(set.getString("name"), set.getInt(DatabaseConstants.USER_ID), set.getInt("id")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.eu.habbo.habbohotel.users;
|
package com.eu.habbo.habbohotel.users;
|
||||||
|
|
||||||
import com.eu.habbo.Emulator;
|
import com.eu.habbo.Emulator;
|
||||||
|
import com.eu.habbo.database.DatabaseConstants;
|
||||||
import com.eu.habbo.habbohotel.achievements.Achievement;
|
import com.eu.habbo.habbohotel.achievements.Achievement;
|
||||||
import com.eu.habbo.habbohotel.achievements.AchievementManager;
|
import com.eu.habbo.habbohotel.achievements.AchievementManager;
|
||||||
import com.eu.habbo.habbohotel.bots.Bot;
|
import com.eu.habbo.habbohotel.bots.Bot;
|
||||||
@ -21,6 +22,7 @@ import com.eu.habbo.messages.outgoing.users.FigureUpdateComposer;
|
|||||||
import gnu.trove.set.hash.THashSet;
|
import gnu.trove.set.hash.THashSet;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
import org.apache.commons.math3.util.Pair;
|
import org.apache.commons.math3.util.Pair;
|
||||||
@ -70,6 +72,7 @@ public abstract class HabboItem implements Runnable, IEventTriggers {
|
|||||||
private int rotation;
|
private int rotation;
|
||||||
@Setter
|
@Setter
|
||||||
@Getter
|
@Getter
|
||||||
|
@Accessors(chain = true)
|
||||||
private String extradata;
|
private String extradata;
|
||||||
@Getter
|
@Getter
|
||||||
private int limitedStack;
|
private int limitedStack;
|
||||||
@ -81,7 +84,7 @@ public abstract class HabboItem implements Runnable, IEventTriggers {
|
|||||||
|
|
||||||
public HabboItem(ResultSet set, Item baseItem) throws SQLException {
|
public HabboItem(ResultSet set, Item baseItem) throws SQLException {
|
||||||
this.id = set.getInt("id");
|
this.id = set.getInt("id");
|
||||||
this.userId = set.getInt("user_id");
|
this.userId = set.getInt(DatabaseConstants.USER_ID);
|
||||||
this.roomId = set.getInt("room_id");
|
this.roomId = set.getInt("room_id");
|
||||||
this.baseItem = baseItem;
|
this.baseItem = baseItem;
|
||||||
this.wallPosition = set.getString("wall_pos");
|
this.wallPosition = set.getString("wall_pos");
|
||||||
@ -260,7 +263,7 @@ public abstract class HabboItem implements Runnable, IEventTriggers {
|
|||||||
room.sendComposer(new DanceMessageComposer(roomUnit).compose());
|
room.sendComposer(new DanceMessageComposer(roomUnit).compose());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.getBaseItem().getClothingOnWalk().isEmpty() && roomUnit.getPreviousLocation() != roomUnit.getGoal() && roomUnit.getGoal() == room.getLayout().getTile(this.x, this.y)) {
|
if (!this.getBaseItem().getClothingOnWalk().isEmpty() && roomUnit.getPreviousLocation() != roomUnit.getGoalLocation() && roomUnit.getGoalLocation() == room.getLayout().getTile(this.x, this.y)) {
|
||||||
Habbo habbo = room.getHabbo(roomUnit);
|
Habbo habbo = room.getHabbo(roomUnit);
|
||||||
|
|
||||||
if (habbo != null && habbo.getClient() != null) {
|
if (habbo != null && habbo.getClient() != null) {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.eu.habbo.habbohotel.users;
|
package com.eu.habbo.habbohotel.users;
|
||||||
|
|
||||||
import com.eu.habbo.Emulator;
|
import com.eu.habbo.Emulator;
|
||||||
|
import com.eu.habbo.database.DatabaseConstants;
|
||||||
import com.eu.habbo.habbohotel.navigation.DisplayMode;
|
import com.eu.habbo.habbohotel.navigation.DisplayMode;
|
||||||
import com.eu.habbo.habbohotel.navigation.ListMode;
|
import com.eu.habbo.habbohotel.navigation.ListMode;
|
||||||
import gnu.trove.map.hash.THashMap;
|
import gnu.trove.map.hash.THashMap;
|
||||||
@ -32,7 +33,7 @@ public class HabboNavigatorWindowSettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public HabboNavigatorWindowSettings(ResultSet set) throws SQLException {
|
public HabboNavigatorWindowSettings(ResultSet set) throws SQLException {
|
||||||
this.userId = set.getInt("user_id");
|
this.userId = set.getInt(DatabaseConstants.USER_ID);
|
||||||
this.x = set.getInt("x");
|
this.x = set.getInt("x");
|
||||||
this.y = set.getInt("y");
|
this.y = set.getInt("y");
|
||||||
this.width = set.getInt("width");
|
this.width = set.getInt("width");
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.eu.habbo.habbohotel.users.cache;
|
package com.eu.habbo.habbohotel.users.cache;
|
||||||
|
|
||||||
import com.eu.habbo.Emulator;
|
import com.eu.habbo.Emulator;
|
||||||
|
import com.eu.habbo.database.DatabaseConstants;
|
||||||
import com.eu.habbo.habbohotel.users.Habbo;
|
import com.eu.habbo.habbohotel.users.Habbo;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@ -24,7 +25,7 @@ public class HabboOfferPurchase {
|
|||||||
private boolean needsUpdate = false;
|
private boolean needsUpdate = false;
|
||||||
|
|
||||||
public HabboOfferPurchase(ResultSet set) throws SQLException {
|
public HabboOfferPurchase(ResultSet set) throws SQLException {
|
||||||
this.userId = set.getInt("user_id");
|
this.userId = set.getInt(DatabaseConstants.USER_ID);
|
||||||
this.offerId = set.getInt("offer_id");
|
this.offerId = set.getInt("offer_id");
|
||||||
this.state = set.getInt("state");
|
this.state = set.getInt("state");
|
||||||
this.amount = set.getInt("amount");
|
this.amount = set.getInt("amount");
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.eu.habbo.habbohotel.users.inventory;
|
package com.eu.habbo.habbohotel.users.inventory;
|
||||||
|
|
||||||
import com.eu.habbo.Emulator;
|
import com.eu.habbo.Emulator;
|
||||||
|
import com.eu.habbo.database.DatabaseConstants;
|
||||||
import com.eu.habbo.habbohotel.users.Habbo;
|
import com.eu.habbo.habbohotel.users.Habbo;
|
||||||
import com.eu.habbo.messages.outgoing.inventory.AvatarEffectActivatedMessageComposer;
|
import com.eu.habbo.messages.outgoing.inventory.AvatarEffectActivatedMessageComposer;
|
||||||
import com.eu.habbo.messages.outgoing.inventory.AvatarEffectAddedMessageComposer;
|
import com.eu.habbo.messages.outgoing.inventory.AvatarEffectAddedMessageComposer;
|
||||||
@ -165,7 +166,7 @@ public class EffectsComponent {
|
|||||||
|
|
||||||
public HabboEffect(ResultSet set) throws SQLException {
|
public HabboEffect(ResultSet set) throws SQLException {
|
||||||
this.effect = set.getInt("effect");
|
this.effect = set.getInt("effect");
|
||||||
this.userId = set.getInt("user_id");
|
this.userId = set.getInt(DatabaseConstants.USER_ID);
|
||||||
this.duration = set.getInt("duration");
|
this.duration = set.getInt("duration");
|
||||||
this.activationTimestamp = set.getInt("activation_timestamp");
|
this.activationTimestamp = set.getInt("activation_timestamp");
|
||||||
this.total = set.getInt("total");
|
this.total = set.getInt("total");
|
||||||
|
@ -2,6 +2,7 @@ package com.eu.habbo.habbohotel.users.subscriptions;
|
|||||||
|
|
||||||
import com.eu.habbo.Emulator;
|
import com.eu.habbo.Emulator;
|
||||||
import com.eu.habbo.database.Database;
|
import com.eu.habbo.database.Database;
|
||||||
|
import com.eu.habbo.database.DatabaseConstants;
|
||||||
import com.eu.habbo.habbohotel.achievements.Achievement;
|
import com.eu.habbo.habbohotel.achievements.Achievement;
|
||||||
import com.eu.habbo.habbohotel.achievements.AchievementManager;
|
import com.eu.habbo.habbohotel.achievements.AchievementManager;
|
||||||
import com.eu.habbo.habbohotel.messenger.Messenger;
|
import com.eu.habbo.habbohotel.messenger.Messenger;
|
||||||
@ -265,7 +266,7 @@ public class SubscriptionHabboClub extends Subscription {
|
|||||||
try (ResultSet set = statement.executeQuery()) {
|
try (ResultSet set = statement.executeQuery()) {
|
||||||
while (set.next()) {
|
while (set.next()) {
|
||||||
try {
|
try {
|
||||||
int userId = set.getInt("user_id");
|
int userId = set.getInt(DatabaseConstants.USER_ID);
|
||||||
HabboInfo habboInfo = Emulator.getGameEnvironment().getHabboManager().getHabboInfo(userId);
|
HabboInfo habboInfo = Emulator.getGameEnvironment().getHabboManager().getHabboInfo(userId);
|
||||||
HabboStats stats = habboInfo.getHabboStats();
|
HabboStats stats = habboInfo.getHabboStats();
|
||||||
ScrSendKickbackInfoMessageComposer calculated = calculatePayday(habboInfo);
|
ScrSendKickbackInfoMessageComposer calculated = calculatePayday(habboInfo);
|
||||||
@ -278,7 +279,7 @@ public class SubscriptionHabboClub extends Subscription {
|
|||||||
stats.setLastHCPayday(timestampNow);
|
stats.setLastHCPayday(timestampNow);
|
||||||
Emulator.getThreading().run(stats);
|
Emulator.getThreading().run(stats);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Exception processing HC payday for user #" + set.getInt("user_id"), e);
|
log.error("Exception processing HC payday for user #" + set.getInt(DatabaseConstants.USER_ID), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -328,7 +329,7 @@ public class SubscriptionHabboClub extends Subscription {
|
|||||||
while (set.next()) {
|
while (set.next()) {
|
||||||
try {
|
try {
|
||||||
int logId = set.getInt("id");
|
int logId = set.getInt("id");
|
||||||
int userId = set.getInt("user_id");
|
int userId = set.getInt(DatabaseConstants.USER_ID);
|
||||||
int totalPayout = set.getInt("total_payout");
|
int totalPayout = set.getInt("total_payout");
|
||||||
String currency = set.getString("currency");
|
String currency = set.getString("currency");
|
||||||
|
|
||||||
@ -339,7 +340,7 @@ public class SubscriptionHabboClub extends Subscription {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Exception processing HC payday for user #" + set.getInt("user_id"), e);
|
log.error("Exception processing HC payday for user #" + set.getInt(DatabaseConstants.USER_ID), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.eu.habbo.habbohotel.users.subscriptions;
|
package com.eu.habbo.habbohotel.users.subscriptions;
|
||||||
|
|
||||||
import com.eu.habbo.Emulator;
|
import com.eu.habbo.Emulator;
|
||||||
|
import com.eu.habbo.database.DatabaseConstants;
|
||||||
import gnu.trove.map.hash.THashMap;
|
import gnu.trove.map.hash.THashMap;
|
||||||
import gnu.trove.set.hash.THashSet;
|
import gnu.trove.set.hash.THashSet;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
@ -67,7 +68,7 @@ public class SubscriptionManager {
|
|||||||
Class<? extends Subscription> subClazz = Emulator.getGameEnvironment().getSubscriptionManager().getSubscriptionClass(set.getString("subscription_type"));
|
Class<? extends Subscription> subClazz = Emulator.getGameEnvironment().getSubscriptionManager().getSubscriptionClass(set.getString("subscription_type"));
|
||||||
Constructor<? extends Subscription> c = subClazz.getConstructor(Integer.class, Integer.class, String.class, Integer.class, Integer.class, Boolean.class);
|
Constructor<? extends Subscription> c = subClazz.getConstructor(Integer.class, Integer.class, String.class, Integer.class, Integer.class, Boolean.class);
|
||||||
c.setAccessible(true);
|
c.setAccessible(true);
|
||||||
Subscription subscription = c.newInstance(set.getInt("id"), set.getInt("user_id"), set.getString("subscription_type"), set.getInt("timestamp_start"), set.getInt("duration"), set.getInt("active") == 1);
|
Subscription subscription = c.newInstance(set.getInt("id"), set.getInt(DatabaseConstants.USER_ID), set.getString("subscription_type"), set.getInt("timestamp_start"), set.getInt("duration"), set.getInt("active") == 1);
|
||||||
subscriptions.add(subscription);
|
subscriptions.add(subscription);
|
||||||
}
|
}
|
||||||
} catch (IllegalAccessException e) {
|
} catch (IllegalAccessException e) {
|
||||||
|
@ -109,7 +109,7 @@ public class UseFurnitureEvent extends MessageHandler {
|
|||||||
room.sendComposer(new RemoveFloorItemComposer(item, true).compose());
|
room.sendComposer(new RemoveFloorItemComposer(item, true).compose());
|
||||||
room.removeHabboItem(item);
|
room.removeHabboItem(item);
|
||||||
room.updateTile(room.getLayout().getTile(item.getX(), item.getY()));
|
room.updateTile(room.getLayout().getTile(item.getX(), item.getY()));
|
||||||
room.placePet(pet, item.getX(), item.getY(), item.getZ(), item.getRotation());
|
room.placePet(pet, item.getX(), item.getY(), item.getZ());
|
||||||
pet.cycle();
|
pet.cycle();
|
||||||
room.sendComposer(new UserUpdateComposer(pet.getRoomUnit()).compose());
|
room.sendComposer(new UserUpdateComposer(pet.getRoomUnit()).compose());
|
||||||
return;
|
return;
|
||||||
|
@ -52,7 +52,7 @@ public class OpenPetPackageEvent extends MessageHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (pet != null) {
|
if (pet != null) {
|
||||||
room.placePet(pet, item.getX(), item.getY(), item.getZ(), item.getRotation());
|
room.placePet(pet, item.getX(), item.getY(), item.getZ());
|
||||||
pet.setUserId(this.client.getHabbo().getHabboInfo().getId());
|
pet.setUserId(this.client.getHabbo().getHabboInfo().getId());
|
||||||
pet.needsUpdate = true;
|
pet.needsUpdate = true;
|
||||||
pet.getRoomUnit().setLocation(room.getLayout().getTile(item.getX(), item.getY()));
|
pet.getRoomUnit().setLocation(room.getLayout().getTile(item.getX(), item.getY()));
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.eu.habbo.messages.outgoing.modtool;
|
package com.eu.habbo.messages.outgoing.modtool;
|
||||||
|
|
||||||
import com.eu.habbo.Emulator;
|
import com.eu.habbo.Emulator;
|
||||||
|
import com.eu.habbo.database.DatabaseConstants;
|
||||||
import com.eu.habbo.habbohotel.modtool.ModToolSanctionItem;
|
import com.eu.habbo.habbohotel.modtool.ModToolSanctionItem;
|
||||||
import com.eu.habbo.habbohotel.modtool.ModToolSanctionLevelItem;
|
import com.eu.habbo.habbohotel.modtool.ModToolSanctionLevelItem;
|
||||||
import com.eu.habbo.habbohotel.modtool.ModToolSanctions;
|
import com.eu.habbo.habbohotel.modtool.ModToolSanctions;
|
||||||
@ -31,7 +32,7 @@ public class ModeratorUserInfoComposer extends MessageComposer {
|
|||||||
|
|
||||||
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection();
|
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection();
|
||||||
PreparedStatement statement = connection.prepareStatement("SELECT COUNT(*) AS amount FROM bans WHERE user_id = ?")) {
|
PreparedStatement statement = connection.prepareStatement("SELECT COUNT(*) AS amount FROM bans WHERE user_id = ?")) {
|
||||||
statement.setInt(1, this.set.getInt("user_id"));
|
statement.setInt(1, this.set.getInt(DatabaseConstants.USER_ID));
|
||||||
try (ResultSet set = statement.executeQuery()) {
|
try (ResultSet set = statement.executeQuery()) {
|
||||||
if (set.next()) {
|
if (set.next()) {
|
||||||
totalBans = set.getInt("amount");
|
totalBans = set.getInt("amount");
|
||||||
@ -43,7 +44,7 @@ public class ModeratorUserInfoComposer extends MessageComposer {
|
|||||||
log.error("Caught SQL exception", e);
|
log.error("Caught SQL exception", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.response.appendInt(this.set.getInt("user_id"));
|
this.response.appendInt(this.set.getInt(DatabaseConstants.USER_ID));
|
||||||
this.response.appendString(this.set.getString("username"));
|
this.response.appendString(this.set.getString("username"));
|
||||||
this.response.appendString(this.set.getString("look"));
|
this.response.appendString(this.set.getString("look"));
|
||||||
this.response.appendInt((Emulator.getIntUnixTimestamp() - this.set.getInt("account_created")) / 60);
|
this.response.appendInt((Emulator.getIntUnixTimestamp() - this.set.getInt("account_created")) / 60);
|
||||||
@ -56,7 +57,7 @@ public class ModeratorUserInfoComposer extends MessageComposer {
|
|||||||
this.response.appendInt(this.set.getInt("tradelock_amount"));
|
this.response.appendInt(this.set.getInt("tradelock_amount"));
|
||||||
this.response.appendString(""); //Trading lock expiry timestamp
|
this.response.appendString(""); //Trading lock expiry timestamp
|
||||||
this.response.appendString(""); //Last Purchase Timestamp
|
this.response.appendString(""); //Last Purchase Timestamp
|
||||||
this.response.appendInt(this.set.getInt("user_id")); //Personal Identification #
|
this.response.appendInt(this.set.getInt(DatabaseConstants.USER_ID)); //Personal Identification #
|
||||||
this.response.appendInt(0); // Number of account bans
|
this.response.appendInt(0); // Number of account bans
|
||||||
this.response.appendString(this.set.getBoolean("hide_mail") ? "" : this.set.getString("mail"));
|
this.response.appendString(this.set.getBoolean("hide_mail") ? "" : this.set.getString("mail"));
|
||||||
this.response.appendString("Rank (" + this.set.getInt("rank_id") + "): " + this.set.getString("rank_name")); //user_class_txt
|
this.response.appendString("Rank (" + this.set.getInt("rank_id") + "): " + this.set.getString("rank_name")); //user_class_txt
|
||||||
@ -64,8 +65,8 @@ public class ModeratorUserInfoComposer extends MessageComposer {
|
|||||||
ModToolSanctions modToolSanctions = Emulator.getGameEnvironment().getModToolSanctions();
|
ModToolSanctions modToolSanctions = Emulator.getGameEnvironment().getModToolSanctions();
|
||||||
|
|
||||||
if (Emulator.getConfig().getBoolean("hotel.sanctions.enabled")) {
|
if (Emulator.getConfig().getBoolean("hotel.sanctions.enabled")) {
|
||||||
THashMap<Integer, ArrayList<ModToolSanctionItem>> modToolSanctionItemsHashMap = Emulator.getGameEnvironment().getModToolSanctions().getSanctions(this.set.getInt("user_id"));
|
THashMap<Integer, ArrayList<ModToolSanctionItem>> modToolSanctionItemsHashMap = Emulator.getGameEnvironment().getModToolSanctions().getSanctions(this.set.getInt(DatabaseConstants.USER_ID));
|
||||||
ArrayList<ModToolSanctionItem> modToolSanctionItems = modToolSanctionItemsHashMap.get(this.set.getInt("user_id"));
|
ArrayList<ModToolSanctionItem> modToolSanctionItems = modToolSanctionItemsHashMap.get(this.set.getInt(DatabaseConstants.USER_ID));
|
||||||
|
|
||||||
if (modToolSanctionItems != null && modToolSanctionItems.size() > 0) //has sanction
|
if (modToolSanctionItems != null && modToolSanctionItems.size() > 0) //has sanction
|
||||||
{
|
{
|
||||||
|
@ -8,9 +8,9 @@ import com.eu.habbo.messages.outgoing.Outgoing;
|
|||||||
import gnu.trove.iterator.TIntObjectIterator;
|
import gnu.trove.iterator.TIntObjectIterator;
|
||||||
import gnu.trove.map.TIntObjectMap;
|
import gnu.trove.map.TIntObjectMap;
|
||||||
import gnu.trove.map.hash.THashMap;
|
import gnu.trove.map.hash.THashMap;
|
||||||
import gnu.trove.set.hash.THashSet;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.NoSuchElementException;
|
import java.util.NoSuchElementException;
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ public class ItemsComposer extends MessageComposer {
|
|||||||
this.response.appendString(set.getValue());
|
this.response.appendString(set.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
THashSet<HabboItem> items = this.room.getWallItems();
|
List<HabboItem> items = this.room.getWallItems();
|
||||||
|
|
||||||
this.response.appendInt(items.size());
|
this.response.appendInt(items.size());
|
||||||
for (HabboItem item : items) {
|
for (HabboItem item : items) {
|
||||||
|
@ -50,7 +50,7 @@ public class UserUpdateComposer extends MessageComposer {
|
|||||||
this.response.appendInt(roomUnit.getBodyRotation().getValue());
|
this.response.appendInt(roomUnit.getBodyRotation().getValue());
|
||||||
|
|
||||||
StringBuilder status = new StringBuilder("/");
|
StringBuilder status = new StringBuilder("/");
|
||||||
for (Map.Entry<RoomUnitStatus, String> entry : roomUnit.getStatusMap().entrySet()) {
|
for (Map.Entry<RoomUnitStatus, String> entry : roomUnit.getStatus().entrySet()) {
|
||||||
status.append(entry.getKey()).append(" ").append(entry.getValue()).append("/");
|
status.append(entry.getKey()).append(" ").append(entry.getValue()).append("/");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ public class UserUpdateComposer extends MessageComposer {
|
|||||||
|
|
||||||
StringBuilder status = new StringBuilder("/");
|
StringBuilder status = new StringBuilder("/");
|
||||||
|
|
||||||
for (Map.Entry<RoomUnitStatus, String> entry : habbo.getRoomUnit().getStatusMap().entrySet()) {
|
for (Map.Entry<RoomUnitStatus, String> entry : habbo.getRoomUnit().getStatus().entrySet()) {
|
||||||
status.append(entry.getKey()).append(" ").append(entry.getValue()).append("/");
|
status.append(entry.getKey()).append(" ").append(entry.getValue()).append("/");
|
||||||
}
|
}
|
||||||
this.response.appendString(status.toString());
|
this.response.appendString(status.toString());
|
||||||
|
@ -18,7 +18,7 @@ public class RoomUnitRidePet implements Runnable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (this.habbo.getRoomUnit() == null || this.pet.getRoomUnit() == null || this.pet.getRoom() != this.habbo.getHabboInfo().getCurrentRoom() || this.goalTile == null || this.habbo.getRoomUnit().getGoal() != this.goalTile)
|
if (this.habbo.getRoomUnit() == null || this.pet.getRoomUnit() == null || this.pet.getRoom() != this.habbo.getHabboInfo().getCurrentRoom() || this.goalTile == null || this.habbo.getRoomUnit().getGoalLocation() != this.goalTile)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (habbo.getRoomUnit().getCurrentLocation().distance(pet.getRoomUnit().getCurrentLocation()) <= 1) {
|
if (habbo.getRoomUnit().getCurrentLocation().distance(pet.getRoomUnit().getCurrentLocation()) <= 1) {
|
||||||
|
@ -24,7 +24,7 @@ public class RoomUnitTeleportWalkToAction implements Runnable {
|
|||||||
RoomTile tile = HabboItem.getSquareInFront(this.room.getLayout(), this.habboItem);
|
RoomTile tile = HabboItem.getSquareInFront(this.room.getLayout(), this.habboItem);
|
||||||
|
|
||||||
if (tile != null) {
|
if (tile != null) {
|
||||||
if (this.habbo.getRoomUnit().getGoal().equals(tile)) {
|
if (this.habbo.getRoomUnit().getGoalLocation().equals(tile)) {
|
||||||
if (this.habbo.getRoomUnit().getCurrentLocation().equals(tile)) {
|
if (this.habbo.getRoomUnit().getCurrentLocation().equals(tile)) {
|
||||||
try {
|
try {
|
||||||
this.habboItem.onClick(this.habbo.getClient(), this.room, new Object[]{0});
|
this.habboItem.onClick(this.habbo.getClient(), this.room, new Object[]{0});
|
||||||
|
@ -22,7 +22,7 @@ public class RoomUnitVendingMachineAction implements Runnable {
|
|||||||
if (this.habboItem.getRoomId() == this.room.getId()) {
|
if (this.habboItem.getRoomId() == this.room.getId()) {
|
||||||
RoomTile tile = HabboItem.getSquareInFront(this.room.getLayout(), this.habboItem);
|
RoomTile tile = HabboItem.getSquareInFront(this.room.getLayout(), this.habboItem);
|
||||||
if (tile != null) {
|
if (tile != null) {
|
||||||
if (this.habbo.getRoomUnit().getGoal().equals(tile)) {
|
if (this.habbo.getRoomUnit().getGoalLocation().equals(tile)) {
|
||||||
if (this.habbo.getRoomUnit().getCurrentLocation().equals(tile)) {
|
if (this.habbo.getRoomUnit().getCurrentLocation().equals(tile)) {
|
||||||
try {
|
try {
|
||||||
this.habboItem.onClick(this.habbo.getClient(), this.room, new Object[]{0});
|
this.habboItem.onClick(this.habbo.getClient(), this.room, new Object[]{0});
|
||||||
|
@ -43,7 +43,7 @@ public class RoomUnitWalkToLocation implements Runnable {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.walker.getGoal().equals(this.goalTile) || (this.walker.getPath().size() == 0 && !this.walker.hasStatus(RoomUnitStatus.MOVE))) {
|
if (!this.walker.getGoalLocation().equals(this.goalTile) || (this.walker.getPath().size() == 0 && !this.walker.hasStatus(RoomUnitStatus.MOVE))) {
|
||||||
onFail();
|
onFail();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ public class RoomUnitWalkToRoomUnit implements Runnable {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.walker.getGoal().equals(this.goalTile)) { // check that the action hasn't been cancelled by changing the goal
|
if (this.walker.getGoalLocation().equals(this.goalTile)) { // check that the action hasn't been cancelled by changing the goal
|
||||||
if (this.walker.getCurrentLocation().distance(this.goalTile) <= this.minDistance) {
|
if (this.walker.getCurrentLocation().distance(this.goalTile) <= this.minDistance) {
|
||||||
for (Runnable r : this.targetReached) {
|
for (Runnable r : this.targetReached) {
|
||||||
Emulator.getThreading().run(r);
|
Emulator.getThreading().run(r);
|
||||||
|
Loading…
Reference in New Issue
Block a user