mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-27 08:50:51 +01:00
Merge branch 'dev' into 'dev'
multiple fixes See merge request morningstar/Arcturus-Community!293
This commit is contained in:
commit
17af91536b
@ -7,9 +7,14 @@ import com.eu.habbo.habbohotel.rooms.Room;
|
|||||||
import com.eu.habbo.habbohotel.rooms.RoomTile;
|
import com.eu.habbo.habbohotel.rooms.RoomTile;
|
||||||
import com.eu.habbo.habbohotel.rooms.RoomUnit;
|
import com.eu.habbo.habbohotel.rooms.RoomUnit;
|
||||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
import com.eu.habbo.habbohotel.users.HabboItem;
|
||||||
|
import com.eu.habbo.habbohotel.wired.WiredHandler;
|
||||||
|
import com.eu.habbo.habbohotel.wired.WiredTriggerType;
|
||||||
import com.eu.habbo.messages.ServerMessage;
|
import com.eu.habbo.messages.ServerMessage;
|
||||||
|
import com.eu.habbo.messages.incoming.rooms.users.RoomUserWalkEvent;
|
||||||
import com.eu.habbo.messages.outgoing.rooms.items.ItemIntStateComposer;
|
import com.eu.habbo.messages.outgoing.rooms.items.ItemIntStateComposer;
|
||||||
import com.eu.habbo.threading.runnables.RoomUnitWalkToLocation;
|
import com.eu.habbo.threading.runnables.RoomUnitWalkToLocation;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@ -17,6 +22,8 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class InteractionOneWayGate extends HabboItem {
|
public class InteractionOneWayGate extends HabboItem {
|
||||||
|
private static final Logger LOGGER = LoggerFactory.getLogger(InteractionOneWayGate.class);
|
||||||
|
|
||||||
private boolean walkable = false;
|
private boolean walkable = false;
|
||||||
|
|
||||||
public InteractionOneWayGate(ResultSet set, Item baseItem) throws SQLException {
|
public InteractionOneWayGate(ResultSet set, Item baseItem) throws SQLException {
|
||||||
@ -86,6 +93,8 @@ public class InteractionOneWayGate extends HabboItem {
|
|||||||
RoomTile tile = room.getLayout().getTileInFront(room.getLayout().getTile(this.getX(), this.getY()), this.getRotation() + 4);
|
RoomTile tile = room.getLayout().getTileInFront(room.getLayout().getTile(this.getX(), this.getY()), this.getRotation() + 4);
|
||||||
unit.setGoalLocation(tile);
|
unit.setGoalLocation(tile);
|
||||||
Emulator.getThreading().run(new RoomUnitWalkToLocation(unit, tile, room, onFail, onFail));
|
Emulator.getThreading().run(new RoomUnitWalkToLocation(unit, tile, room, onFail, onFail));
|
||||||
|
|
||||||
|
Emulator.getThreading().run(() -> WiredHandler.handle(WiredTriggerType.WALKS_ON_FURNI, unit, room, new Object[]{this}), 500);
|
||||||
});
|
});
|
||||||
|
|
||||||
onFail.add(() -> {
|
onFail.add(() -> {
|
||||||
|
@ -137,8 +137,6 @@ public class WiredConditionFurniHaveFurni extends InteractionWiredCondition {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean saveData(ClientMessage packet) {
|
public boolean saveData(ClientMessage packet) {
|
||||||
this.items.clear();
|
|
||||||
|
|
||||||
int count;
|
int count;
|
||||||
packet.readInt();
|
packet.readInt();
|
||||||
|
|
||||||
@ -147,6 +145,9 @@ public class WiredConditionFurniHaveFurni extends InteractionWiredCondition {
|
|||||||
packet.readString();
|
packet.readString();
|
||||||
|
|
||||||
count = packet.readInt();
|
count = packet.readInt();
|
||||||
|
if (count > Emulator.getConfig().getInt("hotel.wired.furni.selection.count")) return false;
|
||||||
|
|
||||||
|
this.items.clear();
|
||||||
|
|
||||||
Room room = Emulator.getGameEnvironment().getRoomManager().getRoom(this.getRoomId());
|
Room room = Emulator.getGameEnvironment().getRoomManager().getRoom(this.getRoomId());
|
||||||
|
|
||||||
|
@ -154,14 +154,15 @@ public class WiredConditionFurniHaveHabbo extends InteractionWiredCondition {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean saveData(ClientMessage packet) {
|
public boolean saveData(ClientMessage packet) {
|
||||||
this.items.clear();
|
|
||||||
|
|
||||||
int count;
|
int count;
|
||||||
packet.readInt();
|
packet.readInt();
|
||||||
|
|
||||||
packet.readString();
|
packet.readString();
|
||||||
|
|
||||||
count = packet.readInt();
|
count = packet.readInt();
|
||||||
|
if (count > Emulator.getConfig().getInt("hotel.wired.furni.selection.count")) return false;
|
||||||
|
|
||||||
|
this.items.clear();
|
||||||
|
|
||||||
Room room = Emulator.getGameEnvironment().getRoomManager().getRoom(this.getRoomId());
|
Room room = Emulator.getGameEnvironment().getRoomManager().getRoom(this.getRoomId());
|
||||||
|
|
||||||
|
@ -104,12 +104,13 @@ public class WiredConditionFurniTypeMatch extends InteractionWiredCondition {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean saveData(ClientMessage packet) {
|
public boolean saveData(ClientMessage packet) {
|
||||||
this.items.clear();
|
|
||||||
|
|
||||||
packet.readInt();
|
packet.readInt();
|
||||||
packet.readString();
|
packet.readString();
|
||||||
|
|
||||||
int count = packet.readInt();
|
int count = packet.readInt();
|
||||||
|
if (count > Emulator.getConfig().getInt("hotel.wired.furni.selection.count")) return false;
|
||||||
|
|
||||||
|
this.items.clear();
|
||||||
|
|
||||||
Room room = Emulator.getGameEnvironment().getRoomManager().getRoom(this.getRoomId());
|
Room room = Emulator.getGameEnvironment().getRoomManager().getRoom(this.getRoomId());
|
||||||
|
|
||||||
|
@ -67,8 +67,6 @@ public class WiredConditionMatchStatePosition extends InteractionWiredCondition
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean saveData(ClientMessage packet) {
|
public boolean saveData(ClientMessage packet) {
|
||||||
this.settings.clear();
|
|
||||||
|
|
||||||
int count;
|
int count;
|
||||||
packet.readInt();
|
packet.readInt();
|
||||||
|
|
||||||
@ -84,6 +82,9 @@ public class WiredConditionMatchStatePosition extends InteractionWiredCondition
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
count = packet.readInt();
|
count = packet.readInt();
|
||||||
|
if (count > Emulator.getConfig().getInt("hotel.wired.furni.selection.count")) return false;
|
||||||
|
|
||||||
|
this.settings.clear();
|
||||||
|
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
int itemId = packet.readInt();
|
int itemId = packet.readInt();
|
||||||
|
@ -123,16 +123,16 @@ public class WiredConditionNotFurniHaveFurni extends InteractionWiredCondition {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean saveData(ClientMessage packet) {
|
public boolean saveData(ClientMessage packet) {
|
||||||
this.items.clear();
|
|
||||||
|
|
||||||
int count;
|
|
||||||
packet.readInt();
|
packet.readInt();
|
||||||
|
|
||||||
this.all = packet.readInt() == 1;
|
this.all = packet.readInt() == 1;
|
||||||
|
|
||||||
packet.readString();
|
packet.readString();
|
||||||
|
|
||||||
count = packet.readInt();
|
int count = packet.readInt();
|
||||||
|
if (count > Emulator.getConfig().getInt("hotel.wired.furni.selection.count")) return false;
|
||||||
|
|
||||||
|
this.items.clear();
|
||||||
|
|
||||||
Room room = Emulator.getGameEnvironment().getRoomManager().getRoom(this.getRoomId());
|
Room room = Emulator.getGameEnvironment().getRoomManager().getRoom(this.getRoomId());
|
||||||
|
|
||||||
|
@ -154,14 +154,14 @@ public class WiredConditionNotFurniHaveHabbo extends InteractionWiredCondition {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean saveData(ClientMessage packet) {
|
public boolean saveData(ClientMessage packet) {
|
||||||
this.items.clear();
|
|
||||||
|
|
||||||
int count;
|
|
||||||
packet.readInt();
|
packet.readInt();
|
||||||
|
|
||||||
packet.readString();
|
packet.readString();
|
||||||
|
|
||||||
count = packet.readInt();
|
int count = packet.readInt();
|
||||||
|
if (count > Emulator.getConfig().getInt("hotel.wired.furni.selection.count")) return false;
|
||||||
|
|
||||||
|
this.items.clear();
|
||||||
|
|
||||||
Room room = Emulator.getGameEnvironment().getRoomManager().getRoom(this.getRoomId());
|
Room room = Emulator.getGameEnvironment().getRoomManager().getRoom(this.getRoomId());
|
||||||
|
|
||||||
|
@ -103,12 +103,13 @@ public class WiredConditionNotFurniTypeMatch extends InteractionWiredCondition {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean saveData(ClientMessage packet) {
|
public boolean saveData(ClientMessage packet) {
|
||||||
this.items.clear();
|
|
||||||
|
|
||||||
packet.readInt();
|
packet.readInt();
|
||||||
packet.readString();
|
packet.readString();
|
||||||
|
|
||||||
int count = packet.readInt();
|
int count = packet.readInt();
|
||||||
|
if (count > Emulator.getConfig().getInt("hotel.wired.furni.selection.count")) return false;
|
||||||
|
|
||||||
|
this.items.clear();
|
||||||
|
|
||||||
Room room = Emulator.getGameEnvironment().getRoomManager().getRoom(this.getRoomId());
|
Room room = Emulator.getGameEnvironment().getRoomManager().getRoom(this.getRoomId());
|
||||||
|
|
||||||
|
@ -142,9 +142,6 @@ public class WiredConditionNotMatchStatePosition extends InteractionWiredConditi
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean saveData(ClientMessage packet) {
|
public boolean saveData(ClientMessage packet) {
|
||||||
this.settings.clear();
|
|
||||||
|
|
||||||
int count;
|
|
||||||
packet.readInt();
|
packet.readInt();
|
||||||
|
|
||||||
this.state = packet.readInt() == 1;
|
this.state = packet.readInt() == 1;
|
||||||
@ -158,7 +155,10 @@ public class WiredConditionNotMatchStatePosition extends InteractionWiredConditi
|
|||||||
if (room == null)
|
if (room == null)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
count = packet.readInt();
|
int count = packet.readInt();
|
||||||
|
if (count > Emulator.getConfig().getInt("hotel.wired.furni.selection.count")) return false;
|
||||||
|
|
||||||
|
this.settings.clear();
|
||||||
|
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
int itemId = packet.readInt();
|
int itemId = packet.readInt();
|
||||||
|
@ -105,12 +105,13 @@ public class WiredConditionNotTriggerOnFurni extends InteractionWiredCondition {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean saveData(ClientMessage packet) {
|
public boolean saveData(ClientMessage packet) {
|
||||||
this.items.clear();
|
|
||||||
|
|
||||||
packet.readInt();
|
packet.readInt();
|
||||||
packet.readString();
|
packet.readString();
|
||||||
|
|
||||||
int count = packet.readInt();
|
int count = packet.readInt();
|
||||||
|
if (count > Emulator.getConfig().getInt("hotel.wired.furni.selection.count")) return false;
|
||||||
|
this.items.clear();
|
||||||
|
|
||||||
Room room = Emulator.getGameEnvironment().getRoomManager().getRoom(this.getRoomId());
|
Room room = Emulator.getGameEnvironment().getRoomManager().getRoom(this.getRoomId());
|
||||||
|
|
||||||
|
@ -108,12 +108,13 @@ public class WiredConditionTriggerOnFurni extends InteractionWiredCondition {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean saveData(ClientMessage packet) {
|
public boolean saveData(ClientMessage packet) {
|
||||||
this.items.clear();
|
|
||||||
|
|
||||||
packet.readInt();
|
packet.readInt();
|
||||||
packet.readString();
|
packet.readString();
|
||||||
|
|
||||||
int count = packet.readInt();
|
int count = packet.readInt();
|
||||||
|
if (count > Emulator.getConfig().getInt("hotel.wired.furni.selection.count")) return false;
|
||||||
|
|
||||||
|
this.items.clear();
|
||||||
|
|
||||||
Room room = Emulator.getGameEnvironment().getRoomManager().getRoom(this.getRoomId());
|
Room room = Emulator.getGameEnvironment().getRoomManager().getRoom(this.getRoomId());
|
||||||
|
|
||||||
|
@ -57,6 +57,8 @@ public class WiredEffectBotTalk extends InteractionWiredEffect {
|
|||||||
|
|
||||||
if (data.length == 2) {
|
if (data.length == 2) {
|
||||||
this.botName = data[0];
|
this.botName = data[0];
|
||||||
|
|
||||||
|
if (data[1].length() > 64) return false;
|
||||||
this.message = data[1];
|
this.message = data[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,6 +77,8 @@ public class WiredEffectBotTalkToHabbo extends InteractionWiredEffect {
|
|||||||
|
|
||||||
if (data.length == 2) {
|
if (data.length == 2) {
|
||||||
this.botName = data[0];
|
this.botName = data[0];
|
||||||
|
|
||||||
|
if (data[1].length() > 64) return false;
|
||||||
this.message = data[1];
|
this.message = data[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,9 +114,10 @@ public class WiredEffectBotTeleport extends InteractionWiredEffect {
|
|||||||
packet.readInt();
|
packet.readInt();
|
||||||
this.botName = packet.readString();
|
this.botName = packet.readString();
|
||||||
|
|
||||||
this.items.clear();
|
|
||||||
|
|
||||||
int count = packet.readInt();
|
int count = packet.readInt();
|
||||||
|
if (count > Emulator.getConfig().getInt("hotel.wired.furni.selection.count")) return false;
|
||||||
|
|
||||||
|
this.items.clear();
|
||||||
|
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
this.items.add(Emulator.getGameEnvironment().getRoomManager().getRoom(this.getRoomId()).getHabboItem(packet.readInt()));
|
this.items.add(Emulator.getGameEnvironment().getRoomManager().getRoom(this.getRoomId()).getHabboItem(packet.readInt()));
|
||||||
|
@ -68,9 +68,10 @@ public class WiredEffectBotWalkToFurni extends InteractionWiredEffect {
|
|||||||
packet.readInt();
|
packet.readInt();
|
||||||
this.botName = packet.readString();
|
this.botName = packet.readString();
|
||||||
|
|
||||||
this.items.clear();
|
|
||||||
|
|
||||||
int count = packet.readInt();
|
int count = packet.readInt();
|
||||||
|
if (count > Emulator.getConfig().getInt("hotel.wired.furni.selection.count")) return false;
|
||||||
|
|
||||||
|
this.items.clear();
|
||||||
|
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
this.items.add(Emulator.getGameEnvironment().getRoomManager().getRoom(this.getRoomId()).getHabboItem(packet.readInt()));
|
this.items.add(Emulator.getGameEnvironment().getRoomManager().getRoom(this.getRoomId()).getHabboItem(packet.readInt()));
|
||||||
|
@ -162,14 +162,17 @@ public class WiredEffectChangeFurniDirection extends InteractionWiredEffect {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean saveData(ClientMessage packet, GameClient gameClient) {
|
public boolean saveData(ClientMessage packet, GameClient gameClient) {
|
||||||
this.items.clear();
|
|
||||||
packet.readInt();
|
packet.readInt();
|
||||||
this.startRotation = RoomUserRotation.fromValue(packet.readInt());
|
this.startRotation = RoomUserRotation.fromValue(packet.readInt());
|
||||||
this.rotateAction = packet.readInt();
|
this.rotateAction = packet.readInt();
|
||||||
packet.readString();
|
packet.readString();
|
||||||
|
|
||||||
int furniCount = packet.readInt();
|
int count = packet.readInt();
|
||||||
for (int i = 0; i < furniCount; i++) {
|
if (count > Emulator.getConfig().getInt("hotel.wired.furni.selection.count")) return false;
|
||||||
|
|
||||||
|
this.items.clear();
|
||||||
|
|
||||||
|
for (int i = 0; i < count; i++) {
|
||||||
HabboItem item = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabboItem(packet.readInt());
|
HabboItem item = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabboItem(packet.readInt());
|
||||||
|
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
|
@ -244,11 +244,6 @@ public class WiredEffectMatchFurni extends InteractionWiredEffect {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean saveData(ClientMessage packet, GameClient gameClient) {
|
public boolean saveData(ClientMessage packet, GameClient gameClient) {
|
||||||
this.settings.clear();
|
|
||||||
|
|
||||||
//packet.readInt();
|
|
||||||
|
|
||||||
int count;
|
|
||||||
packet.readInt();
|
packet.readInt();
|
||||||
|
|
||||||
this.state = packet.readInt() == 1;
|
this.state = packet.readInt() == 1;
|
||||||
@ -262,7 +257,10 @@ public class WiredEffectMatchFurni extends InteractionWiredEffect {
|
|||||||
if (room == null)
|
if (room == null)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
count = packet.readInt();
|
int count = packet.readInt();
|
||||||
|
if (count > Emulator.getConfig().getInt("hotel.wired.furni.selection.count")) return false;
|
||||||
|
|
||||||
|
this.settings.clear();
|
||||||
|
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
int itemId = packet.readInt();
|
int itemId = packet.readInt();
|
||||||
|
@ -186,9 +186,10 @@ public class WiredEffectMoveFurniAway extends InteractionWiredEffect {
|
|||||||
packet.readInt();
|
packet.readInt();
|
||||||
packet.readString();
|
packet.readString();
|
||||||
|
|
||||||
this.items.clear();
|
|
||||||
|
|
||||||
int count = packet.readInt();
|
int count = packet.readInt();
|
||||||
|
if (count > Emulator.getConfig().getInt("hotel.wired.furni.selection.count")) return false;
|
||||||
|
|
||||||
|
this.items.clear();
|
||||||
|
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
this.items.add(Emulator.getGameEnvironment().getRoomManager().getRoom(this.getRoomId()).getHabboItem(packet.readInt()));
|
this.items.add(Emulator.getGameEnvironment().getRoomManager().getRoom(this.getRoomId()).getHabboItem(packet.readInt()));
|
||||||
|
@ -304,9 +304,10 @@ public class WiredEffectMoveFurniTowards extends InteractionWiredEffect {
|
|||||||
packet.readInt();
|
packet.readInt();
|
||||||
packet.readString();
|
packet.readString();
|
||||||
|
|
||||||
this.items.clear();
|
|
||||||
|
|
||||||
int count = packet.readInt();
|
int count = packet.readInt();
|
||||||
|
if (count > Emulator.getConfig().getInt("hotel.wired.furni.selection.count")) return false;
|
||||||
|
|
||||||
|
this.items.clear();
|
||||||
|
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
this.items.add(Emulator.getGameEnvironment().getRoomManager().getRoom(this.getRoomId()).getHabboItem(packet.readInt()));
|
this.items.add(Emulator.getGameEnvironment().getRoomManager().getRoom(this.getRoomId()).getHabboItem(packet.readInt()));
|
||||||
|
@ -17,6 +17,8 @@ import com.eu.habbo.messages.outgoing.rooms.items.FloorItemOnRollerComposer;
|
|||||||
import com.eu.habbo.messages.outgoing.rooms.items.FloorItemUpdateComposer;
|
import com.eu.habbo.messages.outgoing.rooms.items.FloorItemUpdateComposer;
|
||||||
import gnu.trove.set.hash.THashSet;
|
import gnu.trove.set.hash.THashSet;
|
||||||
import org.apache.commons.math3.util.Pair;
|
import org.apache.commons.math3.util.Pair;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
@ -24,6 +26,10 @@ import java.sql.SQLException;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public class WiredEffectMoveRotateFurni extends InteractionWiredEffect {
|
public class WiredEffectMoveRotateFurni extends InteractionWiredEffect {
|
||||||
|
|
||||||
|
|
||||||
|
private static final Logger LOGGER = LoggerFactory.getLogger(WiredEffectMoveRotateFurni.class);
|
||||||
|
|
||||||
public static final WiredEffectType type = WiredEffectType.MOVE_ROTATE;
|
public static final WiredEffectType type = WiredEffectType.MOVE_ROTATE;
|
||||||
private final THashSet<HabboItem> items = new THashSet<>(WiredHandler.MAXIMUM_FURNI_SELECTION / 2);
|
private final THashSet<HabboItem> items = new THashSet<>(WiredHandler.MAXIMUM_FURNI_SELECTION / 2);
|
||||||
private int direction;
|
private int direction;
|
||||||
@ -53,8 +59,7 @@ public class WiredEffectMoveRotateFurni extends InteractionWiredEffect {
|
|||||||
//Verify if rotation result in a valid position
|
//Verify if rotation result in a valid position
|
||||||
FurnitureMovementError rotateError = room.furnitureFitsAt(room.getLayout().getTile(item.getX(), item.getY()), item, newRotation);
|
FurnitureMovementError rotateError = room.furnitureFitsAt(room.getLayout().getTile(item.getX(), item.getY()), item, newRotation);
|
||||||
if (item.getRotation() != newRotation && (rotateError.equals(FurnitureMovementError.TILE_HAS_HABBOS) || rotateError.equals(FurnitureMovementError.TILE_HAS_PETS) ||
|
if (item.getRotation() != newRotation && (rotateError.equals(FurnitureMovementError.TILE_HAS_HABBOS) || rotateError.equals(FurnitureMovementError.TILE_HAS_PETS) ||
|
||||||
rotateError.equals(FurnitureMovementError.TILE_HAS_BOTS) || rotateError.equals(FurnitureMovementError.NONE)))
|
rotateError.equals(FurnitureMovementError.TILE_HAS_BOTS) || rotateError.equals(FurnitureMovementError.NONE))) {
|
||||||
{
|
|
||||||
item.setRotation(newRotation);
|
item.setRotation(newRotation);
|
||||||
if (this.direction == 0) {
|
if (this.direction == 0) {
|
||||||
tilesToUpdate.addAll(room.getLayout().getTilesAt(room.getLayout().getTile(item.getX(), item.getY()), item.getBaseItem().getWidth(), item.getBaseItem().getLength(), item.getRotation()));
|
tilesToUpdate.addAll(room.getLayout().getTilesAt(room.getLayout().getTile(item.getX(), item.getY()), item.getBaseItem().getWidth(), item.getBaseItem().getLength(), item.getRotation()));
|
||||||
@ -144,8 +149,7 @@ public class WiredEffectMoveRotateFurni extends InteractionWiredEffect {
|
|||||||
room.updateHabbosAt(t.x, t.y);
|
room.updateHabbosAt(t.x, t.y);
|
||||||
room.updateBotsAt(t.x, t.y);
|
room.updateBotsAt(t.x, t.y);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
room.sendComposer(new FloorItemOnRollerComposer(item, null, newTile, offset, room).compose());
|
room.sendComposer(new FloorItemOnRollerComposer(item, null, newTile, offset, room).compose());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -268,6 +272,7 @@ public class WiredEffectMoveRotateFurni extends InteractionWiredEffect {
|
|||||||
packet.readString();
|
packet.readString();
|
||||||
|
|
||||||
int count = packet.readInt();
|
int count = packet.readInt();
|
||||||
|
if (count > Emulator.getConfig().getInt("hotel.wired.furni.selection.count", 5)) return false;
|
||||||
|
|
||||||
this.items.clear();
|
this.items.clear();
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
@ -282,6 +287,7 @@ public class WiredEffectMoveRotateFurni extends InteractionWiredEffect {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a new rotation for an item based on the wired options
|
* Returns a new rotation for an item based on the wired options
|
||||||
|
*
|
||||||
* @param item
|
* @param item
|
||||||
* @return new rotation
|
* @return new rotation
|
||||||
*/
|
*/
|
||||||
@ -306,6 +312,7 @@ public class WiredEffectMoveRotateFurni extends InteractionWiredEffect {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the direction of movement based on the wired settings
|
* Returns the direction of movement based on the wired settings
|
||||||
|
*
|
||||||
* @return direction
|
* @return direction
|
||||||
*/
|
*/
|
||||||
private RoomUserRotation getMovementDirection() {
|
private RoomUserRotation getMovementDirection() {
|
||||||
|
@ -131,9 +131,10 @@ public class WiredEffectTeleport extends InteractionWiredEffect {
|
|||||||
packet.readInt();
|
packet.readInt();
|
||||||
packet.readString();
|
packet.readString();
|
||||||
|
|
||||||
this.items.clear();
|
|
||||||
|
|
||||||
int count = packet.readInt();
|
int count = packet.readInt();
|
||||||
|
if (count > Emulator.getConfig().getInt("hotel.wired.furni.selection.count")) return false;
|
||||||
|
|
||||||
|
this.items.clear();
|
||||||
|
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
this.items.add(Emulator.getGameEnvironment().getRoomManager().getRoom(this.getRoomId()).getHabboItem(packet.readInt()));
|
this.items.add(Emulator.getGameEnvironment().getRoomManager().getRoom(this.getRoomId()).getHabboItem(packet.readInt()));
|
||||||
|
@ -96,9 +96,10 @@ public class WiredEffectToggleFurni extends InteractionWiredEffect {
|
|||||||
packet.readInt();
|
packet.readInt();
|
||||||
packet.readString();
|
packet.readString();
|
||||||
|
|
||||||
this.items.clear();
|
|
||||||
|
|
||||||
int count = packet.readInt();
|
int count = packet.readInt();
|
||||||
|
if (count > Emulator.getConfig().getInt("hotel.wired.furni.selection.count")) return false;
|
||||||
|
|
||||||
|
this.items.clear();
|
||||||
|
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
HabboItem item = Emulator.getGameEnvironment().getRoomManager().getRoom(this.getRoomId()).getHabboItem(packet.readInt());
|
HabboItem item = Emulator.getGameEnvironment().getRoomManager().getRoom(this.getRoomId()).getHabboItem(packet.readInt());
|
||||||
|
@ -87,9 +87,10 @@ public class WiredEffectTriggerStacks extends InteractionWiredEffect {
|
|||||||
packet.readInt();
|
packet.readInt();
|
||||||
packet.readString();
|
packet.readString();
|
||||||
|
|
||||||
this.items.clear();
|
|
||||||
|
|
||||||
int count = packet.readInt();
|
int count = packet.readInt();
|
||||||
|
if (count > Emulator.getConfig().getInt("hotel.wired.furni.selection.count")) return false;
|
||||||
|
|
||||||
|
this.items.clear();
|
||||||
|
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
this.items.add(Emulator.getGameEnvironment().getRoomManager().getRoom(this.getRoomId()).getHabboItem(packet.readInt()));
|
this.items.add(Emulator.getGameEnvironment().getRoomManager().getRoom(this.getRoomId()).getHabboItem(packet.readInt()));
|
||||||
|
@ -3244,10 +3244,18 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
|
|
||||||
RoomChatMessage itemMessage = new RoomChatMessage(Emulator.getTexts().getValue(item.getBaseItem().getName() + ".message." + randomValue, item.getBaseItem().getName() + ".message." + randomValue + " not found!"), habbo, RoomChatMessageBubbles.getBubble(Emulator.getConfig().getInt(item.getBaseItem().getName() + ".message.bubble", RoomChatMessageBubbles.PARROT.getType())));
|
RoomChatMessage itemMessage = new RoomChatMessage(Emulator.getTexts().getValue(item.getBaseItem().getName() + ".message." + randomValue, item.getBaseItem().getName() + ".message." + randomValue + " not found!"), habbo, RoomChatMessageBubbles.getBubble(Emulator.getConfig().getInt(item.getBaseItem().getName() + ".message.bubble", RoomChatMessageBubbles.PARROT.getType())));
|
||||||
|
|
||||||
this.sendComposer(new RoomUserShoutComposer(itemMessage).compose());
|
this.sendComposer(new RoomUserTalkComposer(itemMessage).compose());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
item.onClick(habbo.getClient(), this, new Object[0]);
|
item.onClick(habbo.getClient(), this, new Object[0]);
|
||||||
|
item.setExtradata("1");
|
||||||
|
updateItemState(item);
|
||||||
|
|
||||||
|
Emulator.getThreading().run(() -> {
|
||||||
|
item.setExtradata("0");
|
||||||
|
updateItemState(item);
|
||||||
|
}, 2000);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error("Caught exception", e);
|
LOGGER.error("Caught exception", e);
|
||||||
|
@ -527,10 +527,10 @@ public class RoomManager {
|
|||||||
if (overrideChecks ||
|
if (overrideChecks ||
|
||||||
room.isOwner(habbo) ||
|
room.isOwner(habbo) ||
|
||||||
room.getState() == RoomState.OPEN ||
|
room.getState() == RoomState.OPEN ||
|
||||||
room.getState() == RoomState.INVISIBLE ||
|
|
||||||
habbo.hasPermission(Permission.ACC_ANYROOMOWNER) ||
|
habbo.hasPermission(Permission.ACC_ANYROOMOWNER) ||
|
||||||
habbo.hasPermission(Permission.ACC_ENTERANYROOM) ||
|
habbo.hasPermission(Permission.ACC_ENTERANYROOM) ||
|
||||||
room.hasRights(habbo) ||
|
room.hasRights(habbo) ||
|
||||||
|
(room.getState().equals(RoomState.INVISIBLE) && room.hasRights(habbo)) ||
|
||||||
(room.hasGuild() && room.guildRightLevel(habbo) > 2)) {
|
(room.hasGuild() && room.guildRightLevel(habbo) > 2)) {
|
||||||
this.openRoom(habbo, room, doorLocation);
|
this.openRoom(habbo, room, doorLocation);
|
||||||
} else if (room.getState() == RoomState.LOCKED) {
|
} else if (room.getState() == RoomState.LOCKED) {
|
||||||
@ -563,6 +563,9 @@ public class RoomManager {
|
|||||||
habbo.getClient().sendResponse(new HotelViewComposer());
|
habbo.getClient().sendResponse(new HotelViewComposer());
|
||||||
habbo.getHabboInfo().setLoadingRoom(0);
|
habbo.getHabboInfo().setLoadingRoom(0);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
habbo.getClient().sendResponse(new HotelViewComposer());
|
||||||
|
habbo.getHabboInfo().setLoadingRoom(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -938,6 +941,8 @@ public class RoomManager {
|
|||||||
if (room.getOwnerId() != habbo.getHabboInfo().getId()) {
|
if (room.getOwnerId() != habbo.getHabboInfo().getId()) {
|
||||||
AchievementManager.progressAchievement(room.getOwnerId(), Emulator.getGameEnvironment().getAchievementManager().getAchievement("RoomDecoHosting"), (int) Math.floor((Emulator.getIntUnixTimestamp() - habbo.getHabboStats().roomEnterTimestamp) / 60000));
|
AchievementManager.progressAchievement(room.getOwnerId(), Emulator.getGameEnvironment().getAchievementManager().getAchievement("RoomDecoHosting"), (int) Math.floor((Emulator.getIntUnixTimestamp() - habbo.getHabboStats().roomEnterTimestamp) / 60000));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
habbo.getMessenger().connectionChanged(habbo, habbo.isOnline(), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -240,7 +240,8 @@ public class Habbo implements Runnable {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
this.getHabboInfo().addCurrencyAmount(event.type, event.points);
|
this.getHabboInfo().addCurrencyAmount(event.type, event.points);
|
||||||
if (this.client != null) this.client.sendResponse(new UserPointsComposer(this.client.getHabbo().getHabboInfo().getCurrencyAmount(type), event.points, event.type));
|
if (this.client != null)
|
||||||
|
this.client.sendResponse(new UserPointsComposer(this.client.getHabbo().getHabboInfo().getCurrencyAmount(type), event.points, event.type));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -436,9 +437,7 @@ public class Habbo implements Runnable {
|
|||||||
|
|
||||||
|
|
||||||
public void respect(Habbo target) {
|
public void respect(Habbo target) {
|
||||||
if (target != null && target != this.client.getHabbo())
|
if (target != null && target != this.client.getHabbo()) {
|
||||||
|
|
||||||
{
|
|
||||||
target.getHabboStats().respectPointsReceived++;
|
target.getHabboStats().respectPointsReceived++;
|
||||||
this.client.getHabbo().getHabboStats().respectPointsGiven++;
|
this.client.getHabbo().getHabboStats().respectPointsGiven++;
|
||||||
this.client.getHabbo().getHabboStats().respectPointsToGive--;
|
this.client.getHabbo().getHabboStats().respectPointsToGive--;
|
||||||
@ -449,6 +448,7 @@ public class Habbo implements Runnable {
|
|||||||
AchievementManager.progressAchievement(target, Emulator.getGameEnvironment().getAchievementManager().getAchievement("RespectEarned"));
|
AchievementManager.progressAchievement(target, Emulator.getGameEnvironment().getAchievementManager().getAchievement("RespectEarned"));
|
||||||
|
|
||||||
this.client.getHabbo().getHabboInfo().getCurrentRoom().unIdle(this.client.getHabbo());
|
this.client.getHabbo().getHabboInfo().getCurrentRoom().unIdle(this.client.getHabbo());
|
||||||
|
this.client.getHabbo().getHabboInfo().getCurrentRoom().dance(this.client.getHabbo().getRoomUnit(), DanceType.NONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user