diff options
author | Melanie | 2019-08-07 17:58:08 +0100 |
---|---|---|
committer | Melanie | 2019-08-07 17:58:08 +0100 |
commit | d781742d8e966bedb7ac0f9e637003d090a35375 (patch) | |
tree | bd60ff26f75c3bbf0ae4a1ce8e4f37771d3e53ab /OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps | |
parent | Also remove the defaults from Configger (diff) | |
download | opensim-SC-d781742d8e966bedb7ac0f9e637003d090a35375.zip opensim-SC-d781742d8e966bedb7ac0f9e637003d090a35375.tar.gz opensim-SC-d781742d8e966bedb7ac0f9e637003d090a35375.tar.bz2 opensim-SC-d781742d8e966bedb7ac0f9e637003d090a35375.tar.xz |
Fix scope support to get friends list names across co-hosted grids
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index ea68581..9f1ea4d 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs | |||
@@ -93,6 +93,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
93 | 93 | ||
94 | private Scene m_Scene; | 94 | private Scene m_Scene; |
95 | private UUID m_AgentID; | 95 | private UUID m_AgentID; |
96 | private UUID m_scopeID; | ||
96 | private Caps m_HostCapsObj; | 97 | private Caps m_HostCapsObj; |
97 | private ModelCost m_ModelCost; | 98 | private ModelCost m_ModelCost; |
98 | 99 | ||
@@ -128,6 +129,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
128 | private bool m_AllowCapHomeLocation = true; | 129 | private bool m_AllowCapHomeLocation = true; |
129 | private bool m_AllowCapGroupMemberData = true; | 130 | private bool m_AllowCapGroupMemberData = true; |
130 | private IUserManagement m_UserManager; | 131 | private IUserManagement m_UserManager; |
132 | private IUserAccountService m_userAccountService; | ||
131 | 133 | ||
132 | 134 | ||
133 | private enum FileAgentInventoryState : int | 135 | private enum FileAgentInventoryState : int |
@@ -201,9 +203,13 @@ namespace OpenSim.Region.ClientStack.Linden | |||
201 | m_assetService = m_Scene.AssetService; | 203 | m_assetService = m_Scene.AssetService; |
202 | m_regionName = m_Scene.RegionInfo.RegionName; | 204 | m_regionName = m_Scene.RegionInfo.RegionName; |
203 | m_UserManager = m_Scene.RequestModuleInterface<IUserManagement>(); | 205 | m_UserManager = m_Scene.RequestModuleInterface<IUserManagement>(); |
206 | m_userAccountService = m_Scene.RequestModuleInterface<IUserAccountService>(); | ||
204 | if (m_UserManager == null) | 207 | if (m_UserManager == null) |
205 | m_log.Error("[CAPS]: GetDisplayNames disabled because user management component not found"); | 208 | m_log.Error("[CAPS]: GetDisplayNames disabled because user management component not found"); |
206 | 209 | ||
210 | UserAccount account = m_userAccountService.GetUserAccount(m_Scene.RegionInfo.ScopeID, m_AgentID); | ||
211 | m_scopeID = account.ScopeID; | ||
212 | |||
207 | RegisterHandlers(); | 213 | RegisterHandlers(); |
208 | 214 | ||
209 | AddNewInventoryItem = m_Scene.AddUploadedInventoryItem; | 215 | AddNewInventoryItem = m_Scene.AddUploadedInventoryItem; |
@@ -1943,11 +1949,12 @@ namespace OpenSim.Region.ClientStack.Linden | |||
1943 | 1949 | ||
1944 | NameValueCollection query = HttpUtility.ParseQueryString(httpRequest.Url.Query); | 1950 | NameValueCollection query = HttpUtility.ParseQueryString(httpRequest.Url.Query); |
1945 | string[] ids = query.GetValues("ids"); | 1951 | string[] ids = query.GetValues("ids"); |
1952 | m_log.DebugFormat("[DISPLAYNAMES]: Request for {0} names", ids.Length); | ||
1946 | 1953 | ||
1947 | Dictionary<UUID,string> names = m_UserManager.GetUsersNames(ids); | 1954 | Dictionary<UUID,string> names = m_UserManager.GetUsersNames(ids, m_scopeID); |
1948 | |||
1949 | StringBuilder lsl = LLSDxmlEncode.Start(names.Count * 256 + 256); | 1955 | StringBuilder lsl = LLSDxmlEncode.Start(names.Count * 256 + 256); |
1950 | LLSDxmlEncode.AddMap(lsl); | 1956 | LLSDxmlEncode.AddMap(lsl); |
1957 | int ct = 0; | ||
1951 | if(names.Count == 0) | 1958 | if(names.Count == 0) |
1952 | LLSDxmlEncode.AddEmptyArray("agents", lsl); | 1959 | LLSDxmlEncode.AddEmptyArray("agents", lsl); |
1953 | else | 1960 | else |
@@ -1956,13 +1963,18 @@ namespace OpenSim.Region.ClientStack.Linden | |||
1956 | 1963 | ||
1957 | foreach (KeyValuePair<UUID,string> kvp in names) | 1964 | foreach (KeyValuePair<UUID,string> kvp in names) |
1958 | { | 1965 | { |
1966 | string[] parts = kvp.Value.Split(new char[] {' '}); | ||
1967 | string fullname = kvp.Value; | ||
1968 | |||
1959 | if (string.IsNullOrEmpty(kvp.Value)) | 1969 | if (string.IsNullOrEmpty(kvp.Value)) |
1960 | continue; | 1970 | { |
1971 | parts = new string[] {"(hippos)", ""}; | ||
1972 | fullname = "(hippos)"; | ||
1973 | } | ||
1974 | |||
1961 | if(kvp.Key == UUID.Zero) | 1975 | if(kvp.Key == UUID.Zero) |
1962 | continue; | 1976 | continue; |
1963 | 1977 | ||
1964 | string[] parts = kvp.Value.Split(new char[] {' '}); | ||
1965 | |||
1966 | // dont tell about unknown users, we can't send them back on Bad either | 1978 | // dont tell about unknown users, we can't send them back on Bad either |
1967 | if(parts[0] == "Unknown") | 1979 | if(parts[0] == "Unknown") |
1968 | continue; | 1980 | continue; |
@@ -1970,18 +1982,20 @@ namespace OpenSim.Region.ClientStack.Linden | |||
1970 | LLSDxmlEncode.AddMap(lsl); | 1982 | LLSDxmlEncode.AddMap(lsl); |
1971 | LLSDxmlEncode.AddElem("display_name_next_update", DateTime.UtcNow.AddDays(8), lsl); | 1983 | LLSDxmlEncode.AddElem("display_name_next_update", DateTime.UtcNow.AddDays(8), lsl); |
1972 | LLSDxmlEncode.AddElem("display_name_expires", DateTime.UtcNow.AddMonths(1), lsl); | 1984 | LLSDxmlEncode.AddElem("display_name_expires", DateTime.UtcNow.AddMonths(1), lsl); |
1973 | LLSDxmlEncode.AddElem("display_name", kvp.Value, lsl); | 1985 | LLSDxmlEncode.AddElem("display_name", fullname, lsl); |
1974 | LLSDxmlEncode.AddElem("legacy_first_name", parts[0], lsl); | 1986 | LLSDxmlEncode.AddElem("legacy_first_name", parts[0], lsl); |
1975 | LLSDxmlEncode.AddElem("legacy_last_name", parts[1], lsl); | 1987 | LLSDxmlEncode.AddElem("legacy_last_name", parts[1], lsl); |
1976 | LLSDxmlEncode.AddElem("username", kvp.Value, lsl); | 1988 | LLSDxmlEncode.AddElem("username", fullname, lsl); |
1977 | LLSDxmlEncode.AddElem("id", kvp.Key, lsl); | 1989 | LLSDxmlEncode.AddElem("id", kvp.Key, lsl); |
1978 | LLSDxmlEncode.AddElem("is_display_name_default", true, lsl); | 1990 | LLSDxmlEncode.AddElem("is_display_name_default", true, lsl); |
1979 | LLSDxmlEncode.AddEndMap(lsl); | 1991 | LLSDxmlEncode.AddEndMap(lsl); |
1992 | ct++; | ||
1980 | } | 1993 | } |
1981 | LLSDxmlEncode.AddEndArray(lsl); | 1994 | LLSDxmlEncode.AddEndArray(lsl); |
1982 | } | 1995 | } |
1983 | 1996 | ||
1984 | LLSDxmlEncode.AddEndMap(lsl); | 1997 | LLSDxmlEncode.AddEndMap(lsl); |
1998 | m_log.DebugFormat("[DISPLAYNAMES]: Returned {0} names", ct); | ||
1985 | return LLSDxmlEncode.End(lsl);; | 1999 | return LLSDxmlEncode.End(lsl);; |
1986 | } | 2000 | } |
1987 | } | 2001 | } |