private void RegisterRegionWithGrid(Scene scene) { string error = scene.RegisterRegionWithGrid(); if (error != "") { if (error == "Region location is reserved") { m_log.Error("[STARTUP]: Registration of region with grid failed - The region location you specified is reserved. You must move your region."); uint X = 0, Y = 0; uint.TryParse(MainConsole.Instance.CmdPrompt("New Region Location X", "1000"), out X); uint.TryParse(MainConsole.Instance.CmdPrompt("New Region Location Y", "1000"), out Y); scene.RegionInfo.RegionLocX = X; scene.RegionInfo.RegionLocY = Y; Aurora.DataManager.DataManager.RequestPlugin<Aurora.Framework.IRegionInfoConnector>().UpdateRegionInfo(scene.RegionInfo, false); } if (error == "Region overlaps another region") { m_log.Error("[STARTUP]: Registration of region with grid failed - The region location you specified is already in use. You must move your region."); uint X = 0, Y = 0; uint.TryParse(MainConsole.Instance.CmdPrompt("New Region Location X", "1000"), out X); uint.TryParse(MainConsole.Instance.CmdPrompt("New Region Location Y", "1000"), out Y); scene.RegionInfo.RegionLocX = X; scene.RegionInfo.RegionLocY = Y; IConfig config = m_config.Configs["RegionStartup"]; if (config != null) { //TERRIBLE! Needs to be modular, but we can't access the module from a scene module! if (config.GetString("Default") == "RegionLoaderDataBaseSystem") Aurora.DataManager.DataManager.RequestPlugin<Aurora.Framework.IRegionInfoConnector>().UpdateRegionInfo(scene.RegionInfo, false); else SaveChangesFile(scene.RegionInfo); } else SaveChangesFile(scene.RegionInfo); } if (error.Contains("Can't move this region")) { m_log.Error("[STARTUP]: Registration of region with grid failed - You can not move this region. Moving it back to its original position."); //Opensim Grid Servers don't have this functionality. try { string[] position = error.Split(','); scene.RegionInfo.RegionLocX = uint.Parse(position[1]); scene.RegionInfo.RegionLocY = uint.Parse(position[2]); IConfig config = m_config.Configs["RegionStartup"]; if (config != null) { //TERRIBLE! Needs to be modular, but we can't access the module from a scene module! if (config.GetString("Default") == "RegionLoaderDataBaseSystem") Aurora.DataManager.DataManager.RequestPlugin<Aurora.Framework.IRegionInfoConnector>().UpdateRegionInfo(scene.RegionInfo, false); else SaveChangesFile(scene.RegionInfo); } else SaveChangesFile(scene.RegionInfo); } catch (Exception e) { m_log.Error("Unable to move the region back to its original position, is this an opensim server? Please manually move the region back."); throw e; } } if (error == "Duplicate region name") { m_log.Error("[STARTUP]: Registration of region with grid failed - The region name you specified is already in use. Please change the name."); scene.RegionInfo.RegionName = MainConsole.Instance.CmdPrompt("New Region Name", ""); IConfig config = m_config.Configs["RegionStartup"]; if (config != null) { //TERRIBLE! Needs to be modular, but we can't access the module from a scene module! if (config.GetString("Default") == "RegionLoaderDataBaseSystem") Aurora.DataManager.DataManager.RequestPlugin<Aurora.Framework.IRegionInfoConnector>().UpdateRegionInfo(scene.RegionInfo, false); else SaveChangesFile(scene.RegionInfo); } else SaveChangesFile(scene.RegionInfo); } if (error == "Region locked out") { m_log.Error("[STARTUP]: Registration of region with grid failed - The region you are attempting to join has been blocked from connecting. Please connect another region."); throw new Exception(error); } if (error == "Error communicating with grid service") { m_log.Error("[STARTUP]: Registration of region with grid failed - The grid service can not be found! Please make sure that you can connect to the grid server and that the grid server is on."); string input = MainConsole.Instance.CmdPrompt("Press enter when you are ready to proceed, or type cancel to exit"); if (input == "cancel") { Environment.Exit(0); } RegisterRegionWithGrid(scene); } if (error == "Wrong Session ID") { m_log.Error("[STARTUP]: Registration of region with grid failed - Wrong Session ID for this region!"); string input = MainConsole.Instance.CmdPrompt("Press enter when you are ready to proceed, or type cancel to exit"); if (input == "cancel") { Environment.Exit(0); } } RegisterRegionWithGrid(scene); } else m_log.Debug("[SCENE]: Registered " + scene.RegionInfo.RegionName + " with the grid server successfully."); }