private object RegionRestartHandler(IList args, IPEndPoint remoteClient) { m_admin.CheckSessionValid(new UUID((string)args[0])); UUID regionID = new UUID((string)args[1]); Scene rebootedScene; if (!m_app.SceneManager.TryGetScene(regionID, out rebootedScene)) { throw new Exception("region not found"); } rebootedScene.Restart(30); return(true); }
// Region.Restart(string sessionid, optional string regionid = ACTIVE_REGION) private object RegionRestartHandler(IList args, IPEndPoint remoteClient) { m_admin.CheckSessionValid(new UUID((string)args[0])); if (countdownTimeEnd > 0) { throw new Exception("remote shutdown already in progress"); } string regionIDInput = ""; // Make the region ID optional. regionIDInput = Convert.ToString(args[1]); // There's more in the args than what's passed, so this might not be the ID much less a UUID!. if (regionIDInput.Length > 0) { UUID regionID; try { regionID = new UUID(regionIDInput); if (!m_app.SceneManager.TryGetScene(regionID, out rebootedScene)) // It is a UUID, see if that's an active region. { throw new Exception("region not found"); } } catch (FormatException) // Not a UUID, use the active region. { rebootedScene = m_app.SceneManager.CurrentOrFirstScene; } } else { rebootedScene = m_app.SceneManager.CurrentOrFirstScene; } if (rebootedScene != null) { countdownTimeEnd = 1; // Mark a shutdown in progress. rebootedScene.Restart(30); return(true); } throw new Exception("no active region"); }