Fix the perform restart settings flag not getting honored.
This commit is contained in:
parent
825830dcad
commit
c57382dfa4
3 changed files with 26 additions and 17 deletions
|
@ -295,7 +295,10 @@ class C2SUploadSettingsPacket implements IPacket {
|
|||
|
||||
@override
|
||||
void decodeTag(Tag tag) {
|
||||
srvSettings = tag.asCompoundTag().get("settings")!.asCompoundTag();
|
||||
CompoundTag ct = tag.asCompoundTag();
|
||||
|
||||
srvSettings = ct.get("settings")!.asCompoundTag();
|
||||
performRestart = NbtUtils.readBoolean(ct, "restart");
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -339,13 +342,13 @@ class C2SUploadSettingsPacket implements IPacket {
|
|||
settings.deserialize(srvSettings);
|
||||
settings.Write();
|
||||
|
||||
if (!performRestart) {
|
||||
DiscordHookHelper.sendWebHook(
|
||||
settings.inst!.discord,
|
||||
DiscordHookProps.ONLINE_ALERT,
|
||||
"Server Wrapper Settings",
|
||||
"Server wrapper settings have been updated.\n\n${performRestart ? "A restart has been requested" : "A restart is not needed"}");
|
||||
|
||||
if (!performRestart) {
|
||||
return PacketResponse.nil;
|
||||
}
|
||||
|
||||
|
|
|
@ -115,7 +115,7 @@ class HomePageState extends State<HomePage> {
|
|||
upload.srvSettings = settings.serialize();
|
||||
upload.performRestart = requireRestart;
|
||||
|
||||
await settings.client!.send(upload, false);
|
||||
await settings.client!.send(upload, !requireRestart);
|
||||
Settings.Clear();
|
||||
|
||||
setState(() {});
|
||||
|
@ -124,12 +124,18 @@ class HomePageState extends State<HomePage> {
|
|||
Navigator.pop(context);
|
||||
}
|
||||
},
|
||||
)
|
||||
, SwitchListTile(value: requireRestart, onChanged: (V) {
|
||||
),
|
||||
SwitchListTile(
|
||||
value: requireRestart,
|
||||
onChanged: (V) {
|
||||
setState(() {
|
||||
requireRestart = V;
|
||||
});
|
||||
}, title: Text("Perform Restart"), subtitle: Text("Whether a immediate server restart should be performed in combination with this wrapper settings update"),)
|
||||
},
|
||||
title: Text("Perform Restart"),
|
||||
subtitle: Text(
|
||||
"Whether a immediate server restart should be performed in combination with this wrapper settings update"),
|
||||
)
|
||||
],
|
||||
)),
|
||||
);
|
||||
|
|
|
@ -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.0+34
|
||||
version: 1.1.0+35
|
||||
|
||||
environment:
|
||||
sdk: '>=3.1.4 <4.0.0'
|
||||
|
|
Loading…
Reference in a new issue