mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 02:05:34 +08:00
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.
This commit is contained in:
@@ -503,6 +503,37 @@ namespace OpenSim
|
||||
RemoveRegion(target, cleanUp);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Remove a region from the simulator without deleting it permanently.
|
||||
/// </summary>
|
||||
/// <param name="scene"></param>
|
||||
/// <returns></returns>
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Remove a region from the simulator without deleting it permanently.
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <returns></returns>
|
||||
public void CloseRegion(string name)
|
||||
{
|
||||
Scene target;
|
||||
if (m_sceneManager.TryGetScene(name, out target))
|
||||
CloseRegion(target);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a scene and its initial base structures.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user