From 029f0e4e3dcebebd5b9cddb0c06de07a7ba29c9d Mon Sep 17 00:00:00 2001 From: Brian McBee Date: Wed, 8 Aug 2007 02:41:14 +0000 Subject: Grid/GridServer/GridManager.cs Fixed GridManager.cs so that it properly updates the database if you change some parameters in your region (X and Y, region name, etc). It still keys on the region uuid. --- OpenSim/Grid/GridServer/GridManager.cs | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs index f4a8475..d38f5d4 100644 --- a/OpenSim/Grid/GridServer/GridManager.cs +++ b/OpenSim/Grid/GridServer/GridManager.cs @@ -227,18 +227,18 @@ namespace OpenSim.Grid.GridServer SimProfileData TheSim = null; Hashtable requestData = (Hashtable)request.Params[0]; - + string myword; if (requestData.ContainsKey("UUID")) { TheSim = getRegion(new LLUUID((string)requestData["UUID"])); - logToDB((new LLUUID((string)requestData["UUID"])).ToStringHyphenated(),"XmlRpcSimulatorLoginMethod","", 5,"Region attempting login with UUID."); +// logToDB((new LLUUID((string)requestData["UUID"])).ToStringHyphenated(),"XmlRpcSimulatorLoginMethod","", 5,"Region attempting login with UUID."); } else if (requestData.ContainsKey("region_handle")) { - TheSim = getRegion((ulong)Convert.ToUInt64(requestData["region_handle"])); - logToDB((string)requestData["region_handle"], "XmlRpcSimulatorLoginMethod", "", 5, "Region attempting login with regionHandle."); +// TheSim = getRegion((ulong)Convert.ToUInt64(requestData["region_handle"])); +// logToDB((string)requestData["region_handle"], "XmlRpcSimulatorLoginMethod", "", 5, "Region attempting login with regionHandle."); } else { @@ -248,7 +248,14 @@ namespace OpenSim.Grid.GridServer if (TheSim == null) // Shouldnt this be in the REST Simulator Set method? { - //NEW REGION + Console.WriteLine("NEW SIM"); + myword = "creation"; + } + else + { + myword = "connection"; + } + TheSim = new SimProfileData(); TheSim.regionRecvKey = config.SimRecvKey; @@ -272,11 +279,11 @@ namespace OpenSim.Grid.GridServer TheSim.regionMapTextureID = new LLUUID((string)requestData["map-image-id"]); TheSim.regionHandle = Helpers.UIntsToLong((TheSim.regionLocX * 256), (TheSim.regionLocY * 256)); - System.Console.WriteLine("adding region " + TheSim.regionLocX + " , " + TheSim.regionLocY + " , " + TheSim.regionHandle); + System.Console.WriteLine("adding region " + TheSim.regionLocX + " , " + TheSim.regionLocY + " , " + TheSim.serverURI); TheSim.serverURI = "http://" + TheSim.serverIP + ":" + TheSim.serverPort + "/"; TheSim.httpServerURI = "http://" + TheSim.serverIP + ":" + TheSim.httpPort + "/"; - Console.WriteLine("NEW SIM: " + TheSim.serverURI); + TheSim.regionName = (string)requestData["sim_name"]; TheSim.UUID = new LLUUID((string)requestData["UUID"]); @@ -288,7 +295,7 @@ namespace OpenSim.Grid.GridServer switch(insertResponse) { case DataResponse.RESPONSE_OK: - OpenSim.Framework.Console.MainLog.Instance.Verbose("grid", "New sim creation successful: " + TheSim.regionName); + OpenSim.Framework.Console.MainLog.Instance.Verbose("grid", "New sim " + myword + " successful: " + TheSim.regionName); break; case DataResponse.RESPONSE_ERROR: OpenSim.Framework.Console.MainLog.Instance.Warn("storage", "New sim creation failed (Error): " + TheSim.regionName); @@ -307,7 +314,7 @@ namespace OpenSim.Grid.GridServer OpenSim.Framework.Console.MainLog.Instance.Warn("storage", "Unable to add region " + TheSim.UUID.ToStringHyphenated() + " via " + kvp.Key); OpenSim.Framework.Console.MainLog.Instance.Warn("storage", e.ToString()); } - } + if (getRegion(TheSim.regionHandle) == null) -- cgit v1.1