diff options
author | Justin Clark-Casey (justincc) | 2012-07-06 22:33:16 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-07-06 22:33:16 +0100 |
commit | 43a2da9edb9a234ee10735a234d2ad253a33cb7a (patch) | |
tree | 346fc03ccdb48f8d7ab5ef41eb52510e3fb54119 | |
parent | refactor: extract method UpdateUserInventoryWithAttachment() from AttachObjec... (diff) | |
download | opensim-SC_OLD-43a2da9edb9a234ee10735a234d2ad253a33cb7a.zip opensim-SC_OLD-43a2da9edb9a234ee10735a234d2ad253a33cb7a.tar.gz opensim-SC_OLD-43a2da9edb9a234ee10735a234d2ad253a33cb7a.tar.bz2 opensim-SC_OLD-43a2da9edb9a234ee10735a234d2ad253a33cb7a.tar.xz |
Pull prim crossing/teleport checks up into Scene.IncomingCreateObject() from Scene.AddObject()
Only IncomingCreateObject() needs these checks. General object adding does not need to perform crossing perm checks
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 41 |
1 files changed, 27 insertions, 14 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 36d39ea..6239d51 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2495,7 +2495,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
2495 | } | 2495 | } |
2496 | catch (Exception e) | 2496 | catch (Exception e) |
2497 | { | 2497 | { |
2498 | m_log.WarnFormat("[SCENE]: Problem casting object, exception {0}{1}", e.Message, e.StackTrace); | 2498 | m_log.WarnFormat("[INTERREGION]: Problem casting object, exception {0}{1}", e.Message, e.StackTrace); |
2499 | return false; | ||
2500 | } | ||
2501 | |||
2502 | // If the user is banned, we won't let any of their objects | ||
2503 | // enter. Period. | ||
2504 | // | ||
2505 | if (RegionInfo.EstateSettings.IsBanned(newObject.OwnerID)) | ||
2506 | { | ||
2507 | m_log.InfoFormat("[INTERREGION]: Denied prim crossing for banned avatar {0}", newObject.OwnerID); | ||
2499 | return false; | 2508 | return false; |
2500 | } | 2509 | } |
2501 | 2510 | ||
@@ -2504,14 +2513,28 @@ namespace OpenSim.Region.Framework.Scenes | |||
2504 | 2513 | ||
2505 | if (!AddSceneObject(newObject)) | 2514 | if (!AddSceneObject(newObject)) |
2506 | { | 2515 | { |
2507 | m_log.DebugFormat("[SCENE]: Problem adding scene object {0} in {1} ", sog.UUID, RegionInfo.RegionName); | 2516 | m_log.DebugFormat( |
2517 | "[INTERREGION]: Problem adding scene object {0} in {1} ", newObject.UUID, RegionInfo.RegionName); | ||
2508 | return false; | 2518 | return false; |
2509 | } | 2519 | } |
2510 | 2520 | ||
2511 | // For attachments, we need to wait until the agent is root | ||
2512 | // before we restart the scripts, or else some functions won't work. | ||
2513 | if (!newObject.IsAttachment) | 2521 | if (!newObject.IsAttachment) |
2514 | { | 2522 | { |
2523 | // FIXME: It would be better to never add the scene object at all rather than add it and then delete | ||
2524 | // it | ||
2525 | if (!Permissions.CanObjectEntry(newObject.UUID, true, newObject.AbsolutePosition)) | ||
2526 | { | ||
2527 | // Deny non attachments based on parcel settings | ||
2528 | // | ||
2529 | m_log.Info("[INTERREGION]: Denied prim crossing because of parcel settings"); | ||
2530 | |||
2531 | DeleteSceneObject(newObject, false); | ||
2532 | |||
2533 | return false; | ||
2534 | } | ||
2535 | |||
2536 | // For attachments, we need to wait until the agent is root | ||
2537 | // before we restart the scripts, or else some functions won't work. | ||
2515 | newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, GetStateSource(newObject)); | 2538 | newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, GetStateSource(newObject)); |
2516 | newObject.ResumeScripts(); | 2539 | newObject.ResumeScripts(); |
2517 | } | 2540 | } |
@@ -2531,16 +2554,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2531 | /// <returns>True if the SceneObjectGroup was added, False if it was not</returns> | 2554 | /// <returns>True if the SceneObjectGroup was added, False if it was not</returns> |
2532 | public bool AddSceneObject(SceneObjectGroup sceneObject) | 2555 | public bool AddSceneObject(SceneObjectGroup sceneObject) |
2533 | { | 2556 | { |
2534 | // If the user is banned, we won't let any of their objects | ||
2535 | // enter. Period. | ||
2536 | // | ||
2537 | if (RegionInfo.EstateSettings.IsBanned(sceneObject.OwnerID)) | ||
2538 | { | ||
2539 | m_log.InfoFormat("[INTERREGION]: Denied prim crossing for banned avatar {0}", sceneObject.OwnerID); | ||
2540 | |||
2541 | return false; | ||
2542 | } | ||
2543 | |||
2544 | sceneObject.SetScene(this); | 2557 | sceneObject.SetScene(this); |
2545 | 2558 | ||
2546 | // Force allocation of new LocalId | 2559 | // Force allocation of new LocalId |