diff --git a/gradle.properties b/gradle.properties index 270332d..5e6d8b0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ yarn_mappings=1.20.1+build.10 loader_version=0.16.3 # Mod Properties -mod_version=1.6.0 +mod_version=1.6.1 maven_group=cc.reconnected archives_base_name=rcc-server diff --git a/src/main/java/cc/reconnected/server/RccServer.java b/src/main/java/cc/reconnected/server/RccServer.java index e62034b..3d05265 100644 --- a/src/main/java/cc/reconnected/server/RccServer.java +++ b/src/main/java/cc/reconnected/server/RccServer.java @@ -6,6 +6,7 @@ import cc.reconnected.server.database.PlayerTable; import cc.reconnected.server.events.PlayerWelcome; import cc.reconnected.server.http.ServiceServer; import net.fabricmc.api.ModInitializer; +import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents; import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents; import net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents; @@ -93,6 +94,11 @@ public class RccServer implements ModInitializer { } }); + ServerLifecycleEvents.SERVER_STOPPING.register(server -> { + LOGGER.info("Stopping HTTP services"); + serviceServer.httpServer().stop(0); + }); + ServerPlayConnectionEvents.JOIN.register((handler, sender, server) -> { currentPlayerCount = server.getCurrentPlayerCount() + 1; var player = handler.getPlayer();