aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules
diff options
context:
space:
mode:
authorUbitUmarov2015-09-29 01:43:49 +0100
committerUbitUmarov2015-09-29 01:43:49 +0100
commitf2c8f832159e9b75ea94a2ac5f738d9804ec95fb (patch)
tree85786ecbcffa447e66cf88137bd50a6fa2d558ff /OpenSim/Region/OptionalModules
parent remove groups handlers onClientClose also on groups V2 (diff)
downloadopensim-SC-f2c8f832159e9b75ea94a2ac5f738d9804ec95fb.zip
opensim-SC-f2c8f832159e9b75ea94a2ac5f738d9804ec95fb.tar.gz
opensim-SC-f2c8f832159e9b75ea94a2ac5f738d9804ec95fb.tar.bz2
opensim-SC-f2c8f832159e9b75ea94a2ac5f738d9804ec95fb.tar.xz
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
Diffstat (limited to 'OpenSim/Region/OptionalModules')
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs41
1 files changed, 34 insertions, 7 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
index e0402fd..b1fd9ad 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
@@ -79,14 +79,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
79 private IMessageTransferModule m_msgTransferModule; 79 private IMessageTransferModule m_msgTransferModule;
80 80
81 private IGroupsMessagingModule m_groupsMessagingModule; 81 private IGroupsMessagingModule m_groupsMessagingModule;
82 82
83 private IGroupsServicesConnector m_groupData; 83 private IGroupsServicesConnector m_groupData;
84 84
85 // Configuration settings 85 // Configuration settings
86 private bool m_groupsEnabled = false; 86 private bool m_groupsEnabled = false;
87 private bool m_groupNoticesEnabled = true; 87 private bool m_groupNoticesEnabled = true;
88 private bool m_debugEnabled = false; 88 private bool m_debugEnabled = false;
89 private int m_levelGroupCreate = 0; 89 private int m_levelGroupCreate = 0;
90 90
91 #region Region Module interfaceBase Members 91 #region Region Module interfaceBase Members
92 92
@@ -116,9 +116,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
116 116
117 m_log.InfoFormat("[GROUPS]: Initializing {0}", this.Name); 117 m_log.InfoFormat("[GROUPS]: Initializing {0}", this.Name);
118 118
119 m_groupNoticesEnabled = groupsConfig.GetBoolean("NoticesEnabled", true); 119 m_groupNoticesEnabled = groupsConfig.GetBoolean("NoticesEnabled", true);
120 m_debugEnabled = groupsConfig.GetBoolean("DebugEnabled", false); 120 m_debugEnabled = groupsConfig.GetBoolean("DebugEnabled", false);
121 m_levelGroupCreate = groupsConfig.GetInt("LevelGroupCreate", 0); 121 m_levelGroupCreate = groupsConfig.GetInt("LevelGroupCreate", 0);
122 } 122 }
123 } 123 }
124 124
@@ -233,7 +233,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
233 if (m_debugEnabled) m_log.Debug("[GROUPS]: Shutting down Groups module."); 233 if (m_debugEnabled) m_log.Debug("[GROUPS]: Shutting down Groups module.");
234 } 234 }
235 235
236 public Type ReplaceableInterface 236 public Type ReplaceableInterface
237 { 237 {
238 get { return null; } 238 get { return null; }
239 } 239 }
@@ -263,6 +263,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
263 sp.ControllingClient.OnUUIDGroupNameRequest += HandleUUIDGroupNameRequest; 263 sp.ControllingClient.OnUUIDGroupNameRequest += HandleUUIDGroupNameRequest;
264 // Used for Notices and Group Invites/Accept/Reject 264 // Used for Notices and Group Invites/Accept/Reject
265 sp.ControllingClient.OnInstantMessage += OnInstantMessage; 265 sp.ControllingClient.OnInstantMessage += OnInstantMessage;
266// comented out bc some viewers wrongly stoped suporting it
267// sp.ControllingClient.AddGenericPacketHandler("avatargroupsrequest", AvatarGroupsRequest);
266 268
267 // we should send a DataUpdate here for compatibility, 269 // we should send a DataUpdate here for compatibility,
268 // but this is a bad place and a bad thread to do it 270 // but this is a bad place and a bad thread to do it
@@ -276,15 +278,40 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
276 sp.ControllingClient.OnUUIDGroupNameRequest -= HandleUUIDGroupNameRequest; 278 sp.ControllingClient.OnUUIDGroupNameRequest -= HandleUUIDGroupNameRequest;
277 sp.ControllingClient.OnInstantMessage -= OnInstantMessage; 279 sp.ControllingClient.OnInstantMessage -= OnInstantMessage;
278 } 280 }
279 281
280 private void OnNewClient(IClientAPI client) 282 private void OnNewClient(IClientAPI client)
281 { 283 {
282 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); 284 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
283 285
284 client.OnAgentDataUpdateRequest += OnAgentDataUpdateRequest; 286 client.OnAgentDataUpdateRequest += OnAgentDataUpdateRequest;
285 client.OnRequestAvatarProperties += OnRequestAvatarProperties; 287 client.OnRequestAvatarProperties += OnRequestAvatarProperties;
288
289
290 }
291/* this should be the right message to ask for other avatars groups
292
293 private void AvatarGroupsRequest(Object sender, string method, List<String> args)
294 {
295 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
296
297 if (!(sender is IClientAPI))
298 return;
299
300 IClientAPI remoteClient = (IClientAPI)sender;
301
302 UUID avatarID;
303 UUID.TryParse(args[0], out avatarID);
304
305 if (avatarID != UUID.Zero)
306 {
307 GroupMembershipData[] avatarGroups = GetProfileListedGroupMemberships(remoteClient, avatarID);
308 remoteClient.SendAvatarGroupsReply(avatarID, avatarGroups);
309 }
286 } 310 }
311*/
287 312
313// this should not be used to send groups memberships, but some viewers do expect it
314// it does send unnecessary memberships, when viewers just want other properties information
288 private void OnRequestAvatarProperties(IClientAPI remoteClient, UUID avatarID) 315 private void OnRequestAvatarProperties(IClientAPI remoteClient, UUID avatarID)
289 { 316 {
290 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); 317 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);