diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index eab4754..a421484 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 |
@@ -3887,13 +3888,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3887 | 3888 | ||
3888 | UUID uuid = (UUID)id; | 3889 | UUID uuid = (UUID)id; |
3889 | 3890 | ||
3890 | UserProfileData userProfile = | 3891 | UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, uuid); |
3891 | World.CommsManager.UserService.GetUserProfile(uuid); | ||
3892 | 3892 | ||
3893 | UserAgentData userAgent = | 3893 | PresenceInfo[] pinfos = World.PresenceService.GetAgents(new string[] { uuid.ToString() }); |
3894 | World.CommsManager.UserService.GetAgentByUUID(uuid); | 3894 | PresenceInfo pinfo = PresenceInfo.GetOnlinePresence(pinfos); |
3895 | 3895 | ||
3896 | if (userProfile == null || userAgent == null) | 3896 | if (pinfo == null) |
3897 | return UUID.Zero.ToString(); | 3897 | return UUID.Zero.ToString(); |
3898 | 3898 | ||
3899 | string reply = String.Empty; | 3899 | string reply = String.Empty; |
@@ -3902,17 +3902,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3902 | { | 3902 | { |
3903 | case 1: // DATA_ONLINE (0|1) | 3903 | case 1: // DATA_ONLINE (0|1) |
3904 | // TODO: implement fetching of this information | 3904 | // TODO: implement fetching of this information |
3905 | if (userProfile.CurrentAgent!=null && userProfile.CurrentAgent.AgentOnline) | 3905 | if (pinfo != null) |
3906 | reply = "1"; | 3906 | reply = "1"; |
3907 | else | 3907 | else |
3908 | reply = "0"; | 3908 | reply = "0"; |
3909 | break; | 3909 | break; |
3910 | case 2: // DATA_NAME (First Last) | 3910 | case 2: // DATA_NAME (First Last) |
3911 | reply = userProfile.FirstName + " " + userProfile.SurName; | 3911 | reply = account.FirstName + " " + account.LastName; |
3912 | break; | 3912 | break; |
3913 | case 3: // DATA_BORN (YYYY-MM-DD) | 3913 | case 3: // DATA_BORN (YYYY-MM-DD) |
3914 | DateTime born = new DateTime(1970, 1, 1, 0, 0, 0, 0); | 3914 | DateTime born = new DateTime(1970, 1, 1, 0, 0, 0, 0); |
3915 | born = born.AddSeconds(userProfile.Created); | 3915 | born = born.AddSeconds(account.Created); |
3916 | reply = born.ToString("yyyy-MM-dd"); | 3916 | reply = born.ToString("yyyy-MM-dd"); |
3917 | break; | 3917 | break; |
3918 | case 4: // DATA_RATING (0,0,0,0,0,0) | 3918 | case 4: // DATA_RATING (0,0,0,0,0,0) |