Attempt to fix the mod update checker
This commit is contained in:
parent
5d5d43ed06
commit
82c3a8cbcb
5 changed files with 13 additions and 5 deletions
|
@ -1,3 +1,3 @@
|
|||
class Consts {
|
||||
static const VERSION = "1.1.112624.0154";
|
||||
static const VERSION = "1.1.112624.1409";
|
||||
}
|
||||
|
|
|
@ -7,6 +7,9 @@ import 'package:servermanager/structs/settings.dart';
|
|||
|
||||
Future<void> doDownloadMods(bool jail) async {
|
||||
Settings settings = Settings();
|
||||
if (settings.isDownloadingMods) return;
|
||||
|
||||
settings.isDownloadingMods = true;
|
||||
|
||||
// Build download command
|
||||
List<String> manifest = [
|
||||
|
@ -35,6 +38,8 @@ Future<void> doDownloadMods(bool jail) async {
|
|||
var result = await Process.run(settings.getSteamCmd(), manifest);
|
||||
|
||||
print(result.stdout);
|
||||
|
||||
settings.isDownloadingMods = false;
|
||||
}
|
||||
|
||||
Future<List<Mod>> doScanMods(bool jail) async {
|
||||
|
@ -68,8 +73,8 @@ Future<List<Mod>> doScanMods(bool jail) async {
|
|||
var data = md5.convert(content);
|
||||
var hash = data.toString();
|
||||
|
||||
M.mod_pak = name;
|
||||
M.mod_hash = hash;
|
||||
//M.mod_pak = name;
|
||||
//M.mod_hash = hash;
|
||||
|
||||
print("Discovered mod file: $name");
|
||||
print("Hash: $hash");
|
||||
|
@ -83,5 +88,6 @@ Future<List<Mod>> doScanMods(bool jail) async {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -377,7 +377,7 @@ class StateMachine {
|
|||
settings.inst!.discord,
|
||||
DiscordHookProps.ALERT_INTRUSIVE,
|
||||
"Mods have been updated",
|
||||
"The server is going to restart because the following mods have been updated: \n${updatedMods.join(', ')}");
|
||||
"The server is going to restart because the following mods have been updated: \n\n${updatedMods.join('\n')}");
|
||||
DiscordHookHelper.sendWebHook(
|
||||
settings.inst!.discord,
|
||||
DiscordHookProps.ALERT,
|
||||
|
|
|
@ -38,6 +38,8 @@ class Settings {
|
|||
bool FTS = true;
|
||||
UUID remoteLoginToken = UUID.ZERO;
|
||||
|
||||
bool isDownloadingMods = false;
|
||||
|
||||
PacketClient? client;
|
||||
User superuser = User.make("admin", "changeMe123", UserLevel.Super_User);
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
|
|||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||
# In Windows, build-name is used as the major, minor, and patch parts
|
||||
# of the product and file versions while build-number is used as the build suffix.
|
||||
version: 1.1.112624+0154
|
||||
version: 1.1.112624+1409
|
||||
|
||||
environment:
|
||||
sdk: ">=3.1.4 <4.0.0"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue