Enabled touch events (ObjectGrab, ObjectGrabbing, ObjectDeGrab) to be propagated to script engine and triggers script.

dsg
Huaiyu (Kitty) Liu 2011-01-10 14:14:40 -08:00
parent 7eb9affbd3
commit 5c31e0bdd3
7 changed files with 349 additions and 17 deletions

View File

@ -883,13 +883,14 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
// Register for interesting client events which will be forwarded to auth sim // Register for interesting client events which will be forwarded to auth sim
// These are the raw packet data blocks from the client, intercepted and sent up to the sim // These are the raw packet data blocks from the client, intercepted and sent up to the sim
client.OnAgentUpdateRaw += HandleAgentUpdateRaw; client.OnAgentUpdateRaw += HandleAgentUpdateRaw;
//SYMMETRIC SYNC: do not subscribe to OnChatFromClientRaw, we may remove this event entirely later //SYMMETRIC SYNC: do not subscribe to OnChatFromClientRaw: RegionSyncModule + Scene.EventManager will handle this.
//client.OnChatFromClientRaw += HandleChatFromClientRaw; //client.OnChatFromClientRaw += HandleChatFromClientRaw;
client.OnAgentRequestSit += HandleAgentRequestSit; client.OnAgentRequestSit += HandleAgentRequestSit;
client.OnAgentSit += HandleAgentSit; client.OnAgentSit += HandleAgentSit;
client.OnGrabObject += HandleGrabObject; //SYMMETRIC SYNC: do not subscribe to OnGrabObject, OnGrabUpdate, and OnDeGrabObject: RegionSyncModule + Scene.EventManager will handle this.
client.OnGrabUpdate += HandleGrabUpdate; //client.OnGrabObject += HandleGrabObject;
client.OnDeGrabObject += HandleDeGrabObject; //client.OnGrabUpdate += HandleGrabUpdate;
//client.OnDeGrabObject += HandleDeGrabObject;
client.OnStartAnim += HandleStartAnim; client.OnStartAnim += HandleStartAnim;
client.OnStopAnim += HandleStopAnim; client.OnStopAnim += HandleStopAnim;
} }

View File

