Make some experimental changes
This commit is contained in:
parent
577b310d45
commit
09967de31b
4 changed files with 27 additions and 21 deletions
|
@ -25,7 +25,7 @@ RUN dpkg --add-architecture i386 \
|
||||||
&& apt update -y \
|
&& apt update -y \
|
||||||
&& apt install -y --no-install-recommends gnupg2 numactl tzdata software-properties-common libntlm0 winbind xvfb xauth python3 libncurses5:i386 libncurses6:i386 libsdl2-2.0-0 libsdl2-2.0-0:i386
|
&& apt install -y --no-install-recommends gnupg2 numactl tzdata software-properties-common libntlm0 winbind xvfb xauth python3 libncurses5:i386 libncurses6:i386 libsdl2-2.0-0 libsdl2-2.0-0:i386
|
||||||
|
|
||||||
# Install wine and with recommends
|
# Install wine with recommends
|
||||||
RUN mkdir -pm755 /etc/apt/keyrings
|
RUN mkdir -pm755 /etc/apt/keyrings
|
||||||
RUN wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
|
RUN wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
|
||||||
RUN wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/debian/dists/bookworm/winehq-bookworm.sources
|
RUN wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/debian/dists/bookworm/winehq-bookworm.sources
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import 'dart:async';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:libac_dart/nbt/NbtUtils.dart';
|
import 'package:libac_dart/nbt/NbtUtils.dart';
|
||||||
|
@ -297,9 +298,12 @@ class C2SUploadSettingsPacket implements IPacket {
|
||||||
SessionData.CURRENT_INTERVAL = WarnIntervals.NONE;
|
SessionData.CURRENT_INTERVAL = WarnIntervals.NONE;
|
||||||
|
|
||||||
if (settings.subsys.currentState == States.Inactive) {
|
if (settings.subsys.currentState == States.Inactive) {
|
||||||
|
Timer.periodic(Duration(seconds: 10), (timer) {
|
||||||
SessionData.shutdownPending = true;
|
SessionData.shutdownPending = true;
|
||||||
// Stop packet server
|
// Stop packet server
|
||||||
PacketServer.socket!.close();
|
PacketServer.socket!.close();
|
||||||
|
timer.cancel();
|
||||||
|
}); // We give time to allow the server to shut down gracefully.
|
||||||
}
|
}
|
||||||
|
|
||||||
return PacketResponse.nil;
|
return PacketResponse.nil;
|
||||||
|
|
|
@ -55,17 +55,7 @@ Future<void> runDetachedProton(
|
||||||
List<String> args = ["run", command];
|
List<String> args = ["run", command];
|
||||||
args.addAll(argx);
|
args.addAll(argx);
|
||||||
|
|
||||||
List<String> wineArgs = ["--auto-servernum", "wine", command];
|
StateMachine.PROC = await Process.start(settings.getProtonExecutablePath(),
|
||||||
wineArgs.addAll(argx);
|
|
||||||
|
|
||||||
if (settings.inst!.pterodactylMode)
|
|
||||||
StateMachine.PROC = await Process.start("xvfb-run", wineArgs,
|
|
||||||
environment: env,
|
|
||||||
workingDirectory: workingDir,
|
|
||||||
mode: ProcessStartMode.normal);
|
|
||||||
else
|
|
||||||
StateMachine.PROC = await Process.start(
|
|
||||||
settings.getProtonExecutablePath(),
|
|
||||||
args, // Run arbitrary command with arguments
|
args, // Run arbitrary command with arguments
|
||||||
environment: env,
|
environment: env,
|
||||||
workingDirectory: workingDir,
|
workingDirectory: workingDir,
|
||||||
|
|
|
@ -169,6 +169,11 @@ class StateMachine {
|
||||||
|
|
||||||
Timer? task;
|
Timer? task;
|
||||||
|
|
||||||
|
Future<void> pollModUpdates() async {
|
||||||
|
await doDownloadMods(false);
|
||||||
|
await doScanMods(false);
|
||||||
|
}
|
||||||
|
|
||||||
/// You should only start this task once the server is ready to be started.
|
/// You should only start this task once the server is ready to be started.
|
||||||
/// This task will start the server on first-start
|
/// This task will start the server on first-start
|
||||||
///
|
///
|
||||||
|
@ -184,7 +189,7 @@ class StateMachine {
|
||||||
SessionData.enableRestartTimer = settings.inst!.timer.enabled;
|
SessionData.enableRestartTimer = settings.inst!.timer.enabled;
|
||||||
|
|
||||||
// Schedule the server task
|
// Schedule the server task
|
||||||
task = Timer.periodic(Duration(seconds: 1), (timer) {
|
task = Timer.periodic(Duration(seconds: 1), (timer) async {
|
||||||
switch (currentState) {
|
switch (currentState) {
|
||||||
case States.Inactive:
|
case States.Inactive:
|
||||||
{
|
{
|
||||||
|
@ -197,6 +202,7 @@ class StateMachine {
|
||||||
} else {
|
} else {
|
||||||
resetKillswitch();
|
resetKillswitch();
|
||||||
SessionData.timer = settings.inst!.timer.time.copy();
|
SessionData.timer = settings.inst!.timer.time.copy();
|
||||||
|
await pollModUpdates();
|
||||||
changeState(States.PreStart);
|
changeState(States.PreStart);
|
||||||
SessionData.enableRestartTimer = settings.inst!.timer.enabled;
|
SessionData.enableRestartTimer = settings.inst!.timer.enabled;
|
||||||
}
|
}
|
||||||
|
@ -214,7 +220,7 @@ class StateMachine {
|
||||||
WarnIntervals current = SessionData.CURRENT_INTERVAL;
|
WarnIntervals current = SessionData.CURRENT_INTERVAL;
|
||||||
bool send = false;
|
bool send = false;
|
||||||
for (WarnIntervals WI in WarnIntervals.values) {
|
for (WarnIntervals WI in WarnIntervals.values) {
|
||||||
if (WI.seconds <= sec && WI.seconds < current.seconds) {
|
if (WI.seconds <= sec && WI.seconds <= current.seconds) {
|
||||||
current = WI;
|
current = WI;
|
||||||
send = true;
|
send = true;
|
||||||
|
|
||||||
|
@ -232,6 +238,12 @@ class StateMachine {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check Shutdown Pending
|
// Check Shutdown Pending
|
||||||
|
if (SessionData.shutdownMessage.isNotEmpty) {
|
||||||
|
settings
|
||||||
|
.sendRconCommand("broadcast ${SessionData.shutdownMessage}");
|
||||||
|
SessionData.shutdownMessage = "";
|
||||||
|
}
|
||||||
|
|
||||||
if (SessionData.shutdownPending) {
|
if (SessionData.shutdownPending) {
|
||||||
// Shut down the server
|
// Shut down the server
|
||||||
changeState(States.FullStop);
|
changeState(States.FullStop);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue