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
parent
a580d945d1
commit
f2c8f83215
|
@ -79,14 +79,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
private IMessageTransferModule m_msgTransferModule;
|
||||
|
||||
private IGroupsMessagingModule m_groupsMessagingModule;
|
||||
|
||||
|
||||
private IGroupsServicesConnector m_groupData;
|
||||
|
||||
// Configuration settings
|
||||
private bool m_groupsEnabled = false;
|
||||
private bool m_groupNoticesEnabled = true;
|
||||
private bool m_debugEnabled = false;
|
||||
private int m_levelGroupCreate = 0;
|
||||
private int m_levelGroupCreate = 0;
|
||||
|
||||
#region Region Module interfaceBase Members
|
||||
|
||||
|
@ -116,9 +116,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
|
||||
m_log.InfoFormat("[GROUPS]: Initializing {0}", this.Name);
|
||||
|
||||
m_groupNoticesEnabled = groupsConfig.GetBoolean("NoticesEnabled", true);
|
||||
m_debugEnabled = groupsConfig.GetBoolean("DebugEnabled", false);
|
||||
m_levelGroupCreate = groupsConfig.GetInt("LevelGroupCreate", 0);
|
||||
m_groupNoticesEnabled = groupsConfig.GetBoolean("NoticesEnabled", true);
|
||||
m_debugEnabled = groupsConfig.GetBoolean("DebugEnabled", false);
|
||||
m_levelGroupCreate = groupsConfig.GetInt("LevelGroupCreate", 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -233,7 +233,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
if (m_debugEnabled) m_log.Debug("[GROUPS]: Shutting down Groups module.");
|
||||
}
|
||||
|
||||
public Type ReplaceableInterface
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -276,15 +278,40 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
sp.ControllingClient.OnUUIDGroupNameRequest -= HandleUUIDGroupNameRequest;
|
||||
sp.ControllingClient.OnInstantMessage -= OnInstantMessage;
|
||||
}
|
||||
|
||||
|
||||
private void OnNewClient(IClientAPI client)
|
||||
{
|
||||
if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
|
||||
|
||||
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);
|
||||
|
|
Loading…
Reference in New Issue