diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 28 |
1 files changed, 14 insertions, 14 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) |