From 5c8a93c4262f3197a02645aea6c2b7362fd6784e Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Mon, 26 May 2008 01:50:40 +0000 Subject: * Extract and boil down necessary texture UUIDs for an archive of the scene prims * no user functionality yet --- OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | 2 +- .../Environment/Modules/World/Archiver/ArchiverModule.cs | 15 ++++++++++++++- OpenSim/Region/Environment/Scenes/Scene.cs | 8 ++++++++ OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 8 ++++++-- OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 7 +++---- 5 files changed, 32 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index c413416..5fbc7c0 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs @@ -133,7 +133,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP protected virtual void CreatePacketServer() { - LLPacketServer packetServer = new LLPacketServer(this); + new LLPacketServer(this); } protected virtual void OnReceivedData(IAsyncResult result) diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiverModule.cs index 7016d1b..dc81f41 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiverModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiverModule.cs @@ -30,6 +30,7 @@ using OpenSim.Region.Environment.Modules.World.Serialiser; using OpenSim.Region.Environment.Scenes; using System.Collections.Generic; using System.Reflection; +using libsecondlife; using log4net; using Nini.Config; @@ -71,12 +72,23 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver public void ArchiveRegion(string savePath) { m_log.Warn("[ARCHIVER]: Archive region not yet implemented"); + + Dictionary textureUuids = new Dictionary(); List entities = m_scene.GetEntities(); foreach (EntityBase entity in entities) { - + if (entity is SceneObjectGroup) + { + SceneObjectGroup sceneObject = (SceneObjectGroup)entity; + + foreach (SceneObjectPart part in sceneObject.GetParts()) + { + LLUUID texture = new LLUUID(part.Shape.TextureEntry, 0); + textureUuids[texture] = 1; + } + } } string serEntities = SerializeObjects(entities); @@ -84,6 +96,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver if (serEntities != null && serEntities.Length > 0) { m_log.DebugFormat("[ARCHIVER]: Successfully got serialization for {0} entities", entities.Count); + m_log.DebugFormat("[ARCHIVER]: Requiring save of {0} textures", textureUuids.Count); } } diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 1bcd3fd..f4ec1a3 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -197,6 +197,14 @@ namespace OpenSim.Region.Environment.Scenes // set { m_innerScene.SceneObjects = value; } // } + /// + /// The dictionary of all entities in this scene. The contents of this dictionary may be changed at any time. + /// If you wish to add or remove entities, please use the appropriate method for that entity rather than + /// editing this dictionary directly. + /// + /// If you want a list of entities where the list itself is guaranteed not to change, please use + /// GetEntities() + /// public Dictionary Entities { get { return m_innerScene.Entities; } diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 2ad01f9..a85c8d3 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs @@ -92,8 +92,6 @@ namespace OpenSim.Region.Environment.Scenes public bool HasGroupChanged = false; public float scriptScore = 0f; - - private LLVector3 lastPhysGroupPos; private LLQuaternion lastPhysGroupRot; @@ -2054,6 +2052,12 @@ namespace OpenSim.Region.Environment.Scenes } } + /// + /// Get the parts of this scene object + /// + /// + /// A + /// public SceneObjectPart[] GetParts() { int numParts = Children.Count; diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index c6b3059..4b174e3 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -85,7 +85,6 @@ namespace OpenSim.Region.Environment.Scenes [Serializable] public partial class SceneObjectPart : IScriptHost, ISerializable { - [XmlIgnore] public PhysicsActor PhysActor = null; public LLUUID LastOwnerID; @@ -103,7 +102,6 @@ namespace OpenSim.Region.Environment.Scenes [XmlIgnore] private LLObject.ObjectFlags LocalFlags = LLObject.ObjectFlags.None; [XmlIgnore] public bool DIE_AT_EDGE = false; - [XmlIgnore] public bool m_IsAttachment = false; [XmlIgnore] public uint m_attachmentPoint = (byte)0; [XmlIgnore] public LLUUID m_attachedAvatar = LLUUID.Zero; @@ -700,7 +698,6 @@ namespace OpenSim.Region.Environment.Scenes get { return m_shape; } set { - m_shape = value; TriggerScriptChangedEvent(Changed.SHAPE); } @@ -1949,6 +1946,7 @@ namespace OpenSim.Region.Environment.Scenes public void UpdateExtraParam(ushort type, bool inUse, byte[] data) { m_shape.ReadInUpdateExtraParam(type, inUse, data); + if (type == 0x30) { if (m_shape.SculptEntry && m_shape.SculptTexture != LLUUID.Zero) @@ -1957,9 +1955,10 @@ namespace OpenSim.Region.Environment.Scenes m_parentGroup.Scene.AssetCache.GetAsset(m_shape.SculptTexture, SculptTextureCallback, true); } } + ScheduleFullUpdate(); - } + public void SculptTextureCallback(LLUUID textureID, AssetBase texture) { if (m_shape.SculptEntry) -- cgit v1.1