aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.cs
diff options
context:
space:
mode:
authorMelanie2010-02-08 22:11:38 +0000
committerMelanie2010-02-08 22:11:38 +0000
commitc8f3bb56ff20493b9f51a123a1d89e876e0cab75 (patch)
tree0f878d1eb21f821f517ebe8170776023952e6e2c /OpenSim/Region/Framework/Scenes/Scene.cs
parentMerge branch 'master' into careminster (diff)
parentMerge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff)
downloadopensim-SC-c8f3bb56ff20493b9f51a123a1d89e876e0cab75.zip
opensim-SC-c8f3bb56ff20493b9f51a123a1d89e876e0cab75.tar.gz
opensim-SC-c8f3bb56ff20493b9f51a123a1d89e876e0cab75.tar.bz2
opensim-SC-c8f3bb56ff20493b9f51a123a1d89e876e0cab75.tar.xz
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs38
1 files changed, 22 insertions, 16 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index d2f33b0..12f0489 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2433,9 +2433,14 @@ namespace OpenSim.Region.Framework.Scenes
2433 return successYN; 2433 return successYN;
2434 } 2434 }
2435 2435
2436 /// <summary>
2437 /// Called when objects or attachments cross the border between regions.
2438 /// </summary>
2439 /// <param name="sog"></param>
2440 /// <returns></returns>
2436 public bool IncomingCreateObject(ISceneObject sog) 2441 public bool IncomingCreateObject(ISceneObject sog)
2437 { 2442 {
2438 //m_log.Debug(" >>> IncomingCreateObject <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted); 2443 //m_log.Debug(" >>> IncomingCreateObject(sog) <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted);
2439 SceneObjectGroup newObject; 2444 SceneObjectGroup newObject;
2440 try 2445 try
2441 { 2446 {
@@ -2452,7 +2457,12 @@ namespace OpenSim.Region.Framework.Scenes
2452 m_log.DebugFormat("[SCENE]: Problem adding scene object {0} in {1} ", sog.UUID, RegionInfo.RegionName); 2457 m_log.DebugFormat("[SCENE]: Problem adding scene object {0} in {1} ", sog.UUID, RegionInfo.RegionName);
2453 return false; 2458 return false;
2454 } 2459 }
2460
2455 newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, 1); 2461 newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, 1);
2462
2463 // Do this as late as possible so that listeners have full access to the incoming object
2464 EventManager.TriggerOnIncomingSceneObject(newObject);
2465
2456 return true; 2466 return true;
2457 } 2467 }
2458 2468
@@ -2464,6 +2474,8 @@ namespace OpenSim.Region.Framework.Scenes
2464 /// <returns>False</returns> 2474 /// <returns>False</returns>
2465 public virtual bool IncomingCreateObject(UUID userID, UUID itemID) 2475 public virtual bool IncomingCreateObject(UUID userID, UUID itemID)
2466 { 2476 {
2477 //m_log.DebugFormat(" >>> IncomingCreateObject(userID, itemID) <<< {0} {1}", userID, itemID);
2478
2467 ScenePresence sp = GetScenePresence(userID); 2479 ScenePresence sp = GetScenePresence(userID);
2468 if (sp != null) 2480 if (sp != null)
2469 { 2481 {
@@ -2498,7 +2510,7 @@ namespace OpenSim.Region.Framework.Scenes
2498 foreach (SceneObjectPart p in sceneObject.Children.Values) 2510 foreach (SceneObjectPart p in sceneObject.Children.Values)
2499 p.LocalId = 0; 2511 p.LocalId = 0;
2500 2512
2501 if ((sceneObject.RootPart.Shape.PCode == (byte)PCode.Prim) && (sceneObject.RootPart.Shape.State != 0)) // Attachment 2513 if (sceneObject.IsAttachmentCheckFull()) // Attachment
2502 { 2514 {
2503 sceneObject.RootPart.AddFlag(PrimFlags.TemporaryOnRez); 2515 sceneObject.RootPart.AddFlag(PrimFlags.TemporaryOnRez);
2504 sceneObject.RootPart.AddFlag(PrimFlags.Phantom); 2516 sceneObject.RootPart.AddFlag(PrimFlags.Phantom);
@@ -2523,29 +2535,23 @@ namespace OpenSim.Region.Framework.Scenes
2523 2535
2524 //RootPrim.SetParentLocalId(parentLocalID); 2536 //RootPrim.SetParentLocalId(parentLocalID);
2525 2537
2526 m_log.DebugFormat("[ATTACHMENT]: Received " + 2538 m_log.DebugFormat(
2527 "attachment {0}, inworld asset id {1}", 2539 "[ATTACHMENT]: Received attachment {0}, inworld asset id {1}", grp.GetFromItemID(), grp.UUID);
2528 //grp.RootPart.LastOwnerID.ToString(),
2529 grp.GetFromItemID(),
2530 grp.UUID.ToString());
2531 2540
2532 //grp.SetFromAssetID(grp.RootPart.LastOwnerID); 2541 //grp.SetFromAssetID(grp.RootPart.LastOwnerID);
2533 m_log.DebugFormat("[ATTACHMENT]: Attach " + 2542 m_log.DebugFormat(
2534 "to avatar {0} at position {1}", 2543 "[ATTACHMENT]: Attach to avatar {0} at position {1}", sp.UUID, grp.AbsolutePosition);
2535 sp.UUID.ToString(), grp.AbsolutePosition); 2544
2536 AttachObject(sp.ControllingClient, 2545 AttachObject(
2537 grp.LocalId, (uint)0, 2546 sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false);
2538 grp.GroupRotation,
2539 grp.AbsolutePosition, false);
2540 RootPrim.RemFlag(PrimFlags.TemporaryOnRez); 2547 RootPrim.RemFlag(PrimFlags.TemporaryOnRez);
2541 grp.SendGroupFullUpdate(); 2548 grp.SendGroupFullUpdate();
2542 } 2549 }
2543 else 2550 else
2544 { 2551 {
2545 RootPrim.RemFlag(PrimFlags.TemporaryOnRez); 2552 RootPrim.RemFlag(PrimFlags.TemporaryOnRez);
2546 RootPrim.AddFlag(PrimFlags.TemporaryOnRez); 2553 RootPrim.AddFlag(PrimFlags.TemporaryOnRez);
2547 } 2554 }
2548
2549 } 2555 }
2550 else 2556 else
2551 { 2557 {