aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authoronefang2019-07-24 05:49:26 +1000
committeronefang2019-07-24 05:49:26 +1000
commit15b2a91ffc6d240277a852aa750a0259ae6a2a17 (patch)
treefb08c599396ba11d5f23b7bca2af21b9cb5af368 /OpenSim/Region
parentRevert list content type check. (diff)
downloadopensim-SC_OLD-15b2a91ffc6d240277a852aa750a0259ae6a2a17.zip
opensim-SC_OLD-15b2a91ffc6d240277a852aa750a0259ae6a2a17.tar.gz
opensim-SC_OLD-15b2a91ffc6d240277a852aa750a0259ae6a2a17.tar.bz2
opensim-SC_OLD-15b2a91ffc6d240277a852aa750a0259ae6a2a17.tar.xz
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.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs54
2 files changed, 43 insertions, 18 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 9ce6201..59e71c6 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -679,9 +679,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
679 679
680 string homeURI = Scene.GetAgentHomeURI(sp.ControllingClient.AgentId); 680 string homeURI = Scene.GetAgentHomeURI(sp.ControllingClient.AgentId);
681 681
682 m_log.DebugFormat( 682//// m_log.DebugFormat(
683 "[ENTITY TRANSFER MODULE]: Teleporting {0} {1} from {2} to {3} ({4}) {5}/{6}", 683 m_log.InfoFormat(
684 sp.Name, sp.UUID, sp.Scene.RegionInfo.RegionName, 684 "[ENTITY TRANSFER MODULE]: Teleporting {0} {1} from {2}/{3} to {4} ({5}) {6}/{7}",
685 sp.Name, sp.UUID, sp.Scene.RegionInfo.RegionName, sp.AbsolutePosition,
685 reg.ServerURI, finalDestination.ServerURI, finalDestination.RegionName, position); 686 reg.ServerURI, finalDestination.ServerURI, finalDestination.RegionName, position);
686 687
687 RegionInfo sourceRegion = sp.Scene.RegionInfo; 688 RegionInfo sourceRegion = sp.Scene.RegionInfo;
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index c0543fd..ff8d2fe 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -166,6 +166,7 @@ namespace OpenSim.Region.Framework.Scenes
166 public static readonly float CHILDUPDATES_MOVEMENT = 100.0f; 166 public static readonly float CHILDUPDATES_MOVEMENT = 100.0f;
167 public static readonly float CHILDUPDATES_TIME = 2000f; // min time between child updates (ms) 167 public static readonly float CHILDUPDATES_TIME = 2000f; // min time between child updates (ms)
168 168
169
169 private UUID m_previusParcelUUID = UUID.Zero; 170 private UUID m_previusParcelUUID = UUID.Zero;
170 private UUID m_currentParcelUUID = UUID.Zero; 171 private UUID m_currentParcelUUID = UUID.Zero;
171 private bool m_previusParcelHide = false; 172 private bool m_previusParcelHide = false;
@@ -1362,15 +1363,18 @@ namespace OpenSim.Region.Framework.Scenes
1362 if (groundHeight > pos.Z) 1363 if (groundHeight > pos.Z)
1363 pos.Z = groundHeight; 1364 pos.Z = groundHeight;
1364 1365
1366 if (((m_teleportFlags & TeleportFlags.ViaMap) == 0) && (Math.Truncate(pos.Z) == pos.Z))
1367 m_teleportFlags |= TeleportFlags.ViaMap;
1365 bool checkPhysics = !positionChanged && 1368 bool checkPhysics = !positionChanged &&
1366 m_scene.SupportsRayCastFiltered() && 1369 m_scene.SupportsRayCastFiltered() &&
1367 pos.Z < physTestHeight && 1370 pos.Z < physTestHeight &&
1368 ((m_teleportFlags & (TeleportFlags.ViaLogin | TeleportFlags.ViaRegionID)) == 1371 ((m_teleportFlags & (TeleportFlags.ViaLogin | TeleportFlags.ViaRegionID)) ==
1369 (TeleportFlags.ViaLogin | TeleportFlags.ViaRegionID) 1372 (TeleportFlags.ViaLogin | TeleportFlags.ViaRegionID)
1370 || (m_teleportFlags & TeleportFlags.ViaLocation) != 0 1373//// || (m_teleportFlags & TeleportFlags.ViaLocation) != 0
1374 || (m_teleportFlags & TeleportFlags.ViaMap) != 0
1371 || (m_teleportFlags & TeleportFlags.ViaHGLogin) != 0); 1375 || (m_teleportFlags & TeleportFlags.ViaHGLogin) != 0);
1372 1376
1373 if(checkPhysics && (m_teleportFlags & TeleportFlags.ViaScript) == 0) 1377 if(checkPhysics && ((m_teleportFlags & TeleportFlags.ViaScript) == 0))
1374 { 1378 {
1375 // land check was done above 1379 // land check was done above
1376 RayFilterFlags rayfilter = RayFilterFlags.BackFaceCull; 1380 RayFilterFlags rayfilter = RayFilterFlags.BackFaceCull;
@@ -1397,26 +1401,46 @@ namespace OpenSim.Region.Framework.Scenes
1397 return a.Depth.CompareTo(b.Depth); 1401 return a.Depth.CompareTo(b.Depth);
1398 }); 1402 });
1399 1403
1400 int sel = 0; 1404 int sel = -1;
1401 int count = physresults.Count; 1405 int count = physresults.Count;
1402 float curd = physresults[0].Depth; 1406 float curd = physresults[0].Depth;
1403 float nextd = curd + PhysMinSkipGap; 1407 float nextd = curd + PhysMinSkipGap;
1404 float maxDepth = dist - pos.Z; 1408 float maxDepth = dist - pos.Z;
1405 for(int i = 1; i < count; i++) 1409 // Try to find a designated floor.
1410 for(int i = 0; i < count; i++)
1406 { 1411 {
1407 curd = physresults[i].Depth; 1412 SceneObjectPart part = m_scene.GetSceneObjectPart(physresults[i].ConsumerID);
1408 if(curd >= nextd) 1413 if ((null != part) && (string.Empty != part.Description) && ('^' == part.Description[0]))
1409 { 1414 {
1410 sel = i; 1415 sel = i;
1411 if(curd >= maxDepth) 1416 dest = physresults[sel].Pos.Z;
1412 break; 1417 break;
1413 } 1418 }
1414 nextd = curd + PhysMinSkipGap; 1419 }
1420
1421 if (-1 == sel)
1422 {
1423 sel = 0;
1424 for (int i = 1; i < count; i++)
1425 {
1426 curd = physresults[i].Depth;
1427 if(curd >= nextd)
1428 {
1429 sel = i;
1430 if(curd >= maxDepth)
1431 break;
1432 }
1433 nextd = curd + PhysMinSkipGap;
1434 }
1435 dest = physresults[sel].Pos.Z;
1415 } 1436 }
1416 dest = physresults[sel].Pos.Z;
1417 } 1437 }
1418 1438
1419 dest += localAVHalfHeight; 1439 dest += localAVHalfHeight;
1440if ((m_teleportFlags & TeleportFlags.ViaMap) != 0)
1441 m_log.InfoFormat("[SCENE PRESENCE]: Teleport from above, for {0} @ {1}, landing height {2}", Name, pos, dest);
1442else
1443 m_log.ErrorFormat("[SCENE PRESENCE]: Teleport from above NOMAP, for {0} @ {1}, landing height {2}", Name, pos, dest);
1420 if(dest > pos.Z) 1444 if(dest > pos.Z)
1421 pos.Z = dest; 1445 pos.Z = dest;
1422 } 1446 }
@@ -1681,7 +1705,7 @@ namespace OpenSim.Region.Framework.Scenes
1681 AddToPhysicalScene(isFlying); 1705 AddToPhysicalScene(isFlying);
1682 SendTerseUpdateToAllClients(); 1706 SendTerseUpdateToAllClients();
1683 } 1707 }
1684 1708/* Not called from anywhere.
1685 public void avnLocalTeleport(Vector3 newpos, Vector3? newvel, bool rotateToVelXY) 1709 public void avnLocalTeleport(Vector3 newpos, Vector3? newvel, bool rotateToVelXY)
1686 { 1710 {
1687 if(!CheckLocalTPLandingPoint(ref newpos)) 1711 if(!CheckLocalTPLandingPoint(ref newpos))
@@ -1715,7 +1739,7 @@ namespace OpenSim.Region.Framework.Scenes
1715 } 1739 }
1716 SendTerseUpdateToAllClients(); 1740 SendTerseUpdateToAllClients();
1717 } 1741 }
1718 1742*/
1719 public void StopFlying() 1743 public void StopFlying()
1720 { 1744 {
1721 if (IsInTransit) 1745 if (IsInTransit)