* Minor: Initial cleaning up of some of the grid sim login messages

0.6.0-stable
Justin Clarke Casey 2008-05-12 16:16:50 +00:00
parent d8a6c89a44
commit 6a5be03a80
2 changed files with 30 additions and 22 deletions

View File

@ -292,7 +292,7 @@ namespace OpenSim.Grid.GridServer
if (!requestData.ContainsKey("UUID") || !LLUUID.TryParse((string)requestData["UUID"], out uuid)) if (!requestData.ContainsKey("UUID") || !LLUUID.TryParse((string)requestData["UUID"], out uuid))
{ {
m_log.Info("[GRID]: Region connected without a UUID, ignoring."); m_log.Warn("[LOGIN PRELUDE]: Region connected without a UUID, sending back error response.");
return ErrorResponse("No UUID passed to grid server - unable to connect you"); return ErrorResponse("No UUID passed to grid server - unable to connect you");
} }
@ -302,10 +302,12 @@ namespace OpenSim.Grid.GridServer
} }
catch (FormatException e) catch (FormatException e)
{ {
m_log.Info("[GRID]: Invalid login parameters, ignoring."); m_log.Warn("[LOGIN PRELUDE]: Invalid login parameters, sending back error response.");
return ErrorResponse("Wrong format in login parameters. Please verify parameters." + e.ToString() ); return ErrorResponse("Wrong format in login parameters. Please verify parameters." + e.ToString() );
} }
m_log.InfoFormat("[LOGIN BEGIN]: Received login request from simulator: {0}", sim.regionName);
existingSim = GetRegion(sim.regionHandle); existingSim = GetRegion(sim.regionHandle);
if (existingSim == null || existingSim.UUID == sim.UUID || sim.UUID != sim.originUUID) if (existingSim == null || existingSim.UUID == sim.UUID || sim.UUID != sim.originUUID)
@ -341,27 +343,27 @@ namespace OpenSim.Grid.GridServer
switch (insertResponse) switch (insertResponse)
{ {
case DataResponse.RESPONSE_OK: case DataResponse.RESPONSE_OK:
m_log.Info("[grid]: New sim " + (existingSim == null ? "creation" : "connection") + " successful: " + sim.regionName); m_log.Info("[LOGIN END]: " + (existingSim == null ? "New" : "Existing") + " sim login successful: " + sim.regionName);
break; break;
case DataResponse.RESPONSE_ERROR: case DataResponse.RESPONSE_ERROR:
m_log.Warn("[storage]: New sim creation failed (Error): " + sim.regionName); m_log.Warn("[LOGIN END]: Sim login failed (Error): " + sim.regionName);
break; break;
case DataResponse.RESPONSE_INVALIDCREDENTIALS: case DataResponse.RESPONSE_INVALIDCREDENTIALS:
m_log.Warn("[storage]: " + m_log.Warn("[LOGIN END]: " +
"New sim creation failed (Invalid Credentials): " + sim.regionName); "Sim login failed (Invalid Credentials): " + sim.regionName);
break; break;
case DataResponse.RESPONSE_AUTHREQUIRED: case DataResponse.RESPONSE_AUTHREQUIRED:
m_log.Warn("[storage]: " + m_log.Warn("[LOGIN END]: " +
"New sim creation failed (Authentication Required): " + "Sim login failed (Authentication Required): " +
sim.regionName); sim.regionName);
break; break;
} }
} }
catch (Exception e) catch (Exception e)
{ {
m_log.Warn("[storage]: " + m_log.Warn("[LOGIN END]: " +
"Unable to add region " + sim.UUID.ToString() + " via " + kvp.Key); "Unable to login region " + sim.UUID.ToString() + " via " + kvp.Key);
m_log.Warn("[storage]: " + e.ToString()); m_log.Warn("[LOGIN END]: " + e.ToString());
} }
} }
@ -373,24 +375,26 @@ namespace OpenSim.Grid.GridServer
{ {
if (existingSim == null) if (existingSim == null)
{ {
m_log.Warn("[grid]: Authentication failed when trying to add new region " + sim.regionName + m_log.WarnFormat(
" at location " + sim.regionLocX + "[LOGIN END]: Authentication failed when trying to login new region {0} at location {1} {2}"
" " + sim.regionLocY + " with TheSim.regionRecvKey " + sim.regionRecvKey + "(" + Config.SimSendKey + ") and TheSim.regionRecvKey " + sim.regionSendKey + "(" + Config.SimRecvKey + ") "); + " with TheSim.regionSendKey {3} (expected {4}) and TheSim.regionRecvKey {5} (expected {6})",
sim.regionName, sim.regionLocX, sim.regionLocY,
sim.regionSendKey, Config.SimRecvKey, sim.regionRecvKey, Config.SimSendKey);
} }
else else
{ {
m_log.Warn("[grid]: Authentication failed when trying to add new region " + sim.regionName + m_log.Warn("[LOGIN END]: Authentication failed when trying to login region " + sim.regionName +
" at location " + sim.regionLocX + " at location " + sim.regionLocX +
" " + sim.regionLocY + " currently occupied by " + existingSim.regionName); " " + sim.regionLocY + " currently occupied by " + existingSim.regionName);
} }
return ErrorResponse("The key required to connect to your region did not match. Please check your send and recieve keys."); return ErrorResponse("The key required to login your region did not match. Please check your send and receive keys.");
} }
} }
else else
{ {
m_log.Warn("[grid]: Failed to add new region " + sim.regionName + " at location " + sim.regionLocX + " " + sim.regionLocY + " currently occupied by " + existingSim.regionName); m_log.Warn("[LOGIN END]: Failed to login region " + sim.regionName + " at location " + sim.regionLocX + " " + sim.regionLocY + " currently occupied by " + existingSim.regionName);
return ErrorResponse("Another region already exists at that location. Try another"); return ErrorResponse("Another region already exists at that location. Please try another.");
} }
} }
@ -539,7 +543,6 @@ namespace OpenSim.Grid.GridServer
sim.regionSecret = Config.SimRecvKey; sim.regionSecret = Config.SimRecvKey;
} }
sim.regionDataURI = String.Empty; sim.regionDataURI = String.Empty;
sim.regionAssetURI = Config.DefaultAssetServer; sim.regionAssetURI = Config.DefaultAssetServer;
sim.regionAssetRecvKey = Config.AssetRecvKey; sim.regionAssetRecvKey = Config.AssetRecvKey;

View File

@ -655,6 +655,11 @@ namespace OpenSim
return GetPhysicsScene(m_physicsEngine, m_meshEngineName); return GetPhysicsScene(m_physicsEngine, m_meshEngineName);
} }
/// <summary>
/// Handler to supply the current status of this sim
///
/// Currently this is always OK if the simulator is still listening for connections on its HTTP service
/// </summary>
protected class SimStatusHandler : IStreamedRequestHandler protected class SimStatusHandler : IStreamedRequestHandler
{ {
public byte[] Handle(string path, Stream request) public byte[] Handle(string path, Stream request)