From e877c94b514d942158d01f784bbbb9b7a4a36157 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 11 Mar 2019 23:37:53 +0000 Subject: [PATCH] Add a but more status info on marker files --- OpenSim/Region/Framework/Scenes/Scene.cs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 03122620c2..7668a87511 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1775,6 +1775,30 @@ namespace OpenSim.Region.Framework.Scenes // Region ready should always be set Ready = true; + + + IConfig restartConfig = m_config.Configs["RestartModule"]; + if (restartConfig != null) + { + string markerPath = restartConfig.GetString("MarkerPath", String.Empty); + + if (markerPath != String.Empty) + { + string path = Path.Combine(markerPath, RegionInfo.RegionID.ToString() + ".ready"); + try + { + string pidstring = System.Diagnostics.Process.GetCurrentProcess().Id.ToString(); + FileStream fs = File.Create(path); + System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); + Byte[] buf = enc.GetBytes(pidstring); + fs.Write(buf, 0, buf.Length); + fs.Close(); + } + catch (Exception) + { + } + } + } } else {