aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/RegionLoader
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/RegionLoader')
-rw-r--r--OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs8
-rw-r--r--OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs37
2 files changed, 21 insertions, 24 deletions
diff --git a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs
index fb50171..a710f50 100644
--- a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs
+++ b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs
@@ -25,12 +25,8 @@
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26* 26*
27*/ 27*/
28using System;
29using System.Collections.Generic;
30using System.Text;
31using Nini.Config;
32using OpenSim.Framework;
33using System.IO; 28using System.IO;
29using Nini.Config;
34 30
35namespace OpenSim.Framework.RegionLoader.Filesystem 31namespace OpenSim.Framework.RegionLoader.Filesystem
36{ 32{
@@ -67,4 +63,4 @@ namespace OpenSim.Framework.RegionLoader.Filesystem
67 return regionInfos; 63 return regionInfos;
68 } 64 }
69 } 65 }
70} 66} \ No newline at end of file
diff --git a/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs b/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs
index ec7059a..1625fa6 100644
--- a/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs
+++ b/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs
@@ -25,48 +25,46 @@
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26* 26*
27*/ 27*/
28using System;
29using System.Net;
30using System.IO; 28using System.IO;
29using System.Net;
31using System.Xml; 30using System.Xml;
32using System.Collections.Generic;
33using System.Text;
34using Nini.Config; 31using Nini.Config;
35using OpenSim.Framework; 32using OpenSim.Framework.Console;
36 33
37namespace OpenSim.Framework.RegionLoader.Web 34namespace OpenSim.Framework.RegionLoader.Web
38{ 35{
39 public class RegionLoaderWebServer : IRegionLoader 36 public class RegionLoaderWebServer : IRegionLoader
40 { 37 {
41 private IniConfigSource m_configSouce; 38 private IniConfigSource m_configSouce;
39
42 public void SetIniConfigSource(IniConfigSource configSource) 40 public void SetIniConfigSource(IniConfigSource configSource)
43 { 41 {
44 m_configSouce = configSource; 42 m_configSouce = configSource;
45 } 43 }
44
46 public RegionInfo[] LoadRegions() 45 public RegionInfo[] LoadRegions()
47 { 46 {
48 if (m_configSouce == null) 47 if (m_configSouce == null)
49 { 48 {
50 Console.MainLog.Instance.Error("WEBLOADER", "Unable to load configuration source!"); 49 MainLog.Instance.Error("WEBLOADER", "Unable to load configuration source!");
51 return null; 50 return null;
52 } 51 }
53 else 52 else
54 { 53 {
55 IniConfig startupConfig = (IniConfig)m_configSouce.Configs["Startup"]; 54 IniConfig startupConfig = (IniConfig) m_configSouce.Configs["Startup"];
56 string url = startupConfig.GetString("regionload_webserver_url","").Trim(); 55 string url = startupConfig.GetString("regionload_webserver_url", "").Trim();
57 if (url == "") 56 if (url == "")
58 { 57 {
59 Console.MainLog.Instance.Error("WEBLOADER", "Unable to load webserver URL - URL was empty."); 58 MainLog.Instance.Error("WEBLOADER", "Unable to load webserver URL - URL was empty.");
60 return null; 59 return null;
61 } 60 }
62 else 61 else
63 { 62 {
64 63 HttpWebRequest webRequest = (HttpWebRequest) WebRequest.Create(url);
65 HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url);
66 webRequest.Timeout = 30000; //30 Second Timeout 64 webRequest.Timeout = 30000; //30 Second Timeout
67 Console.MainLog.Instance.Debug("WEBLOADER", "Sending Download Request..."); 65 MainLog.Instance.Debug("WEBLOADER", "Sending Download Request...");
68 HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse(); 66 HttpWebResponse webResponse = (HttpWebResponse) webRequest.GetResponse();
69 Console.MainLog.Instance.Debug("WEBLOADER", "Downloading Region Information From Remote Server..."); 67 MainLog.Instance.Debug("WEBLOADER", "Downloading Region Information From Remote Server...");
70 StreamReader reader = new StreamReader(webResponse.GetResponseStream()); 68 StreamReader reader = new StreamReader(webResponse.GetResponseStream());
71 string xmlSource = ""; 69 string xmlSource = "";
72 string tempStr = reader.ReadLine(); 70 string tempStr = reader.ReadLine();
@@ -75,7 +73,9 @@ namespace OpenSim.Framework.RegionLoader.Web
75 xmlSource = xmlSource + tempStr; 73 xmlSource = xmlSource + tempStr;
76 tempStr = reader.ReadLine(); 74 tempStr = reader.ReadLine();
77 } 75 }
78 Console.MainLog.Instance.Debug("WEBLOADER", "Done downloading region information from server. Total Bytes: " + xmlSource.Length); 76 MainLog.Instance.Debug("WEBLOADER",
77 "Done downloading region information from server. Total Bytes: " +
78 xmlSource.Length);
79 XmlDocument xmlDoc = new XmlDocument(); 79 XmlDocument xmlDoc = new XmlDocument();
80 xmlDoc.LoadXml(xmlSource); 80 xmlDoc.LoadXml(xmlSource);
81 if (xmlDoc.FirstChild.Name == "Regions") 81 if (xmlDoc.FirstChild.Name == "Regions")
@@ -84,8 +84,9 @@ namespace OpenSim.Framework.RegionLoader.Web
84 int i; 84 int i;
85 for (i = 0; i < xmlDoc.FirstChild.ChildNodes.Count; i++) 85 for (i = 0; i < xmlDoc.FirstChild.ChildNodes.Count; i++)
86 { 86 {
87 Console.MainLog.Instance.Debug(xmlDoc.FirstChild.ChildNodes[i].OuterXml); 87 MainLog.Instance.Debug(xmlDoc.FirstChild.ChildNodes[i].OuterXml);
88 regionInfos[i] = new RegionInfo("REGION CONFIG #" + (i + 1), xmlDoc.FirstChild.ChildNodes[i]); 88 regionInfos[i] =
89 new RegionInfo("REGION CONFIG #" + (i + 1), xmlDoc.FirstChild.ChildNodes[i]);
89 } 90 }
90 91
91 return regionInfos; 92 return regionInfos;
@@ -95,4 +96,4 @@ namespace OpenSim.Framework.RegionLoader.Web
95 } 96 }
96 } 97 }
97 } 98 }
98} 99} \ No newline at end of file