diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 2c8b0ea..fccd07e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -36,12 +36,11 @@ using OpenMetaverse; | |||
36 | using Nini.Config; | 36 | using Nini.Config; |
37 | using OpenSim; | 37 | using OpenSim; |
38 | using OpenSim.Framework; | 38 | using OpenSim.Framework; |
39 | using OpenSim.Framework.Communications.Cache; | 39 | |
40 | using OpenSim.Framework.Console; | 40 | using OpenSim.Framework.Console; |
41 | using OpenSim.Region.CoreModules.Avatar.NPC; | 41 | using OpenSim.Region.CoreModules.Avatar.NPC; |
42 | using OpenSim.Region.Framework.Interfaces; | 42 | using OpenSim.Region.Framework.Interfaces; |
43 | using OpenSim.Region.Framework.Scenes; | 43 | using OpenSim.Region.Framework.Scenes; |
44 | using OpenSim.Region.Framework.Scenes.Hypergrid; | ||
45 | using OpenSim.Region.ScriptEngine.Shared; | 44 | using OpenSim.Region.ScriptEngine.Shared; |
46 | using OpenSim.Region.ScriptEngine.Shared.Api.Plugins; | 45 | using OpenSim.Region.ScriptEngine.Shared.Api.Plugins; |
47 | using OpenSim.Region.ScriptEngine.Shared.ScriptBase; | 46 | using OpenSim.Region.ScriptEngine.Shared.ScriptBase; |
@@ -607,21 +606,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
607 | // and convert the regionName to the target region | 606 | // and convert the regionName to the target region |
608 | if (regionName.Contains(".") && regionName.Contains(":")) | 607 | if (regionName.Contains(".") && regionName.Contains(":")) |
609 | { | 608 | { |
609 | List<GridRegion> regions = World.GridService.GetRegionsByName(World.RegionInfo.ScopeID, regionName, 1); | ||
610 | // Try to link the region | 610 | // Try to link the region |
611 | IHyperlinkService hyperService = World.RequestModuleInterface<IHyperlinkService>(); | 611 | if (regions != null && regions.Count > 0) |
612 | if (hyperService != null) | ||
613 | { | 612 | { |
614 | GridRegion regInfo = hyperService.TryLinkRegion(presence.ControllingClient, | 613 | GridRegion regInfo = regions[0]; |
615 | regionName); | 614 | regionName = regInfo.RegionName; |
616 | // Get the region name | ||
617 | if (regInfo != null) | ||
618 | { | ||
619 | regionName = regInfo.RegionName; | ||
620 | } | ||
621 | else | ||
622 | { | ||
623 | // Might need to ping the client here in case of failure?? | ||
624 | } | ||
625 | } | 615 | } |
626 | } | 616 | } |
627 | presence.ControllingClient.SendTeleportLocationStart(); | 617 | presence.ControllingClient.SendTeleportLocationStart(); |
@@ -1691,15 +1681,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1691 | { | 1681 | { |
1692 | CheckThreatLevel(ThreatLevel.Low, "osAvatarName2Key"); | 1682 | CheckThreatLevel(ThreatLevel.Low, "osAvatarName2Key"); |
1693 | 1683 | ||
1694 | CachedUserInfo userInfo = World.CommsManager.UserProfileCacheService.GetUserDetails(firstname, lastname); | 1684 | UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, firstname, lastname); |
1695 | 1685 | if (null == account) | |
1696 | if (null == userInfo) | ||
1697 | { | 1686 | { |
1698 | return UUID.Zero.ToString(); | 1687 | return UUID.Zero.ToString(); |
1699 | } | 1688 | } |
1700 | else | 1689 | else |
1701 | { | 1690 | { |
1702 | return userInfo.UserProfile.ID.ToString(); | 1691 | return account.PrincipalID.ToString(); |
1703 | } | 1692 | } |
1704 | } | 1693 | } |
1705 | 1694 | ||
@@ -1710,15 +1699,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1710 | 1699 | ||
1711 | if (UUID.TryParse(id, out key)) | 1700 | if (UUID.TryParse(id, out key)) |
1712 | { | 1701 | { |
1713 | CachedUserInfo userInfo = World.CommsManager.UserProfileCacheService.GetUserDetails(key); | 1702 | UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, key); |
1714 | 1703 | if (null == account) | |
1715 | if (null == userInfo) | ||
1716 | { | 1704 | { |
1717 | return ""; | 1705 | return ""; |
1718 | } | 1706 | } |
1719 | else | 1707 | else |
1720 | { | 1708 | { |
1721 | return userInfo.UserProfile.Name; | 1709 | return account.Name; |
1722 | } | 1710 | } |
1723 | } | 1711 | } |
1724 | else | 1712 | else |