aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/OpenSim.RegionServer/RegionInfo.cs
diff options
context:
space:
mode:
authorMW2007-05-26 14:34:57 +0000
committerMW2007-05-26 14:34:57 +0000
commitc3a40b7d42276f152d8f4f6a7a3ad4eca3c6d7a8 (patch)
treec5de8198621ecacf0798ff84aa00208c6f51a78f /OpenSim/OpenSim.RegionServer/RegionInfo.cs
parentDie Avatar class, and you to Primitive class! (diff)
downloadopensim-SC-c3a40b7d42276f152d8f4f6a7a3ad4eca3c6d7a8.zip
opensim-SC-c3a40b7d42276f152d8f4f6a7a3ad4eca3c6d7a8.tar.gz
opensim-SC-c3a40b7d42276f152d8f4f6a7a3ad4eca3c6d7a8.tar.bz2
opensim-SC-c3a40b7d42276f152d8f4f6a7a3ad4eca3c6d7a8.tar.xz
Die WebFrontEnd, Die Grid class!
Diffstat (limited to 'OpenSim/OpenSim.RegionServer/RegionInfo.cs')
-rw-r--r--OpenSim/OpenSim.RegionServer/RegionInfo.cs52
1 files changed, 1 insertions, 51 deletions
diff --git a/OpenSim/OpenSim.RegionServer/RegionInfo.cs b/OpenSim/OpenSim.RegionServer/RegionInfo.cs
index f82495a..76f05b6 100644
--- a/OpenSim/OpenSim.RegionServer/RegionInfo.cs
+++ b/OpenSim/OpenSim.RegionServer/RegionInfo.cs
@@ -32,53 +32,6 @@ namespace OpenSim
32 32
33 } 33 }
34 34
35 public void SaveToGrid()
36 {
37 //we really want to keep any server connection code out of here and out of the code code
38 // and put it in the server connection classes (those inheriting from IGridServer etc)
39 string reqtext;
40 reqtext = "<Root>";
41 reqtext += "<authkey>" + this.GridSendKey + "</authkey>";
42 reqtext += "<sim>";
43 reqtext += "<uuid>" + this.SimUUID.ToString() + "</uuid>";
44 reqtext += "<regionname>" + this.RegionName + "</regionname>";
45 reqtext += "<sim_ip>" + this.IPListenAddr + "</sim_ip>";
46 reqtext += "<sim_port>" + this.IPListenPort.ToString() + "</sim_port>";
47 reqtext += "<region_locx>" + this.RegionLocX.ToString() + "</region_locx>";
48 reqtext += "<region_locy>" + this.RegionLocY.ToString() + "</region_locy>";
49 reqtext += "<estate_id>1</estate_id>";
50 reqtext += "</sim>";
51 reqtext += "</Root>";
52
53 byte[] reqdata = (new System.Text.ASCIIEncoding()).GetBytes(reqtext);
54 string newpath = "";
55 if (this.GridURL.EndsWith("/"))
56 {
57 newpath = this.GridURL + "sims/";
58 }
59 else
60 {
61 newpath = this.GridURL + "/sims/";
62 }
63
64 WebRequest GridSaveReq = WebRequest.Create(newpath + this.SimUUID.ToString());
65 GridSaveReq.Method = "POST";
66 GridSaveReq.ContentType = "application/x-www-form-urlencoded";
67 GridSaveReq.ContentLength = reqdata.Length;
68
69 Stream stOut = GridSaveReq.GetRequestStream();
70 stOut.Write(reqdata, 0, reqdata.Length);
71 stOut.Close();
72
73 WebResponse gridresp = GridSaveReq.GetResponse();
74 StreamReader stIn = new StreamReader(gridresp.GetResponseStream(), Encoding.ASCII);
75 string GridResponse = stIn.ReadToEnd();
76 stIn.Close();
77 gridresp.Close();
78
79 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"RegionInfo.CS:SaveToGrid() - Grid said: " + GridResponse);
80 }
81
82 public void InitConfig(bool sandboxMode, IGenericConfig configData) 35 public void InitConfig(bool sandboxMode, IGenericConfig configData)
83 { 36 {
84 this.isSandbox = sandboxMode; 37 this.isSandbox = sandboxMode;
@@ -233,10 +186,7 @@ namespace OpenSim
233 186
234 } 187 }
235 this.RegionHandle = Util.UIntsToLong((RegionLocX * 256), (RegionLocY * 256)); 188 this.RegionHandle = Util.UIntsToLong((RegionLocX * 256), (RegionLocY * 256));
236 if (!this.isSandbox) 189
237 {
238 this.SaveToGrid();
239 }
240 configData.Commit(); 190 configData.Commit();
241 } 191 }
242 catch (Exception e) 192 catch (Exception e)