aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authoronefang2019-07-24 05:49:26 +1000
committeronefang2019-07-24 05:49:26 +1000
commit15b2a91ffc6d240277a852aa750a0259ae6a2a17 (patch)
treefb08c599396ba11d5f23b7bca2af21b9cb5af368
parentRevert list content type check. (diff)
downloadopensim-SC-15b2a91ffc6d240277a852aa750a0259ae6a2a17.zip
opensim-SC-15b2a91ffc6d240277a852aa750a0259ae6a2a17.tar.gz
opensim-SC-15b2a91ffc6d240277a852aa750a0259ae6a2a17.tar.bz2
opensim-SC-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.
-rw-r--r--OpenSim/Framework/Constants.cs3
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs54
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginService.cs28
4 files changed, 61 insertions, 31 deletions
diff --git a/OpenSim/Framework/Constants.cs b/OpenSim/Framework/Constants.cs
index 15da7e6..ac99a92 100644
--- a/OpenSim/Framework/Constants.cs
+++ b/OpenSim/Framework/Constants.cs
@@ -60,6 +60,7 @@ namespace OpenSim.Framework
60 EstateManagers = 10 60 EstateManagers = 10
61 } 61 }
62 62
63 // Identical to the one in OpenMetaverse, except I'm extending it now, and OpenSim decided to copy it here, making life hard.
63 [Flags]public enum TeleportFlags : uint 64 [Flags]public enum TeleportFlags : uint
64 { 65 {
65 /// <summary>No flags set, or teleport failed</summary> 66 /// <summary>No flags set, or teleport failed</summary>
@@ -98,6 +99,8 @@ namespace OpenSim.Framework
98 ForceRedirect = 1 << 15, 99 ForceRedirect = 1 << 15,
99 /// <summary>Via script.</summary> 100 /// <summary>Via script.</summary>
100 ViaScript = 1 << 16, 101 ViaScript = 1 << 16,
102 /// <summary>Via map, though this is a guess.</summary>
103 ViaMap = 1 << 17,
101 /// <summary>Teleport Finished via a Lure</summary> 104 /// <summary>Teleport Finished via a Lure</summary>
102 FinishedViaLure = 1 << 26, 105 FinishedViaLure = 1 << 26,
103 /// <summary>Finished, Sim Changed</summary> 106 /// <summary>Finished, Sim Changed</summary>
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)
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs
index 3ccdc9c..53a3c2f 100644
--- a/OpenSim/Services/LLLoginService/LLLoginService.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginService.cs
@@ -489,7 +489,7 @@ namespace OpenSim.Services.LLLoginService
489 Vector3 position = Vector3.Zero; 489 Vector3 position = Vector3.Zero;
490 Vector3 lookAt = Vector3.Zero; 490 Vector3 lookAt = Vector3.Zero;
491 GridRegion gatekeeper = null; 491 GridRegion gatekeeper = null;
492 TeleportFlags flags; 492 Constants.TeleportFlags flags;
493 GridRegion destination = FindDestination(account, scopeID, guinfo, session, startLocation, home, out gatekeeper, out where, out position, out lookAt, out flags); 493 GridRegion destination = FindDestination(account, scopeID, guinfo, session, startLocation, home, out gatekeeper, out where, out position, out lookAt, out flags);
494 if (destination == null) 494 if (destination == null)
495 { 495 {
@@ -508,7 +508,7 @@ namespace OpenSim.Services.LLLoginService
508 } 508 }
509 509
510 if (account.UserLevel >= 200) 510 if (account.UserLevel >= 200)
511 flags |= TeleportFlags.Godlike; 511 flags |= Constants.TeleportFlags.Godlike;
512 // 512 //
513 // Get the avatar 513 // Get the avatar
514 // 514 //
@@ -582,9 +582,9 @@ namespace OpenSim.Services.LLLoginService
582 protected GridRegion FindDestination( 582 protected GridRegion FindDestination(
583 UserAccount account, UUID scopeID, GridUserInfo pinfo, UUID sessionID, string startLocation, 583 UserAccount account, UUID scopeID, GridUserInfo pinfo, UUID sessionID, string startLocation,
584 GridRegion home, out GridRegion gatekeeper, 584 GridRegion home, out GridRegion gatekeeper,
585 out string where, out Vector3 position, out Vector3 lookAt, out TeleportFlags flags) 585 out string where, out Vector3 position, out Vector3 lookAt, out Constants.TeleportFlags flags)
586 { 586 {
587 flags = TeleportFlags.ViaLogin; 587 flags = Constants.TeleportFlags.ViaLogin;
588 588
589 m_log.DebugFormat( 589 m_log.DebugFormat(
590 "[LLOGIN SERVICE]: Finding destination matching start location {0} for {1}", 590 "[LLOGIN SERVICE]: Finding destination matching start location {0} for {1}",
@@ -618,7 +618,7 @@ namespace OpenSim.Services.LLLoginService
618 618
619 position = pinfo.HomePosition; 619 position = pinfo.HomePosition;
620 lookAt = pinfo.HomeLookAt; 620 lookAt = pinfo.HomeLookAt;
621 flags |= TeleportFlags.ViaHome; 621 flags |= Constants.TeleportFlags.ViaHome;
622 } 622 }
623 623
624 if (tryDefaults) 624 if (tryDefaults)
@@ -626,7 +626,7 @@ namespace OpenSim.Services.LLLoginService
626 List<GridRegion> defaults = m_GridService.GetDefaultRegions(scopeID); 626 List<GridRegion> defaults = m_GridService.GetDefaultRegions(scopeID);
627 if (defaults != null && defaults.Count > 0) 627 if (defaults != null && defaults.Count > 0)
628 { 628 {
629 flags |= TeleportFlags.ViaRegionID; 629 flags |= Constants.TeleportFlags.ViaRegionID;
630 region = defaults[0]; 630 region = defaults[0];
631 where = "safe"; 631 where = "safe";
632 } 632 }
@@ -637,7 +637,7 @@ namespace OpenSim.Services.LLLoginService
637 region = FindAlternativeRegion(scopeID); 637 region = FindAlternativeRegion(scopeID);
638 if (region != null) 638 if (region != null)
639 { 639 {
640 flags |= TeleportFlags.ViaRegionID; 640 flags |= Constants.TeleportFlags.ViaRegionID;
641 where = "safe"; 641 where = "safe";
642 } 642 }
643 } 643 }
@@ -660,7 +660,7 @@ namespace OpenSim.Services.LLLoginService
660 List<GridRegion> defaults = m_GridService.GetDefaultRegions(scopeID); 660 List<GridRegion> defaults = m_GridService.GetDefaultRegions(scopeID);
661 if (defaults != null && defaults.Count > 0) 661 if (defaults != null && defaults.Count > 0)
662 { 662 {
663 flags |= TeleportFlags.ViaRegionID; 663 flags |= Constants.TeleportFlags.ViaRegionID;
664 region = defaults[0]; 664 region = defaults[0];
665 where = "safe"; 665 where = "safe";
666 } 666 }
@@ -670,7 +670,7 @@ namespace OpenSim.Services.LLLoginService
670 region = FindAlternativeRegion(scopeID); 670 region = FindAlternativeRegion(scopeID);
671 if (region != null) 671 if (region != null)
672 { 672 {
673 flags |= TeleportFlags.ViaRegionID; 673 flags |= Constants.TeleportFlags.ViaRegionID;
674 where = "safe"; 674 where = "safe";
675 } 675 }
676 } 676 }
@@ -686,7 +686,7 @@ namespace OpenSim.Services.LLLoginService
686 } 686 }
687 else 687 else
688 { 688 {
689 flags |= TeleportFlags.ViaRegionID; 689 flags |= Constants.TeleportFlags.ViaRegionID;
690 690
691 // free uri form 691 // free uri form
692 // e.g. New Moon&135&46 New Moon@osgrid.org:8002&153&34 692 // e.g. New Moon&135&46 New Moon@osgrid.org:8002&153&34
@@ -704,6 +704,8 @@ namespace OpenSim.Services.LLLoginService
704 position = new Vector3(float.Parse(uriMatch.Groups["x"].Value, Culture.NumberFormatInfo), 704 position = new Vector3(float.Parse(uriMatch.Groups["x"].Value, Culture.NumberFormatInfo),
705 float.Parse(uriMatch.Groups["y"].Value, Culture.NumberFormatInfo), 705 float.Parse(uriMatch.Groups["y"].Value, Culture.NumberFormatInfo),
706 float.Parse(uriMatch.Groups["z"].Value, Culture.NumberFormatInfo)); 706 float.Parse(uriMatch.Groups["z"].Value, Culture.NumberFormatInfo));
707 if (0 == position.Z)
708 flags |= Constants.TeleportFlags.ViaMap;
707 709
708 string regionName = uriMatch.Groups["region"].ToString(); 710 string regionName = uriMatch.Groups["region"].ToString();
709 if (regionName != null) 711 if (regionName != null)
@@ -858,7 +860,7 @@ namespace OpenSim.Services.LLLoginService
858 860
859 protected AgentCircuitData LaunchAgentAtGrid(GridRegion gatekeeper, GridRegion destination, UserAccount account, AvatarAppearance avatar, 861 protected AgentCircuitData LaunchAgentAtGrid(GridRegion gatekeeper, GridRegion destination, UserAccount account, AvatarAppearance avatar,
860 UUID session, UUID secureSession, Vector3 position, string currentWhere, string viewer, string channel, string mac, string id0, 862 UUID session, UUID secureSession, Vector3 position, string currentWhere, string viewer, string channel, string mac, string id0,
861 IPEndPoint clientIP, TeleportFlags flags, out string where, out string reason, out GridRegion dest) 863 IPEndPoint clientIP, Constants.TeleportFlags flags, out string where, out string reason, out GridRegion dest)
862 { 864 {
863 where = currentWhere; 865 where = currentWhere;
864 ISimulationService simConnector = null; 866 ISimulationService simConnector = null;
@@ -895,7 +897,7 @@ namespace OpenSim.Services.LLLoginService
895 { 897 {
896 foreach (GridRegion r in fallbacks) 898 foreach (GridRegion r in fallbacks)
897 { 899 {
898 success = LaunchAgentDirectly(simConnector, r, aCircuit, flags | TeleportFlags.ViaRegionID, out reason); 900 success = LaunchAgentDirectly(simConnector, r, aCircuit, flags | Constants.TeleportFlags.ViaRegionID | Constants.TeleportFlags.ViaMap, out reason);
899 if (success) 901 if (success)
900 { 902 {
901 where = "safe"; 903 where = "safe";
@@ -1041,7 +1043,7 @@ namespace OpenSim.Services.LLLoginService
1041 1043
1042 } 1044 }
1043 1045
1044 private bool LaunchAgentDirectly(ISimulationService simConnector, GridRegion region, AgentCircuitData aCircuit, TeleportFlags flags, out string reason) 1046 private bool LaunchAgentDirectly(ISimulationService simConnector, GridRegion region, AgentCircuitData aCircuit, Constants.TeleportFlags flags, out string reason)
1045 { 1047 {
1046 EntityTransferContext ctx = new EntityTransferContext(); 1048 EntityTransferContext ctx = new EntityTransferContext();
1047 1049