aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-10-13 01:03:09 +0100
committerJustin Clark-Casey (justincc)2012-10-13 01:03:09 +0100
commit330b976a62b3153dadfb1acdaa99b60a9084453d (patch)
treea54bf8de09279ecbe5f8efef34d224593d18ddd3 /OpenSim/Region/ScriptEngine
parentNow using region flags for llRequestSimulatorData DATA_SIM_POS. (diff)
downloadopensim-SC_OLD-330b976a62b3153dadfb1acdaa99b60a9084453d.zip
opensim-SC_OLD-330b976a62b3153dadfb1acdaa99b60a9084453d.tar.gz
opensim-SC_OLD-330b976a62b3153dadfb1acdaa99b60a9084453d.tar.bz2
opensim-SC_OLD-330b976a62b3153dadfb1acdaa99b60a9084453d.tar.xz
Improve on TBG Renfold's fix to llRequestSimulatorData DATA_SIM_POS by only performing HG regionflags service check if the region secret is not empty.
An empty RegionSecret is never HG, whilst a non-empty one may be HG or being genuinely used as a RegionSecret.
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs44
1 files changed, 25 insertions, 19 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 6b08b00..1e8dec8 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -9314,11 +9314,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9314 9314
9315 GridRegion info; 9315 GridRegion info;
9316 9316
9317 if (m_ScriptEngine.World.RegionInfo.RegionName == simulator) //Det data for this simulator? 9317 if (World.RegionInfo.RegionName == simulator)
9318 9318 info = new GridRegion(World.RegionInfo);
9319 info = new GridRegion(m_ScriptEngine.World.RegionInfo);
9320 else 9319 else
9321 info = m_ScriptEngine.World.GridService.GetRegionByName(m_ScriptEngine.World.RegionInfo.ScopeID, simulator); 9320 info = World.GridService.GetRegionByName(m_ScriptEngine.World.RegionInfo.ScopeID, simulator);
9322 9321
9323 switch (data) 9322 switch (data)
9324 { 9323 {
@@ -9329,12 +9328,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9329 return UUID.Zero.ToString(); 9328 return UUID.Zero.ToString();
9330 } 9329 }
9331 9330
9332 RegionFlags regionFlags = (RegionFlags)m_ScriptEngine.World.GridService.GetRegionFlags(info.ScopeID, info.RegionID); 9331 bool isHypergridRegion = false;
9333 if ((regionFlags & RegionFlags.Hyperlink) != 0) 9332
9333 if (World.RegionInfo.RegionName != simulator && info.RegionSecret != "")
9334 {
9335 // Hypergrid is currently placing real destination region co-ords into RegionSecret.
9336 // But other code can also use this field for a genuine RegionSecret! Therefore, if
9337 // anything is present we need to disambiguate.
9338 //
9339 // FIXME: Hypergrid should be storing this data in a different field.
9340 RegionFlags regionFlags
9341 = (RegionFlags)m_ScriptEngine.World.GridService.GetRegionFlags(
9342 info.ScopeID, info.RegionID);
9343 isHypergridRegion = (regionFlags & RegionFlags.Hyperlink) != 0;
9344 }
9345
9346 if (isHypergridRegion)
9334 { 9347 {
9335 uint rx = 0, ry = 0; 9348 uint rx = 0, ry = 0;
9336 //Hypergrid Region co-ordinates
9337 Utils.LongToUInts(Convert.ToUInt64(info.RegionSecret), out rx, out ry); 9349 Utils.LongToUInts(Convert.ToUInt64(info.RegionSecret), out rx, out ry);
9350
9338 reply = new LSL_Vector( 9351 reply = new LSL_Vector(
9339 rx, 9352 rx,
9340 ry, 9353 ry,
@@ -9342,18 +9355,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9342 } 9355 }
9343 else 9356 else
9344 { 9357 {
9345 UUID regionSecret = UUID.Zero; 9358 // Local grid co-oridnates
9346 if (UUID.TryParse(info.RegionSecret, out regionSecret)) 9359 reply = new LSL_Vector(
9347 { 9360 info.RegionLocX,
9348 if (regionSecret != UUID.Zero) 9361 info.RegionLocY,
9349 { 9362 0).ToString();
9350 //Local co-oridnates
9351 reply = new LSL_Vector(
9352 info.RegionLocX,
9353 info.RegionLocY,
9354 0).ToString();
9355 }
9356 }
9357 } 9363 }
9358 break; 9364 break;
9359 case ScriptBaseClass.DATA_SIM_STATUS: 9365 case ScriptBaseClass.DATA_SIM_STATUS: