From c677de97188105f150cb31c3a36c14b058c0f8d0 Mon Sep 17 00:00:00 2001 From: Anna Puddles <113144806+annapuddles@users.noreply.github.com> Date: Tue, 31 Jan 2023 09:54:19 -0500 Subject: [PATCH] Send prim-dns:shutting-down when rebooting --- prim-dns.lsl | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/prim-dns.lsl b/prim-dns.lsl index 933d436..446ec3e 100644 --- a/prim-dns.lsl +++ b/prim-dns.lsl @@ -1,5 +1,5 @@ /* The version of prim-dns. */ -string version = "2.1.0"; +string version = "2.2.0"; /* The name of the configuration notecard. */ string config_notecard = "prim-dns config"; @@ -402,7 +402,7 @@ state startup if (message == "reboot") { - state read_configuration; + state reboot; } else if (message == "shutdown") { @@ -547,7 +547,7 @@ state request_url if (message == "reboot") { - state read_configuration; + state reboot; } else if (message == "shutdown") { @@ -653,7 +653,7 @@ state main } else if (method == "prim-dns:reboot") { - state read_configuration; + state reboot; } else if (method == "prim-dns:shutdown") { @@ -673,7 +673,7 @@ state main llListenRemove(dialog_listener); dialog_listener = llListen(dialog_channel, "", toucher, ""); - llDialog(toucher, "prim-dns v" + version, ["cancel", " ", " ", "info", "reboot", "shutdown"], dialog_channel); + llDialog(toucher, "prim-dns v" + version, [" ", "cancel", " ", "info", "reboot", "shutdown"], dialog_channel); } /* Handle the response from the options menu. */ @@ -683,7 +683,7 @@ state main if (message == "reboot") { - state read_configuration; + state reboot; } else if (message == "shutdown") { @@ -710,6 +710,21 @@ state main } } } + +state reboot +{ + state_entry() + { + set_text("Rebooting..."); + jsonrpc_link_notification(LINK_SET, "prim-dns:shutting-down", JSON_OBJECT, []); + state read_configuration; + } + + state_exit() + { + clear_text(); + } +} state shutdown {