Arcturus-Community/src/main/java/com/eu/habbo/habbohotel/GameEnvironment.java

195 lines
6.3 KiB
Java
Raw Normal View History

2018-07-06 15:30:00 +02:00
package com.eu.habbo.habbohotel;
import com.eu.habbo.Emulator;
2020-05-03 01:46:07 +02:00
import com.eu.habbo.core.*;
2018-07-06 15:30:00 +02:00
import com.eu.habbo.habbohotel.achievements.AchievementManager;
import com.eu.habbo.habbohotel.bots.BotManager;
import com.eu.habbo.habbohotel.catalog.CatalogManager;
import com.eu.habbo.habbohotel.commands.CommandHandler;
import com.eu.habbo.habbohotel.crafting.CraftingManager;
import com.eu.habbo.habbohotel.guides.GuideManager;
import com.eu.habbo.habbohotel.guilds.GuildManager;
import com.eu.habbo.habbohotel.hotelview.HotelViewManager;
import com.eu.habbo.habbohotel.items.ItemManager;
import com.eu.habbo.habbohotel.modtool.ModToolManager;
import com.eu.habbo.habbohotel.modtool.ModToolSanctions;
2018-07-06 15:30:00 +02:00
import com.eu.habbo.habbohotel.modtool.WordFilter;
import com.eu.habbo.habbohotel.navigation.NavigatorManager;
import com.eu.habbo.habbohotel.permissions.PermissionsManager;
import com.eu.habbo.habbohotel.pets.PetManager;
import com.eu.habbo.habbohotel.polls.PollManager;
import com.eu.habbo.habbohotel.rooms.RoomManager;
import com.eu.habbo.habbohotel.users.HabboManager;
2020-05-03 01:46:07 +02:00
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
2018-07-06 15:30:00 +02:00
2019-05-26 20:14:53 +02:00
public class GameEnvironment {
2020-05-03 01:46:07 +02:00
private static final Logger LOGGER = LoggerFactory.getLogger(GameEnvironment.class);
2019-05-26 20:14:53 +02:00
public CreditsScheduler creditsScheduler;
public PixelScheduler pixelScheduler;
public PointsScheduler pointsScheduler;
2019-07-17 02:33:19 +02:00
public GotwPointsScheduler gotwPointsScheduler;
2018-07-06 15:30:00 +02:00
private HabboManager habboManager;
private NavigatorManager navigatorManager;
private GuildManager guildManager;
private ItemManager itemManager;
private CatalogManager catalogManager;
private HotelViewManager hotelViewManager;
private RoomManager roomManager;
private CommandHandler commandHandler;
private PermissionsManager permissionsManager;
private BotManager botManager;
private ModToolManager modToolManager;
private ModToolSanctions modToolSanctions;
2018-07-06 15:30:00 +02:00
private PetManager petManager;
private AchievementManager achievementManager;
private GuideManager guideManager;
private WordFilter wordFilter;
private CraftingManager craftingManager;
private PollManager pollManager;
2019-05-26 20:14:53 +02:00
public void load() throws Exception {
2020-05-03 01:46:07 +02:00
LOGGER.info("GameEnvironment -> Loading...");
2018-07-06 15:30:00 +02:00
this.permissionsManager = new PermissionsManager();
2019-05-26 20:14:53 +02:00
this.habboManager = new HabboManager();
this.hotelViewManager = new HotelViewManager();
this.itemManager = new ItemManager();
2018-07-06 15:30:00 +02:00
this.itemManager.load();
2019-05-26 20:14:53 +02:00
this.botManager = new BotManager();
this.petManager = new PetManager();
this.guildManager = new GuildManager();
this.catalogManager = new CatalogManager();
this.roomManager = new RoomManager();
this.navigatorManager = new NavigatorManager();
this.commandHandler = new CommandHandler();
this.modToolManager = new ModToolManager();
this.modToolSanctions = new ModToolSanctions();
2018-07-06 15:30:00 +02:00
this.achievementManager = new AchievementManager();
this.achievementManager.reload();
2019-05-26 20:14:53 +02:00
this.guideManager = new GuideManager();
this.wordFilter = new WordFilter();
this.craftingManager = new CraftingManager();
this.pollManager = new PollManager();
2018-07-06 15:30:00 +02:00
this.roomManager.loadPublicRooms();
this.navigatorManager.loadNavigator();
2018-07-06 15:30:00 +02:00
2019-05-26 20:14:53 +02:00
this.creditsScheduler = new CreditsScheduler();
2018-07-06 15:30:00 +02:00
Emulator.getThreading().run(this.creditsScheduler);
2019-05-26 20:14:53 +02:00
this.pixelScheduler = new PixelScheduler();
2018-07-06 15:30:00 +02:00
Emulator.getThreading().run(this.pixelScheduler);
2019-05-26 20:14:53 +02:00
this.pointsScheduler = new PointsScheduler();
2018-07-06 15:30:00 +02:00
Emulator.getThreading().run(this.pointsScheduler);
2019-07-17 02:33:19 +02:00
this.gotwPointsScheduler = new GotwPointsScheduler();
Emulator.getThreading().run(this.gotwPointsScheduler);
2018-07-06 15:30:00 +02:00
2020-05-03 01:46:07 +02:00
LOGGER.info("GameEnvironment -> Loaded!");
2018-07-06 15:30:00 +02:00
}
2019-05-26 20:14:53 +02:00
public void dispose() {
2018-07-06 15:30:00 +02:00
this.pointsScheduler.setDisposed(true);
this.pixelScheduler.setDisposed(true);
this.creditsScheduler.setDisposed(true);
2019-07-17 02:33:19 +02:00
this.gotwPointsScheduler.setDisposed(true);
2018-07-06 15:30:00 +02:00
this.craftingManager.dispose();
this.habboManager.dispose();
this.commandHandler.dispose();
this.guildManager.dispose();
this.catalogManager.dispose();
this.roomManager.dispose();
this.itemManager.dispose();
this.hotelViewManager.dispose();
2020-05-03 01:46:07 +02:00
LOGGER.info("GameEnvironment -> Disposed!");
2018-07-06 15:30:00 +02:00
}
2019-05-26 20:14:53 +02:00
public HabboManager getHabboManager() {
2018-07-06 15:30:00 +02:00
return this.habboManager;
}
2019-05-26 20:14:53 +02:00
public NavigatorManager getNavigatorManager() {
2018-07-06 15:30:00 +02:00
return this.navigatorManager;
}
2019-05-26 20:14:53 +02:00
public GuildManager getGuildManager() {
2018-07-06 15:30:00 +02:00
return this.guildManager;
}
2019-05-26 20:14:53 +02:00
public ItemManager getItemManager() {
2018-07-06 15:30:00 +02:00
return this.itemManager;
}
2019-05-26 20:14:53 +02:00
public CatalogManager getCatalogManager() {
2018-07-06 15:30:00 +02:00
return this.catalogManager;
}
2019-05-26 20:14:53 +02:00
public HotelViewManager getHotelViewManager() {
2018-07-06 15:30:00 +02:00
return this.hotelViewManager;
}
2019-05-26 20:14:53 +02:00
public RoomManager getRoomManager() {
2018-07-06 15:30:00 +02:00
return this.roomManager;
}
2019-05-26 20:14:53 +02:00
public CommandHandler getCommandHandler() {
2018-07-06 15:30:00 +02:00
return this.commandHandler;
}
2019-05-26 20:14:53 +02:00
public PermissionsManager getPermissionsManager() {
2018-07-06 15:30:00 +02:00
return this.permissionsManager;
}
2019-05-26 20:14:53 +02:00
public BotManager getBotManager() {
2018-07-06 15:30:00 +02:00
return this.botManager;
}
2019-05-26 20:14:53 +02:00
public ModToolManager getModToolManager() {
2018-07-06 15:30:00 +02:00
return this.modToolManager;
}
public ModToolSanctions getModToolSanctions() {
return this.modToolSanctions;
}
2019-05-26 20:14:53 +02:00
public PetManager getPetManager() {
2018-07-06 15:30:00 +02:00
return this.petManager;
}
2019-05-26 20:14:53 +02:00
public AchievementManager getAchievementManager() {
2018-07-06 15:30:00 +02:00
return this.achievementManager;
}
2019-05-26 20:14:53 +02:00
public GuideManager getGuideManager() {
2018-07-06 15:30:00 +02:00
return this.guideManager;
}
2019-05-26 20:14:53 +02:00
public WordFilter getWordFilter() {
2018-07-06 15:30:00 +02:00
return this.wordFilter;
}
2019-05-26 20:14:53 +02:00
public CraftingManager getCraftingManager() {
2018-07-06 15:30:00 +02:00
return this.craftingManager;
}
2019-05-26 20:14:53 +02:00
public PollManager getPollManager() {
2018-07-06 15:30:00 +02:00
return this.pollManager;
}
public CreditsScheduler getCreditsScheduler() {
return this.creditsScheduler;
}
public PixelScheduler getPixelScheduler() {
return this.pixelScheduler;
}
2019-07-17 02:33:19 +02:00
public PointsScheduler getPointsScheduler() { return this.pointsScheduler;
}
public GotwPointsScheduler getGotwPointsScheduler() { return this.gotwPointsScheduler;
}
2018-07-06 15:30:00 +02:00
}