diff options
author | onefang | 2020-09-09 22:59:24 +1000 |
---|---|---|
committer | onefang | 2020-09-09 22:59:24 +1000 |
commit | aaef497afbedef9382c9afdcb9f8d0d5b0a0e0bc (patch) | |
tree | 0cca9608b28ec503f045a26b0f664a176a061d1f /OpenSim/Services/LLLoginService/LLLoginService.cs | |
parent | Use F1 instead of ? as the in command help key. (diff) | |
download | opensim-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/Services/LLLoginService/LLLoginService.cs')
-rw-r--r-- | OpenSim/Services/LLLoginService/LLLoginService.cs | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 7aa18b1..06e3d8d 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs | |||
@@ -534,7 +534,7 @@ namespace OpenSim.Services.LLLoginService | |||
534 | Vector3 position = Vector3.Zero; | 534 | Vector3 position = Vector3.Zero; |
535 | Vector3 lookAt = Vector3.Zero; | 535 | Vector3 lookAt = Vector3.Zero; |
536 | GridRegion gatekeeper = null; | 536 | GridRegion gatekeeper = null; |
537 | TeleportFlags flags; | 537 | Constants.TeleportFlags flags; |
538 | GridRegion destination = FindDestination(account, scopeID, guinfo, session, startLocation, home, out gatekeeper, out where, out position, out lookAt, out flags); | 538 | GridRegion destination = FindDestination(account, scopeID, guinfo, session, startLocation, home, out gatekeeper, out where, out position, out lookAt, out flags); |
539 | if (destination == null) | 539 | if (destination == null) |
540 | { | 540 | { |
@@ -553,7 +553,7 @@ namespace OpenSim.Services.LLLoginService | |||
553 | } | 553 | } |
554 | 554 | ||
555 | if (account.UserLevel >= 200) | 555 | if (account.UserLevel >= 200) |
556 | flags |= TeleportFlags.Godlike; | 556 | flags |= Constants.TeleportFlags.Godlike; |
557 | // | 557 | // |
558 | // Get the avatar | 558 | // Get the avatar |
559 | // | 559 | // |
@@ -627,9 +627,9 @@ namespace OpenSim.Services.LLLoginService | |||
627 | protected GridRegion FindDestination( | 627 | protected GridRegion FindDestination( |
628 | UserAccount account, UUID scopeID, GridUserInfo pinfo, UUID sessionID, string startLocation, | 628 | UserAccount account, UUID scopeID, GridUserInfo pinfo, UUID sessionID, string startLocation, |
629 | GridRegion home, out GridRegion gatekeeper, | 629 | GridRegion home, out GridRegion gatekeeper, |
630 | out string where, out Vector3 position, out Vector3 lookAt, out TeleportFlags flags) | 630 | out string where, out Vector3 position, out Vector3 lookAt, out Constants.TeleportFlags flags) |
631 | { | 631 | { |
632 | flags = TeleportFlags.ViaLogin; | 632 | flags = Constants.TeleportFlags.ViaLogin; |
633 | 633 | ||
634 | m_log.DebugFormat( | 634 | m_log.DebugFormat( |
635 | "[LLOGIN SERVICE]: Finding destination matching start location {0} for {1}", | 635 | "[LLOGIN SERVICE]: Finding destination matching start location {0} for {1}", |
@@ -663,7 +663,7 @@ namespace OpenSim.Services.LLLoginService | |||
663 | 663 | ||
664 | position = pinfo.HomePosition; | 664 | position = pinfo.HomePosition; |
665 | lookAt = pinfo.HomeLookAt; | 665 | lookAt = pinfo.HomeLookAt; |
666 | flags |= TeleportFlags.ViaHome; | 666 | flags |= Constants.TeleportFlags.ViaHome; |
667 | } | 667 | } |
668 | 668 | ||
669 | if (tryDefaults) | 669 | if (tryDefaults) |
@@ -671,7 +671,7 @@ namespace OpenSim.Services.LLLoginService | |||
671 | List<GridRegion> defaults = m_GridService.GetDefaultRegions(scopeID); | 671 | List<GridRegion> defaults = m_GridService.GetDefaultRegions(scopeID); |
672 | if (defaults != null && defaults.Count > 0) | 672 | if (defaults != null && defaults.Count > 0) |
673 | { | 673 | { |
674 | flags |= TeleportFlags.ViaRegionID; | 674 | flags |= Constants.TeleportFlags.ViaRegionID; |
675 | region = defaults[0]; | 675 | region = defaults[0]; |
676 | where = "safe"; | 676 | where = "safe"; |
677 | } | 677 | } |
@@ -682,7 +682,7 @@ namespace OpenSim.Services.LLLoginService | |||
682 | region = FindAlternativeRegion(scopeID); | 682 | region = FindAlternativeRegion(scopeID); |
683 | if (region != null) | 683 | if (region != null) |
684 | { | 684 | { |
685 | flags |= TeleportFlags.ViaRegionID; | 685 | flags |= Constants.TeleportFlags.ViaRegionID; |
686 | where = "safe"; | 686 | where = "safe"; |
687 | } | 687 | } |
688 | } | 688 | } |
@@ -705,7 +705,7 @@ namespace OpenSim.Services.LLLoginService | |||
705 | List<GridRegion> defaults = m_GridService.GetDefaultRegions(scopeID); | 705 | List<GridRegion> defaults = m_GridService.GetDefaultRegions(scopeID); |
706 | if (defaults != null && defaults.Count > 0) | 706 | if (defaults != null && defaults.Count > 0) |
707 | { | 707 | { |
708 | flags |= TeleportFlags.ViaRegionID; | 708 | flags |= Constants.TeleportFlags.ViaRegionID; |
709 | region = defaults[0]; | 709 | region = defaults[0]; |
710 | where = "safe"; | 710 | where = "safe"; |
711 | } | 711 | } |
@@ -715,7 +715,7 @@ namespace OpenSim.Services.LLLoginService | |||
715 | region = FindAlternativeRegion(scopeID); | 715 | region = FindAlternativeRegion(scopeID); |
716 | if (region != null) | 716 | if (region != null) |
717 | { | 717 | { |
718 | flags |= TeleportFlags.ViaRegionID; | 718 | flags |= Constants.TeleportFlags.ViaRegionID; |
719 | where = "safe"; | 719 | where = "safe"; |
720 | } | 720 | } |
721 | } | 721 | } |
@@ -730,7 +730,7 @@ namespace OpenSim.Services.LLLoginService | |||
730 | } | 730 | } |
731 | else | 731 | else |
732 | { | 732 | { |
733 | flags |= TeleportFlags.ViaRegionID; | 733 | flags |= Constants.TeleportFlags.ViaRegionID; |
734 | 734 | ||
735 | // free uri form | 735 | // free uri form |
736 | // e.g. New Moon&135&46 New Moon@osgrid.org:8002&153&34 | 736 | // e.g. New Moon&135&46 New Moon@osgrid.org:8002&153&34 |
@@ -748,6 +748,8 @@ namespace OpenSim.Services.LLLoginService | |||
748 | position = new Vector3(float.Parse(uriMatch.Groups["x"].Value, Culture.NumberFormatInfo), | 748 | position = new Vector3(float.Parse(uriMatch.Groups["x"].Value, Culture.NumberFormatInfo), |
749 | float.Parse(uriMatch.Groups["y"].Value, Culture.NumberFormatInfo), | 749 | float.Parse(uriMatch.Groups["y"].Value, Culture.NumberFormatInfo), |
750 | float.Parse(uriMatch.Groups["z"].Value, Culture.NumberFormatInfo)); | 750 | float.Parse(uriMatch.Groups["z"].Value, Culture.NumberFormatInfo)); |
751 | if (0 == position.Z) | ||
752 | flags |= Constants.TeleportFlags.ViaMap; | ||
751 | 753 | ||
752 | string regionName = uriMatch.Groups["region"].ToString(); | 754 | string regionName = uriMatch.Groups["region"].ToString(); |
753 | if (regionName != null) | 755 | if (regionName != null) |
@@ -900,7 +902,7 @@ namespace OpenSim.Services.LLLoginService | |||
900 | 902 | ||
901 | protected AgentCircuitData LaunchAgentAtGrid(GridRegion gatekeeper, GridRegion destination, UserAccount account, AvatarAppearance avatar, | 903 | protected AgentCircuitData LaunchAgentAtGrid(GridRegion gatekeeper, GridRegion destination, UserAccount account, AvatarAppearance avatar, |
902 | UUID session, UUID secureSession, Vector3 position, string currentWhere, string viewer, string channel, string mac, string id0, | 904 | UUID session, UUID secureSession, Vector3 position, string currentWhere, string viewer, string channel, string mac, string id0, |
903 | IPEndPoint clientIP, TeleportFlags flags, out string where, out string reason, out GridRegion dest) | 905 | IPEndPoint clientIP, Constants.TeleportFlags flags, out string where, out string reason, out GridRegion dest) |
904 | { | 906 | { |
905 | where = currentWhere; | 907 | where = currentWhere; |
906 | ISimulationService simConnector = null; | 908 | ISimulationService simConnector = null; |
@@ -937,7 +939,7 @@ namespace OpenSim.Services.LLLoginService | |||
937 | { | 939 | { |
938 | foreach (GridRegion r in fallbacks) | 940 | foreach (GridRegion r in fallbacks) |
939 | { | 941 | { |
940 | success = LaunchAgentDirectly(simConnector, r, aCircuit, flags | TeleportFlags.ViaRegionID, out reason); | 942 | success = LaunchAgentDirectly(simConnector, r, aCircuit, flags | Constants.TeleportFlags.ViaRegionID | Constants.TeleportFlags.ViaMap, out reason); |
941 | if (success) | 943 | if (success) |
942 | { | 944 | { |
943 | where = "safe"; | 945 | where = "safe"; |
@@ -1083,7 +1085,7 @@ namespace OpenSim.Services.LLLoginService | |||
1083 | 1085 | ||
1084 | } | 1086 | } |
1085 | 1087 | ||
1086 | private bool LaunchAgentDirectly(ISimulationService simConnector, GridRegion region, AgentCircuitData aCircuit, TeleportFlags flags, out string reason) | 1088 | private bool LaunchAgentDirectly(ISimulationService simConnector, GridRegion region, AgentCircuitData aCircuit, Constants.TeleportFlags flags, out string reason) |
1087 | { | 1089 | { |
1088 | EntityTransferContext ctx = new EntityTransferContext(); | 1090 | EntityTransferContext ctx = new EntityTransferContext(); |
1089 | 1091 | ||