From b665504c4b20d3874799e3c733f956ea24c96a67 Mon Sep 17 00:00:00 2001 From: dbrownidau Date: Mon, 10 Feb 2020 10:35:19 +1100 Subject: [PATCH] Added block on main thread until tick scheduler shutdown. --- 2006Redone Server/src/com/rebotted/GameEngine.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/2006Redone Server/src/com/rebotted/GameEngine.java b/2006Redone Server/src/com/rebotted/GameEngine.java index 6bd717b4..2d8b215d 100644 --- a/2006Redone Server/src/com/rebotted/GameEngine.java +++ b/2006Redone Server/src/com/rebotted/GameEngine.java @@ -213,7 +213,14 @@ public class GameEngine { } }, 0, GameConstants.CYCLE_TIME, TimeUnit.MILLISECONDS); - + try { + while (!scheduler.awaitTermination(60, TimeUnit.SECONDS)) { + // TODO + // Cleanup? + } + } catch (InterruptedException e) { + e.printStackTrace(); + } acceptor = null; connectionHandler = null;