ConanServerManager/lib/structs/SessionData.dart
zontreck 317df007d4 Refactor: Fix slow initial server start
Moved hashing to first update check
2025-01-04 17:50:10 -07:00

50 lines
1.6 KiB
Dart

import 'package:libac_dart/utils/TimeUtils.dart';
import 'package:servermanager/statemachine.dart';
class SessionData {
static bool shutdownPending = false;
/// This flag will track the number of seconds until restart
///
/// This is initialized initially based on the AutomaticRestart timer if enabled.
///
/// This may be updated to one to two minutes by a Mod Update, or Wrapper update
static Time timer = Time(hours: 0, minutes: 0, seconds: 0);
static Time operating_time = Time(hours: 0, minutes: 0, seconds: 0);
static String shutdownMessage = "";
static WarnIntervals CURRENT_INTERVAL = WarnIntervals.NONE;
static Time mod_update_check_tracker = Time(hours: 0, minutes: 0, seconds: 0);
static bool enableRestartTimer = false;
static bool canPingServer = false;
static bool isWorldRestore = false;
static String snapshotToRestore =
""; // This is the absolute path to the snapshot being restored
static Time timeSinceLastPing = Time(hours: 0, minutes: 0, seconds: 0);
static void resetModUpdateChecker() {
mod_update_check_tracker = Time(hours: 0, minutes: 0, seconds: 0);
}
static void bumpModUpdateChecker() {
mod_update_check_tracker.tickUp();
}
static bool shouldCheckModUpdates() {
return mod_update_check_tracker.minutes >= 30;
}
/// Interactive Editor - Snapshots
///
/// This contains the list of snapshot files for the editor client GUI.
///
/// DO NOT USE ON SERVER
///
/// Use the [Settings.getWorldSnapshotFiles] function instead
static List<String> IE_SNAPSHOTS = [];
static bool IS_FIRST_MOD_CHECK = true;
}