From 6a5be03a80ca11c46531b853932e94c579cb4020 Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Mon, 12 May 2008 16:16:50 +0000
Subject: * Minor: Initial cleaning up of some of the grid sim login messages
---
OpenSim/Grid/GridServer/GridManager.cs | 47 ++++++++++++++++---------------
OpenSim/Region/Application/OpenSimMain.cs | 5 ++++
2 files changed, 30 insertions(+), 22 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs
index 7eb9c34..14a813a 100644
--- a/OpenSim/Grid/GridServer/GridManager.cs
+++ b/OpenSim/Grid/GridServer/GridManager.cs
@@ -249,7 +249,7 @@ namespace OpenSim.Grid.GridServer
///
///
protected virtual bool ValidateOverwrite(RegionProfileData sim, RegionProfileData existingSim)
- {
+ {
return (existingSim.regionRecvKey == sim.regionRecvKey &&
existingSim.regionSendKey == sim.regionSendKey);
}
@@ -263,7 +263,7 @@ namespace OpenSim.Grid.GridServer
///
///
protected virtual bool ValidateNewRegion(RegionProfileData sim)
- {
+ {
return (sim.regionRecvKey == Config.SimSendKey &&
sim.regionSendKey == Config.SimRecvKey);
}
@@ -292,7 +292,7 @@ namespace OpenSim.Grid.GridServer
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");
}
@@ -302,9 +302,11 @@ namespace OpenSim.Grid.GridServer
}
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() );
}
+
+ m_log.InfoFormat("[LOGIN BEGIN]: Received login request from simulator: {0}", sim.regionName);
existingSim = GetRegion(sim.regionHandle);
@@ -341,27 +343,27 @@ namespace OpenSim.Grid.GridServer
switch (insertResponse)
{
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;
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;
case DataResponse.RESPONSE_INVALIDCREDENTIALS:
- m_log.Warn("[storage]: " +
- "New sim creation failed (Invalid Credentials): " + sim.regionName);
+ m_log.Warn("[LOGIN END]: " +
+ "Sim login failed (Invalid Credentials): " + sim.regionName);
break;
case DataResponse.RESPONSE_AUTHREQUIRED:
- m_log.Warn("[storage]: " +
- "New sim creation failed (Authentication Required): " +
+ m_log.Warn("[LOGIN END]: " +
+ "Sim login failed (Authentication Required): " +
sim.regionName);
break;
}
}
catch (Exception e)
{
- m_log.Warn("[storage]: " +
- "Unable to add region " + sim.UUID.ToString() + " via " + kvp.Key);
- m_log.Warn("[storage]: " + e.ToString());
+ m_log.Warn("[LOGIN END]: " +
+ "Unable to login region " + sim.UUID.ToString() + " via " + kvp.Key);
+ m_log.Warn("[LOGIN END]: " + e.ToString());
}
}
@@ -373,24 +375,26 @@ namespace OpenSim.Grid.GridServer
{
if (existingSim == null)
{
- m_log.Warn("[grid]: Authentication failed when trying to add new region " + sim.regionName +
- " at location " + sim.regionLocX +
- " " + sim.regionLocY + " with TheSim.regionRecvKey " + sim.regionRecvKey + "(" + Config.SimSendKey + ") and TheSim.regionRecvKey " + sim.regionSendKey + "(" + Config.SimRecvKey + ") ");
+ m_log.WarnFormat(
+ "[LOGIN END]: Authentication failed when trying to login new region {0} at location {1} {2}"
+ + " 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
{
- 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 +
" " + 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
{
- m_log.Warn("[grid]: Failed to add new 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");
+ 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. Please try another.");
}
}
@@ -537,8 +541,7 @@ namespace OpenSim.Grid.GridServer
else
{
sim.regionSecret = Config.SimRecvKey;
- }
-
+ }
sim.regionDataURI = String.Empty;
sim.regionAssetURI = Config.DefaultAssetServer;
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs
index ec26d9d..d910dc4 100644
--- a/OpenSim/Region/Application/OpenSimMain.cs
+++ b/OpenSim/Region/Application/OpenSimMain.cs
@@ -655,6 +655,11 @@ namespace OpenSim
return GetPhysicsScene(m_physicsEngine, m_meshEngineName);
}
+ ///
+ /// 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
+ ///
protected class SimStatusHandler : IStreamedRequestHandler
{
public byte[] Handle(string path, Stream request)
--
cgit v1.1