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.afrisby
parent
013641f31d
commit
029f0e4e3d
|
@ -227,18 +227,18 @@ namespace OpenSim.Grid.GridServer
|
||||||
|
|
||||||
SimProfileData TheSim = null;
|
SimProfileData TheSim = null;
|
||||||
Hashtable requestData = (Hashtable)request.Params[0];
|
Hashtable requestData = (Hashtable)request.Params[0];
|
||||||
|
string myword;
|
||||||
if (requestData.ContainsKey("UUID"))
|
if (requestData.ContainsKey("UUID"))
|
||||||
{
|
{
|
||||||
TheSim = getRegion(new LLUUID((string)requestData["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"))
|
else if (requestData.ContainsKey("region_handle"))
|
||||||
{
|
{
|
||||||
|
|
||||||
TheSim = getRegion((ulong)Convert.ToUInt64(requestData["region_handle"]));
|
// TheSim = getRegion((ulong)Convert.ToUInt64(requestData["region_handle"]));
|
||||||
logToDB((string)requestData["region_handle"], "XmlRpcSimulatorLoginMethod", "", 5, "Region attempting login with regionHandle.");
|
// logToDB((string)requestData["region_handle"], "XmlRpcSimulatorLoginMethod", "", 5, "Region attempting login with regionHandle.");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -248,7 +248,14 @@ namespace OpenSim.Grid.GridServer
|
||||||
|
|
||||||
if (TheSim == null) // Shouldnt this be in the REST Simulator Set method?
|
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 = new SimProfileData();
|
||||||
|
|
||||||
TheSim.regionRecvKey = config.SimRecvKey;
|
TheSim.regionRecvKey = config.SimRecvKey;
|
||||||
|
@ -272,11 +279,11 @@ namespace OpenSim.Grid.GridServer
|
||||||
TheSim.regionMapTextureID = new LLUUID((string)requestData["map-image-id"]);
|
TheSim.regionMapTextureID = new LLUUID((string)requestData["map-image-id"]);
|
||||||
|
|
||||||
TheSim.regionHandle = Helpers.UIntsToLong((TheSim.regionLocX * 256), (TheSim.regionLocY * 256));
|
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.serverURI = "http://" + TheSim.serverIP + ":" + TheSim.serverPort + "/";
|
||||||
TheSim.httpServerURI = "http://" + TheSim.serverIP + ":" + TheSim.httpPort + "/";
|
TheSim.httpServerURI = "http://" + TheSim.serverIP + ":" + TheSim.httpPort + "/";
|
||||||
|
|
||||||
Console.WriteLine("NEW SIM: " + TheSim.serverURI);
|
|
||||||
TheSim.regionName = (string)requestData["sim_name"];
|
TheSim.regionName = (string)requestData["sim_name"];
|
||||||
TheSim.UUID = new LLUUID((string)requestData["UUID"]);
|
TheSim.UUID = new LLUUID((string)requestData["UUID"]);
|
||||||
|
|
||||||
|
@ -288,7 +295,7 @@ namespace OpenSim.Grid.GridServer
|
||||||
switch(insertResponse)
|
switch(insertResponse)
|
||||||
{
|
{
|
||||||
case DataResponse.RESPONSE_OK:
|
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;
|
break;
|
||||||
case DataResponse.RESPONSE_ERROR:
|
case DataResponse.RESPONSE_ERROR:
|
||||||
OpenSim.Framework.Console.MainLog.Instance.Warn("storage", "New sim creation failed (Error): " + TheSim.regionName);
|
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", "Unable to add region " + TheSim.UUID.ToStringHyphenated() + " via " + kvp.Key);
|
||||||
OpenSim.Framework.Console.MainLog.Instance.Warn("storage", e.ToString());
|
OpenSim.Framework.Console.MainLog.Instance.Warn("storage", e.ToString());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (getRegion(TheSim.regionHandle) == null)
|
if (getRegion(TheSim.regionHandle) == null)
|
||||||
|
|
Loading…
Reference in New Issue