aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs28
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs16
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs2
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;
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,8 +52,9 @@ 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 GridRegion = OpenSim.Services.Interfaces.GridRegion; 56using GridRegion = OpenSim.Services.Interfaces.GridRegion;
57using PresenceInfo = OpenSim.Services.Interfaces.PresenceInfo;
57 58
58using AssetLandmark = OpenSim.Framework.AssetLandmark; 59using 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;
36using Nini.Config; 36using Nini.Config;
37using OpenSim; 37using OpenSim;
38using OpenSim.Framework; 38using OpenSim.Framework;
39using OpenSim.Framework.Communications.Cache; 39
40using OpenSim.Framework.Console; 40using OpenSim.Framework.Console;
41using OpenSim.Region.CoreModules.Avatar.NPC; 41using OpenSim.Region.CoreModules.Avatar.NPC;
42using OpenSim.Region.Framework.Interfaces; 42using 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;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using OpenMetaverse; 30using OpenMetaverse;
31using OpenSim.Framework; 31using OpenSim.Framework;
32using OpenSim.Framework.Communications.Cache; 32
33using OpenSim.Region.Framework.Scenes; 33using OpenSim.Region.Framework.Scenes;
34using OpenSim.Region.ScriptEngine.Shared; 34using OpenSim.Region.ScriptEngine.Shared;
35using OpenSim.Region.ScriptEngine.Shared.Api; 35using OpenSim.Region.ScriptEngine.Shared.Api;