diff options
author | Melanie | 2010-02-08 21:42:23 +0000 |
---|---|---|
committer | Melanie | 2010-02-08 21:42:23 +0000 |
commit | def8f8166a0ce1d6727e1621d434e8f6251bccff (patch) | |
tree | a57a9c5e03b014093a63b48e9b441369fc9e22bc /OpenSim/Region/Framework/Scenes/Scene.cs | |
parent | Bug fix in configger (diff) | |
parent | Merge branch 'master' of ssh://justincc@opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC-def8f8166a0ce1d6727e1621d434e8f6251bccff.zip opensim-SC-def8f8166a0ce1d6727e1621d434e8f6251bccff.tar.gz opensim-SC-def8f8166a0ce1d6727e1621d434e8f6251bccff.tar.bz2 opensim-SC-def8f8166a0ce1d6727e1621d434e8f6251bccff.tar.xz |
Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 73b0b3e..ddebd0b 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2406,9 +2406,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
2406 | return successYN; | 2406 | return successYN; |
2407 | } | 2407 | } |
2408 | 2408 | ||
2409 | /// <summary> | ||
2410 | /// Called when objects or attachments cross the border between regions. | ||
2411 | /// </summary> | ||
2412 | /// <param name="sog"></param> | ||
2413 | /// <returns></returns> | ||
2409 | public bool IncomingCreateObject(ISceneObject sog) | 2414 | public bool IncomingCreateObject(ISceneObject sog) |
2410 | { | 2415 | { |
2411 | //m_log.Debug(" >>> IncomingCreateObject <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted); | 2416 | //m_log.Debug(" >>> IncomingCreateObject(sog) <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted); |
2412 | SceneObjectGroup newObject; | 2417 | SceneObjectGroup newObject; |
2413 | try | 2418 | try |
2414 | { | 2419 | { |
@@ -2425,7 +2430,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2425 | m_log.DebugFormat("[SCENE]: Problem adding scene object {0} in {1} ", sog.UUID, RegionInfo.RegionName); | 2430 | m_log.DebugFormat("[SCENE]: Problem adding scene object {0} in {1} ", sog.UUID, RegionInfo.RegionName); |
2426 | return false; | 2431 | return false; |
2427 | } | 2432 | } |
2433 | |||
2428 | newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, 1); | 2434 | newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, 1); |
2435 | |||
2436 | // Do this as late as possible so that listeners have full access to the incoming object | ||
2437 | EventManager.TriggerOnIncomingSceneObject(newObject); | ||
2438 | |||
2429 | return true; | 2439 | return true; |
2430 | } | 2440 | } |
2431 | 2441 | ||
@@ -2437,6 +2447,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2437 | /// <returns>False</returns> | 2447 | /// <returns>False</returns> |
2438 | public virtual bool IncomingCreateObject(UUID userID, UUID itemID) | 2448 | public virtual bool IncomingCreateObject(UUID userID, UUID itemID) |
2439 | { | 2449 | { |
2450 | //m_log.DebugFormat(" >>> IncomingCreateObject(userID, itemID) <<< {0} {1}", userID, itemID); | ||
2451 | |||
2440 | ScenePresence sp = GetScenePresence(userID); | 2452 | ScenePresence sp = GetScenePresence(userID); |
2441 | if (sp != null) | 2453 | if (sp != null) |
2442 | { | 2454 | { |
@@ -2471,7 +2483,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2471 | foreach (SceneObjectPart p in sceneObject.Children.Values) | 2483 | foreach (SceneObjectPart p in sceneObject.Children.Values) |
2472 | p.LocalId = 0; | 2484 | p.LocalId = 0; |
2473 | 2485 | ||
2474 | if ((sceneObject.RootPart.Shape.PCode == (byte)PCode.Prim) && (sceneObject.RootPart.Shape.State != 0)) // Attachment | 2486 | if (sceneObject.IsAttachmentCheckFull()) // Attachment |
2475 | { | 2487 | { |
2476 | sceneObject.RootPart.AddFlag(PrimFlags.TemporaryOnRez); | 2488 | sceneObject.RootPart.AddFlag(PrimFlags.TemporaryOnRez); |
2477 | sceneObject.RootPart.AddFlag(PrimFlags.Phantom); | 2489 | sceneObject.RootPart.AddFlag(PrimFlags.Phantom); |
@@ -2496,29 +2508,23 @@ namespace OpenSim.Region.Framework.Scenes | |||
2496 | 2508 | ||
2497 | //RootPrim.SetParentLocalId(parentLocalID); | 2509 | //RootPrim.SetParentLocalId(parentLocalID); |
2498 | 2510 | ||
2499 | m_log.DebugFormat("[ATTACHMENT]: Received " + | 2511 | m_log.DebugFormat( |
2500 | "attachment {0}, inworld asset id {1}", | 2512 | "[ATTACHMENT]: Received attachment {0}, inworld asset id {1}", grp.GetFromItemID(), grp.UUID); |
2501 | //grp.RootPart.LastOwnerID.ToString(), | ||
2502 | grp.GetFromItemID(), | ||
2503 | grp.UUID.ToString()); | ||
2504 | 2513 | ||
2505 | //grp.SetFromAssetID(grp.RootPart.LastOwnerID); | 2514 | //grp.SetFromAssetID(grp.RootPart.LastOwnerID); |
2506 | m_log.DebugFormat("[ATTACHMENT]: Attach " + | 2515 | m_log.DebugFormat( |
2507 | "to avatar {0} at position {1}", | 2516 | "[ATTACHMENT]: Attach to avatar {0} at position {1}", sp.UUID, grp.AbsolutePosition); |
2508 | sp.UUID.ToString(), grp.AbsolutePosition); | 2517 | |
2509 | AttachObject(sp.ControllingClient, | 2518 | AttachObject( |
2510 | grp.LocalId, (uint)0, | 2519 | sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false); |
2511 | grp.GroupRotation, | ||
2512 | grp.AbsolutePosition, false); | ||
2513 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); | 2520 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); |
2514 | grp.SendGroupFullUpdate(); | 2521 | grp.SendGroupFullUpdate(); |
2515 | } | 2522 | } |
2516 | else | 2523 | else |
2517 | { | 2524 | { |
2518 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); | 2525 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); |
2519 | RootPrim.AddFlag(PrimFlags.TemporaryOnRez); | 2526 | RootPrim.AddFlag(PrimFlags.TemporaryOnRez); |
2520 | } | 2527 | } |
2521 | |||
2522 | } | 2528 | } |
2523 | else | 2529 | else |
2524 | { | 2530 | { |