diff options
Diffstat (limited to 'OpenSim/Region/Environment/Modules/World/Archiver/ArchiverModule.cs')
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/Archiver/ArchiverModule.cs | 56 |
1 files changed, 2 insertions, 54 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiverModule.cs index dc81f41..cff9235 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiverModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiverModule.cs | |||
@@ -25,6 +25,7 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using OpenSim.Framework.Communications.Cache; | ||
28 | using OpenSim.Region.Environment.Interfaces; | 29 | using OpenSim.Region.Environment.Interfaces; |
29 | using OpenSim.Region.Environment.Modules.World.Serialiser; | 30 | using OpenSim.Region.Environment.Modules.World.Serialiser; |
30 | using OpenSim.Region.Environment.Scenes; | 31 | using OpenSim.Region.Environment.Scenes; |
@@ -71,65 +72,12 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
71 | 72 | ||
72 | public void ArchiveRegion(string savePath) | 73 | public void ArchiveRegion(string savePath) |
73 | { | 74 | { |
74 | m_log.Warn("[ARCHIVER]: Archive region not yet implemented"); | 75 | new ArchiveRequest(m_scene, savePath); |
75 | |||
76 | Dictionary<LLUUID, int> textureUuids = new Dictionary<LLUUID, int>(); | ||
77 | |||
78 | List<EntityBase> entities = m_scene.GetEntities(); | ||
79 | |||
80 | foreach (EntityBase entity in entities) | ||
81 | { | ||
82 | if (entity is SceneObjectGroup) | ||
83 | { | ||
84 | SceneObjectGroup sceneObject = (SceneObjectGroup)entity; | ||
85 | |||
86 | foreach (SceneObjectPart part in sceneObject.GetParts()) | ||
87 | { | ||
88 | LLUUID texture = new LLUUID(part.Shape.TextureEntry, 0); | ||
89 | textureUuids[texture] = 1; | ||
90 | } | ||
91 | } | ||
92 | } | ||
93 | |||
94 | string serEntities = SerializeObjects(entities); | ||
95 | |||
96 | if (serEntities != null && serEntities.Length > 0) | ||
97 | { | ||
98 | m_log.DebugFormat("[ARCHIVER]: Successfully got serialization for {0} entities", entities.Count); | ||
99 | m_log.DebugFormat("[ARCHIVER]: Requiring save of {0} textures", textureUuids.Count); | ||
100 | } | ||
101 | } | 76 | } |
102 | 77 | ||
103 | public void DearchiveRegion(string loadPath) | 78 | public void DearchiveRegion(string loadPath) |
104 | { | 79 | { |
105 | m_log.Warn("[ARCHIVER]: Dearchive region not yet implemented"); | 80 | m_log.Warn("[ARCHIVER]: Dearchive region not yet implemented"); |
106 | } | 81 | } |
107 | |||
108 | /// <summary> | ||
109 | /// Get an xml representation of the given scene objects. | ||
110 | /// </summary> | ||
111 | /// <param name="scene"></param> | ||
112 | /// <returns></returns> | ||
113 | private static string SerializeObjects(List<EntityBase> entities) | ||
114 | { | ||
115 | string serialization = "<scene>"; | ||
116 | |||
117 | List<string> serObjects = new List<string>(); | ||
118 | |||
119 | foreach (EntityBase ent in entities) | ||
120 | { | ||
121 | if (ent is SceneObjectGroup) | ||
122 | { | ||
123 | serObjects.Add(((SceneObjectGroup) ent).ToXmlString2()); | ||
124 | } | ||
125 | } | ||
126 | |||
127 | foreach (string serObject in serObjects) | ||
128 | serialization += serObject; | ||
129 | |||
130 | serialization += "</scene>"; | ||
131 | |||
132 | return serialization; | ||
133 | } | ||
134 | } | 82 | } |
135 | } \ No newline at end of file | 83 | } \ No newline at end of file |