diff options
6 files changed, 78 insertions, 38 deletions
diff --git a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs index 0aae4ff..8332c14 100644 --- a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs +++ b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs | |||
@@ -48,11 +48,13 @@ namespace OpenSim.Framework.RegionLoader.Filesystem | |||
48 | public RegionInfo[] LoadRegions() | 48 | public RegionInfo[] LoadRegions() |
49 | { | 49 | { |
50 | string regionConfigPath = Path.Combine(Util.configDir(), "Regions"); | 50 | string regionConfigPath = Path.Combine(Util.configDir(), "Regions"); |
51 | bool allowRegionless = false; | ||
51 | 52 | ||
52 | try | 53 | try |
53 | { | 54 | { |
54 | IConfig startupConfig = (IConfig)m_configSource.Configs["Startup"]; | 55 | IConfig startupConfig = (IConfig)m_configSource.Configs["Startup"]; |
55 | regionConfigPath = startupConfig.GetString("regionload_regionsdir", regionConfigPath).Trim(); | 56 | regionConfigPath = startupConfig.GetString("regionload_regionsdir", regionConfigPath).Trim(); |
57 | allowRegionless = startupConfig.GetBoolean("allow_regionless", false); | ||
56 | } | 58 | } |
57 | catch (Exception) | 59 | catch (Exception) |
58 | { | 60 | { |
@@ -68,7 +70,7 @@ namespace OpenSim.Framework.RegionLoader.Filesystem | |||
68 | string[] iniFiles = Directory.GetFiles(regionConfigPath, "*.ini"); | 70 | string[] iniFiles = Directory.GetFiles(regionConfigPath, "*.ini"); |
69 | 71 | ||
70 | // Create an empty Regions.ini if there are no existing config files. | 72 | // Create an empty Regions.ini if there are no existing config files. |
71 | if (configFiles.Length == 0 && iniFiles.Length == 0) | 73 | if (!allowRegionless && configFiles.Length == 0 && iniFiles.Length == 0) |
72 | { | 74 | { |
73 | new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "Regions.ini"), false, m_configSource); | 75 | new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "Regions.ini"), false, m_configSource); |
74 | iniFiles = Directory.GetFiles(regionConfigPath, "*.ini"); | 76 | iniFiles = Directory.GetFiles(regionConfigPath, "*.ini"); |
diff --git a/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs b/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs index f0ffc2c..c7caf6f 100644 --- a/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs +++ b/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs | |||
@@ -60,6 +60,8 @@ namespace OpenSim.Framework.RegionLoader.Web | |||
60 | { | 60 | { |
61 | IConfig startupConfig = (IConfig) m_configSource.Configs["Startup"]; | 61 | IConfig startupConfig = (IConfig) m_configSource.Configs["Startup"]; |
62 | string url = startupConfig.GetString("regionload_webserver_url", String.Empty).Trim(); | 62 | string url = startupConfig.GetString("regionload_webserver_url", String.Empty).Trim(); |
63 | bool allowRegionless = startupConfig.GetBoolean("allow_regionless", false); | ||
64 | |||
63 | if (url == String.Empty) | 65 | if (url == String.Empty) |
64 | { | 66 | { |
65 | m_log.Error("[WEBLOADER]: Unable to load webserver URL - URL was empty."); | 67 | m_log.Error("[WEBLOADER]: Unable to load webserver URL - URL was empty."); |
@@ -67,39 +69,60 @@ namespace OpenSim.Framework.RegionLoader.Web | |||
67 | } | 69 | } |
68 | else | 70 | else |
69 | { | 71 | { |
70 | while (tries > 0) | 72 | while(tries > 0) |
71 | { | 73 | { |
72 | HttpWebRequest webRequest = (HttpWebRequest) WebRequest.Create(url); | 74 | RegionInfo[] regionInfos = new RegionInfo[] {}; |
73 | webRequest.Timeout = 30000; //30 Second Timeout | 75 | int regionCount = 0; |
74 | m_log.Debug("[WEBLOADER]: Sending Download Request..."); | 76 | HttpWebRequest webRequest = (HttpWebRequest) WebRequest.Create(url); |
75 | HttpWebResponse webResponse = (HttpWebResponse) webRequest.GetResponse(); | 77 | webRequest.Timeout = 30000; //30 Second Timeout |
76 | m_log.Debug("[WEBLOADER]: Downloading Region Information From Remote Server..."); | 78 | m_log.DebugFormat("[WEBLOADER]: Sending download request to {0}", url); |
77 | StreamReader reader = new StreamReader(webResponse.GetResponseStream()); | ||
78 | string xmlSource = String.Empty; | ||
79 | string tempStr = reader.ReadLine(); | ||
80 | while (tempStr != null) | ||
81 | { | ||
82 | xmlSource = xmlSource + tempStr; | ||
83 | tempStr = reader.ReadLine(); | ||
84 | } | ||
85 | m_log.Debug("[WEBLOADER]: Done downloading region information from server. Total Bytes: " + | ||
86 | xmlSource.Length); | ||
87 | XmlDocument xmlDoc = new XmlDocument(); | ||
88 | xmlDoc.LoadXml(xmlSource); | ||
89 | if (xmlDoc.FirstChild.Name == "Regions") | ||
90 | { | ||
91 | RegionInfo[] regionInfos = new RegionInfo[xmlDoc.FirstChild.ChildNodes.Count]; | ||
92 | int i; | ||
93 | for (i = 0; i < xmlDoc.FirstChild.ChildNodes.Count; i++) | ||
94 | { | ||
95 | m_log.Debug(xmlDoc.FirstChild.ChildNodes[i].OuterXml); | ||
96 | regionInfos[i] = | ||
97 | new RegionInfo("REGION CONFIG #" + (i + 1), xmlDoc.FirstChild.ChildNodes[i],false,m_configSource); | ||
98 | } | ||
99 | 79 | ||
100 | if (i > 0) | 80 | try |
101 | return regionInfos; | 81 | { |
102 | } | 82 | HttpWebResponse webResponse = (HttpWebResponse) webRequest.GetResponse(); |
83 | m_log.Debug("[WEBLOADER]: Downloading region information..."); | ||
84 | StreamReader reader = new StreamReader(webResponse.GetResponseStream()); | ||
85 | string xmlSource = String.Empty; | ||
86 | string tempStr = reader.ReadLine(); | ||
87 | while (tempStr != null) | ||
88 | { | ||
89 | xmlSource = xmlSource + tempStr; | ||
90 | tempStr = reader.ReadLine(); | ||
91 | } | ||
92 | m_log.Debug("[WEBLOADER]: Done downloading region information from server. Total Bytes: " + | ||
93 | xmlSource.Length); | ||
94 | XmlDocument xmlDoc = new XmlDocument(); | ||
95 | xmlDoc.LoadXml(xmlSource); | ||
96 | if (xmlDoc.FirstChild.Name == "Regions") | ||
97 | { | ||
98 | regionCount = xmlDoc.FirstChild.ChildNodes.Count; | ||
99 | |||
100 | if (regionCount > 0) | ||
101 | { | ||
102 | regionInfos = new RegionInfo[regionCount]; | ||
103 | int i; | ||
104 | for (i = 0; i < xmlDoc.FirstChild.ChildNodes.Count; i++) | ||
105 | { | ||
106 | m_log.Debug(xmlDoc.FirstChild.ChildNodes[i].OuterXml); | ||
107 | regionInfos[i] = | ||
108 | new RegionInfo("REGION CONFIG #" + (i + 1), xmlDoc.FirstChild.ChildNodes[i],false,m_configSource); | ||
109 | } | ||
110 | } | ||
111 | } | ||
112 | } | ||
113 | catch (WebException ex) | ||
114 | { | ||
115 | if (((HttpWebResponse)ex.Response).StatusCode == HttpStatusCode.NotFound) | ||
116 | { | ||
117 | if (!allowRegionless) | ||
118 | throw ex; | ||
119 | } | ||
120 | else | ||
121 | throw ex; | ||
122 | } | ||
123 | |||
124 | if (regionCount > 0 | allowRegionless) | ||
125 | return regionInfos; | ||
103 | 126 | ||
104 | m_log.Debug("[WEBLOADER]: Request yielded no regions."); | 127 | m_log.Debug("[WEBLOADER]: Request yielded no regions."); |
105 | tries--; | 128 | tries--; |
@@ -108,8 +131,10 @@ namespace OpenSim.Framework.RegionLoader.Web | |||
108 | m_log.Debug("[WEBLOADER]: Retrying"); | 131 | m_log.Debug("[WEBLOADER]: Retrying"); |
109 | System.Threading.Thread.Sleep(wait); | 132 | System.Threading.Thread.Sleep(wait); |
110 | } | 133 | } |
111 | } | 134 | } |
112 | return null; | 135 | |
136 | m_log.Error("[WEBLOADER]: No region configs were available."); | ||
137 | return null; | ||
113 | } | 138 | } |
114 | } | 139 | } |
115 | } | 140 | } |
diff --git a/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs b/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs index ed3e516..6f83948 100644 --- a/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs | |||
@@ -112,10 +112,13 @@ namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL | |||
112 | 112 | ||
113 | public void PostInitialise() | 113 | public void PostInitialise() |
114 | { | 114 | { |
115 | m_textureManager = m_scene.RequestModuleInterface<IDynamicTextureManager>(); | 115 | if (m_scene != null) |
116 | if (m_textureManager != null) | ||
117 | { | 116 | { |
118 | m_textureManager.RegisterRender(GetContentType(), this); | 117 | m_textureManager = m_scene.RequestModuleInterface<IDynamicTextureManager>(); |
118 | if (m_textureManager != null) | ||
119 | { | ||
120 | m_textureManager.RegisterRender(GetContentType(), this); | ||
121 | } | ||
119 | } | 122 | } |
120 | } | 123 | } |
121 | 124 | ||
diff --git a/OpenSim/Tools/Configger/ConfigurationLoader.cs b/OpenSim/Tools/Configger/ConfigurationLoader.cs index 3914652..28bcc99 100644 --- a/OpenSim/Tools/Configger/ConfigurationLoader.cs +++ b/OpenSim/Tools/Configger/ConfigurationLoader.cs | |||
@@ -233,6 +233,7 @@ namespace OpenSim.Tools.Configger | |||
233 | config = defaultConfig.AddConfig("Startup"); | 233 | config = defaultConfig.AddConfig("Startup"); |
234 | 234 | ||
235 | config.Set("region_info_source", "filesystem"); | 235 | config.Set("region_info_source", "filesystem"); |
236 | config.Set("allow_regionless", false); | ||
236 | 237 | ||
237 | config.Set("gridmode", false); | 238 | config.Set("gridmode", false); |
238 | config.Set("physics", "OpenDynamicsEngine"); | 239 | config.Set("physics", "OpenDynamicsEngine"); |
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index 57a2e06..ce86d56 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example | |||
@@ -71,6 +71,11 @@ | |||
71 | ;; in a <Regions> tag. | 71 | ;; in a <Regions> tag. |
72 | ; regionload_webserver_url = "http://example.com/regions.xml"; | 72 | ; regionload_webserver_url = "http://example.com/regions.xml"; |
73 | 73 | ||
74 | ;# {allow_regionless} {} {Allow simulator to start up with no regions configured.} {true false} false | ||
75 | ;; Allow the simulator to start up if there are no region configuration available | ||
76 | ;; from the selected region_info_source. | ||
77 | ; allow_regionless = false | ||
78 | |||
74 | ;# {NonPhysicalPrimMax} {} {Maximum size of nonphysical prims?} {} 256 | 79 | ;# {NonPhysicalPrimMax} {} {Maximum size of nonphysical prims?} {} 256 |
75 | ;; Maximum size for non-physical prims. Affects resizing of existing prims. This can be overriden in the region config file (as NonphysicalPrimMax!). | 80 | ;; Maximum size for non-physical prims. Affects resizing of existing prims. This can be overriden in the region config file (as NonphysicalPrimMax!). |
76 | ; NonPhysicalPrimMax = 256 | 81 | ; NonPhysicalPrimMax = 256 |
diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index f5d7f4a..a456f4d 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini | |||
@@ -70,6 +70,10 @@ | |||
70 | ; except that everything is also enclosed in a <Regions> tag. | 70 | ; except that everything is also enclosed in a <Regions> tag. |
71 | ; regionload_webserver_url = "http://example.com/regions.xml"; | 71 | ; regionload_webserver_url = "http://example.com/regions.xml"; |
72 | 72 | ||
73 | ;; Allow the simulator to start up if there are no region configuration available | ||
74 | ;; from the selected region_info_source. | ||
75 | allow_regionless = false | ||
76 | |||
73 | ; Maximum size of non physical prims. Affects resizing of existing prims. This can be overriden in the region config file (as NonphysicalPrimMax!). | 77 | ; Maximum size of non physical prims. Affects resizing of existing prims. This can be overriden in the region config file (as NonphysicalPrimMax!). |
74 | NonPhysicalPrimMax = 256 | 78 | NonPhysicalPrimMax = 256 |
75 | 79 | ||