Fix: improve flood detection
This commit is contained in:
parent
05af8c2160
commit
ef10b1de85
@ -2969,8 +2969,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
list.add(bot.getRoomUnit());
|
list.add(bot.getRoomUnit());
|
||||||
}
|
}
|
||||||
|
|
||||||
for(Habbo habbo : this.getHabbosAt(tile))
|
for (Habbo habbo : this.getHabbosAt(tile)) {
|
||||||
{
|
|
||||||
list.add(habbo.getRoomUnit());
|
list.add(habbo.getRoomUnit());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3169,21 +3168,6 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chatType != RoomChatType.WHISPER) {
|
|
||||||
if (CommandHandler.handleCommand(habbo.getClient(), roomChatMessage.getUnfilteredMessage())) {
|
|
||||||
WiredHandler.handle(WiredTriggerType.SAY_COMMAND, habbo.getRoomUnit(), habbo.getHabboInfo().getCurrentRoom(), new Object[]{roomChatMessage.getMessage()});
|
|
||||||
roomChatMessage.isCommand = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!ignoreWired) {
|
|
||||||
if (WiredHandler.handle(WiredTriggerType.SAY_SOMETHING, habbo.getRoomUnit(), habbo.getHabboInfo().getCurrentRoom(), new Object[]{roomChatMessage.getMessage()})) {
|
|
||||||
habbo.getClient().sendResponse(new RoomUserWhisperComposer(new RoomChatMessage(roomChatMessage.getMessage(), habbo, habbo, roomChatMessage.getBubble())));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!habbo.hasPermission(Permission.ACC_CHAT_NO_FLOOD)) {
|
if (!habbo.hasPermission(Permission.ACC_CHAT_NO_FLOOD)) {
|
||||||
final int chatCounter = habbo.getHabboStats().chatCounter.addAndGet(1);
|
final int chatCounter = habbo.getHabboStats().chatCounter.addAndGet(1);
|
||||||
|
|
||||||
@ -3195,15 +3179,30 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
if (this.chatProtection == 0) {
|
if (this.chatProtection == 0) {
|
||||||
this.floodMuteHabbo(habbo, muteTime);
|
this.floodMuteHabbo(habbo, muteTime);
|
||||||
return;
|
return;
|
||||||
} else if (this.chatProtection == 1 && chatCounter > 4) {
|
} /* else if (this.chatProtection == 1 && chatCounter > 4) {
|
||||||
this.floodMuteHabbo(habbo, muteTime);
|
this.floodMuteHabbo(habbo, muteTime);
|
||||||
return;
|
return;
|
||||||
} else if (this.chatProtection == 2 && chatCounter > 5) {
|
} else if (this.chatProtection == 2 && chatCounter > 5) {
|
||||||
this.floodMuteHabbo(habbo, muteTime);
|
this.floodMuteHabbo(habbo, muteTime);
|
||||||
return;
|
return;
|
||||||
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (chatType != RoomChatType.WHISPER) {
|
||||||
|
if (CommandHandler.handleCommand(habbo.getClient(), roomChatMessage.getUnfilteredMessage())) {
|
||||||
|
WiredHandler.handle(WiredTriggerType.SAY_COMMAND, habbo.getRoomUnit(), habbo.getHabboInfo().getCurrentRoom(), new Object[]{roomChatMessage.getMessage()});
|
||||||
|
roomChatMessage.isCommand = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ignoreWired) {
|
||||||
|
if (WiredHandler.handle(WiredTriggerType.SAY_SOMETHING, habbo.getRoomUnit(), habbo.getHabboInfo().getCurrentRoom(), new Object[]{roomChatMessage.getMessage()})) {
|
||||||
|
habbo.getClient().sendResponse(new RoomUserWhisperComposer(new RoomChatMessage(roomChatMessage.getMessage(), habbo, habbo, roomChatMessage.getBubble())));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ServerMessage prefixMessage = null;
|
ServerMessage prefixMessage = null;
|
||||||
@ -3357,6 +3356,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends the given message to the receiving Habbo if the Habbo has the ACC_SEE_TENTCHAT permission and is not within the tent
|
* Sends the given message to the receiving Habbo if the Habbo has the ACC_SEE_TENTCHAT permission and is not within the tent
|
||||||
|
*
|
||||||
* @param receivingHabbo The receiving Habbo
|
* @param receivingHabbo The receiving Habbo
|
||||||
* @param roomChatMessage The message to receive
|
* @param roomChatMessage The message to receive
|
||||||
* @param tentRectangle The whole tent area from where the sending Habbo is saying something
|
* @param tentRectangle The whole tent area from where the sending Habbo is saying something
|
||||||
@ -3473,8 +3473,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
if (item.getRotation() != 2 && item.getRotation() != 6) {
|
if (item.getRotation() != 2 && item.getRotation() != 6) {
|
||||||
width = item.getBaseItem().getWidth() > 0 ? item.getBaseItem().getWidth() : 1;
|
width = item.getBaseItem().getWidth() > 0 ? item.getBaseItem().getWidth() : 1;
|
||||||
length = item.getBaseItem().getLength() > 0 ? item.getBaseItem().getLength() : 1;
|
length = item.getBaseItem().getLength() > 0 ? item.getBaseItem().getLength() : 1;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
width = item.getBaseItem().getLength() > 0 ? item.getBaseItem().getLength() : 1;
|
width = item.getBaseItem().getLength() > 0 ? item.getBaseItem().getLength() : 1;
|
||||||
length = item.getBaseItem().getWidth() > 0 ? item.getBaseItem().getWidth() : 1;
|
length = item.getBaseItem().getWidth() > 0 ? item.getBaseItem().getWidth() : 1;
|
||||||
}
|
}
|
||||||
@ -4699,8 +4698,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if((!stackHelper.isPresent() && topItem != null && topItem != item && !topItem.getBaseItem().allowStack())|| (topItem != null && topItem != item && topItem.getZ() + Item.getCurrentHeight(topItem) + Item.getCurrentHeight(item) > MAXIMUM_FURNI_HEIGHT))
|
if ((!stackHelper.isPresent() && topItem != null && topItem != item && !topItem.getBaseItem().allowStack()) || (topItem != null && topItem != item && topItem.getZ() + Item.getCurrentHeight(topItem) + Item.getCurrentHeight(item) > MAXIMUM_FURNI_HEIGHT)) {
|
||||||
{
|
|
||||||
item.setRotation(oldRotation);
|
item.setRotation(oldRotation);
|
||||||
return FurnitureMovementError.CANT_STACK;
|
return FurnitureMovementError.CANT_STACK;
|
||||||
}
|
}
|
||||||
@ -4726,7 +4724,8 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (height > MAXIMUM_FURNI_HEIGHT) return FurnitureMovementError.CANT_STACK;
|
if (height > MAXIMUM_FURNI_HEIGHT) return FurnitureMovementError.CANT_STACK;
|
||||||
if(height < this.getLayout().getHeightAtSquare(tile.x, tile.y)) return FurnitureMovementError.CANT_STACK; //prevent furni going under the floor
|
if (height < this.getLayout().getHeightAtSquare(tile.x, tile.y))
|
||||||
|
return FurnitureMovementError.CANT_STACK; //prevent furni going under the floor
|
||||||
|
|
||||||
if (Emulator.getPluginManager().isRegistered(FurnitureBuildheightEvent.class, true)) {
|
if (Emulator.getPluginManager().isRegistered(FurnitureBuildheightEvent.class, true)) {
|
||||||
FurnitureBuildheightEvent event = Emulator.getPluginManager().fireEvent(new FurnitureBuildheightEvent(item, actor, 0.00, height));
|
FurnitureBuildheightEvent event = Emulator.getPluginManager().fireEvent(new FurnitureBuildheightEvent(item, actor, 0.00, height));
|
||||||
@ -4778,8 +4777,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
for (Habbo h : this.getHabbosAt(t.x, t.y)) {
|
for (Habbo h : this.getHabbosAt(t.x, t.y)) {
|
||||||
try {
|
try {
|
||||||
item.onWalkOn(h.getRoomUnit(), this, null);
|
item.onWalkOn(h.getRoomUnit(), this, null);
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch(Exception e) {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user