Make some experimental changes

This commit is contained in:
zontreck 2024-06-03 15:07:55 -07:00
parent 577b310d45
commit 09967de31b
4 changed files with 27 additions and 21 deletions

View file

@ -1,3 +1,4 @@
import 'dart:async';
import 'dart:convert';
import 'package:libac_dart/nbt/NbtUtils.dart';
@ -297,9 +298,12 @@ class C2SUploadSettingsPacket implements IPacket {
SessionData.CURRENT_INTERVAL = WarnIntervals.NONE;
if (settings.subsys.currentState == States.Inactive) {
SessionData.shutdownPending = true;
// Stop packet server
PacketServer.socket!.close();
Timer.periodic(Duration(seconds: 10), (timer) {
SessionData.shutdownPending = true;
// Stop packet server
PacketServer.socket!.close();
timer.cancel();
}); // We give time to allow the server to shut down gracefully.
}
return PacketResponse.nil;