From 525ab2c2780d093e6f72d2054dca998620dd4629 Mon Sep 17 00:00:00 2001
From: Charles Krinke
Date: Wed, 8 Jul 2009 20:53:22 +0000
Subject: Thank you kindly, RandomHuman for a patch that: The
admin_close_region method removes a region from the simulator without
deleting it. The region can then be recreated by calling admin_create_region
with the same UUID. There is also a change to admin_create_region to
facilitate this.The reason I want to have this functionality is to make it
possible to detach regions when they are idle and recreate them on demand
through a web interface. It's probably doable using the existing methods by
saving and loading oars, but it also doesn't seem like that should be
necessary.
---
OpenSim/Region/Application/OpenSimBase.cs | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
(limited to 'OpenSim/Region/Application/OpenSimBase.cs')
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 9e3dafb..a42fd3d 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -504,6 +504,37 @@ namespace OpenSim
}
///
+ /// Remove a region from the simulator without deleting it permanently.
+ ///
+ ///
+ ///
+ public void CloseRegion(Scene scene)
+ {
+ // only need to check this if we are not at the
+ // root level
+ if ((m_sceneManager.CurrentScene != null) &&
+ (m_sceneManager.CurrentScene.RegionInfo.RegionID == scene.RegionInfo.RegionID))
+ {
+ m_sceneManager.TrySetCurrentScene("..");
+ }
+
+ m_sceneManager.CloseScene(scene);
+
+ }
+
+ ///
+ /// Remove a region from the simulator without deleting it permanently.
+ ///
+ ///
+ ///
+ public void CloseRegion(string name)
+ {
+ Scene target;
+ if (m_sceneManager.TryGetScene(name, out target))
+ CloseRegion(target);
+ }
+
+ ///
/// Create a scene and its initial base structures.
///
///
--
cgit v1.1