From 79babcc53e504b0c53957dc032e616b957f0c44c Mon Sep 17 00:00:00 2001 From: Bwly999 <438225686@qq.com> Date: Sat, 7 May 2022 08:00:31 +0800 Subject: [PATCH] roll back to timer --- src/main/java/emu/grasscutter/server/game/GameServer.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/emu/grasscutter/server/game/GameServer.java b/src/main/java/emu/grasscutter/server/game/GameServer.java index 0135145c0..e6709abf5 100644 --- a/src/main/java/emu/grasscutter/server/game/GameServer.java +++ b/src/main/java/emu/grasscutter/server/game/GameServer.java @@ -205,7 +205,7 @@ public final class GameServer extends KcpServer { @Override public synchronized void start() { // Schedule game loop. - ScheduledExecutorService gameLoop = Executors.newScheduledThreadPool(2); + Timer gameLoop = new Timer(); gameLoop.scheduleAtFixedRate(new TimerTask() { @Override public void run() { @@ -215,7 +215,8 @@ public final class GameServer extends KcpServer { Grasscutter.getLogger().error(Grasscutter.getLanguage().An_error_occurred_during_game_update, e); } } - }, 0L, 1000L, TimeUnit.MILLISECONDS); + }, new Date(), 1000L); + super.start(); }