aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/GridServer/GridManager.cs
diff options
context:
space:
mode:
authorBrian McBee2007-08-08 02:41:14 +0000
committerBrian McBee2007-08-08 02:41:14 +0000
commit029f0e4e3dcebebd5b9cddb0c06de07a7ba29c9d (patch)
tree006ca5e7476aec0a03a668cab0acc1800e6fa6c6 /OpenSim/Grid/GridServer/GridManager.cs
parentstarting to push some of the actual sql commands to get this to disk. (diff)
downloadopensim-SC_OLD-029f0e4e3dcebebd5b9cddb0c06de07a7ba29c9d.zip
opensim-SC_OLD-029f0e4e3dcebebd5b9cddb0c06de07a7ba29c9d.tar.gz
opensim-SC_OLD-029f0e4e3dcebebd5b9cddb0c06de07a7ba29c9d.tar.bz2
opensim-SC_OLD-029f0e4e3dcebebd5b9cddb0c06de07a7ba29c9d.tar.xz
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.
Diffstat (limited to 'OpenSim/Grid/GridServer/GridManager.cs')
-rw-r--r--OpenSim/Grid/GridServer/GridManager.cs25
1 files changed, 16 insertions, 9 deletions
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
227 227
228 SimProfileData TheSim = null; 228 SimProfileData TheSim = null;
229 Hashtable requestData = (Hashtable)request.Params[0]; 229 Hashtable requestData = (Hashtable)request.Params[0];
230 230 string myword;
231 if (requestData.ContainsKey("UUID")) 231 if (requestData.ContainsKey("UUID"))
232 { 232 {
233 TheSim = getRegion(new LLUUID((string)requestData["UUID"])); 233 TheSim = getRegion(new LLUUID((string)requestData["UUID"]));
234 234
235 logToDB((new LLUUID((string)requestData["UUID"])).ToStringHyphenated(),"XmlRpcSimulatorLoginMethod","", 5,"Region attempting login with UUID."); 235// logToDB((new LLUUID((string)requestData["UUID"])).ToStringHyphenated(),"XmlRpcSimulatorLoginMethod","", 5,"Region attempting login with UUID.");
236 } 236 }
237 else if (requestData.ContainsKey("region_handle")) 237 else if (requestData.ContainsKey("region_handle"))
238 { 238 {
239 239
240 TheSim = getRegion((ulong)Convert.ToUInt64(requestData["region_handle"])); 240// TheSim = getRegion((ulong)Convert.ToUInt64(requestData["region_handle"]));
241 logToDB((string)requestData["region_handle"], "XmlRpcSimulatorLoginMethod", "", 5, "Region attempting login with regionHandle."); 241// logToDB((string)requestData["region_handle"], "XmlRpcSimulatorLoginMethod", "", 5, "Region attempting login with regionHandle.");
242 } 242 }
243 else 243 else
244 { 244 {
@@ -248,7 +248,14 @@ namespace OpenSim.Grid.GridServer
248 248
249 if (TheSim == null) // Shouldnt this be in the REST Simulator Set method? 249 if (TheSim == null) // Shouldnt this be in the REST Simulator Set method?
250 { 250 {
251 //NEW REGION 251 Console.WriteLine("NEW SIM");
252 myword = "creation";
253 }
254 else
255 {
256 myword = "connection";
257 }
258
252 TheSim = new SimProfileData(); 259 TheSim = new SimProfileData();
253 260
254 TheSim.regionRecvKey = config.SimRecvKey; 261 TheSim.regionRecvKey = config.SimRecvKey;
@@ -272,11 +279,11 @@ namespace OpenSim.Grid.GridServer
272 TheSim.regionMapTextureID = new LLUUID((string)requestData["map-image-id"]); 279 TheSim.regionMapTextureID = new LLUUID((string)requestData["map-image-id"]);
273 280
274 TheSim.regionHandle = Helpers.UIntsToLong((TheSim.regionLocX * 256), (TheSim.regionLocY * 256)); 281 TheSim.regionHandle = Helpers.UIntsToLong((TheSim.regionLocX * 256), (TheSim.regionLocY * 256));
275 System.Console.WriteLine("adding region " + TheSim.regionLocX + " , " + TheSim.regionLocY + " , " + TheSim.regionHandle); 282 System.Console.WriteLine("adding region " + TheSim.regionLocX + " , " + TheSim.regionLocY + " , " + TheSim.serverURI);
276 TheSim.serverURI = "http://" + TheSim.serverIP + ":" + TheSim.serverPort + "/"; 283 TheSim.serverURI = "http://" + TheSim.serverIP + ":" + TheSim.serverPort + "/";
277 TheSim.httpServerURI = "http://" + TheSim.serverIP + ":" + TheSim.httpPort + "/"; 284 TheSim.httpServerURI = "http://" + TheSim.serverIP + ":" + TheSim.httpPort + "/";
278 285
279 Console.WriteLine("NEW SIM: " + TheSim.serverURI); 286
280 TheSim.regionName = (string)requestData["sim_name"]; 287 TheSim.regionName = (string)requestData["sim_name"];
281 TheSim.UUID = new LLUUID((string)requestData["UUID"]); 288 TheSim.UUID = new LLUUID((string)requestData["UUID"]);
282 289
@@ -288,7 +295,7 @@ namespace OpenSim.Grid.GridServer
288 switch(insertResponse) 295 switch(insertResponse)
289 { 296 {
290 case DataResponse.RESPONSE_OK: 297 case DataResponse.RESPONSE_OK:
291 OpenSim.Framework.Console.MainLog.Instance.Verbose("grid", "New sim creation successful: " + TheSim.regionName); 298 OpenSim.Framework.Console.MainLog.Instance.Verbose("grid", "New sim " + myword + " successful: " + TheSim.regionName);
292 break; 299 break;
293 case DataResponse.RESPONSE_ERROR: 300 case DataResponse.RESPONSE_ERROR:
294 OpenSim.Framework.Console.MainLog.Instance.Warn("storage", "New sim creation failed (Error): " + TheSim.regionName); 301 OpenSim.Framework.Console.MainLog.Instance.Warn("storage", "New sim creation failed (Error): " + TheSim.regionName);
@@ -307,7 +314,7 @@ namespace OpenSim.Grid.GridServer
307 OpenSim.Framework.Console.MainLog.Instance.Warn("storage", "Unable to add region " + TheSim.UUID.ToStringHyphenated() + " via " + kvp.Key); 314 OpenSim.Framework.Console.MainLog.Instance.Warn("storage", "Unable to add region " + TheSim.UUID.ToStringHyphenated() + " via " + kvp.Key);
308 OpenSim.Framework.Console.MainLog.Instance.Warn("storage", e.ToString()); 315 OpenSim.Framework.Console.MainLog.Instance.Warn("storage", e.ToString());
309 } 316 }
310 } 317
311 318
312 319
313 if (getRegion(TheSim.regionHandle) == null) 320 if (getRegion(TheSim.regionHandle) == null)