aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-12-19 23:03:45 +0000
committerJustin Clark-Casey (justincc)2011-12-19 23:03:45 +0000
commit87a2d8d51b66db12a487014deb8447fb2432e2a3 (patch)
tree88b5985189fcd4af3849e1031e9d1e74ccedfc37
parentStop sending the viewer its own AvatarAppearance packet. (diff)
downloadopensim-SC_OLD-87a2d8d51b66db12a487014deb8447fb2432e2a3.zip
opensim-SC_OLD-87a2d8d51b66db12a487014deb8447fb2432e2a3.tar.gz
opensim-SC_OLD-87a2d8d51b66db12a487014deb8447fb2432e2a3.tar.bz2
opensim-SC_OLD-87a2d8d51b66db12a487014deb8447fb2432e2a3.tar.xz
Move HandleObjectGroupUpdate() from GroupsModule to Scene.PacketHandlers.cs as this is updating SOG/SOP.GroupID, which is arguably generic.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs39
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs11
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs30
3 files changed, 44 insertions, 36 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index f9d0e0a..3355ebe 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -154,6 +154,45 @@ namespace OpenSim.Region.Framework.Scenes
154 } 154 }
155 155
156 /// <summary> 156 /// <summary>
157 /// Handle the update of an object's user group.
158 /// </summary>
159 /// <param name="remoteClient"></param>
160 /// <param name="groupID"></param>
161 /// <param name="objectLocalID"></param>
162 /// <param name="Garbage"></param>
163 private void HandleObjectGroupUpdate(
164 IClientAPI remoteClient, UUID groupID, uint objectLocalID, UUID Garbage)
165 {
166 if (m_groupsModule == null)
167 return;
168
169 // XXX: Might be better to get rid of this special casing and have GetMembershipData return something
170 // reasonable for a UUID.Zero group.
171 if (groupID != UUID.Zero)
172 {
173 GroupMembershipData gmd = m_groupsModule.GetMembershipData(groupID, remoteClient.AgentId);
174
175 if (gmd == null)
176 {
177// m_log.WarnFormat(
178// "[GROUPS]: User {0} is not a member of group {1} so they can't update {2} to this group",
179// remoteClient.Name, GroupID, objectLocalID);
180
181 return;
182 }
183 }
184
185 SceneObjectGroup so = ((Scene)remoteClient.Scene).GetGroupByPrim(objectLocalID);
186 if (so != null)
187 {
188 if (so.OwnerID == remoteClient.AgentId)
189 {
190 so.SetGroup(groupID, remoteClient);
191 }
192 }
193 }
194
195 /// <summary>
157 /// Handle the deselection of a prim from the client. 196 /// Handle the deselection of a prim from the client.
158 /// </summary> 197 /// </summary>
159 /// <param name="primLocalID"></param> 198 /// <param name="primLocalID"></param>
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 4914d65..6666328 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -139,6 +139,7 @@ namespace OpenSim.Region.Framework.Scenes
139 protected IDialogModule m_dialogModule; 139 protected IDialogModule m_dialogModule;
140 protected IEntityTransferModule m_teleportModule; 140 protected IEntityTransferModule m_teleportModule;
141 protected ICapabilitiesModule m_capsModule; 141 protected ICapabilitiesModule m_capsModule;
142 protected IGroupsModule m_groupsModule;
142 143
143 /// <summary> 144 /// <summary>
144 /// Current scene frame number 145 /// Current scene frame number
@@ -1164,6 +1165,7 @@ namespace OpenSim.Region.Framework.Scenes
1164 m_dialogModule = RequestModuleInterface<IDialogModule>(); 1165 m_dialogModule = RequestModuleInterface<IDialogModule>();
1165 m_capsModule = RequestModuleInterface<ICapabilitiesModule>(); 1166 m_capsModule = RequestModuleInterface<ICapabilitiesModule>();
1166 m_teleportModule = RequestModuleInterface<IEntityTransferModule>(); 1167 m_teleportModule = RequestModuleInterface<IEntityTransferModule>();
1168 m_groupsModule = RequestModuleInterface<IGroupsModule>();
1167 } 1169 }
1168 1170
1169 #endregion 1171 #endregion
@@ -2733,6 +2735,7 @@ namespace OpenSim.Region.Framework.Scenes
2733 client.OnObjectDescription += m_sceneGraph.PrimDescription; 2735 client.OnObjectDescription += m_sceneGraph.PrimDescription;
2734 client.OnObjectIncludeInSearch += m_sceneGraph.MakeObjectSearchable; 2736 client.OnObjectIncludeInSearch += m_sceneGraph.MakeObjectSearchable;
2735 client.OnObjectOwner += ObjectOwner; 2737 client.OnObjectOwner += ObjectOwner;
2738 client.OnObjectGroupRequest += HandleObjectGroupUpdate;
2736 } 2739 }
2737 2740
2738 public virtual void SubscribeToClientPrimRezEvents(IClientAPI client) 2741 public virtual void SubscribeToClientPrimRezEvents(IClientAPI client)
@@ -3520,15 +3523,11 @@ namespace OpenSim.Region.Framework.Scenes
3520 m_log.ErrorFormat("[CONNECTION BEGIN]: Estate Settings is null!"); 3523 m_log.ErrorFormat("[CONNECTION BEGIN]: Estate Settings is null!");
3521 } 3524 }
3522 3525
3523 IGroupsModule groupsModule =
3524 RequestModuleInterface<IGroupsModule>();
3525
3526 List<UUID> agentGroups = new List<UUID>(); 3526 List<UUID> agentGroups = new List<UUID>();
3527 3527
3528 if (groupsModule != null) 3528 if (m_groupsModule != null)
3529 { 3529 {
3530 GroupMembershipData[] GroupMembership = 3530 GroupMembershipData[] GroupMembership = m_groupsModule.GetMembershipData(agent.AgentID);
3531 groupsModule.GetMembershipData(agent.AgentID);
3532 3531
3533 if (GroupMembership != null) 3532 if (GroupMembership != null)
3534 { 3533 {
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
index e959821..740dbdd 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
@@ -218,7 +218,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
218 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);
219 219
220 client.OnUUIDGroupNameRequest += HandleUUIDGroupNameRequest; 220 client.OnUUIDGroupNameRequest += HandleUUIDGroupNameRequest;
221 client.OnObjectGroupRequest += HandleObjectGroupUpdate;
222 client.OnAgentDataUpdateRequest += OnAgentDataUpdateRequest; 221 client.OnAgentDataUpdateRequest += OnAgentDataUpdateRequest;
223 client.OnDirFindQuery += OnDirFindQuery; 222 client.OnDirFindQuery += OnDirFindQuery;
224 client.OnRequestAvatarProperties += OnRequestAvatarProperties; 223 client.OnRequestAvatarProperties += OnRequestAvatarProperties;
@@ -329,35 +328,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
329 remoteClient.SendGroupNameReply(GroupID, GroupName); 328 remoteClient.SendGroupNameReply(GroupID, GroupName);
330 } 329 }
331 330
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
361 private void OnInstantMessage(IClientAPI remoteClient, GridInstantMessage im) 331 private void OnInstantMessage(IClientAPI remoteClient, GridInstantMessage im)
362 { 332 {
363 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); 333 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);