diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
3 files changed, 22 insertions, 24 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index c9998c0..ee2a94c 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,8 +52,9 @@ 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 GridRegion = OpenSim.Services.Interfaces.GridRegion; | 56 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; |
57 | using PresenceInfo = OpenSim.Services.Interfaces.PresenceInfo; | ||
57 | 58 | ||
58 | using AssetLandmark = OpenSim.Framework.AssetLandmark; | 59 | using AssetLandmark = OpenSim.Framework.AssetLandmark; |
59 | 60 | ||
@@ -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 |
@@ -3841,13 +3842,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3841 | 3842 | ||
3842 | UUID uuid = (UUID)id; | 3843 | UUID uuid = (UUID)id; |
3843 | 3844 | ||
3844 | UserProfileData userProfile = | 3845 | UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, uuid); |
3845 | World.CommsManager.UserService.GetUserProfile(uuid); | ||
3846 | 3846 | ||
3847 | UserAgentData userAgent = | 3847 | PresenceInfo[] pinfos = World.PresenceService.GetAgents(new string[] { uuid.ToString() }); |
3848 | World.CommsManager.UserService.GetAgentByUUID(uuid); | 3848 | PresenceInfo pinfo = PresenceInfo.GetOnlinePresence(pinfos); |
3849 | 3849 | ||
3850 | if (userProfile == null || userAgent == null) | 3850 | if (pinfo == null) |
3851 | return UUID.Zero.ToString(); | 3851 | return UUID.Zero.ToString(); |
3852 | 3852 | ||
3853 | string reply = String.Empty; | 3853 | string reply = String.Empty; |
@@ -3856,17 +3856,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3856 | { | 3856 | { |
3857 | case 1: // DATA_ONLINE (0|1) | 3857 | case 1: // DATA_ONLINE (0|1) |
3858 | // TODO: implement fetching of this information | 3858 | // TODO: implement fetching of this information |
3859 | if (userProfile.CurrentAgent!=null && userProfile.CurrentAgent.AgentOnline) | 3859 | if (pinfo != null) |
3860 | reply = "1"; | 3860 | reply = "1"; |
3861 | else | 3861 | else |
3862 | reply = "0"; | 3862 | reply = "0"; |
3863 | break; | 3863 | break; |
3864 | case 2: // DATA_NAME (First Last) | 3864 | case 2: // DATA_NAME (First Last) |
3865 | reply = userProfile.FirstName + " " + userProfile.SurName; | 3865 | reply = account.FirstName + " " + account.LastName; |
3866 | break; | 3866 | break; |
3867 | case 3: // DATA_BORN (YYYY-MM-DD) | 3867 | case 3: // DATA_BORN (YYYY-MM-DD) |
3868 | DateTime born = new DateTime(1970, 1, 1, 0, 0, 0, 0); | 3868 | DateTime born = new DateTime(1970, 1, 1, 0, 0, 0, 0); |
3869 | born = born.AddSeconds(userProfile.Created); | 3869 | born = born.AddSeconds(account.Created); |
3870 | reply = born.ToString("yyyy-MM-dd"); | 3870 | reply = born.ToString("yyyy-MM-dd"); |
3871 | break; | 3871 | break; |
3872 | case 4: // DATA_RATING (0,0,0,0,0,0) | 3872 | 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..7462ba0 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -36,7 +36,7 @@ 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; |
@@ -1691,15 +1691,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1691 | { | 1691 | { |
1692 | CheckThreatLevel(ThreatLevel.Low, "osAvatarName2Key"); | 1692 | CheckThreatLevel(ThreatLevel.Low, "osAvatarName2Key"); |
1693 | 1693 | ||
1694 | CachedUserInfo userInfo = World.CommsManager.UserProfileCacheService.GetUserDetails(firstname, lastname); | 1694 | UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, firstname, lastname); |
1695 | 1695 | if (null == account) | |
1696 | if (null == userInfo) | ||
1697 | { | 1696 | { |
1698 | return UUID.Zero.ToString(); | 1697 | return UUID.Zero.ToString(); |
1699 | } | 1698 | } |
1700 | else | 1699 | else |
1701 | { | 1700 | { |
1702 | return userInfo.UserProfile.ID.ToString(); | 1701 | return account.PrincipalID.ToString(); |
1703 | } | 1702 | } |
1704 | } | 1703 | } |
1705 | 1704 | ||
@@ -1710,15 +1709,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1710 | 1709 | ||
1711 | if (UUID.TryParse(id, out key)) | 1710 | if (UUID.TryParse(id, out key)) |
1712 | { | 1711 | { |
1713 | CachedUserInfo userInfo = World.CommsManager.UserProfileCacheService.GetUserDetails(key); | 1712 | UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, key); |
1714 | 1713 | if (null == account) | |
1715 | if (null == userInfo) | ||
1716 | { | 1714 | { |
1717 | return ""; | 1715 | return ""; |
1718 | } | 1716 | } |
1719 | else | 1717 | else |
1720 | { | 1718 | { |
1721 | return userInfo.UserProfile.Name; | 1719 | return account.Name; |
1722 | } | 1720 | } |
1723 | } | 1721 | } |
1724 | else | 1722 | 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; |