From df04345e3f0f1ca964085445f1e0d924bad44654 Mon Sep 17 00:00:00 2001
From: Charles Krinke
Date: Sun, 17 Feb 2008 02:03:27 +0000
Subject: Thank you very much, Diva for a patch to increase the grid server
reliability.
---
OpenSim/Grid/GridServer/GridManager.cs | 38 +++++++++++++++++++++-------------
1 file changed, 24 insertions(+), 14 deletions(-)
(limited to 'OpenSim/Grid/GridServer/GridManager.cs')
diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs
index 1c8972e..5cd83ea 100644
--- a/OpenSim/Grid/GridServer/GridManager.cs
+++ b/OpenSim/Grid/GridServer/GridManager.cs
@@ -680,29 +680,39 @@ namespace OpenSim.Grid.GridServer
///
///
///
- ///
+ /// A string representing the sim's UUID
/// Information about the sim in XML
public string RestGetSimMethod(string request, string path, string param)
{
string respstring = String.Empty;
RegionProfileData TheSim;
- LLUUID UUID = new LLUUID(param);
- TheSim = getRegion(UUID);
- if (!(TheSim == null))
+ LLUUID UUID;
+ if (LLUUID.TryParse(param, out UUID))
+ {
+ TheSim = getRegion(UUID);
+
+ if (!(TheSim == null))
+ {
+ respstring = "";
+ respstring += "" + TheSim.regionSendKey + "";
+ respstring += "";
+ respstring += "" + TheSim.UUID.ToString() + "";
+ respstring += "" + TheSim.regionName + "";
+ respstring += "" + Util.GetHostFromDNS(TheSim.serverIP).ToString() + "";
+ respstring += "" + TheSim.serverPort.ToString() + "";
+ respstring += "" + TheSim.regionLocX.ToString() + "";
+ respstring += "" + TheSim.regionLocY.ToString() + "";
+ respstring += "1";
+ respstring += "";
+ respstring += "";
+ }
+ }
+ else
{
respstring = "";
- respstring += "" + TheSim.regionSendKey + "";
- respstring += "";
- respstring += "" + TheSim.UUID.ToString() + "";
- respstring += "" + TheSim.regionName + "";
- respstring += "" + Util.GetHostFromDNS(TheSim.serverIP).ToString() + "";
- respstring += "" + TheSim.serverPort.ToString() + "";
- respstring += "" + TheSim.regionLocX.ToString() + "";
- respstring += "" + TheSim.regionLocY.ToString() + "";
- respstring += "1";
- respstring += "";
+ respstring += "Param must be a UUID";
respstring += "";
}
--
cgit v1.1