@ -854,6 +854,9 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
case SymmetricSyncMessage.MsgType.ScriptReset: case SymmetricSyncMessage.MsgType.ScriptReset:
case SymmetricSyncMessage.MsgType.ChatFromClient: case SymmetricSyncMessage.MsgType.ChatFromClient:
case SymmetricSyncMessage.MsgType.ChatFromWorld: case SymmetricSyncMessage.MsgType.ChatFromWorld:
case SymmetricSyncMessage.MsgType.ObjectGrab:
case SymmetricSyncMessage.MsgType.ObjectGrabbing:
case SymmetricSyncMessage.MsgType.ObjectDeGrab:
{ {
HandleRemoteEvent(msg); HandleRemoteEvent(msg);
return; return;
@ -1011,6 +1014,15 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
case SymmetricSyncMessage.MsgType.ChatFromWorld: case SymmetricSyncMessage.MsgType.ChatFromWorld:
HandleRemoteEvent_OnChatFromWorld(init_actorID, evSeqNum, data); HandleRemoteEvent_OnChatFromWorld(init_actorID, evSeqNum, data);
break; break;
case SymmetricSyncMessage.MsgType.ObjectGrab:
HandleRemoteEvent_OnObjectGrab(init_actorID, evSeqNum, data);
break;
case SymmetricSyncMessage.MsgType.ObjectGrabbing:
HandleRemoteEvent_OnObjectGrabbing(init_actorID, evSeqNum, data);
break;
case SymmetricSyncMessage.MsgType.ObjectDeGrab:
HandleRemoteEvent_OnObjectDeGrab(init_actorID, evSeqNum, data);
break;
} }
//if this is a relay node, forwards the event //if this is a relay node, forwards the event
@ -1102,6 +1114,120 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
m_scene.EventManager.TriggerOnChatFromWorldLocally(m_scene, args); m_scene.EventManager.TriggerOnChatFromWorldLocally(m_scene, args);
} }
/// <summary>
/// Special actions for remote event ChatFromClient
/// </summary>
/// <param name="data">OSDMap data of event args</param>
private void HandleRemoteEvent_OnObjectGrab(string actorID, ulong evSeqNum, OSDMap data)
{
m_log.Debug(LogHeader + ", " + m_actorID + ": received GrabObject from " + actorID + ", seq " + evSeqNum);
UUID agentID = data["agentID"].AsUUID();
UUID primID = data["primID"].AsUUID();
UUID originalPrimID = data["originalPrimID"].AsUUID();
Vector3 offsetPos = data["offsetPos"].AsVector3();
SurfaceTouchEventArgs surfaceArgs = new SurfaceTouchEventArgs();
surfaceArgs.Binormal = data["binormal"].AsVector3();
surfaceArgs.FaceIndex = data["faceIndex"].AsInteger();
surfaceArgs.Normal = data["normal"].AsVector3();
surfaceArgs.Position = data["position"].AsVector3();
surfaceArgs.STCoord = data["stCoord"].AsVector3();
surfaceArgs.UVCoord = data["uvCoord"].AsVector3();
//Create an instance of IClientAPI to pass along agentID, see SOPObject.EventManager_OnObjectGrab()
//We don't really need RegionSyncAvatar's implementation here, just borrow it's IClientAPI interface.
//If we decide to remove RegionSyncAvatar later, we can simple just define a very simple class that implements
//ICleintAPI to be used here.
IClientAPI remoteClinet = new RegionSyncAvatar(m_scene, agentID, "", "", Vector3.Zero);
SceneObjectPart part = m_scene.GetSceneObjectPart(primID);
if (part == null)
{
m_log.Error(LogHeader + ": no prim with ID " + primID);
return;
}
uint originalID = 0;
if (originalPrimID != UUID.Zero)
{
SceneObjectPart originalPart = m_scene.GetSceneObjectPart(originalPrimID);
originalID = originalPart.LocalId;
}
m_scene.EventManager.TriggerObjectGrabLocally(part.LocalId, originalID, offsetPos, remoteClinet, surfaceArgs);
}
private void HandleRemoteEvent_OnObjectGrabbing(string actorID, ulong evSeqNum, OSDMap data)
{
m_log.Debug(LogHeader + ", " + m_actorID + ": received GrabObject from " + actorID + ", seq " + evSeqNum);
UUID agentID = data["agentID"].AsUUID();
UUID primID = data["primID"].AsUUID();
UUID originalPrimID = data["originalPrimID"].AsUUID();
Vector3 offsetPos = data["offsetPos"].AsVector3();
SurfaceTouchEventArgs surfaceArgs = new SurfaceTouchEventArgs();
surfaceArgs.Binormal = data["binormal"].AsVector3();
surfaceArgs.FaceIndex = data["faceIndex"].AsInteger();
surfaceArgs.Normal = data["normal"].AsVector3();
surfaceArgs.Position = data["position"].AsVector3();
surfaceArgs.STCoord = data["stCoord"].AsVector3();
surfaceArgs.UVCoord = data["uvCoord"].AsVector3();
//Create an instance of IClientAPI to pass along agentID, see SOPObject.EventManager_OnObjectGrab()
//We don't really need RegionSyncAvatar's implementation here, just borrow it's IClientAPI interface.
//If we decide to remove RegionSyncAvatar later, we can simple just define a very simple class that implements
//ICleintAPI to be used here.
IClientAPI remoteClinet = new RegionSyncAvatar(m_scene, agentID, "", "", Vector3.Zero);
SceneObjectPart part = m_scene.GetSceneObjectPart(primID);
if (part == null)
{
m_log.Error(LogHeader + ": no prim with ID " + primID);
return;
}
uint originalID = 0;
if (originalPrimID != UUID.Zero)
{
SceneObjectPart originalPart = m_scene.GetSceneObjectPart(originalPrimID);
originalID = originalPart.LocalId;
}
m_scene.EventManager.TriggerObjectGrabbingLocally(part.LocalId, originalID, offsetPos, remoteClinet, surfaceArgs);
}
private void HandleRemoteEvent_OnObjectDeGrab(string actorID, ulong evSeqNum, OSDMap data)
{
m_log.Debug(LogHeader + ", " + m_actorID + ": received GrabObject from " + actorID + ", seq " + evSeqNum);
UUID agentID = data["agentID"].AsUUID();
UUID primID = data["primID"].AsUUID();
UUID originalPrimID = data["originalPrimID"].AsUUID();
SurfaceTouchEventArgs surfaceArgs = new SurfaceTouchEventArgs();
surfaceArgs.Binormal = data["binormal"].AsVector3();
surfaceArgs.FaceIndex = data["faceIndex"].AsInteger();
surfaceArgs.Normal = data["normal"].AsVector3();
surfaceArgs.Position = data["position"].AsVector3();
surfaceArgs.STCoord = data["stCoord"].AsVector3();
surfaceArgs.UVCoord = data["uvCoord"].AsVector3();
//Create an instance of IClientAPI to pass along agentID, see SOPObject.EventManager_OnObjectGrab()
//We don't really need RegionSyncAvatar's implementation here, just borrow it's IClientAPI interface.
//If we decide to remove RegionSyncAvatar later, we can simple just define a very simple class that implements
//ICleintAPI to be used here.
IClientAPI remoteClinet = new RegionSyncAvatar(m_scene, agentID, "", "", Vector3.Zero);
SceneObjectPart part = m_scene.GetSceneObjectPart(primID);
if (part == null)
{
m_log.Error(LogHeader + ": no prim with ID " + primID);
return;
}
uint originalID = 0;
if (originalPrimID != UUID.Zero)
{
SceneObjectPart originalPart = m_scene.GetSceneObjectPart(originalPrimID);
originalID = originalPart.LocalId;
}
m_scene.EventManager.TriggerObjectDeGrabLocally(part.LocalId, originalID, remoteClinet, surfaceArgs);
}
/// <summary> /// <summary>
/// Send a sync message to remove the given objects in all connected actors, if this is a relay node. /// Send a sync message to remove the given objects in all connected actors, if this is a relay node.
@ -1164,6 +1290,15 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
} }
OnLocalChatFromWorld(evArgs[0], (OSChatMessage)evArgs[1]); OnLocalChatFromWorld(evArgs[0], (OSChatMessage)evArgs[1]);
return; return;
case EventManager.EventNames.ObjectGrab:
OnLocalGrabObject((uint)evArgs[0], (uint)evArgs[1], (Vector3) evArgs[2], (IClientAPI) evArgs[3], (SurfaceTouchEventArgs)evArgs[4]);
return;
case EventManager.EventNames.ObjectGrabbing:
OnLocalObjectGrabbing((uint)evArgs[0], (uint)evArgs[1], (Vector3)evArgs[2], (IClientAPI)evArgs[3], (SurfaceTouchEventArgs)evArgs[4]);
return;
case EventManager.EventNames.ObjectDeGrab:
OnLocalDeGrabObject((uint)evArgs[0], (uint)evArgs[1], (IClientAPI)evArgs[2], (SurfaceTouchEventArgs)evArgs[3]);
return;
default: default:
return; return;
} }
@ -1204,6 +1339,12 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
//we will use the prim's UUID as the identifier, not the localID, to publish the event for the prim //we will use the prim's UUID as the identifier, not the localID, to publish the event for the prim
SceneObjectPart part = m_scene.GetSceneObjectPart(localID); SceneObjectPart part = m_scene.GetSceneObjectPart(localID);
if (part == null)
{
m_log.Warn(LogHeader + ": part with localID " + localID + " not exist");
return;
}
OSDMap data = new OSDMap(); OSDMap data = new OSDMap();
data["primID"] = OSD.FromUUID(part.UUID); data["primID"] = OSD.FromUUID(part.UUID);
data["itemID"] = OSD.FromUUID(itemID); data["itemID"] = OSD.FromUUID(itemID);
@ -1245,6 +1386,117 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
data["type"] = OSD.FromInteger((int)chat.Type); data["type"] = OSD.FromInteger((int)chat.Type);
SendSceneEvent(SymmetricSyncMessage.MsgType.ChatFromWorld, data); SendSceneEvent(SymmetricSyncMessage.MsgType.ChatFromWorld, data);
} }
private void OnLocalGrabObject(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
{
/*
//we will use the prim's UUID as the identifier, not the localID, to publish the event for the prim
SceneObjectPart part = m_scene.GetSceneObjectPart(localID);
if (part == null)
{
m_log.Warn(LogHeader + ": part with localID " + localID + " not exist");
return;
}
//this seems to be useful if the prim touched and the prim handling the touch event are different:
//i.e. a child part is touched, pass the event to root, and root handles the event. then root is the "part",
//and the child part is the "originalPart"
SceneObjectPart originalPart = null;
if (originalID != 0)
{
originalPart = m_scene.GetSceneObjectPart(originalID);
if (originalPart == null)
{
m_log.Warn(LogHeader + ": part with localID " + localID + " not exist");
return;
}
}
OSDMap data = new OSDMap();
data["agentID"] = OSD.FromUUID(remoteClient.AgentId);
data["primID"] = OSD.FromUUID(part.UUID);
if (originalID != 0)
{
data["originalPrimID"] = OSD.FromUUID(originalPart.UUID);
}
else
{
data["originalPrimID"] = OSD.FromUUID(UUID.Zero);
}
data["offsetPos"] = OSD.FromVector3(offsetPos);
data["binormal"] = OSD.FromVector3(surfaceArgs.Binormal);
data["faceIndex"] = OSD.FromInteger(surfaceArgs.FaceIndex);
data["normal"] = OSD.FromVector3(surfaceArgs.Normal);
data["position"] = OSD.FromVector3(surfaceArgs.Position);
data["stCoord"] = OSD.FromVector3(surfaceArgs.STCoord);
data["uvCoord"] = OSD.FromVector3(surfaceArgs.UVCoord);
* */
OSDMap data = PrepareObjectGrabArgs(localID, originalID, offsetPos, remoteClient, surfaceArgs);
SendSceneEvent(SymmetricSyncMessage.MsgType.ObjectGrab, data);
}
private void OnLocalObjectGrabbing(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
{
OSDMap data = PrepareObjectGrabArgs(localID, originalID, offsetPos, remoteClient, surfaceArgs);
if (data != null)
{
SendSceneEvent(SymmetricSyncMessage.MsgType.ObjectGrabbing, data);
}
}
private OSDMap PrepareObjectGrabArgs(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
{
//we will use the prim's UUID as the identifier, not the localID, to publish the event for the prim
SceneObjectPart part = m_scene.GetSceneObjectPart(localID);
if (part == null)
{
m_log.Warn(LogHeader + ": PrepareObjectGrabArgs - part with localID " + localID + " not exist");
return null;
}
//this seems to be useful if the prim touched and the prim handling the touch event are different:
//i.e. a child part is touched, pass the event to root, and root handles the event. then root is the "part",
//and the child part is the "originalPart"
SceneObjectPart originalPart = null;
if (originalID != 0)
{
originalPart = m_scene.GetSceneObjectPart(originalID);
if (originalPart == null)
{
m_log.Warn(LogHeader + ": PrepareObjectGrabArgs - part with localID " + localID + " not exist");
return null;
}
}
OSDMap data = new OSDMap();
data["agentID"] = OSD.FromUUID(remoteClient.AgentId);
data["primID"] = OSD.FromUUID(part.UUID);
if (originalID != 0)
{
data["originalPrimID"] = OSD.FromUUID(originalPart.UUID);
}
else
{
data["originalPrimID"] = OSD.FromUUID(UUID.Zero);
}
data["offsetPos"] = OSD.FromVector3(offsetPos);
data["binormal"] = OSD.FromVector3(surfaceArgs.Binormal);
data["faceIndex"] = OSD.FromInteger(surfaceArgs.FaceIndex);
data["normal"] = OSD.FromVector3(surfaceArgs.Normal);
data["position"] = OSD.FromVector3(surfaceArgs.Position);
data["stCoord"] = OSD.FromVector3(surfaceArgs.STCoord);
data["uvCoord"] = OSD.FromVector3(surfaceArgs.UVCoord);
return data;
}
private void OnLocalDeGrabObject(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
{
}
private void SendSceneEvent(SymmetricSyncMessage.MsgType msgType, OSDMap data) private void SendSceneEvent(SymmetricSyncMessage.MsgType msgType, OSDMap data)
{ {

View File

@ -38,6 +38,9 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
ScriptReset, ScriptReset,
ChatFromClient, ChatFromClient,
ChatFromWorld, ChatFromWorld,
ObjectGrab,
ObjectGrabbing,
ObjectDeGrab,
} }
#endregion #endregion

View File

@ -34,8 +34,8 @@ using OpenSim.Framework;
using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes;
using log4net; //using log4net;
using System.Reflection; //using System.Reflection;
/***************************************************** /*****************************************************
@ -98,7 +98,7 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm
private int m_saydistance = 30; private int m_saydistance = 30;
private int m_shoutdistance = 100; private int m_shoutdistance = 100;
private ILog m_log; //private ILog m_log;
#region IRegionModule Members #region IRegionModule Members
@ -130,7 +130,7 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm
//SYMMETRIC SYNC //SYMMETRIC SYNC
//m_scene.EventManager.OnChatFromWorld += DeliverClientMessage; //m_scene.EventManager.OnChatFromWorld += DeliverClientMessage;
//Kitty: temp debug //Kitty: temp debug
m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); //m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
//end SYMMETRIC SYNC //end SYMMETRIC SYNC
m_pendingQ = new Queue(); m_pendingQ = new Queue();
m_pending = Queue.Synchronized(m_pendingQ); m_pending = Queue.Synchronized(m_pendingQ);
@ -248,8 +248,8 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm
/// <param name="msg">msg to sent</param> /// <param name="msg">msg to sent</param>
public void DeliverMessage(ChatTypeEnum type, int channel, string name, UUID id, string msg, Vector3 position) public void DeliverMessage(ChatTypeEnum type, int channel, string name, UUID id, string msg, Vector3 position)
{ {
m_log.DebugFormat("[WorldComm] got[2] type {0}, channel {1}, name {2}, id {3}, msg {4}", //m_log.DebugFormat("[WorldComm] got[2] type {0}, channel {1}, name {2}, id {3}, msg {4}",
type, channel, name, id, msg); // type, channel, name, id, msg);
// Determine which listen event filters match the given set of arguments, this results // Determine which listen event filters match the given set of arguments, this results
// in a limited set of listeners, each belonging a host. If the host is in range, add them // in a limited set of listeners, each belonging a host. If the host is in range, add them

View File

@ -54,6 +54,10 @@ namespace OpenSim.Region.Framework.Scenes
ScriptReset, ScriptReset,
ChatFromClient, //chats from avatars ChatFromClient, //chats from avatars
ChatFromWorld, //chats from objects ChatFromWorld, //chats from objects
ObjectGrab,
ObjectGrabbing,
ObjectDeGrab,
} }
public EventManager(Scene scene) public EventManager(Scene scene)
@ -148,6 +152,68 @@ namespace OpenSim.Region.Framework.Scenes
base.TriggerOnChatFromWorld(sender, chat); base.TriggerOnChatFromWorld(sender, chat);
} }
#endregion //ChatFromWorld #endregion //ChatFromWorld
#region ObjectGrab, ObjectGrabbing, ObjectDeGrab
public override void TriggerObjectGrab(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
{
if (m_scene.RegionSyncModule != null)
{
Object[] eventArgs = new Object[5];
eventArgs[0] = (Object)localID;
eventArgs[1] = (Object)originalID;
eventArgs[2] = (Object)offsetPos;
eventArgs[3] = (Object)remoteClient;
eventArgs[4] = (Object)surfaceArgs;
m_scene.RegionSyncModule.PublishSceneEvent(EventNames.ObjectGrab, eventArgs);
}
TriggerObjectGrabLocally(localID, originalID, offsetPos, remoteClient, surfaceArgs);
}
public void TriggerObjectGrabLocally(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
{
base.TriggerObjectGrab(localID, originalID, offsetPos, remoteClient, surfaceArgs);
}
public override void TriggerObjectGrabbing(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
{
if (m_scene.RegionSyncModule != null)
{
Object[] eventArgs = new Object[5];
eventArgs[0] = (Object)localID;
eventArgs[1] = (Object)originalID;
eventArgs[2] = (Object)offsetPos;
eventArgs[3] = (Object)remoteClient;
eventArgs[4] = (Object)surfaceArgs;
m_scene.RegionSyncModule.PublishSceneEvent(EventNames.ObjectGrabbing, eventArgs);
}
TriggerObjectGrabbingLocally(localID, originalID, offsetPos, remoteClient, surfaceArgs);
}
public void TriggerObjectGrabbingLocally(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
{
base.TriggerObjectGrabbing(localID, originalID, offsetPos, remoteClient, surfaceArgs);
}
public override void TriggerObjectDeGrab(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
{
if (m_scene.RegionSyncModule != null)
{
Object[] eventArgs = new Object[4];
eventArgs[0] = (Object)localID;
eventArgs[1] = (Object)originalID;
eventArgs[2] = (Object)remoteClient;
eventArgs[3] = (Object)surfaceArgs;
m_scene.RegionSyncModule.PublishSceneEvent(EventNames.ObjectDeGrab, eventArgs);
}
TriggerObjectDeGrabLocally(localID, originalID, remoteClient, surfaceArgs);
}
public void TriggerObjectDeGrabLocally(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
{
base.TriggerObjectDeGrab(localID, originalID, remoteClient, surfaceArgs);
}
#endregion //GrabObject
} }
/// <summary> /// <summary>
@ -954,7 +1020,9 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
public void TriggerObjectGrab(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs) //SYMMETRIC SYNC: overridden at new EventManager class
//public void TriggerObjectGrab(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
public virtual void TriggerObjectGrab(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
{ {
ObjectGrabDelegate handlerObjectGrab = OnObjectGrab; ObjectGrabDelegate handlerObjectGrab = OnObjectGrab;
if (handlerObjectGrab != null) if (handlerObjectGrab != null)
@ -975,7 +1043,9 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
public void TriggerObjectGrabbing(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs) //SYMMETRIC SYNC: overridden at new EventManager class
//public void TriggerObjectGrabbing(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
public virtual void TriggerObjectGrabbing(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
{ {
ObjectGrabDelegate handlerObjectGrabbing = OnObjectGrabbing; ObjectGrabDelegate handlerObjectGrabbing = OnObjectGrabbing;
if (handlerObjectGrabbing != null) if (handlerObjectGrabbing != null)
@ -996,7 +1066,9 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
public void TriggerObjectDeGrab(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs) //SYMMETRIC SYNC: overridden at new EventManager class
//public void TriggerObjectDeGrab(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
public virtual void TriggerObjectDeGrab(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
{ {
ObjectDeGrabDelegate handlerObjectDeGrab = OnObjectDeGrab; ObjectDeGrabDelegate handlerObjectDeGrab = OnObjectDeGrab;
if (handlerObjectDeGrab != null) if (handlerObjectDeGrab != null)

View File

@ -3071,12 +3071,13 @@ namespace OpenSim.Region.Framework.Scenes
client.OnUpdatePrimFlags += m_sceneGraph.UpdatePrimFlags; client.OnUpdatePrimFlags += m_sceneGraph.UpdatePrimFlags;
client.OnRequestObjectPropertiesFamily += m_sceneGraph.RequestObjectPropertiesFamily; client.OnRequestObjectPropertiesFamily += m_sceneGraph.RequestObjectPropertiesFamily;
client.OnObjectPermissions += HandleObjectPermissionsUpdate; client.OnObjectPermissions += HandleObjectPermissionsUpdate;
if (IsSyncedServer()) //SYMMETRIC SYNC: return the code back to its original OpenSim version
{ //if (IsSyncedServer())
//{
client.OnGrabObject += ProcessObjectGrab; client.OnGrabObject += ProcessObjectGrab;
client.OnGrabUpdate += ProcessObjectGrabUpdate; client.OnGrabUpdate += ProcessObjectGrabUpdate;
client.OnDeGrabObject += ProcessObjectDeGrab; client.OnDeGrabObject += ProcessObjectDeGrab;
} //}
client.OnUndo += m_sceneGraph.HandleUndo; client.OnUndo += m_sceneGraph.HandleUndo;
client.OnRedo += m_sceneGraph.HandleRedo; client.OnRedo += m_sceneGraph.HandleRedo;
client.OnObjectDescription += m_sceneGraph.PrimDescription; client.OnObjectDescription += m_sceneGraph.PrimDescription;

View File

@ -1174,7 +1174,10 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
writer.WriteElementString("GroupMask", sop.GroupMask.ToString()); writer.WriteElementString("GroupMask", sop.GroupMask.ToString());
writer.WriteElementString("EveryoneMask", sop.EveryoneMask.ToString()); writer.WriteElementString("EveryoneMask", sop.EveryoneMask.ToString());
writer.WriteElementString("NextOwnerMask", sop.NextOwnerMask.ToString()); writer.WriteElementString("NextOwnerMask", sop.NextOwnerMask.ToString());
WriteFlags(writer, "Flags", sop.Flags.ToString(), options); //SYMMETRIC SYNC: also serialize SceneObjectPart:LocalFlags, so that it can be propogated across actors
//WriteFlags(writer, "Flags", sop.Flags.ToString(), options);
WriteFlags(writer, "Flags", sop.GetEffectiveObjectFlags().ToString(), options);
//end SYMMETRIC SYNC
WriteUUID(writer, "CollisionSound", sop.CollisionSound, options); WriteUUID(writer, "CollisionSound", sop.CollisionSound, options);
writer.WriteElementString("CollisionSoundVolume", sop.CollisionSoundVolume.ToString()); writer.WriteElementString("CollisionSoundVolume", sop.CollisionSoundVolume.ToString());
if (sop.MediaUrl != null) if (sop.MediaUrl != null)