You've already forked Arcturus-Morningstar-Extended
mirror of
https://github.com/duckietm/Arcturus-Morningstar-Extended.git
synced 2026-06-20 15:36:17 +00:00
:up Pull request from simoleo89 - Integrate UpdateAll plugin as built-in command
Make sure you use the SQL in the SQL Update directory
This commit is contained in:
@@ -0,0 +1,6 @@
|
|||||||
|
ALTER TABLE `permissions` ADD `cmd_update_all` ENUM('0','1') NOT NULL DEFAULT '0' AFTER `cmd_update_achievements`;
|
||||||
|
|
||||||
|
INSERT INTO `emulator_texts` (`key`, `value`) VALUES
|
||||||
|
('commands.keys.cmd_update_all', 'update_all'),
|
||||||
|
('commands.description.cmd_update_all', ':update_all'),
|
||||||
|
('commands.succes.cmd_update_all', 'Successfully updated everything!');
|
||||||
@@ -275,6 +275,7 @@ public class CommandHandler {
|
|||||||
addCommand(new UnbanCommand());
|
addCommand(new UnbanCommand());
|
||||||
addCommand(new UnloadRoomCommand());
|
addCommand(new UnloadRoomCommand());
|
||||||
addCommand(new UnmuteCommand());
|
addCommand(new UnmuteCommand());
|
||||||
|
addCommand(new UpdateAllCommand());
|
||||||
addCommand(new UpdateAchievements());
|
addCommand(new UpdateAchievements());
|
||||||
addCommand(new UpdateBotsCommand());
|
addCommand(new UpdateBotsCommand());
|
||||||
addCommand(new UpdateCalendarCommand());
|
addCommand(new UpdateCalendarCommand());
|
||||||
|
|||||||
@@ -0,0 +1,102 @@
|
|||||||
|
package com.eu.habbo.habbohotel.commands;
|
||||||
|
|
||||||
|
import com.eu.habbo.Emulator;
|
||||||
|
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
||||||
|
import com.eu.habbo.habbohotel.rooms.Room;
|
||||||
|
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
|
||||||
|
import com.eu.habbo.messages.outgoing.catalog.*;
|
||||||
|
import com.eu.habbo.messages.outgoing.catalog.marketplace.MarketplaceConfigComposer;
|
||||||
|
import com.eu.habbo.messages.outgoing.rooms.RoomRelativeMapComposer;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
|
||||||
|
public class UpdateAllCommand extends Command {
|
||||||
|
|
||||||
|
private static final Logger LOGGER = LoggerFactory.getLogger(UpdateAllCommand.class);
|
||||||
|
|
||||||
|
public UpdateAllCommand() {
|
||||||
|
super("cmd_update_all", Emulator.getTexts().getValue("commands.keys.cmd_update_all").split(";"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean handle(GameClient gameClient, String[] params) throws Exception {
|
||||||
|
LOGGER.info("[UpdateAll] Reloading all subsystems...");
|
||||||
|
|
||||||
|
// Achievements
|
||||||
|
Emulator.getGameEnvironment().getAchievementManager().reload();
|
||||||
|
|
||||||
|
// Bots
|
||||||
|
Emulator.getGameEnvironment().getBotManager().reload();
|
||||||
|
|
||||||
|
// Catalog
|
||||||
|
Emulator.getGameEnvironment().getCatalogManager().initialize();
|
||||||
|
Emulator.getGameServer().getGameClientManager().sendBroadcastResponse(new CatalogUpdatedComposer());
|
||||||
|
Emulator.getGameServer().getGameClientManager().sendBroadcastResponse(new CatalogModeComposer(0));
|
||||||
|
Emulator.getGameServer().getGameClientManager().sendBroadcastResponse(new DiscountComposer());
|
||||||
|
Emulator.getGameServer().getGameClientManager().sendBroadcastResponse(new MarketplaceConfigComposer());
|
||||||
|
Emulator.getGameServer().getGameClientManager().sendBroadcastResponse(new GiftConfigurationComposer());
|
||||||
|
Emulator.getGameServer().getGameClientManager().sendBroadcastResponse(new RecyclerLogicComposer());
|
||||||
|
|
||||||
|
// Crafting
|
||||||
|
Emulator.getGameEnvironment().getCraftingManager().reload();
|
||||||
|
|
||||||
|
// Config
|
||||||
|
Emulator.getConfig().reload();
|
||||||
|
|
||||||
|
// Guild Parts
|
||||||
|
Emulator.getGameEnvironment().getGuildManager().loadGuildParts();
|
||||||
|
Emulator.getBadgeImager().reload();
|
||||||
|
|
||||||
|
// Hotel View
|
||||||
|
Emulator.getGameEnvironment().getHotelViewManager().getNewsList().reload();
|
||||||
|
Emulator.getGameEnvironment().getHotelViewManager().getHallOfFame().reload();
|
||||||
|
|
||||||
|
// Items
|
||||||
|
Emulator.getGameEnvironment().getItemManager().loadItems();
|
||||||
|
Emulator.getGameEnvironment().getItemManager().loadCrackable();
|
||||||
|
Emulator.getGameEnvironment().getItemManager().loadSoundTracks();
|
||||||
|
|
||||||
|
synchronized (Emulator.getGameEnvironment().getRoomManager().getActiveRooms()) {
|
||||||
|
for (Room room : Emulator.getGameEnvironment().getRoomManager().getActiveRooms()) {
|
||||||
|
if (room.isLoaded() && room.getUserCount() > 0 && room.getLayout() != null) {
|
||||||
|
room.sendComposer(new RoomRelativeMapComposer(room).compose());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Navigator
|
||||||
|
Emulator.getGameEnvironment().getNavigatorManager().loadNavigator();
|
||||||
|
|
||||||
|
// Room Models
|
||||||
|
Emulator.getGameEnvironment().getRoomManager().loadRoomModels();
|
||||||
|
Emulator.getGameEnvironment().getRoomManager().loadPublicRooms();
|
||||||
|
|
||||||
|
// Permissions
|
||||||
|
Emulator.getGameEnvironment().getPermissionsManager().reload();
|
||||||
|
|
||||||
|
// Pet Data
|
||||||
|
Emulator.getGameEnvironment().getPetManager().reloadPetData();
|
||||||
|
|
||||||
|
// Polls
|
||||||
|
Emulator.getGameEnvironment().getPollManager().loadPolls();
|
||||||
|
|
||||||
|
// Texts & Commands
|
||||||
|
try {
|
||||||
|
Emulator.getTexts().reload();
|
||||||
|
Emulator.getGameEnvironment().getCommandHandler().reloadCommands();
|
||||||
|
} catch (Exception e) {
|
||||||
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_update_texts.failed"), RoomChatMessageBubbles.ALERT);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Word Filter
|
||||||
|
Emulator.getGameEnvironment().getWordFilter().reload();
|
||||||
|
|
||||||
|
// YouTube
|
||||||
|
Emulator.getGameEnvironment().getItemManager().getYoutubeManager().load();
|
||||||
|
|
||||||
|
LOGGER.info("[UpdateAll] All subsystems reloaded successfully!");
|
||||||
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_update_all"), RoomChatMessageBubbles.ALERT);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user