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 | 36 |
1 files changed, 12 insertions, 24 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 1ddba1e..845834e 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(); |
@@ -1482,7 +1472,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1482 | m_host.AddScriptLPS(1); | 1472 | m_host.AddScriptLPS(1); |
1483 | 1473 | ||
1484 | // Create new asset | 1474 | // Create new asset |
1485 | AssetBase asset = new AssetBase(UUID.Random(), notecardName, (sbyte)AssetType.Notecard); | 1475 | AssetBase asset = new AssetBase(UUID.Random(), notecardName, (sbyte)AssetType.Notecard, m_host.OwnerID.ToString()); |
1486 | asset.Description = "Script Generated Notecard"; | 1476 | asset.Description = "Script Generated Notecard"; |
1487 | string notecardData = String.Empty; | 1477 | string notecardData = String.Empty; |
1488 | 1478 | ||
@@ -1695,15 +1685,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1695 | { | 1685 | { |
1696 | CheckThreatLevel(ThreatLevel.Low, "osAvatarName2Key"); | 1686 | CheckThreatLevel(ThreatLevel.Low, "osAvatarName2Key"); |
1697 | 1687 | ||
1698 | CachedUserInfo userInfo = World.CommsManager.UserProfileCacheService.GetUserDetails(firstname, lastname); | 1688 | UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, firstname, lastname); |
1699 | 1689 | if (null == account) | |
1700 | if (null == userInfo) | ||
1701 | { | 1690 | { |
1702 | return UUID.Zero.ToString(); | 1691 | return UUID.Zero.ToString(); |
1703 | } | 1692 | } |
1704 | else | 1693 | else |
1705 | { | 1694 | { |
1706 | return userInfo.UserProfile.ID.ToString(); | 1695 | return account.PrincipalID.ToString(); |
1707 | } | 1696 | } |
1708 | } | 1697 | } |
1709 | 1698 | ||
@@ -1714,15 +1703,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1714 | 1703 | ||
1715 | if (UUID.TryParse(id, out key)) | 1704 | if (UUID.TryParse(id, out key)) |
1716 | { | 1705 | { |
1717 | CachedUserInfo userInfo = World.CommsManager.UserProfileCacheService.GetUserDetails(key); | 1706 | UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, key); |
1718 | 1707 | if (null == account) | |
1719 | if (null == userInfo) | ||
1720 | { | 1708 | { |
1721 | return ""; | 1709 | return ""; |
1722 | } | 1710 | } |
1723 | else | 1711 | else |
1724 | { | 1712 | { |
1725 | return userInfo.UserProfile.Name; | 1713 | return account.Name; |
1726 | } | 1714 | } |
1727 | } | 1715 | } |
1728 | else | 1716 | else |