diff options
Diffstat (limited to 'OpenSim.RegionServer')
-rw-r--r-- | OpenSim.RegionServer/RegionInfo.cs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/OpenSim.RegionServer/RegionInfo.cs b/OpenSim.RegionServer/RegionInfo.cs index 1256b50..9958f1a 100644 --- a/OpenSim.RegionServer/RegionInfo.cs +++ b/OpenSim.RegionServer/RegionInfo.cs | |||
@@ -54,19 +54,23 @@ namespace OpenSim | |||
54 | reqtext += "<region_locy>" + this.RegionLocY.ToString() + "</region_locy>"; | 54 | reqtext += "<region_locy>" + this.RegionLocY.ToString() + "</region_locy>"; |
55 | reqtext += "<estate_id>1</estate_id>"; | 55 | reqtext += "<estate_id>1</estate_id>"; |
56 | reqtext += "</sim>"; | 56 | reqtext += "</sim>"; |
57 | |||
58 | byte[] reqdata = (new System.Text.ASCIIEncoding()).GetBytes(reqtext); | ||
57 | 59 | ||
58 | WebRequest GridSaveReq = WebRequest.Create(this.GridURL + "sims/" + this.SimUUID.ToString()); | 60 | WebRequest GridSaveReq = WebRequest.Create(this.GridURL + "sims/" + this.SimUUID.ToString()); |
59 | GridSaveReq.Method = "POST"; | 61 | GridSaveReq.Method = "POST"; |
60 | GridSaveReq.ContentType = "text/plaintext"; | 62 | GridSaveReq.ContentType = "application/x-www-form-urlencoded"; |
61 | GridSaveReq.ContentLength = reqtext.Length; | 63 | GridSaveReq.ContentLength = reqdata.Length; |
62 | 64 | ||
63 | StreamWriter stOut = new StreamWriter(GridSaveReq.GetRequestStream(), System.Text.Encoding.ASCII); | 65 | Stream stOut = GridSaveReq.GetRequestStream(); |
64 | stOut.Write(reqtext); | 66 | stOut.Write(reqdata,0,reqdata.Length); |
65 | stOut.Close(); | 67 | stOut.Close(); |
66 | 68 | ||
67 | StreamReader stIn = new StreamReader(GridSaveReq.GetResponse().GetResponseStream()); | 69 | WebResponse gridresp = GridSaveReq.GetResponse(); |
70 | StreamReader stIn = new StreamReader(gridresp.GetResponseStream()); | ||
68 | string GridResponse = stIn.ReadToEnd(); | 71 | string GridResponse = stIn.ReadToEnd(); |
69 | stIn.Close(); | 72 | stIn.Close(); |
73 | gridresp.Close(); | ||
70 | 74 | ||
71 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("RegionInfo.CS:SaveToGrid() - Grid said: " + GridResponse); | 75 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("RegionInfo.CS:SaveToGrid() - Grid said: " + GridResponse); |
72 | } | 76 | } |