From 291eb48fb0338d80e3baeed65664d7a72fea1892 Mon Sep 17 00:00:00 2001 From: MW Date: Sun, 26 Aug 2007 17:57:25 +0000 Subject: Another attempt to fix the image sending bug (next week, I intend to rewrite the assetcache and asset server). Attempt to fix bug # 326. (crashing when using save-xml and hollow prims) Attempt to fix bug # 328 (limit of 50 items in a folder) --- OpenSim/Region/Environment/PermissionManager.cs | 2 +- .../Region/Environment/Scenes/Scene.Inventory.cs | 46 +++++++++++----------- OpenSim/Region/Environment/Scenes/Scene.cs | 13 +++--- 3 files changed, 32 insertions(+), 29 deletions(-) (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/PermissionManager.cs b/OpenSim/Region/Environment/PermissionManager.cs index 55660c5..3e481e8 100644 --- a/OpenSim/Region/Environment/PermissionManager.cs +++ b/OpenSim/Region/Environment/PermissionManager.cs @@ -86,7 +86,7 @@ namespace OpenSim.Region.Environment if (!permission) SendPermissionError(user, reason); - return true; + return permission; } #region Object Permissions diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index 4b30a80..e0fd459 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs @@ -262,7 +262,7 @@ namespace OpenSim.Region.Environment.Scenes if (rezAsset != null) { string script = Util.FieldToString(rezAsset.Data); - // Console.WriteLine("rez script " + script); + // Console.WriteLine("rez script " + script); this.EventManager.TriggerRezScript(localID, copyID, script); rezzed = true; } @@ -270,22 +270,22 @@ namespace OpenSim.Region.Environment.Scenes if (rezzed) { - bool hasPrim = false; - foreach (EntityBase ent in Entities.Values) - { - if (ent is SceneObjectGroup) - { - hasPrim = ((SceneObjectGroup)ent).HasChildPrim(localID); - if (hasPrim != false) - { - - bool added = ((SceneObjectGroup)ent).AddInventoryItem(remoteClient, localID, item, copyID); - ((SceneObjectGroup)ent).GetProperites(remoteClient); - - } - } - } - + bool hasPrim = false; + foreach (EntityBase ent in Entities.Values) + { + if (ent is SceneObjectGroup) + { + hasPrim = ((SceneObjectGroup)ent).HasChildPrim(localID); + if (hasPrim != false) + { + + bool added = ((SceneObjectGroup)ent).AddInventoryItem(remoteClient, localID, item, copyID); + ((SceneObjectGroup)ent).GetProperites(remoteClient); + + } + } + } + } } } @@ -361,7 +361,7 @@ namespace OpenSim.Region.Environment.Scenes this.phyScene.RemovePrim(rootPart.PhysActor); rootPart.PhysActor = null; } - + storageManager.DataStore.RemoveObject(((SceneObjectGroup)selectedEnt).UUID, m_regInfo.SimUUID); ((SceneObjectGroup)selectedEnt).DeleteGroup(); @@ -415,11 +415,11 @@ namespace OpenSim.Region.Environment.Scenes this.AddEntity(group); group.AbsolutePosition = pos; SceneObjectPart rootPart = group.GetChildPart(group.UUID); - rootPart.PhysActor = phyScene.AddPrim( - new PhysicsVector(rootPart.AbsolutePosition.X, rootPart.AbsolutePosition.Y, rootPart.AbsolutePosition.Z), - new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z), - new Axiom.Math.Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X, - rootPart.RotationOffset.Y, rootPart.RotationOffset.Z)); + rootPart.PhysActor = phyScene.AddPrim( + new PhysicsVector(rootPart.AbsolutePosition.X, rootPart.AbsolutePosition.Y, rootPart.AbsolutePosition.Z), + new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z), + new Axiom.Math.Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X, + rootPart.RotationOffset.Y, rootPart.RotationOffset.Z)); } diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 282e548..dcc3e16 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -544,11 +544,14 @@ namespace OpenSim.Region.Environment.Scenes /// public void AddNewPrim(LLUUID ownerID, LLVector3 pos, PrimitiveBaseShape shape) { - SceneObjectGroup sceneOb = new SceneObjectGroup(this, this.m_regionHandle, ownerID, PrimIDAllocate(), pos, shape); - AddEntity(sceneOb); - SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID); - rootPart.PhysActor =phyScene.AddPrim(new PhysicsVector(pos.X, pos.Y, pos.Z), new PhysicsVector(shape.Scale.X, shape.Scale.Y, shape.Scale.Z), - new Axiom.Math.Quaternion()); + if (this.PermissionsMngr.CanRezObject(ownerID, pos)) + { + SceneObjectGroup sceneOb = new SceneObjectGroup(this, this.m_regionHandle, ownerID, PrimIDAllocate(), pos, shape); + AddEntity(sceneOb); + SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID); + rootPart.PhysActor = phyScene.AddPrim(new PhysicsVector(pos.X, pos.Y, pos.Z), new PhysicsVector(shape.Scale.X, shape.Scale.Y, shape.Scale.Z), + new Axiom.Math.Quaternion()); + } } public void RemovePrim(uint localID, LLUUID avatar_deleter) -- cgit v1.1