mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-23 15:20:52 +01:00
Fix more issues.
This commit is contained in:
parent
4c140d9402
commit
463fb82654
@ -35,12 +35,18 @@ public class EventCommand extends Command {
|
||||
|
||||
ServerMessage msg = new BubbleAlertComposer("hotel.event", codes).compose();
|
||||
|
||||
for (Map.Entry<Integer, Habbo> set : Emulator.getGameEnvironment().getHabboManager().getOnlineHabbos().entrySet()) {
|
||||
Habbo habbo = set.getValue();
|
||||
if (habbo.getHabboStats().blockStaffAlerts)
|
||||
continue;
|
||||
msg.retain();
|
||||
|
||||
habbo.getClient().sendResponse(msg);
|
||||
try {
|
||||
for (Map.Entry<Integer, Habbo> set : Emulator.getGameEnvironment().getHabboManager().getOnlineHabbos().entrySet()) {
|
||||
Habbo habbo = set.getValue();
|
||||
if (habbo.getHabboStats().blockStaffAlerts)
|
||||
continue;
|
||||
|
||||
habbo.getClient().sendResponse(msg);
|
||||
}
|
||||
} finally {
|
||||
msg.release();
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -32,21 +32,25 @@ public class MassBadgeCommand extends Command {
|
||||
keys.put("image", "${image.library.url}album1584/" + badge + ".gif");
|
||||
keys.put("message", Emulator.getTexts().getValue("commands.generic.cmd_badge.received"));
|
||||
ServerMessage message = new BubbleAlertComposer(BubbleAlertKeys.RECEIVED_BADGE.key, keys).compose();
|
||||
message.retain();
|
||||
try {
|
||||
for (Map.Entry<Integer, Habbo> set : Emulator.getGameEnvironment().getHabboManager().getOnlineHabbos().entrySet()) {
|
||||
Habbo habbo = set.getValue();
|
||||
|
||||
for (Map.Entry<Integer, Habbo> set : Emulator.getGameEnvironment().getHabboManager().getOnlineHabbos().entrySet()) {
|
||||
Habbo habbo = set.getValue();
|
||||
if (habbo.isOnline()) {
|
||||
if (habbo.getInventory() != null && habbo.getInventory().getBadgesComponent() != null && !habbo.getInventory().getBadgesComponent().hasBadge(badge)) {
|
||||
HabboBadge b = BadgesComponent.createBadge(badge, habbo);
|
||||
|
||||
if (habbo.isOnline()) {
|
||||
if (habbo.getInventory() != null && habbo.getInventory().getBadgesComponent() != null && !habbo.getInventory().getBadgesComponent().hasBadge(badge)) {
|
||||
HabboBadge b = BadgesComponent.createBadge(badge, habbo);
|
||||
if (b != null) {
|
||||
habbo.getClient().sendResponse(new AddUserBadgeComposer(b));
|
||||
|
||||
if (b != null) {
|
||||
habbo.getClient().sendResponse(new AddUserBadgeComposer(b));
|
||||
|
||||
habbo.getClient().sendResponse(message);
|
||||
habbo.getClient().sendResponse(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
message.release();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
@ -60,20 +60,26 @@ public class MassGiftCommand extends Command {
|
||||
ServerMessage giftNotificiationMessage = new BubbleAlertComposer(BubbleAlertKeys.RECEIVED_BADGE.key, keys).compose();
|
||||
|
||||
Emulator.getThreading().run(() -> {
|
||||
for (Map.Entry<Integer, Habbo> set : Emulator.getGameEnvironment().getHabboManager().getOnlineHabbos().entrySet()) {
|
||||
Habbo habbo = set.getValue();
|
||||
giftNotificiationMessage.retain();
|
||||
|
||||
HabboItem item = Emulator.getGameEnvironment().getItemManager().createItem(0, baseItem, 0, 0, "");
|
||||
try {
|
||||
for (Map.Entry<Integer, Habbo> set : Emulator.getGameEnvironment().getHabboManager().getOnlineHabbos().entrySet()) {
|
||||
Habbo habbo = set.getValue();
|
||||
|
||||
Item giftItem = Emulator.getGameEnvironment().getItemManager().getItem((Integer) Emulator.getGameEnvironment().getCatalogManager().giftFurnis.values().toArray()[Emulator.getRandom().nextInt(Emulator.getGameEnvironment().getCatalogManager().giftFurnis.size())]);
|
||||
HabboItem item = Emulator.getGameEnvironment().getItemManager().createItem(0, baseItem, 0, 0, "");
|
||||
|
||||
String extraData = "1\t" + item.getId();
|
||||
extraData += "\t0\t0\t0\t" + finalMessage + "\t0\t0";
|
||||
Item giftItem = Emulator.getGameEnvironment().getItemManager().getItem((Integer) Emulator.getGameEnvironment().getCatalogManager().giftFurnis.values().toArray()[Emulator.getRandom().nextInt(Emulator.getGameEnvironment().getCatalogManager().giftFurnis.size())]);
|
||||
|
||||
Emulator.getGameEnvironment().getItemManager().createGift(habbo.getHabboInfo().getUsername(), giftItem, extraData, 0, 0);
|
||||
String extraData = "1\t" + item.getId();
|
||||
extraData += "\t0\t0\t0\t" + finalMessage + "\t0\t0";
|
||||
|
||||
habbo.getClient().sendResponse(new InventoryRefreshComposer());
|
||||
habbo.getClient().sendResponse(giftNotificiationMessage);
|
||||
Emulator.getGameEnvironment().getItemManager().createGift(habbo.getHabboInfo().getUsername(), giftItem, extraData, 0, 0);
|
||||
|
||||
habbo.getClient().sendResponse(new InventoryRefreshComposer());
|
||||
habbo.getClient().sendResponse(giftNotificiationMessage);
|
||||
}
|
||||
} finally {
|
||||
giftNotificiationMessage.release();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -43,12 +43,17 @@ public class ImageHotelAlert extends RCONMessage<ImageHotelAlert.JSON> {
|
||||
}
|
||||
|
||||
ServerMessage message = new BubbleAlertComposer(json.bubble_key, keys).compose();
|
||||
for (Map.Entry<Integer, Habbo> set : Emulator.getGameEnvironment().getHabboManager().getOnlineHabbos().entrySet()) {
|
||||
Habbo habbo = set.getValue();
|
||||
if (habbo.getHabboStats().blockStaffAlerts)
|
||||
continue;
|
||||
message.retain();
|
||||
try {
|
||||
for (Map.Entry<Integer, Habbo> set : Emulator.getGameEnvironment().getHabboManager().getOnlineHabbos().entrySet()) {
|
||||
Habbo habbo = set.getValue();
|
||||
if (habbo.getHabboStats().blockStaffAlerts)
|
||||
continue;
|
||||
|
||||
habbo.getClient().sendResponse(message);
|
||||
habbo.getClient().sendResponse(message);
|
||||
}
|
||||
} finally {
|
||||
message.release();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,18 +33,24 @@ public class CannonKickAction implements Runnable {
|
||||
dater.put("title", "${notification.room.kick.cannonball.title}");
|
||||
dater.put("message", "${notification.room.kick.cannonball.message}");
|
||||
|
||||
ServerMessage message = new BubbleAlertComposer("cannon.png", dater).compose();
|
||||
|
||||
int rotation = this.cannon.getRotation();
|
||||
List<RoomTile> tiles = this.room.getLayout().getTilesInFront(this.room.getLayout().getTile(this.cannon.getX(), this.cannon.getY()), rotation + 6, 3);
|
||||
|
||||
for (RoomTile t : tiles) {
|
||||
for (Habbo habbo : this.room.getHabbosAt(t.x, t.y)) {
|
||||
if (!habbo.hasPermission(Permission.ACC_UNKICKABLE) && !this.room.isOwner(habbo)) {
|
||||
Emulator.getGameEnvironment().getRoomManager().leaveRoom(habbo, this.room);
|
||||
habbo.getClient().sendResponse(message); //kicked composer
|
||||
ServerMessage message = new BubbleAlertComposer("cannon.png", dater).compose();
|
||||
|
||||
message.retain();
|
||||
|
||||
try {
|
||||
for (RoomTile t : tiles) {
|
||||
for (Habbo habbo : this.room.getHabbosAt(t.x, t.y)) {
|
||||
if (!habbo.hasPermission(Permission.ACC_UNKICKABLE) && !this.room.isOwner(habbo)) {
|
||||
Emulator.getGameEnvironment().getRoomManager().leaveRoom(habbo, this.room);
|
||||
habbo.getClient().sendResponse(message); //kicked composer
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
message.release();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user