aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Servers/BaseOpenSimServer.cs
diff options
context:
space:
mode:
authoronefang2019-05-19 21:24:15 +1000
committeronefang2019-05-19 21:24:15 +1000
commit5e4d6cab00cb29cd088ab7b62ab13aff103b64cb (patch)
treea9fbc62df9eb2d1d9ba2698d8552eae71eca20d8 /OpenSim/Framework/Servers/BaseOpenSimServer.cs
parentAdd a build script. (diff)
downloadopensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.zip
opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.gz
opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.bz2
opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.xz
Dump OpenSim 0.9.0.1 into it's own branch.
Diffstat (limited to 'OpenSim/Framework/Servers/BaseOpenSimServer.cs')
-rw-r--r--OpenSim/Framework/Servers/BaseOpenSimServer.cs73
1 files changed, 49 insertions, 24 deletions
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index 5ce978e..81dd357 100644
--- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs
+++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
@@ -65,11 +65,12 @@ namespace OpenSim.Framework.Servers
65 /// This will control a periodic log printout of the current 'show stats' (if they are active) for this 65 /// This will control a periodic log printout of the current 'show stats' (if they are active) for this
66 /// server. 66 /// server.
67 /// </summary> 67 /// </summary>
68
68 private int m_periodDiagnosticTimerMS = 60 * 60 * 1000; 69 private int m_periodDiagnosticTimerMS = 60 * 60 * 1000;
69 private Timer m_periodicDiagnosticsTimer = new Timer(60 * 60 * 1000); 70 private Timer m_periodicDiagnosticsTimer = new Timer(60 * 60 * 1000);
70 71
71 /// <summary> 72 /// <summary>
72 /// Random uuid for private data 73 /// Random uuid for private data
73 /// </summary> 74 /// </summary>
74 protected string m_osSecret = String.Empty; 75 protected string m_osSecret = String.Empty;
75 76
@@ -83,9 +84,8 @@ namespace OpenSim.Framework.Servers
83 { 84 {
84 // Random uuid for private data 85 // Random uuid for private data
85 m_osSecret = UUID.Random().ToString(); 86 m_osSecret = UUID.Random().ToString();
86
87 } 87 }
88 88
89 /// <summary> 89 /// <summary>
90 /// Must be overriden by child classes for their own server specific startup behaviour. 90 /// Must be overriden by child classes for their own server specific startup behaviour.
91 /// </summary> 91 /// </summary>
@@ -104,26 +104,33 @@ namespace OpenSim.Framework.Servers
104 m_periodicDiagnosticsTimer.Interval = m_periodDiagnosticTimerMS; 104 m_periodicDiagnosticsTimer.Interval = m_periodDiagnosticTimerMS;
105 m_periodicDiagnosticsTimer.Enabled = true; 105 m_periodicDiagnosticsTimer.Enabled = true;
106 } 106 }
107 } 107 }
108 108
109 protected override void ShutdownSpecific() 109 protected override void ShutdownSpecific()
110 { 110 {
111 m_log.Info("[SHUTDOWN]: Shutdown processing on main thread complete. Exiting..."); 111 Watchdog.Enabled = false;
112 base.ShutdownSpecific();
113
114 MainServer.Stop();
115
116 Thread.Sleep(5000);
117 Util.StopThreadPool();
118 WorkManager.Stop();
112 119
120 Thread.Sleep(1000);
113 RemovePIDFile(); 121 RemovePIDFile();
114 122
115 base.ShutdownSpecific(); 123 m_log.Info("[SHUTDOWN]: Shutdown processing on main thread complete. Exiting...");
116 124
117 if (!SuppressExit) 125 if (!SuppressExit)
118 System.Diagnostics.Process.GetCurrentProcess().Kill(); 126 Environment.Exit(0);
119//// Environment.Exit(0);
120 } 127 }
121 128
122 /// <summary> 129 /// <summary>
123 /// Provides a list of help topics that are available. Overriding classes should append their topics to the 130 /// Provides a list of help topics that are available. Overriding classes should append their topics to the
124 /// information returned when the base method is called. 131 /// information returned when the base method is called.
125 /// </summary> 132 /// </summary>
126 /// 133 ///
127 /// <returns> 134 /// <returns>
128 /// A list of strings that represent different help topics on which more information is available 135 /// A list of strings that represent different help topics on which more information is available
129 /// </returns> 136 /// </returns>
@@ -147,20 +154,38 @@ namespace OpenSim.Framework.Servers
147 /// Performs initialisation of the scene, such as loading configuration from disk. 154 /// Performs initialisation of the scene, such as loading configuration from disk.
148 /// </summary> 155 /// </summary>
149 public virtual void Startup() 156 public virtual void Startup()
150 { 157 {
151 StartupSpecific(); 158 m_log.Info("[STARTUP]: Beginning startup processing");
152 159
160 m_log.Info("[STARTUP]: version: " + m_version + Environment.NewLine);
161 // clr version potentially is more confusing than helpful, since it doesn't tell us if we're running under Mono/MS .NET and
162 // the clr version number doesn't match the project version number under Mono.
163 //m_log.Info("[STARTUP]: Virtual machine runtime version: " + Environment.Version + Environment.NewLine);
164 m_log.InfoFormat(
165 "[STARTUP]: Operating system version: {0}, .NET platform {1}, {2}-bit\n",
166 Environment.OSVersion, Environment.OSVersion.Platform, Util.Is64BitProcess() ? "64" : "32");
167
168 try
169 {
170 StartupSpecific();
171 }
172 catch(Exception e)
173 {
174 m_log.Fatal("Fatal error: " + e.ToString());
175 Environment.Exit(1);
176 }
177
153 TimeSpan timeTaken = DateTime.Now - m_startuptime; 178 TimeSpan timeTaken = DateTime.Now - m_startuptime;
154 179
155 MainConsole.Instance.OutputFormat( 180// MainConsole.Instance.OutputFormat(
156 "PLEASE WAIT FOR LOGINS TO BE ENABLED ON REGIONS ONCE SCRIPTS HAVE STARTED. Non-script portion of startup took {0}m {1}s.", 181// "PLEASE WAIT FOR LOGINS TO BE ENABLED ON REGIONS ONCE SCRIPTS HAVE STARTED. Non-script portion of startup took {0}m {1}s.",
157 timeTaken.Minutes, timeTaken.Seconds); 182// timeTaken.Minutes, timeTaken.Seconds);
158 } 183 }
159 184
160 public string osSecret 185 public string osSecret
161 { 186 {
162 // Secret uuid for the simulator 187 // Secret uuid for the simulator
163 get { return m_osSecret; } 188 get { return m_osSecret; }
164 } 189 }
165 190
166 public string StatReport(IOSHttpRequest httpRequest) 191 public string StatReport(IOSHttpRequest httpRequest)
@@ -169,8 +194,8 @@ namespace OpenSim.Framework.Servers
169 if (httpRequest.Query.ContainsKey("callback")) 194 if (httpRequest.Query.ContainsKey("callback"))
170 { 195 {
171 return httpRequest.Query["callback"].ToString() + "(" + StatsManager.SimExtraStats.XReport((DateTime.Now - m_startuptime).ToString() , m_version) + ");"; 196 return httpRequest.Query["callback"].ToString() + "(" + StatsManager.SimExtraStats.XReport((DateTime.Now - m_startuptime).ToString() , m_version) + ");";
172 } 197 }
173 else 198 else
174 { 199 {
175 return StatsManager.SimExtraStats.XReport((DateTime.Now - m_startuptime).ToString() , m_version); 200 return StatsManager.SimExtraStats.XReport((DateTime.Now - m_startuptime).ToString() , m_version);
176 } 201 }