From 1777324a862a41c57d12bd6180129a30d9653841 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 1 Jul 2016 17:31:31 +0100 Subject: cleanup a bit AgentGroupDataUpdate sending --- OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'OpenSim/Region/OptionalModules') diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index 2617723..343935d 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs @@ -1409,12 +1409,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups GroupMembershipData[] membershipArray = GetProfileListedGroupMemberships(remoteClient, agentID); IEventQueue eq = remoteClient.Scene.RequestModuleInterface(); - if (eq != null) - eq.GroupMembershipData(agentID, membershipArray); - else - remoteClient.SendGroupMembership(membershipArray); remoteClient.RefreshGroupMembership(); + remoteClient.SendAgentGroupDataUpdate(agentID, membershipArray); } /// -- cgit v1.1 From aa744eecf2bc474509a1703028d681b27111ce84 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 1 Jul 2016 18:19:09 +0100 Subject: add a few methods to modify clientview group powers --- .../InternetRelayClientView/Server/IRCClientView.cs | 16 ++++++++++++++++ OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | 12 ++++++++++++ 2 files changed, 28 insertions(+) (limited to 'OpenSim/Region/OptionalModules') diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index f19cd47..f34dbe8 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs @@ -1626,6 +1626,22 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server } + public void UpdateGroupMembership(GroupMembershipData[] data) + { + + } + + public void GroupMembershipRemove(UUID GroupID) + { + + } + + public void GroupMembershipAddReplace(UUID GroupID,ulong GroupPowers) + { + + } + + public void SendAvatarNotesReply(UUID targetID, string text) { diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index 43b4e02..bdac6aa 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs @@ -1255,6 +1255,18 @@ namespace OpenSim.Region.OptionalModules.World.NPC { } + public void UpdateGroupMembership(GroupMembershipData[] data) + { + } + + public void GroupMembershipRemove(UUID GroupID) + { + } + + public void GroupMembershipAddReplace(UUID GroupID,ulong GroupPowers) + { + } + public void SendUseCachedMuteList() { } -- cgit v1.1 From 7b7483ec7e69ef7a9fb5e82ce6f03a68103ef63a Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 1 Jul 2016 18:38:38 +0100 Subject: save one call to grid to get agent groups powers (xmlrpcgoups only for now --- OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'OpenSim/Region/OptionalModules') diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index 343935d..27645e4 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs @@ -1408,9 +1408,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups SendDataUpdate(remoteClient, tellOthers); GroupMembershipData[] membershipArray = GetProfileListedGroupMemberships(remoteClient, agentID); - IEventQueue eq = remoteClient.Scene.RequestModuleInterface(); + remoteClient.UpdateGroupMembership(membershipArray); - remoteClient.RefreshGroupMembership(); remoteClient.SendAgentGroupDataUpdate(agentID, membershipArray); } -- cgit v1.1 From 057bc648f3c30d3a82e075749eb0be1f33568084 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 1 Jul 2016 23:26:16 +0100 Subject: xmlrpcgroups: make use of a forgotten GetMemberGroupProfilemethod, put back xmlrpc cache since it is necessary to prevent folish viewers flooding --- .../Avatar/XmlRpcGroups/GroupsModule.cs | 5 +++- .../XmlRpcGroups/IGroupsServicesConnector.cs | 3 ++- .../XmlRpcGroupsServicesConnectorModule.cs | 30 ++++++++++++---------- 3 files changed, 23 insertions(+), 15 deletions(-) (limited to 'OpenSim/Region/OptionalModules') diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index 27645e4..11f53dd 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs @@ -785,6 +785,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups { if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); +/* GroupProfileData profile = new GroupProfileData(); @@ -813,7 +814,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups profile.MemberTitle = memberInfo.GroupTitle; profile.PowersMask = memberInfo.GroupPowers; } - +*/ + UUID agent = GetRequestingAgentID(remoteClient); + GroupProfileData profile = m_groupData.GetMemberGroupProfile(agent, groupID, agent); return profile; } diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/IGroupsServicesConnector.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/IGroupsServicesConnector.cs index 6b5b40a..cff3212 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/IGroupsServicesConnector.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/IGroupsServicesConnector.cs @@ -51,7 +51,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups /// GroupID may be specified instead, in which case this parmeter will be null. /// GroupRecord GetGroupRecord(UUID RequestingAgentID, UUID GroupID, string GroupName); - + GroupProfileData GetMemberGroupProfile(UUID requestingAgentID, UUID GroupID, UUID AgentID); + List FindGroups(UUID RequestingAgentID, string search); List GetGroupMembers(UUID RequestingAgentID, UUID GroupID); diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs index acb37f6..2dda3a1 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs @@ -181,9 +181,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups m_cacheTimeout = groupsConfig.GetInt("GroupsCacheTimeout", 30); - // disable cache until it is fixed - m_cacheTimeout = 0; - if (m_cacheTimeout == 0) { m_log.WarnFormat("[XMLRPC-GROUPS-CONNECTOR]: Groups Cache Disabled."); @@ -385,10 +382,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups GroupMembershipData MemberInfo = GetAgentGroupMembership(requestingAgentID, AgentID, GroupID); GroupProfileData MemberGroupProfile = GroupProfileHashtableToGroupProfileData(respData); - - MemberGroupProfile.MemberTitle = MemberInfo.GroupTitle; - MemberGroupProfile.PowersMask = MemberInfo.GroupPowers; - + if(MemberInfo != null) + { + MemberGroupProfile.MemberTitle = MemberInfo.GroupTitle; + MemberGroupProfile.PowersMask = MemberInfo.GroupPowers; + } return MemberGroupProfile; } @@ -977,12 +975,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups try { - resp = req.Send(m_groupsServerURI, 30000); - - if ((m_cacheTimeout > 0) && (CacheKey != null)) - { - m_memoryCache.AddOrUpdate(CacheKey, resp, TimeSpan.FromSeconds(m_cacheTimeout)); - } + resp = req.Send(m_groupsServerURI); } catch (Exception e) { @@ -1004,12 +997,22 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups m_log.WarnFormat("[XMLRPC-GROUPS-CONNECTOR]: {0} :: {1}", key, param[key].ToString()); } } + + if ((m_cacheTimeout > 0) && (CacheKey != null)) + { + m_memoryCache.AddOrUpdate(CacheKey, resp, 10.0); + } Hashtable respData = new Hashtable(); respData.Add("error", e.ToString()); return respData; } } + if ((m_cacheTimeout > 0) && (CacheKey != null)) + { + m_memoryCache.AddOrUpdate(CacheKey, resp, TimeSpan.FromSeconds(m_cacheTimeout)); + } + if (resp.Value is Hashtable) { Hashtable respData = (Hashtable)resp.Value; @@ -1138,6 +1141,7 @@ namespace Nwc.XmlRpc request.ContentType = "text/xml"; request.AllowWriteStreamBuffering = true; request.KeepAlive = !_disableKeepAlive; + request.Timeout = 30000; using (Stream stream = request.GetRequestStream()) { -- cgit v1.1 From cd34f978fb6603885a54a24b0513f2d45b749282 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 2 Jul 2016 01:01:29 +0100 Subject: revert to previus GroupProfileRequest because floatsam groups server seems to return wrong values for GroupMembershipCount and GroupRolesCount. this should be fixed because we are getting the full lists just to count number of entries --- OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/OptionalModules') diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index 11f53dd..cb6ceb5 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs @@ -785,10 +785,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups { if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); -/* GroupProfileData profile = new GroupProfileData(); - GroupRecord groupInfo = m_groupData.GetGroupRecord(GetRequestingAgentID(remoteClient), groupID, null); if (groupInfo != null) { @@ -814,9 +812,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups profile.MemberTitle = memberInfo.GroupTitle; profile.PowersMask = memberInfo.GroupPowers; } -*/ +/* + this should save xmlrpc calls, but seems to return wrong GroupMembershipCount and GroupRolesCount UUID agent = GetRequestingAgentID(remoteClient); GroupProfileData profile = m_groupData.GetMemberGroupProfile(agent, groupID, agent); +*/ return profile; } -- cgit v1.1