Add discord webhooks
This commit is contained in:
parent
cbf0279c42
commit
a17e0452a0
6 changed files with 208 additions and 2 deletions
|
@ -5,11 +5,13 @@ import 'package:libac_dart/nbt/impl/ListTag.dart';
|
|||
import 'package:libac_dart/utils/TimeUtils.dart';
|
||||
import 'package:servermanager/structs/autorestarts.dart';
|
||||
import 'package:servermanager/structs/credentials.dart';
|
||||
import 'package:servermanager/structs/discordHookHelper.dart';
|
||||
import 'package:servermanager/structs/mod.dart';
|
||||
import 'package:servermanager/structs/serversettings.dart';
|
||||
|
||||
class SettingsEntry {
|
||||
List<Mod> mods = [];
|
||||
DiscordHookProps? discord;
|
||||
Credentials? steam_creds;
|
||||
bool pterodactylMode = true; // Default is to be compatible
|
||||
AutomaticRestartInfo timer =
|
||||
|
@ -33,6 +35,10 @@ class SettingsEntry {
|
|||
st.pterodactylMode = NbtUtils.readBoolean(tag, "pterodactyl");
|
||||
}
|
||||
|
||||
if (tag.containsKey(DiscordHookProps.TAG_NAME))
|
||||
st.discord = DiscordHookProps.deserialize(
|
||||
tag.get(DiscordHookProps.TAG_NAME)!.asCompoundTag());
|
||||
|
||||
st.mods.clear();
|
||||
ListTag lMods = tag.get("mods") as ListTag;
|
||||
for (Tag tag in lMods.value) {
|
||||
|
@ -55,6 +61,9 @@ class SettingsEntry {
|
|||
}
|
||||
tag.put("mods", lMods);
|
||||
|
||||
if (discord != null)
|
||||
tag.put(DiscordHookProps.TAG_NAME, discord!.serialize());
|
||||
|
||||
return tag;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue