diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index ac97375353..16781852e4 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -422,6 +422,7 @@ namespace OpenSim.Framework event ObjectDeselect OnObjectDeselect; event GenericCall7 OnObjectDescription; event GenericCall7 OnObjectName; + event GenericCall7 OnObjectClickAction; event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily; event UpdatePrimFlags OnUpdatePrimFlags; event UpdatePrimTexture OnUpdatePrimTexture; diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 6235381980..57a995c319 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -170,6 +170,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP private ObjectSelect handlerDeGrabObject = null; //OnDeGrabObject; private GenericCall7 handlerObjectDescription = null; private GenericCall7 handlerObjectName = null; + private GenericCall7 handlerObjectClickAction = null; private ObjectPermissions handlerObjectPermissions = null; private RequestObjectPropertiesFamily handlerRequestObjectPropertiesFamily = null; //OnRequestObjectPropertiesFamily; private TextureRequest handlerTextureRequest = null; @@ -864,6 +865,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP public event ObjectDeselect OnObjectDeselect; public event GenericCall7 OnObjectDescription; public event GenericCall7 OnObjectName; + public event GenericCall7 OnObjectClickAction; public event ObjectIncludeInSearch OnObjectIncludeInSearch; public event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily; public event UpdatePrimFlags OnUpdatePrimFlags; @@ -4774,16 +4776,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP case PacketType.ObjectClickAction: ObjectClickActionPacket ocpacket = (ObjectClickActionPacket)Pack; - Scene tScene = (Scene)m_scene; - foreach (ObjectClickActionPacket.ObjectDataBlock odata in ocpacket.ObjectData) + handlerObjectClickAction = OnObjectClickAction; + if(handlerObjectClickAction != null) { - byte action = odata.ClickAction; - uint localId = odata.ObjectLocalID; - SceneObjectPart part = tScene.GetSceneObjectPart(localId); - part.ClickAction = action; + foreach (ObjectClickActionPacket.ObjectDataBlock odata in ocpacket.ObjectData) + { + byte action = odata.ClickAction; + uint localID = odata.ObjectLocalID; + handlerObjectClickAction(this, localID, action.ToString()); + } } - break; #endregion diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs index a4491f6bed..a1d72be4bc 100644 --- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs @@ -211,6 +211,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC public event ObjectSelect OnObjectSelect; public event GenericCall7 OnObjectDescription; public event GenericCall7 OnObjectName; + public event GenericCall7 OnObjectClickAction; public event UpdatePrimFlags OnUpdatePrimFlags; public event UpdatePrimTexture OnUpdatePrimTexture; public event UpdateVector OnUpdatePrimGroupPosition; diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index bfe6832931..20442aa9f0 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs @@ -1218,6 +1218,22 @@ namespace OpenSim.Region.Environment.Scenes } } + protected internal void PrimClickAction(IClientAPI remoteClient, uint primLocalID, string clickAction) + { + SceneObjectGroup group = GetGroupByPrim(primLocalID); + if (group != null) + { + if (m_parentScene.ExternalChecks.ExternalChecksCanEditObject(group.UUID, remoteClient.AgentId)) + { + SceneObjectPart part = m_parentScene.GetSceneObjectPart(primLocalID); + part.ClickAction = Convert.ToByte(clickAction); + group.HasGroupChanged = true; + } + } + } + + + protected internal void UpdateExtraParam(UUID agentID, uint primLocalID, ushort type, bool inUse, byte[] data) { SceneObjectGroup group = GetGroupByPrim(primLocalID); diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 9c2dd062e8..5b5880486b 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -2144,6 +2144,7 @@ namespace OpenSim.Region.Environment.Scenes client.OnNameFromUUIDRequest += CommsManager.HandleUUIDNameRequest; client.OnObjectDescription += m_innerScene.PrimDescription; client.OnObjectName += m_innerScene.PrimName; + client.OnObjectClickAction += m_innerScene.PrimClickAction; client.OnLinkObjects += m_innerScene.LinkObjects; client.OnDelinkObjects += m_innerScene.DelinkObjects; client.OnObjectDuplicate += m_innerScene.DuplicateObject; diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index c42eaeb98b..623325ec36 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs @@ -106,6 +106,7 @@ namespace OpenSim.Region.Examples.SimpleModule public event ObjectSelect OnObjectSelect; public event GenericCall7 OnObjectDescription; public event GenericCall7 OnObjectName; + public event GenericCall7 OnObjectClickAction; public event UpdatePrimFlags OnUpdatePrimFlags; public event UpdatePrimTexture OnUpdatePrimTexture; public event UpdateVector OnUpdatePrimGroupPosition;