aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authoronefang2020-09-09 22:59:24 +1000
committeronefang2020-09-09 22:59:24 +1000
commitaaef497afbedef9382c9afdcb9f8d0d5b0a0e0bc (patch)
tree0cca9608b28ec503f045a26b0f664a176a061d1f /OpenSim/Region
parentUse F1 instead of ? as the in command help key. (diff)
downloadopensim-SC-aaef497afbedef9382c9afdcb9f8d0d5b0a0e0bc.zip
opensim-SC-aaef497afbedef9382c9afdcb9f8d0d5b0a0e0bc.tar.gz
opensim-SC-aaef497afbedef9382c9afdcb9f8d0d5b0a0e0bc.tar.bz2
opensim-SC-aaef497afbedef9382c9afdcb9f8d0d5b0a0e0bc.tar.xz
Various teleport fixes.
TPs from scripts avoid all that silly raycasting nonsense, just go where we ask. For the "teleport from above" case, do the right thing. Which includes looking for designated floor prims, which have ^ as the first character of their description. Don't do "teleport from above" when we have proper coords. Teleport home from off grid shouldn't land on roofs either.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs57
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs6
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs2
4 files changed, 48 insertions, 24 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index fa49546..9970132 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -673,9 +673,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
673 673
674 string homeURI = Scene.GetAgentHomeURI(sp.ControllingClient.AgentId); 674 string homeURI = Scene.GetAgentHomeURI(sp.ControllingClient.AgentId);
675 675
676 m_log.DebugFormat( 676//// m_log.DebugFormat(
677 "[ENTITY TRANSFER MODULE]: Teleporting {0} {1} from {2} to {3} ({4}) {5}/{6}", 677 m_log.InfoFormat(
678 sp.Name, sp.UUID, sp.Scene.RegionInfo.RegionName, 678 "[ENTITY TRANSFER MODULE]: Teleporting {0} {1} from {2}/{3} to {4} ({5}) {6}/{7}",
679 sp.Name, sp.UUID, sp.Scene.RegionInfo.RegionName, sp.AbsolutePosition,
679 reg.ServerURI, finalDestination.ServerURI, finalDestination.RegionName, position); 680 reg.ServerURI, finalDestination.ServerURI, finalDestination.RegionName, position);
680 681
681 RegionInfo sourceRegion = sp.Scene.RegionInfo; 682 RegionInfo sourceRegion = sp.Scene.RegionInfo;
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 0d8f286..e84018e 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1406,15 +1406,18 @@ namespace OpenSim.Region.Framework.Scenes
1406 if (groundHeight > pos.Z) 1406 if (groundHeight > pos.Z)
1407 pos.Z = groundHeight; 1407 pos.Z = groundHeight;
1408 1408
1409 if (((m_teleportFlags & TeleportFlags.ViaMap) == 0) && (Math.Truncate(pos.Z) == pos.Z))
1410 m_teleportFlags |= TeleportFlags.ViaMap;
1409 bool checkPhysics = !positionChanged && 1411 bool checkPhysics = !positionChanged &&
1410 m_scene.SupportsRayCastFiltered() && 1412 m_scene.SupportsRayCastFiltered() &&
1411 pos.Z < physTestHeight && 1413 pos.Z < physTestHeight &&
1412 ((m_teleportFlags & (TeleportFlags.ViaLogin | TeleportFlags.ViaRegionID)) == 1414 ((m_teleportFlags & (TeleportFlags.ViaLogin | TeleportFlags.ViaRegionID)) ==
1413 (TeleportFlags.ViaLogin | TeleportFlags.ViaRegionID) 1415 (TeleportFlags.ViaLogin | TeleportFlags.ViaRegionID)
1414 || (m_teleportFlags & TeleportFlags.ViaLocation) != 0 1416//// || (m_teleportFlags & TeleportFlags.ViaLocation) != 0
1417 || (m_teleportFlags & TeleportFlags.ViaMap) != 0
1415 || (m_teleportFlags & TeleportFlags.ViaHGLogin) != 0); 1418 || (m_teleportFlags & TeleportFlags.ViaHGLogin) != 0);
1416 1419
1417 if(checkPhysics) 1420 if(checkPhysics && ((m_teleportFlags & TeleportFlags.ViaScript) == 0) && ((m_teleportFlags & TeleportFlags.ViaHome) == 0))
1418 { 1421 {
1419 // land check was done above 1422 // land check was done above
1420 RayFilterFlags rayfilter = RayFilterFlags.BackFaceCull; 1423 RayFilterFlags rayfilter = RayFilterFlags.BackFaceCull;
@@ -1443,29 +1446,49 @@ namespace OpenSim.Region.Framework.Scenes
1443 return a.Depth.CompareTo(b.Depth); 1446 return a.Depth.CompareTo(b.Depth);
1444 }); 1447 });
1445 1448
1446 int sel = 0; 1449 int sel = -1;
1447 int count = physresults.Count; 1450 int count = physresults.Count;
1448 float curd = physresults[0].Depth; 1451 float curd = physresults[0].Depth;
1449 float nextd = curd + PhysMinSkipGap; 1452 float nextd = curd + PhysMinSkipGap;
1450 float maxDepth = dist - pos.Z; 1453 float maxDepth = dist - pos.Z;
1451 for(int i = 1; i < count; i++) 1454 // Try to find a designated floor.
1455 for(int i = 0; i < count; i++)
1452 { 1456 {
1453 curd = physresults[i].Depth; 1457 SceneObjectPart part = m_scene.GetSceneObjectPart(physresults[i].ConsumerID);
1454 if(curd >= nextd) 1458 if ((null != part) && (string.Empty != part.Description) && ('^' == part.Description[0]))
1455 { 1459 {
1456 sel = i; 1460 sel = i;
1457 if(curd >= maxDepth || curd >= nextd + PhysSkipGapDelta) 1461 dest = physresults[sel].Pos.Z;
1458 break; 1462 break;
1459 } 1463 }
1460 nextd = curd + PhysMinSkipGap; 1464 }
1465
1466 if (-1 == sel)
1467 {
1468 sel = 0;
1469 for (int i = 1; i < count; i++)
1470 {
1471 curd = physresults[i].Depth;
1472 if(curd >= nextd)
1473 {
1474 sel = i;
1475 if(curd >= maxDepth || curd >= nextd + PhysSkipGapDelta)
1476 break;
1477 }
1478 nextd = curd + PhysMinSkipGap;
1479 }
1480 dest = physresults[sel].Pos.Z;
1461 } 1481 }
1462 dest = physresults[sel].Pos.Z;
1463 } 1482 }
1464 1483
1465 dest += localAVHalfHeight; 1484 dest += localAVHalfHeight;
1466 if(dest > pos.Z) 1485if ((m_teleportFlags & TeleportFlags.ViaMap) != 0)
1467 pos.Z = dest; 1486 m_log.InfoFormat("[SCENE PRESENCE]: Teleport from above, for {0} @ {1}, landing height {2}", Name, pos, dest);
1468 break; 1487else
1488 m_log.ErrorFormat("[SCENE PRESENCE]: Teleport from above NOMAP, for {0} @ {1}, landing height {2}", Name, pos, dest);
1489 if(dest > pos.Z)
1490 pos.Z = dest;
1491 break;
1469 } 1492 }
1470 } 1493 }
1471 1494
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index c9ee28e..10afe99 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -5245,7 +5245,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5245 5245
5246 if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_TELEPORT) != 0) 5246 if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_TELEPORT) != 0)
5247 { 5247 {
5248 World.RequestTeleportLocation(presence.ControllingClient, regionHandle, targetPos, targetLookAt, (uint)TeleportFlags.ViaLocation); 5248 World.RequestTeleportLocation(presence.ControllingClient, regionHandle, targetPos, targetLookAt, (uint)(Constants.TeleportFlags.ViaLocation | Constants.TeleportFlags.ViaScript));
5249 } 5249 }
5250 } 5250 }
5251 } 5251 }
@@ -5259,7 +5259,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5259 // Use it as a sim name 5259 // Use it as a sim name
5260 if (assetID == UUID.Zero) 5260 if (assetID == UUID.Zero)
5261 { 5261 {
5262 World.RequestTeleportLocation(sp.ControllingClient, destination, targetPos, targetLookAt, (uint)TeleportFlags.ViaLocation); 5262 World.RequestTeleportLocation(sp.ControllingClient, destination, targetPos, targetLookAt, (uint)(Constants.TeleportFlags.ViaLocation | Constants.TeleportFlags.ViaScript));
5263 return; 5263 return;
5264 } 5264 }
5265 5265
@@ -5272,7 +5272,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5272 5272
5273 AssetLandmark lm = new AssetLandmark(lma); 5273 AssetLandmark lm = new AssetLandmark(lma);
5274 5274
5275 World.RequestTeleportLocation(sp.ControllingClient, lm.RegionHandle, targetPos, targetLookAt, (uint)TeleportFlags.ViaLocation); 5275 World.RequestTeleportLocation(sp.ControllingClient, lm.RegionHandle, targetPos, targetLookAt, (uint)(Constants.TeleportFlags.ViaLocation | Constants.TeleportFlags.ViaScript));
5276 } 5276 }
5277 5277
5278 public void llTextBox(string agent, string message, int chatChannel) 5278 public void llTextBox(string agent, string message, int chatChannel)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index d268609..48f9d0b 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -1071,7 +1071,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1071 Util.FireAndForget( 1071 Util.FireAndForget(
1072 o => World.RequestTeleportLocation( 1072 o => World.RequestTeleportLocation(
1073 presence.ControllingClient, regionName, position, 1073 presence.ControllingClient, regionName, position,
1074 lookat, (uint)TPFlags.ViaLocation), 1074 lookat, (uint)(TPFlags.ViaLocation | TPFlags.ViaScript)),
1075 null, "OSSL_Api.TeleportAgentByRegionCoords"); 1075 null, "OSSL_Api.TeleportAgentByRegionCoords");
1076 ScriptSleep(5000); 1076 ScriptSleep(5000);
1077 } 1077 }