* Force ClickAction persistence even if other object properties are not edited 
* Thanks nlin!
0.6.0-stable
Justin Clarke Casey 2008-09-12 20:42:04 +00:00
parent 2d7aca6d9d
commit 62d1eba3b2
6 changed files with 30 additions and 7 deletions

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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;