From 84700807c7d8a40038de0792df01c3133965d291 Mon Sep 17 00:00:00 2001 From: MW Date: Fri, 20 Apr 2007 13:44:17 +0000 Subject: Hopefully fixed the forward slash bug in the gridurl set up --- OpenSim.RegionServer/RegionInfo.cs | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'OpenSim.RegionServer') diff --git a/OpenSim.RegionServer/RegionInfo.cs b/OpenSim.RegionServer/RegionInfo.cs index 0d5e980..d3f67ef 100644 --- a/OpenSim.RegionServer/RegionInfo.cs +++ b/OpenSim.RegionServer/RegionInfo.cs @@ -44,7 +44,7 @@ namespace OpenSim //we really want to keep any server connection code out of here and out of the code code // and put it in the server connection classes (those inheriting from IGridServer etc) string reqtext; - reqtext = ""; + reqtext = ""; reqtext += "" + this.GridSendKey + ""; reqtext += ""; reqtext += "" + this.SimUUID.ToString() + ""; @@ -55,24 +55,33 @@ namespace OpenSim reqtext += "" + this.RegionLocY.ToString() + ""; reqtext += "1"; reqtext += ""; - reqtext += ""; + reqtext += ""; - byte[] reqdata = (new System.Text.ASCIIEncoding()).GetBytes(reqtext); + byte[] reqdata = (new System.Text.ASCIIEncoding()).GetBytes(reqtext); + string newpath = ""; + if (this.GridURL.EndsWith("/")) + { + newpath = this.GridURL + "sims/"; + } + else + { + newpath = this.GridURL + "/sims/"; + } - WebRequest GridSaveReq = WebRequest.Create(this.GridURL + "sims/" + this.SimUUID.ToString()); + WebRequest GridSaveReq = WebRequest.Create(newpath + this.SimUUID.ToString()); GridSaveReq.Method = "POST"; GridSaveReq.ContentType = "application/x-www-form-urlencoded"; GridSaveReq.ContentLength = reqdata.Length; Stream stOut = GridSaveReq.GetRequestStream(); - stOut.Write(reqdata,0,reqdata.Length); + stOut.Write(reqdata, 0, reqdata.Length); stOut.Close(); WebResponse gridresp = GridSaveReq.GetResponse(); - StreamReader stIn = new StreamReader(gridresp.GetResponseStream(), Encoding.ASCII); + StreamReader stIn = new StreamReader(gridresp.GetResponseStream(), Encoding.ASCII); string GridResponse = stIn.ReadToEnd(); stIn.Close(); - gridresp.Close(); + gridresp.Close(); OpenSim.Framework.Console.MainConsole.Instance.WriteLine("RegionInfo.CS:SaveToGrid() - Grid said: " + GridResponse); } -- cgit v1.1