From 87a2d8d51b66db12a487014deb8447fb2432e2a3 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 19 Dec 2011 23:03:45 +0000 Subject: Move HandleObjectGroupUpdate() from GroupsModule to Scene.PacketHandlers.cs as this is updating SOG/SOP.GroupID, which is arguably generic. --- .../Framework/Scenes/Scene.PacketHandlers.cs | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs') 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 } /// + /// Handle the update of an object's user group. + /// + /// + /// + /// + /// + private void HandleObjectGroupUpdate( + IClientAPI remoteClient, UUID groupID, uint objectLocalID, UUID Garbage) + { + if (m_groupsModule == null) + return; + + // XXX: Might be better to get rid of this special casing and have GetMembershipData return something + // reasonable for a UUID.Zero group. + if (groupID != UUID.Zero) + { + GroupMembershipData gmd = m_groupsModule.GetMembershipData(groupID, remoteClient.AgentId); + + if (gmd == null) + { +// m_log.WarnFormat( +// "[GROUPS]: User {0} is not a member of group {1} so they can't update {2} to this group", +// remoteClient.Name, GroupID, objectLocalID); + + return; + } + } + + SceneObjectGroup so = ((Scene)remoteClient.Scene).GetGroupByPrim(objectLocalID); + if (so != null) + { + if (so.OwnerID == remoteClient.AgentId) + { + so.SetGroup(groupID, remoteClient); + } + } + } + + /// /// Handle the deselection of a prim from the client. /// /// -- cgit v1.1