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 aa876ec..dc4249c 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
@@ -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)