aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs')
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs41
1 files changed, 32 insertions, 9 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
index b2c0f48..8002cb6 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
@@ -29,25 +29,18 @@ using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Reflection; 30using System.Reflection;
31using System.Timers; 31using System.Timers;
32
33using log4net; 32using log4net;
34using Mono.Addins; 33using Mono.Addins;
35using Nini.Config; 34using Nini.Config;
36
37using OpenMetaverse; 35using OpenMetaverse;
38using OpenMetaverse.StructuredData; 36using OpenMetaverse.StructuredData;
39
40using OpenSim.Framework; 37using OpenSim.Framework;
41using OpenSim.Framework.Communications; 38using OpenSim.Framework.Communications;
42using OpenSim.Region.Framework.Interfaces; 39using OpenSim.Region.Framework.Interfaces;
43using OpenSim.Region.Framework.Scenes; 40using OpenSim.Region.Framework.Scenes;
44
45using OpenSim.Services.Interfaces; 41using OpenSim.Services.Interfaces;
46
47using DirFindFlags = OpenMetaverse.DirectoryManager.DirFindFlags; 42using DirFindFlags = OpenMetaverse.DirectoryManager.DirFindFlags;
48 43
49
50
51namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups 44namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
52{ 45{
53 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] 46 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
@@ -90,7 +83,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
90 // Configuration settings 83 // Configuration settings
91 private bool m_groupsEnabled = false; 84 private bool m_groupsEnabled = false;
92 private bool m_groupNoticesEnabled = true; 85 private bool m_groupNoticesEnabled = true;
93 private bool m_debugEnabled = true; 86 private bool m_debugEnabled = false;
94 87
95 #region IRegionModuleBase Members 88 #region IRegionModuleBase Members
96 89
@@ -225,6 +218,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
225 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); 218 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
226 219
227 client.OnUUIDGroupNameRequest += HandleUUIDGroupNameRequest; 220 client.OnUUIDGroupNameRequest += HandleUUIDGroupNameRequest;
221 client.OnObjectGroupRequest += HandleObjectGroupUpdate;
228 client.OnAgentDataUpdateRequest += OnAgentDataUpdateRequest; 222 client.OnAgentDataUpdateRequest += OnAgentDataUpdateRequest;
229 client.OnDirFindQuery += OnDirFindQuery; 223 client.OnDirFindQuery += OnDirFindQuery;
230 client.OnRequestAvatarProperties += OnRequestAvatarProperties; 224 client.OnRequestAvatarProperties += OnRequestAvatarProperties;
@@ -232,7 +226,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
232 // Used for Notices and Group Invites/Accept/Reject 226 // Used for Notices and Group Invites/Accept/Reject
233 client.OnInstantMessage += OnInstantMessage; 227 client.OnInstantMessage += OnInstantMessage;
234 228
235 // Send client thier groups information. 229 // Send client their groups information.
236 SendAgentGroupDataUpdate(client, client.AgentId); 230 SendAgentGroupDataUpdate(client, client.AgentId);
237 } 231 }
238 232
@@ -335,6 +329,35 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
335 remoteClient.SendGroupNameReply(GroupID, GroupName); 329 remoteClient.SendGroupNameReply(GroupID, GroupName);
336 } 330 }
337 331
332 private void HandleObjectGroupUpdate(
333 IClientAPI remoteClient, UUID GroupID, uint objectLocalID, UUID Garbage)
334 {
335 // XXX: Might be better to get rid of this special casing and have GetMembershipData return something
336 // reasonable for a UUID.Zero group.
337 if (GroupID != UUID.Zero)
338 {
339 GroupMembershipData gmd = GetMembershipData(GroupID, remoteClient.AgentId);
340
341 if (gmd == null)
342 {
343// m_log.WarnFormat(
344// "[GROUPS]: User {0} is not a member of group {1} so they can't update {2} to this group",
345// remoteClient.Name, GroupID, objectLocalID);
346
347 return;
348 }
349 }
350
351 SceneObjectGroup so = ((Scene)remoteClient.Scene).GetGroupByPrim(objectLocalID);
352 if (so != null)
353 {
354 if (so.OwnerID == remoteClient.AgentId)
355 {
356 so.SetGroup(GroupID, remoteClient);
357 }
358 }
359 }
360
338 private void OnInstantMessage(IClientAPI remoteClient, GridInstantMessage im) 361 private void OnInstantMessage(IClientAPI remoteClient, GridInstantMessage im)
339 { 362 {
340 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); 363 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);