Merge branch 'dev' into 'subscription-boxes'

# Conflicts:
#   sqlupdates/2_0_0-RC-2_TO_2_0_0-RC-3.sql
This commit is contained in:
Beny 2019-05-16 13:15:23 -04:00
commit 5e836977f9
3 changed files with 42 additions and 3 deletions

View File

@ -12,4 +12,9 @@ ALTER TABLE `items_crackable`
ADD COLUMN `subscription_duration` int(3) NULL AFTER `required_effect`,
ADD COLUMN `subscription_type` varchar(255) NULL COMMENT 'hc for Habbo Club, bc for Builders Club' AFTER `subscription_duration`;
#END DATABASE UPDATE: 2.0.0 RC-2 -> 2.0.0 RC-3
INSERT INTO `emulator_settings`(`key`, `value`) VALUES ('invisible.prevent.chat', '0');
INSERT INTO `emulator_texts`(`key`, `value`) VALUES ('invisible.prevent.chat.error', 'While being invisible you cannot talk.');
INSERT INTO `emulator_texts`(`key`, `value`) VALUES ('commands.succes.cmd_invisible.updated.back', 'You are now visible again.');
#END DATABASE UPDATE: 2.0.0 RC-2 -> 2.0.0 RC-3

View File

@ -2,8 +2,14 @@ package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomLayout;
import com.eu.habbo.habbohotel.rooms.RoomUnit;
import com.eu.habbo.habbohotel.rooms.RoomUserRotation;
import com.eu.habbo.habbohotel.wired.WiredHandler;
import com.eu.habbo.habbohotel.wired.WiredTriggerType;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserRemoveComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserStatusComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUsersComposer;
public class InvisibleCommand extends Command
{
@ -17,10 +23,30 @@ public class InvisibleCommand extends Command
{
RoomUnit roomUnit = gameClient.getHabbo().getRoomUnit();
if (roomUnit.isInvisible()) {
RoomLayout roomLayout = roomUnit.getRoom().getLayout();
roomUnit.setLocation(roomLayout.getDoorTile());
roomUnit.clearStatus();
roomUnit.clearWalking();
roomUnit.setBodyRotation(RoomUserRotation.values()[roomLayout.getDoorDirection()]);
roomUnit.setHeadRotation(RoomUserRotation.values()[roomLayout.getDoorDirection()]);
roomUnit.setInvisible(false);
roomUnit.setInRoom(true);
roomUnit.getRoom().sendComposer(new RoomUsersComposer(gameClient.getHabbo()).compose());
roomUnit.getRoom().sendComposer(new RoomUserStatusComposer(roomUnit).compose());
WiredHandler.handle(WiredTriggerType.ENTER_ROOM, roomUnit, roomUnit.getRoom(), null);
roomUnit.getRoom().habboEntered(gameClient.getHabbo());
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_invisible.updated.back"));
return true;
}
roomUnit.setInvisible(true);
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_invisible.updated"));
gameClient.getHabbo().getHabboInfo().getCurrentRoom().sendComposer(new RoomUserRemoveComposer(roomUnit).compose());
return true;

View File

@ -3711,6 +3711,14 @@ public class Room implements Comparable<Room>, ISerialize, Runnable
if (!habbo.getHabboStats().allowTalk())
return;
if (habbo.getRoomUnit().isInvisible() && Emulator.getConfig().getBoolean("invisible.prevent.chat", false)) {
if (!CommandHandler.handleCommand(habbo.getClient(), roomChatMessage.getUnfilteredMessage())) {
habbo.whisper(Emulator.getTexts().getValue("invisible.prevent.chat.error"));
}
return;
}
habbo.getHabboStats().chatCounter += 2;
if (habbo.getHabboInfo().getCurrentRoom() != this)