Refactor archive loading to optionally start script engine after loading.

0.9.0-post-fixes
Robert Adams 2017-08-14 21:27:53 -07:00
parent eb837defdf
commit a754ab0e4f
1 changed files with 21 additions and 13 deletions

View File

@ -285,6 +285,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver
/// Dearchive the region embodied in this request. /// Dearchive the region embodied in this request.
/// </summary> /// </summary>
public void DearchiveRegion() public void DearchiveRegion()
{
DearchiveRegion(true);
}
public void DearchiveRegion(bool shouldStartScripts)
{ {
int successfulAssetRestores = 0; int successfulAssetRestores = 0;
int failedAssetRestores = 0; int failedAssetRestores = 0;
@ -425,6 +430,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
// Start the scripts. We delayed this because we want the OAR to finish loading ASAP, so // Start the scripts. We delayed this because we want the OAR to finish loading ASAP, so
// that users can enter the scene. If we allow the scripts to start in the loop above // that users can enter the scene. If we allow the scripts to start in the loop above
// then they significantly increase the time until the OAR finishes loading. // then they significantly increase the time until the OAR finishes loading.
if (shouldStartScripts)
{
WorkManager.RunInThread(o => WorkManager.RunInThread(o =>
{ {
Thread.Sleep(15000); Thread.Sleep(15000);
@ -441,6 +448,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
sceneContext.SceneObjects.Clear(); sceneContext.SceneObjects.Clear();
} }
}, null, string.Format("ReadArchiveStartScripts (request {0})", m_requestId)); }, null, string.Format("ReadArchiveStartScripts (request {0})", m_requestId));
}
m_log.InfoFormat("[ARCHIVER]: Successfully loaded archive"); m_log.InfoFormat("[ARCHIVER]: Successfully loaded archive");