OSDMap GetRegion(OSDMap map)
{
OSDMap resp = new OSDMap();
IRegionData regiondata = DataPlugins.RequestPlugin <IRegionData> ();
if (regiondata != null && (map.ContainsKey("RegionID") || map.ContainsKey("Region")))
{
string regionName = map.ContainsKey("Region") ? map ["Region"].ToString().Trim() : "";
UUID regionID = map.ContainsKey("RegionID") ? UUID.Parse(map ["RegionID"].ToString()) : UUID.Zero;
// not used?? // UUID scopeID = map.ContainsKey ("ScopeID") ? UUID.Parse (map ["ScopeID"].ToString ()) : UUID.Zero;
GridRegion region = null;
if (regionID != UUID.Zero)
{
region = regiondata.Get(regionID, null);
}
else if (regionName != string.Empty)
{
region = regiondata.Get(regionName, null, null, null) [0];
}
if (region != null)
{
resp ["Region"] = region.ToOSD();
}
}
return(resp);
}