diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | 75 |
1 files changed, 65 insertions, 10 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index 4d491d1..a5abe76 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | |||
@@ -340,13 +340,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
340 | obj.ObjectGrabHandler(localID, offsetPos, remoteClient); | 340 | obj.ObjectGrabHandler(localID, offsetPos, remoteClient); |
341 | 341 | ||
342 | // If the touched prim handles touches, deliver it | 342 | // If the touched prim handles touches, deliver it |
343 | // If not, deliver to root prim | ||
344 | if ((part.ScriptEvents & scriptEvents.touch_start) != 0) | 343 | if ((part.ScriptEvents & scriptEvents.touch_start) != 0) |
345 | EventManager.TriggerObjectGrab(part.LocalId, 0, part.OffsetPosition, remoteClient, surfaceArg); | 344 | EventManager.TriggerObjectGrab(part.LocalId, 0, part.OffsetPosition, remoteClient, surfaceArg); |
346 | 345 | ||
347 | // Deliver to the root prim if the touched prim doesn't handle touches | 346 | // Deliver to the root prim if the touched prim doesn't handle touches |
348 | // or if we're meant to pass on touches anyway. Don't send to root prim | 347 | // or if we're meant to pass on touches anyway. |
349 | // if prim touched is the root prim as we just did it | ||
350 | if (((part.ScriptEvents & scriptEvents.touch_start) == 0) || | 348 | if (((part.ScriptEvents & scriptEvents.touch_start) == 0) || |
351 | (part.PassTouches && (part.LocalId != obj.RootPart.LocalId))) | 349 | (part.PassTouches && (part.LocalId != obj.RootPart.LocalId))) |
352 | { | 350 | { |
@@ -381,12 +379,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
381 | surfaceArg = surfaceArgs[0]; | 379 | surfaceArg = surfaceArgs[0]; |
382 | 380 | ||
383 | // If the touched prim handles touches, deliver it | 381 | // If the touched prim handles touches, deliver it |
384 | // If not, deliver to root prim | ||
385 | if ((part.ScriptEvents & scriptEvents.touch) != 0) | 382 | if ((part.ScriptEvents & scriptEvents.touch) != 0) |
386 | EventManager.TriggerObjectGrabbing(part.LocalId, 0, part.OffsetPosition, remoteClient, surfaceArg); | 383 | EventManager.TriggerObjectGrabbing(part.LocalId, 0, part.OffsetPosition, remoteClient, surfaceArg); |
387 | // Deliver to the root prim if the touched prim doesn't handle touches | 384 | // Deliver to the root prim if the touched prim doesn't handle touches |
388 | // or if we're meant to pass on touches anyway. Don't send to root prim | 385 | // or if we're meant to pass on touches anyway. |
389 | // if prim touched is the root prim as we just did it | ||
390 | if (((part.ScriptEvents & scriptEvents.touch) == 0) || | 386 | if (((part.ScriptEvents & scriptEvents.touch) == 0) || |
391 | (part.PassTouches && (part.LocalId != group.RootPart.LocalId))) | 387 | (part.PassTouches && (part.LocalId != group.RootPart.LocalId))) |
392 | { | 388 | { |
@@ -400,18 +396,77 @@ namespace OpenSim.Region.Framework.Scenes | |||
400 | if (part == null) | 396 | if (part == null) |
401 | return; | 397 | return; |
402 | 398 | ||
403 | SceneObjectGroup obj = part.ParentGroup; | 399 | SceneObjectGroup grp = part.ParentGroup; |
404 | 400 | ||
405 | SurfaceTouchEventArgs surfaceArg = null; | 401 | SurfaceTouchEventArgs surfaceArg = null; |
406 | if (surfaceArgs != null && surfaceArgs.Count > 0) | 402 | if (surfaceArgs != null && surfaceArgs.Count > 0) |
407 | surfaceArg = surfaceArgs[0]; | 403 | surfaceArg = surfaceArgs[0]; |
408 | 404 | ||
409 | // If the touched prim handles touches, deliver it | 405 | // If the touched prim handles touches, deliver it |
410 | // If not, deliver to root prim | ||
411 | if ((part.ScriptEvents & scriptEvents.touch_end) != 0) | 406 | if ((part.ScriptEvents & scriptEvents.touch_end) != 0) |
412 | EventManager.TriggerObjectDeGrab(part.LocalId, 0, remoteClient, surfaceArg); | 407 | EventManager.TriggerObjectDeGrab(part.LocalId, 0, remoteClient, surfaceArg); |
413 | else | 408 | // if not or PassTouchs, send it also to root. |
414 | EventManager.TriggerObjectDeGrab(obj.RootPart.LocalId, part.LocalId, remoteClient, surfaceArg); | 409 | if (((part.ScriptEvents & scriptEvents.touch_end) == 0) || |
410 | (part.PassTouches && (part.LocalId != grp.RootPart.LocalId))) | ||
411 | { | ||
412 | EventManager.TriggerObjectDeGrab(grp.RootPart.LocalId, part.LocalId, remoteClient, surfaceArg); | ||
413 | } | ||
414 | } | ||
415 | |||
416 | /// <summary> | ||
417 | /// Start spinning the given object | ||
418 | /// </summary> | ||
419 | /// <param name="objectID"></param> | ||
420 | /// <param name="rotation"></param> | ||
421 | /// <param name="remoteClient"></param> | ||
422 | public virtual void ProcessSpinStart(UUID objectID, IClientAPI remoteClient) | ||
423 | { | ||
424 | SceneObjectGroup group = GetGroupByPrim(objectID); | ||
425 | if (group != null) | ||
426 | { | ||
427 | if (Permissions.CanMoveObject(group.UUID, remoteClient.AgentId))// && PermissionsMngr.) | ||
428 | { | ||
429 | group.SpinStart(remoteClient); | ||
430 | } | ||
431 | } | ||
432 | } | ||
433 | |||
434 | /// <summary> | ||
435 | /// Spin the given object | ||
436 | /// </summary> | ||
437 | /// <param name="objectID"></param> | ||
438 | /// <param name="rotation"></param> | ||
439 | /// <param name="remoteClient"></param> | ||
440 | public virtual void ProcessSpinObject(UUID objectID, Quaternion rotation, IClientAPI remoteClient) | ||
441 | { | ||
442 | SceneObjectGroup group = GetGroupByPrim(objectID); | ||
443 | if (group != null) | ||
444 | { | ||
445 | if (Permissions.CanMoveObject(group.UUID, remoteClient.AgentId))// && PermissionsMngr.) | ||
446 | { | ||
447 | group.SpinMovement(rotation, remoteClient); | ||
448 | } | ||
449 | // This is outside the above permissions condition | ||
450 | // so that if the object is locked the client moving the object | ||
451 | // get's it's position on the simulator even if it was the same as before | ||
452 | // This keeps the moving user's client in sync with the rest of the world. | ||
453 | group.SendGroupTerseUpdate(); | ||
454 | } | ||
455 | } | ||
456 | |||
457 | public virtual void ProcessSpinObjectStop(UUID objectID, IClientAPI remoteClient) | ||
458 | { | ||
459 | /* no op for now | ||
460 | SceneObjectGroup group = GetGroupByPrim(objectID); | ||
461 | if (group != null) | ||
462 | { | ||
463 | if (Permissions.CanMoveObject(group.UUID, remoteClient.AgentId))// && PermissionsMngr.) | ||
464 | { | ||
465 | // group.SpinMovement(rotation, remoteClient); | ||
466 | } | ||
467 | group.SendGroupTerseUpdate(); | ||
468 | } | ||
469 | */ | ||
415 | } | 470 | } |
416 | 471 | ||
417 | public void ProcessScriptReset(IClientAPI remoteClient, UUID objectID, | 472 | public void ProcessScriptReset(IClientAPI remoteClient, UUID objectID, |