aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs30
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 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;
38using OpenMetaverse.Packets; 38using OpenMetaverse.Packets;
39using OpenSim; 39using OpenSim;
40using OpenSim.Framework; 40using OpenSim.Framework;
41using OpenSim.Framework.Communications.Cache; 41
42using OpenSim.Region.CoreModules; 42using OpenSim.Region.CoreModules;
43using OpenSim.Region.CoreModules.World.Land; 43using OpenSim.Region.CoreModules.World.Land;
44using OpenSim.Region.CoreModules.World.Terrain; 44using OpenSim.Region.CoreModules.World.Terrain;
@@ -52,9 +52,10 @@ using OpenSim.Region.ScriptEngine.Shared.ScriptBase;
52using OpenSim.Region.ScriptEngine.Interfaces; 52using OpenSim.Region.ScriptEngine.Interfaces;
53using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces; 53using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces;
54using OpenSim.Services.Interfaces; 54using OpenSim.Services.Interfaces;
55 55using OpenSim.Services.Interfaces;
56using PrimType = OpenSim.Region.Framework.Scenes.PrimType;
57using GridRegion = OpenSim.Services.Interfaces.GridRegion; 56using GridRegion = OpenSim.Services.Interfaces.GridRegion;
57using PresenceInfo = OpenSim.Services.Interfaces.PresenceInfo;
58using PrimType = OpenSim.Region.Framework.Scenes.PrimType;
58using AssetLandmark = OpenSim.Framework.AssetLandmark; 59using AssetLandmark = OpenSim.Framework.AssetLandmark;
59 60
60using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat; 61using 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)