add processing of AvatarGroupsRequest message that should be used to get other avatars group memberships, but keep it disabled since some viewers no longer suport it correctly and expect memberships in reply to avatar properties, so we need to keep wasting bandwith sending useless information when some viewers really only want avatarproperties

avinationmerge
UbitUmarov 2015-09-29 01:43:49 +01:00
parent a580d945d1
commit f2c8f83215
1 changed files with 35 additions and 8 deletions

View File

@ -263,6 +263,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
sp.ControllingClient.OnUUIDGroupNameRequest += HandleUUIDGroupNameRequest;
// Used for Notices and Group Invites/Accept/Reject
sp.ControllingClient.OnInstantMessage += OnInstantMessage;
// comented out bc some viewers wrongly stoped suporting it
// sp.ControllingClient.AddGenericPacketHandler("avatargroupsrequest", AvatarGroupsRequest);
// we should send a DataUpdate here for compatibility,
// but this is a bad place and a bad thread to do it
@ -283,8 +285,33 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
client.OnAgentDataUpdateRequest += OnAgentDataUpdateRequest;
client.OnRequestAvatarProperties += OnRequestAvatarProperties;
}
}
/* this should be the right message to ask for other avatars groups
private void AvatarGroupsRequest(Object sender, string method, List<String> args)
{
if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
if (!(sender is IClientAPI))
return;
IClientAPI remoteClient = (IClientAPI)sender;
UUID avatarID;
UUID.TryParse(args[0], out avatarID);
if (avatarID != UUID.Zero)
{
GroupMembershipData[] avatarGroups = GetProfileListedGroupMemberships(remoteClient, avatarID);
remoteClient.SendAvatarGroupsReply(avatarID, avatarGroups);
}
}
*/
// this should not be used to send groups memberships, but some viewers do expect it
// it does send unnecessary memberships, when viewers just want other properties information
private void OnRequestAvatarProperties(IClientAPI remoteClient, UUID avatarID)
{
if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);