瀏覽代碼

Add a but more status info on marker files

root 5 年之前
父節點
當前提交
e877c94b51
共有 1 個文件被更改,包括 24 次插入0 次删除
  1. 24 0
      OpenSim/Region/Framework/Scenes/Scene.cs

+ 24 - 0
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
                         {