diff options
Diffstat (limited to 'OpenSim/Region/OptionalModules')
-rw-r--r-- | OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs | 41 | ||||
-rw-r--r-- | OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs | 12 |
2 files changed, 41 insertions, 12 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; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Reflection; | 30 | using System.Reflection; |
31 | using System.Timers; | 31 | using System.Timers; |
32 | |||
33 | using log4net; | 32 | using log4net; |
34 | using Mono.Addins; | 33 | using Mono.Addins; |
35 | using Nini.Config; | 34 | using Nini.Config; |
36 | |||
37 | using OpenMetaverse; | 35 | using OpenMetaverse; |
38 | using OpenMetaverse.StructuredData; | 36 | using OpenMetaverse.StructuredData; |
39 | |||
40 | using OpenSim.Framework; | 37 | using OpenSim.Framework; |
41 | using OpenSim.Framework.Communications; | 38 | using OpenSim.Framework.Communications; |
42 | using OpenSim.Region.Framework.Interfaces; | 39 | using OpenSim.Region.Framework.Interfaces; |
43 | using OpenSim.Region.Framework.Scenes; | 40 | using OpenSim.Region.Framework.Scenes; |
44 | |||
45 | using OpenSim.Services.Interfaces; | 41 | using OpenSim.Services.Interfaces; |
46 | |||
47 | using DirFindFlags = OpenMetaverse.DirectoryManager.DirFindFlags; | 42 | using DirFindFlags = OpenMetaverse.DirectoryManager.DirFindFlags; |
48 | 43 | ||
49 | |||
50 | |||
51 | namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | 44 | namespace 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); |
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs index a08bcd0..52fc27d 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs | |||
@@ -52,6 +52,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
52 | { | 52 | { |
53 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 53 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
54 | 54 | ||
55 | private bool m_debugEnabled = false; | ||
56 | |||
55 | public const GroupPowers m_DefaultEveryonePowers = GroupPowers.AllowSetHome | | 57 | public const GroupPowers m_DefaultEveryonePowers = GroupPowers.AllowSetHome | |
56 | GroupPowers.Accountable | | 58 | GroupPowers.Accountable | |
57 | GroupPowers.JoinChat | | 59 | GroupPowers.JoinChat | |
@@ -81,7 +83,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
81 | private Dictionary<UUID, List<UUID>> m_groupsAgentsDroppedFromChatSession = new Dictionary<UUID, List<UUID>>(); | 83 | private Dictionary<UUID, List<UUID>> m_groupsAgentsDroppedFromChatSession = new Dictionary<UUID, List<UUID>>(); |
82 | private Dictionary<UUID, List<UUID>> m_groupsAgentsInvitedToChatSession = new Dictionary<UUID, List<UUID>>(); | 84 | private Dictionary<UUID, List<UUID>> m_groupsAgentsInvitedToChatSession = new Dictionary<UUID, List<UUID>>(); |
83 | 85 | ||
84 | |||
85 | #region IRegionModuleBase Members | 86 | #region IRegionModuleBase Members |
86 | 87 | ||
87 | public string Name | 88 | public string Name |
@@ -115,7 +116,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
115 | return; | 116 | return; |
116 | } | 117 | } |
117 | 118 | ||
118 | m_log.InfoFormat("[XMLRPC-GROUPS-CONNECTOR]: Initializing {0}", this.Name); | 119 | m_log.DebugFormat("[XMLRPC-GROUPS-CONNECTOR]: Initializing {0}", this.Name); |
119 | 120 | ||
120 | m_groupsServerURI = groupsConfig.GetString("GroupsServerURI", string.Empty); | 121 | m_groupsServerURI = groupsConfig.GetString("GroupsServerURI", string.Empty); |
121 | if ((m_groupsServerURI == null) || | 122 | if ((m_groupsServerURI == null) || |
@@ -142,6 +143,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
142 | m_log.InfoFormat("[XMLRPC-GROUPS-CONNECTOR]: Groups Cache Timeout set to {0}.", m_cacheTimeout); | 143 | m_log.InfoFormat("[XMLRPC-GROUPS-CONNECTOR]: Groups Cache Timeout set to {0}.", m_cacheTimeout); |
143 | } | 144 | } |
144 | 145 | ||
146 | m_debugEnabled = groupsConfig.GetBoolean("DebugEnabled", false); | ||
147 | |||
145 | // If we got all the config options we need, lets start'er'up | 148 | // If we got all the config options we need, lets start'er'up |
146 | m_memoryCache = new ExpiringCache<string, XmlRpcResponse>(); | 149 | m_memoryCache = new ExpiringCache<string, XmlRpcResponse>(); |
147 | m_connectorEnabled = true; | 150 | m_connectorEnabled = true; |
@@ -150,7 +153,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
150 | 153 | ||
151 | public void Close() | 154 | public void Close() |
152 | { | 155 | { |
153 | m_log.InfoFormat("[XMLRPC-GROUPS-CONNECTOR]: Closing {0}", this.Name); | 156 | m_log.DebugFormat("[XMLRPC-GROUPS-CONNECTOR]: Closing {0}", this.Name); |
154 | } | 157 | } |
155 | 158 | ||
156 | public void AddRegion(OpenSim.Region.Framework.Scenes.Scene scene) | 159 | public void AddRegion(OpenSim.Region.Framework.Scenes.Scene scene) |
@@ -958,6 +961,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
958 | 961 | ||
959 | if (resp == null) | 962 | if (resp == null) |
960 | { | 963 | { |
964 | if (m_debugEnabled) | ||
965 | m_log.DebugFormat("[XMLRPC-GROUPS-CONNECTOR]: Cache miss for key {0}", CacheKey); | ||
966 | |||
961 | string UserService; | 967 | string UserService; |
962 | UUID SessionID; | 968 | UUID SessionID; |
963 | GetClientGroupRequestID(requestingAgentID, out UserService, out SessionID); | 969 | GetClientGroupRequestID(requestingAgentID, out UserService, out SessionID); |