diff options
Diffstat (limited to '')
3 files changed, 28 insertions, 40 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; | |||
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) |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 2c8b0ea..85ee29d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -36,12 +36,11 @@ using OpenMetaverse; | |||
36 | using Nini.Config; | 36 | using Nini.Config; |
37 | using OpenSim; | 37 | using OpenSim; |
38 | using OpenSim.Framework; | 38 | using OpenSim.Framework; |
39 | using OpenSim.Framework.Communications.Cache; | 39 | |
40 | using OpenSim.Framework.Console; | 40 | using OpenSim.Framework.Console; |
41 | using OpenSim.Region.CoreModules.Avatar.NPC; | 41 | using OpenSim.Region.CoreModules.Avatar.NPC; |
42 | using OpenSim.Region.Framework.Interfaces; | 42 | using OpenSim.Region.Framework.Interfaces; |
43 | using OpenSim.Region.Framework.Scenes; | 43 | using OpenSim.Region.Framework.Scenes; |
44 | using OpenSim.Region.Framework.Scenes.Hypergrid; | ||
45 | using OpenSim.Region.ScriptEngine.Shared; | 44 | using OpenSim.Region.ScriptEngine.Shared; |
46 | using OpenSim.Region.ScriptEngine.Shared.Api.Plugins; | 45 | using OpenSim.Region.ScriptEngine.Shared.Api.Plugins; |
47 | using OpenSim.Region.ScriptEngine.Shared.ScriptBase; | 46 | using OpenSim.Region.ScriptEngine.Shared.ScriptBase; |
@@ -607,21 +606,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
607 | // and convert the regionName to the target region | 606 | // and convert the regionName to the target region |
608 | if (regionName.Contains(".") && regionName.Contains(":")) | 607 | if (regionName.Contains(".") && regionName.Contains(":")) |
609 | { | 608 | { |
609 | List<GridRegion> regions = World.GridService.GetRegionsByName(World.RegionInfo.ScopeID, regionName, 1); | ||
610 | // Try to link the region | 610 | // Try to link the region |
611 | IHyperlinkService hyperService = World.RequestModuleInterface<IHyperlinkService>(); | 611 | if (regions != null && regions.Count > 0) |
612 | if (hyperService != null) | ||
613 | { | 612 | { |
614 | GridRegion regInfo = hyperService.TryLinkRegion(presence.ControllingClient, | 613 | GridRegion regInfo = regions[0]; |
615 | regionName); | 614 | regionName = regInfo.RegionName; |
616 | // Get the region name | ||
617 | if (regInfo != null) | ||
618 | { | ||
619 | regionName = regInfo.RegionName; | ||
620 | } | ||
621 | else | ||
622 | { | ||
623 | // Might need to ping the client here in case of failure?? | ||
624 | } | ||
625 | } | 615 | } |
626 | } | 616 | } |
627 | presence.ControllingClient.SendTeleportLocationStart(); | 617 | presence.ControllingClient.SendTeleportLocationStart(); |
@@ -1484,7 +1474,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1484 | m_host.AddScriptLPS(1); | 1474 | m_host.AddScriptLPS(1); |
1485 | 1475 | ||
1486 | // Create new asset | 1476 | // Create new asset |
1487 | AssetBase asset = new AssetBase(UUID.Random(), notecardName, (sbyte)AssetType.Notecard); | 1477 | AssetBase asset = new AssetBase(UUID.Random(), notecardName, (sbyte)AssetType.Notecard, m_host.OwnerID.ToString()); |
1488 | asset.Description = "Script Generated Notecard"; | 1478 | asset.Description = "Script Generated Notecard"; |
1489 | string notecardData = String.Empty; | 1479 | string notecardData = String.Empty; |
1490 | 1480 | ||
@@ -1691,15 +1681,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1691 | { | 1681 | { |
1692 | CheckThreatLevel(ThreatLevel.Low, "osAvatarName2Key"); | 1682 | CheckThreatLevel(ThreatLevel.Low, "osAvatarName2Key"); |
1693 | 1683 | ||
1694 | CachedUserInfo userInfo = World.CommsManager.UserProfileCacheService.GetUserDetails(firstname, lastname); | 1684 | UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, firstname, lastname); |
1695 | 1685 | if (null == account) | |
1696 | if (null == userInfo) | ||
1697 | { | 1686 | { |
1698 | return UUID.Zero.ToString(); | 1687 | return UUID.Zero.ToString(); |
1699 | } | 1688 | } |
1700 | else | 1689 | else |
1701 | { | 1690 | { |
1702 | return userInfo.UserProfile.ID.ToString(); | 1691 | return account.PrincipalID.ToString(); |
1703 | } | 1692 | } |
1704 | } | 1693 | } |
1705 | 1694 | ||
@@ -1710,15 +1699,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1710 | 1699 | ||
1711 | if (UUID.TryParse(id, out key)) | 1700 | if (UUID.TryParse(id, out key)) |
1712 | { | 1701 | { |
1713 | CachedUserInfo userInfo = World.CommsManager.UserProfileCacheService.GetUserDetails(key); | 1702 | UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, key); |
1714 | 1703 | if (null == account) | |
1715 | if (null == userInfo) | ||
1716 | { | 1704 | { |
1717 | return ""; | 1705 | return ""; |
1718 | } | 1706 | } |
1719 | else | 1707 | else |
1720 | { | 1708 | { |
1721 | return userInfo.UserProfile.Name; | 1709 | return account.Name; |
1722 | } | 1710 | } |
1723 | } | 1711 | } |
1724 | else | 1712 | 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; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using OpenMetaverse; | 30 | using OpenMetaverse; |
31 | using OpenSim.Framework; | 31 | using OpenSim.Framework; |
32 | using OpenSim.Framework.Communications.Cache; | 32 | |
33 | using OpenSim.Region.Framework.Scenes; | 33 | using OpenSim.Region.Framework.Scenes; |
34 | using OpenSim.Region.ScriptEngine.Shared; | 34 | using OpenSim.Region.ScriptEngine.Shared; |
35 | using OpenSim.Region.ScriptEngine.Shared.Api; | 35 | using OpenSim.Region.ScriptEngine.Shared.Api; |