diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
3 files changed, 27 insertions, 39 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index a1db77e..e77425a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -38,7 +38,7 @@ using OpenMetaverse; | |||
38 | using OpenMetaverse.Packets; | 38 | using OpenMetaverse.Packets; |
39 | using OpenSim; | 39 | using OpenSim; |
40 | using OpenSim.Framework; | 40 | using OpenSim.Framework; |
41 | using OpenSim.Framework.Communications.Cache; | 41 | |
42 | using OpenSim.Region.CoreModules; | 42 | using OpenSim.Region.CoreModules; |
43 | using OpenSim.Region.CoreModules.World.Land; | 43 | using OpenSim.Region.CoreModules.World.Land; |
44 | using OpenSim.Region.CoreModules.World.Terrain; | 44 | using OpenSim.Region.CoreModules.World.Terrain; |
@@ -52,9 +52,10 @@ using OpenSim.Region.ScriptEngine.Shared.ScriptBase; | |||
52 | using OpenSim.Region.ScriptEngine.Interfaces; | 52 | using OpenSim.Region.ScriptEngine.Interfaces; |
53 | using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces; | 53 | using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces; |
54 | using OpenSim.Services.Interfaces; | 54 | using OpenSim.Services.Interfaces; |
55 | 55 | using OpenSim.Services.Interfaces; | |
56 | using PrimType = OpenSim.Region.Framework.Scenes.PrimType; | ||
57 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | 56 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; |
57 | using PresenceInfo = OpenSim.Services.Interfaces.PresenceInfo; | ||
58 | using PrimType = OpenSim.Region.Framework.Scenes.PrimType; | ||
58 | using AssetLandmark = OpenSim.Framework.AssetLandmark; | 59 | using AssetLandmark = OpenSim.Framework.AssetLandmark; |
59 | 60 | ||
60 | using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat; | 61 | using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat; |
@@ -848,10 +849,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
848 | public string resolveName(UUID objecUUID) | 849 | public string resolveName(UUID objecUUID) |
849 | { | 850 | { |
850 | // try avatar username surname | 851 | // try avatar username surname |
851 | CachedUserInfo profile = World.CommsManager.UserProfileCacheService.GetUserDetails(objecUUID); | 852 | UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, objecUUID); |
852 | if (profile != null && profile.UserProfile != null) | 853 | if (account != null) |
853 | { | 854 | { |
854 | string avatarname = profile.UserProfile.FirstName + " " + profile.UserProfile.SurName; | 855 | string avatarname = account.Name; |
855 | return avatarname; | 856 | return avatarname; |
856 | } | 857 | } |
857 | // try an scene object | 858 | // try an scene object |
@@ -3807,13 +3808,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3807 | 3808 | ||
3808 | UUID uuid = (UUID)id; | 3809 | UUID uuid = (UUID)id; |
3809 | 3810 | ||
3810 | UserProfileData userProfile = | 3811 | UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, uuid); |
3811 | World.CommsManager.UserService.GetUserProfile(uuid); | ||
3812 | 3812 | ||
3813 | UserAgentData userAgent = | 3813 | PresenceInfo[] pinfos = World.PresenceService.GetAgents(new string[] { uuid.ToString() }); |
3814 | World.CommsManager.UserService.GetAgentByUUID(uuid); | 3814 | PresenceInfo pinfo = PresenceInfo.GetOnlinePresence(pinfos); |
3815 | 3815 | ||
3816 | if (userProfile == null || userAgent == null) | 3816 | if (pinfo == null) |
3817 | return UUID.Zero.ToString(); | 3817 | return UUID.Zero.ToString(); |
3818 | 3818 | ||
3819 | string reply = String.Empty; | 3819 | string reply = String.Empty; |
@@ -3822,17 +3822,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3822 | { | 3822 | { |
3823 | case 1: // DATA_ONLINE (0|1) | 3823 | case 1: // DATA_ONLINE (0|1) |
3824 | // TODO: implement fetching of this information | 3824 | // TODO: implement fetching of this information |
3825 | if (userProfile.CurrentAgent!=null && userProfile.CurrentAgent.AgentOnline) | 3825 | if (pinfo != null) |
3826 | reply = "1"; | 3826 | reply = "1"; |
3827 | else | 3827 | else |
3828 | reply = "0"; | 3828 | reply = "0"; |
3829 | break; | 3829 | break; |
3830 | case 2: // DATA_NAME (First Last) | 3830 | case 2: // DATA_NAME (First Last) |
3831 | reply = userProfile.FirstName + " " + userProfile.SurName; | 3831 | reply = account.FirstName + " " + account.LastName; |
3832 | break; | 3832 | break; |
3833 | case 3: // DATA_BORN (YYYY-MM-DD) | 3833 | case 3: // DATA_BORN (YYYY-MM-DD) |
3834 | DateTime born = new DateTime(1970, 1, 1, 0, 0, 0, 0); | 3834 | DateTime born = new DateTime(1970, 1, 1, 0, 0, 0, 0); |
3835 | born = born.AddSeconds(userProfile.Created); | 3835 | born = born.AddSeconds(account.Created); |
3836 | reply = born.ToString("yyyy-MM-dd"); | 3836 | reply = born.ToString("yyyy-MM-dd"); |
3837 | break; | 3837 | break; |
3838 | case 4: // DATA_RATING (0,0,0,0,0,0) | 3838 | case 4: // DATA_RATING (0,0,0,0,0,0) |
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 |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs index b75a2e4..829fbb7 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs | |||
@@ -29,7 +29,7 @@ using System; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using OpenMetaverse; | 30 | using OpenMetaverse; |
31 | using OpenSim.Framework; | 31 | using OpenSim.Framework; |
32 | using OpenSim.Framework.Communications.Cache; | 32 | |
33 | using OpenSim.Region.Framework.Scenes; | 33 | using OpenSim.Region.Framework.Scenes; |
34 | using OpenSim.Region.ScriptEngine.Shared; | 34 | using OpenSim.Region.ScriptEngine.Shared; |
35 | using OpenSim.Region.ScriptEngine.Shared.Api; | 35 | using OpenSim.Region.ScriptEngine.Shared.Api; |