From f3067ce6f9f2ea992f0e601ab120f3a1ff89cf94 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Sat, 24 May 2008 22:45:13 +0000 Subject: * Refactor: Change previous commits Object methods to SceneObject methods instead, on the basis that this is less likely to cause confusion with c#'s base object type --- .../Environment/Modules/World/Archiver/ArchiverModule.cs | 6 ++++++ .../Modules/World/TreePopulator/TreePopulatorModule.cs | 2 +- OpenSim/Region/Environment/Scenes/InnerScene.cs | 11 ++++++----- OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | 4 ++-- OpenSim/Region/Environment/Scenes/Scene.cs | 16 ++++++++-------- OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 2 +- OpenSim/Region/Environment/Scenes/SceneXmlLoader.cs | 4 ++-- OpenSim/Region/Examples/SimpleModule/ComplexObject.cs | 2 +- OpenSim/Region/Examples/SimpleModule/RegionModule.cs | 6 +++--- 9 files changed, 30 insertions(+), 23 deletions(-) diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiverModule.cs index ce78f21..27f16a7 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiverModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiverModule.cs @@ -73,6 +73,12 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver m_log.Warn("[ARCHIVER]: Archive region not yet implemented"); List entities = m_scene.GetEntities(); + + foreach (EntityBase entity in entities) + { + + } + string serEntities = SerializeObjects(entities); if (serEntities != null && serEntities.Length > 0) diff --git a/OpenSim/Region/Environment/Modules/World/TreePopulator/TreePopulatorModule.cs b/OpenSim/Region/Environment/Modules/World/TreePopulator/TreePopulatorModule.cs index ae70436..c56ed08 100644 --- a/OpenSim/Region/Environment/Modules/World/TreePopulator/TreePopulatorModule.cs +++ b/OpenSim/Region/Environment/Modules/World/TreePopulator/TreePopulatorModule.cs @@ -179,7 +179,7 @@ namespace OpenSim.Region.Environment.Modules.World.TreePopulator if (Util.RandomClass.NextDouble() < killLikelyhood) { - m_scene.RemoveObject(selectedTree.ParentGroup); + m_scene.RemoveSceneObject(selectedTree.ParentGroup); m_trees.Remove(selectedTree.ParentGroup.UUID); m_scene.ForEachClient(delegate(IClientAPI controller) diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index 4088746..4885d6d 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs @@ -186,7 +186,7 @@ namespace OpenSim.Region.Environment.Scenes /// Add an object into the scene that has come from storage /// /// - public void AddObjectFromStorage(SceneObjectGroup sceneObject) + public void AddSceneObjectFromStorage(SceneObjectGroup sceneObject) { sceneObject.RegionHandle = m_regInfo.RegionHandle; sceneObject.SetScene(m_parentScene); @@ -197,18 +197,18 @@ namespace OpenSim.Region.Environment.Scenes } sceneObject.UpdateParentIDs(); - AddObject(sceneObject); + AddSceneObject(sceneObject); } /// /// Add an object to the scene. /// /// - public void AddObject(SceneObjectGroup sceneObject) + public void AddSceneObject(SceneObjectGroup sceneObject) { if (!Entities.ContainsKey(sceneObject.UUID)) { - // QuadTree.AddObject(sceneObject); + // QuadTree.AddSceneObject(sceneObject); lock (Entities) { Entities.Add(sceneObject.UUID, sceneObject); @@ -299,7 +299,7 @@ namespace OpenSim.Region.Environment.Scenes { if (m_parentScene.ExternalChecks.ExternalChecksCanDeleteObject(((SceneObjectGroup)obj).UUID, avatar_deleter)) { - m_parentScene.RemoveObject((SceneObjectGroup)obj); + m_parentScene.RemoveSceneObject((SceneObjectGroup)obj); m_numPrim--; } return; @@ -307,6 +307,7 @@ namespace OpenSim.Region.Environment.Scenes } } } + public void DetachObject(uint objectLocalID, IClientAPI remoteClient) { List EntityList = GetEntities(); diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index 81ab733..816b01d 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs @@ -1502,7 +1502,7 @@ namespace OpenSim.Region.Environment.Scenes group.ResetIDs(); - AddObject(group); + AddSceneObject(group); // if attachment we set it's asset id so object updates can reflect that // if not, we set it's position in world. @@ -1614,7 +1614,7 @@ namespace OpenSim.Region.Environment.Scenes } group.ResetIDs(); - AddObject(group); + AddSceneObject(group); // Set the startup parameter for on_rez event and llGetStartParameter() function group.StartParameter = param; diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 5912c51..e3f219f 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -1163,7 +1163,7 @@ namespace OpenSim.Region.Environment.Scenes List PrimsFromDB = m_storageManager.DataStore.LoadObjects(regionID); foreach (SceneObjectGroup group in PrimsFromDB) { - AddObjectFromStorage(group); + AddSceneObjectFromStorage(group); SceneObjectPart rootPart = group.GetChildPart(group.UUID); rootPart.ObjectFlags &= ~(uint)LLObject.ObjectFlags.Scripted; rootPart.TrimPermissions(); @@ -1290,7 +1290,7 @@ namespace OpenSim.Region.Environment.Scenes { SceneObjectGroup sceneOb = new SceneObjectGroup(this, m_regionHandle, ownerID, PrimIDAllocate(), pos, rot, shape); - AddObject(sceneOb); + AddSceneObject(sceneOb); SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID); // if grass or tree, make phantom //rootPart.TrimPermissions(); @@ -1328,25 +1328,25 @@ namespace OpenSim.Region.Environment.Scenes /// Add an object into the scene that has come from storage /// /// - public void AddObjectFromStorage(SceneObjectGroup sceneObject) + public void AddSceneObjectFromStorage(SceneObjectGroup sceneObject) { - m_innerScene.AddObjectFromStorage(sceneObject); + m_innerScene.AddSceneObjectFromStorage(sceneObject); } /// /// Add an object to the scene /// /// - public void AddObject(SceneObjectGroup sceneObject) + public void AddSceneObject(SceneObjectGroup sceneObject) { - m_innerScene.AddObject(sceneObject); + m_innerScene.AddSceneObject(sceneObject); } /// /// Remove an object from the scene /// /// - public void RemoveObject(SceneObjectGroup sceneObject) + public void RemoveSceneObject(SceneObjectGroup sceneObject) { if (Entities.ContainsKey(sceneObject.UUID)) { @@ -3164,7 +3164,7 @@ namespace OpenSim.Region.Environment.Scenes lock (Entities) { - RemoveObject(group); + RemoveSceneObject(group); } group.DeleteParts(); diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 935253f..f4e1ef4 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs @@ -1841,7 +1841,7 @@ namespace OpenSim.Region.Environment.Scenes SceneObjectGroup objectGroup = new SceneObjectGroup(m_scene, m_regionHandle, linkPart); - m_scene.AddObject(objectGroup); + m_scene.AddSceneObject(objectGroup); ScheduleGroupForFullUpdate(); } diff --git a/OpenSim/Region/Environment/Scenes/SceneXmlLoader.cs b/OpenSim/Region/Environment/Scenes/SceneXmlLoader.cs index 13483bb..742996e 100644 --- a/OpenSim/Region/Environment/Scenes/SceneXmlLoader.cs +++ b/OpenSim/Region/Environment/Scenes/SceneXmlLoader.cs @@ -72,7 +72,7 @@ namespace OpenSim.Region.Environment.Scenes //if we want this to be a import method then we need new uuids for the object to avoid any clashes //obj.RegenerateFullIDs(); - m_innerScene.AddObject(obj); + m_innerScene.AddSceneObject(obj); SceneObjectPart rootPart = obj.GetChildPart(obj.UUID); // Apply loadOffsets for load/import and move combinations @@ -184,7 +184,7 @@ namespace OpenSim.Region.Environment.Scenes SceneObjectGroup obj = new SceneObjectGroup(xmlData); LLVector3 receivedVelocity = obj.RootPart.Velocity; //System.Console.WriteLine(obj.RootPart.Velocity.ToString()); - m_innerScene.AddObjectFromStorage(obj); + m_innerScene.AddSceneObjectFromStorage(obj); SceneObjectPart rootPart = obj.GetChildPart(obj.UUID); bool UsePhysics = (((rootPart.GetEffectiveObjectFlags() & (uint) LLObject.ObjectFlags.Physics) > 0) && diff --git a/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs b/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs index 5300750..87a5ffc 100644 --- a/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs +++ b/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs @@ -126,7 +126,7 @@ namespace OpenSim.Region.Examples.SimpleModule if (m_parts.Count == 1) { m_parts.Remove(m_rootPart.UUID); - m_scene.RemoveObject(this); + m_scene.RemoveSceneObject(this); remoteClient.SendKillObject(m_regionHandle, m_rootPart.LocalId); remoteClient.AddMoney(50); remoteClient.SendChatMessage("KABLAM!!!", 1, AbsolutePosition, "Groupie Groupie", LLUUID.Zero, (byte)ChatSourceType.Object, (byte)ChatAudibleLevel.Fully); diff --git a/OpenSim/Region/Examples/SimpleModule/RegionModule.cs b/OpenSim/Region/Examples/SimpleModule/RegionModule.cs index 4129d61..7be2684 100644 --- a/OpenSim/Region/Examples/SimpleModule/RegionModule.cs +++ b/OpenSim/Region/Examples/SimpleModule/RegionModule.cs @@ -76,7 +76,7 @@ namespace OpenSim.Region.Examples.SimpleModule } FileSystemObject fileObject = new FileSystemObject(m_scene, fileInfo, filePos); - m_scene.AddObject(fileObject); + m_scene.AddSceneObject(fileObject); fileObject.ScheduleGroupForFullUpdate(); } } @@ -107,7 +107,7 @@ namespace OpenSim.Region.Examples.SimpleModule ComplexObject complexObject = new ComplexObject(m_scene, regionInfo.RegionHandle, LLUUID.Zero, m_scene.PrimIDAllocate(), pos + posOffset); - m_scene.AddObject(complexObject); + m_scene.AddSceneObject(complexObject); } } @@ -116,7 +116,7 @@ namespace OpenSim.Region.Examples.SimpleModule SceneObjectGroup sceneObject = new CpuCounterObject(m_scene, regionInfo.RegionHandle, LLUUID.Zero, m_scene.PrimIDAllocate(), pos + new LLVector3(1f, 1f, 1f)); - m_scene.AddObject(sceneObject); + m_scene.AddSceneObject(sceneObject); } public void Close() -- cgit v1.1