Initialize DailyTaskManager when server starts.
This commit is contained in:
		| @@ -120,6 +120,7 @@ import org.l2jmobius.gameserver.instancemanager.CommissionManager; | ||||
| import org.l2jmobius.gameserver.instancemanager.CursedWeaponsManager; | ||||
| import org.l2jmobius.gameserver.instancemanager.CustomMailManager; | ||||
| import org.l2jmobius.gameserver.instancemanager.DBSpawnManager; | ||||
| import org.l2jmobius.gameserver.instancemanager.DailyTaskManager; | ||||
| import org.l2jmobius.gameserver.instancemanager.EventDropManager; | ||||
| import org.l2jmobius.gameserver.instancemanager.FactionManager; | ||||
| import org.l2jmobius.gameserver.instancemanager.FakePlayerChatManager; | ||||
| @@ -416,6 +417,8 @@ public class GameServer | ||||
| 		 | ||||
| 		TaskManager.getInstance(); | ||||
| 		 | ||||
| 		DailyTaskManager.getInstance(); | ||||
| 		 | ||||
| 		AntiFeedManager.getInstance().registerEvent(AntiFeedManager.GAME_ID); | ||||
| 		 | ||||
| 		if (Config.ALLOW_MAIL) | ||||
|   | ||||
| @@ -47,7 +47,7 @@ public class DailyTaskManager | ||||
| { | ||||
| 	private static final Logger LOGGER = Logger.getLogger(DailyTaskManager.class.getName()); | ||||
| 	 | ||||
| 	private final static int[] RESET_SKILLS = | ||||
| 	private static final int[] RESET_SKILLS = | ||||
| 	{ | ||||
| 		2510, // Wondrous Cubic | ||||
| 		22180, // Wondrous Cubic - 1 time use | ||||
| @@ -65,10 +65,10 @@ public class DailyTaskManager | ||||
| 		calendar.set(Calendar.MINUTE, 30); | ||||
| 		calendar.set(Calendar.SECOND, 0); | ||||
| 		final long startDelay = Math.max(0, calendar.getTimeInMillis() - Chronos.currentTimeMillis()); | ||||
| 		ThreadPool.scheduleAtFixedRate(() -> onReset(), startDelay, 86400000); // 86400000 = 1 day | ||||
| 		ThreadPool.scheduleAtFixedRate(this::onReset, startDelay, 86400000); // 86400000 = 1 day | ||||
| 		 | ||||
| 		// Global save task. | ||||
| 		ThreadPool.scheduleAtFixedRate(() -> onSave(), 1800000, 1800000); // 1800000 = 30 minutes | ||||
| 		ThreadPool.scheduleAtFixedRate(this::onSave, 1800000, 1800000); // 1800000 = 30 minutes | ||||
| 	} | ||||
| 	 | ||||
| 	private void onReset() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 MobiusDevelopment
					MobiusDevelopment