diff options
Merge branch 'master' into presence-refactor
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 f109589..669720a 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2239,9 +2239,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
2239 | } | 2239 | } |
2240 | 2240 | ||
2241 | 2241 | ||
2242 | /// <summary> | ||
2243 | /// Called when objects or attachments cross the border between regions. | ||
2244 | /// </summary> | ||
2245 | /// <param name="sog"></param> | ||
2246 | /// <returns></returns> | ||
2242 | public bool IncomingCreateObject(ISceneObject sog) | 2247 | public bool IncomingCreateObject(ISceneObject sog) |
2243 | { | 2248 | { |
2244 | //m_log.Debug(" >>> IncomingCreateObject <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted); | 2249 | //m_log.Debug(" >>> IncomingCreateObject(sog) <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted); |
2245 | SceneObjectGroup newObject; | 2250 | SceneObjectGroup newObject; |
2246 | try | 2251 | try |
2247 | { | 2252 | { |
@@ -2258,7 +2263,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2258 | m_log.DebugFormat("[SCENE]: Problem adding scene object {0} in {1} ", sog.UUID, RegionInfo.RegionName); | 2263 | m_log.DebugFormat("[SCENE]: Problem adding scene object {0} in {1} ", sog.UUID, RegionInfo.RegionName); |
2259 | return false; | 2264 | return false; |
2260 | } | 2265 | } |
2266 | |||
2261 | newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, 1); | 2267 | newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, 1); |
2268 | |||
2269 | // Do this as late as possible so that listeners have full access to the incoming object | ||
2270 | EventManager.TriggerOnIncomingSceneObject(newObject); | ||
2271 | |||
2262 | return true; | 2272 | return true; |
2263 | } | 2273 | } |
2264 | 2274 | ||
@@ -2270,6 +2280,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2270 | /// <returns>False</returns> | 2280 | /// <returns>False</returns> |
2271 | public virtual bool IncomingCreateObject(UUID userID, UUID itemID) | 2281 | public virtual bool IncomingCreateObject(UUID userID, UUID itemID) |
2272 | { | 2282 | { |
2283 | //m_log.DebugFormat(" >>> IncomingCreateObject(userID, itemID) <<< {0} {1}", userID, itemID); | ||
2284 | |||
2273 | ScenePresence sp = GetScenePresence(userID); | 2285 | ScenePresence sp = GetScenePresence(userID); |
2274 | if (sp != null) | 2286 | if (sp != null) |
2275 | { | 2287 | { |
@@ -2307,7 +2319,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2307 | foreach (SceneObjectPart p in sceneObject.Children.Values) | 2319 | foreach (SceneObjectPart p in sceneObject.Children.Values) |
2308 | p.LocalId = 0; | 2320 | p.LocalId = 0; |
2309 | 2321 | ||
2310 | if ((sceneObject.RootPart.Shape.PCode == (byte)PCode.Prim) && (sceneObject.RootPart.Shape.State != 0)) // Attachment | 2322 | if (sceneObject.IsAttachmentCheckFull()) // Attachment |
2311 | { | 2323 | { |
2312 | sceneObject.RootPart.AddFlag(PrimFlags.TemporaryOnRez); | 2324 | sceneObject.RootPart.AddFlag(PrimFlags.TemporaryOnRez); |
2313 | sceneObject.RootPart.AddFlag(PrimFlags.Phantom); | 2325 | sceneObject.RootPart.AddFlag(PrimFlags.Phantom); |
@@ -2332,29 +2344,23 @@ namespace OpenSim.Region.Framework.Scenes | |||
2332 | 2344 | ||
2333 | //RootPrim.SetParentLocalId(parentLocalID); | 2345 | //RootPrim.SetParentLocalId(parentLocalID); |
2334 | 2346 | ||
2335 | m_log.DebugFormat("[ATTACHMENT]: Received " + | 2347 | m_log.DebugFormat( |
2336 | "attachment {0}, inworld asset id {1}", | 2348 | "[ATTACHMENT]: Received attachment {0}, inworld asset id {1}", grp.GetFromItemID(), grp.UUID); |
2337 | //grp.RootPart.LastOwnerID.ToString(), | ||
2338 | grp.GetFromItemID(), | ||
2339 | grp.UUID.ToString()); | ||
2340 | 2349 | ||
2341 | //grp.SetFromAssetID(grp.RootPart.LastOwnerID); | 2350 | //grp.SetFromAssetID(grp.RootPart.LastOwnerID); |
2342 | m_log.DebugFormat("[ATTACHMENT]: Attach " + | 2351 | m_log.DebugFormat( |
2343 | "to avatar {0} at position {1}", | 2352 | "[ATTACHMENT]: Attach to avatar {0} at position {1}", sp.UUID, grp.AbsolutePosition); |
2344 | sp.UUID.ToString(), grp.AbsolutePosition); | 2353 | |
2345 | AttachObject(sp.ControllingClient, | 2354 | AttachObject( |
2346 | grp.LocalId, (uint)0, | 2355 | sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false); |
2347 | grp.GroupRotation, | ||
2348 | grp.AbsolutePosition, false); | ||
2349 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); | 2356 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); |
2350 | grp.SendGroupFullUpdate(); | 2357 | grp.SendGroupFullUpdate(); |
2351 | } | 2358 | } |
2352 | else | 2359 | else |
2353 | { | 2360 | { |
2354 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); | 2361 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); |
2355 | RootPrim.AddFlag(PrimFlags.TemporaryOnRez); | 2362 | RootPrim.AddFlag(PrimFlags.TemporaryOnRez); |
2356 | } | 2363 | } |
2357 | |||
2358 | } | 2364 | } |
2359 | else | 2365 | else |
2360 | { | 2366 | { |