aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-07-07 18:54:11 +0000
committerJustin Clarke Casey2008-07-07 18:54:11 +0000
commit0b2fcbfec4ae06b3e3f278d9e42f84c88f556587 (patch)
tree0a62ef6c55651582adba93b7bd003384f4f9db03 /OpenSim/Region/Environment
parent* switch terrain archiving to raw32 rather than png to avoid unnecessary post... (diff)
downloadopensim-SC-0b2fcbfec4ae06b3e3f278d9e42f84c88f556587.zip
opensim-SC-0b2fcbfec4ae06b3e3f278d9e42f84c88f556587.tar.gz
opensim-SC-0b2fcbfec4ae06b3e3f278d9e42f84c88f556587.tar.bz2
opensim-SC-0b2fcbfec4ae06b3e3f278d9e42f84c88f556587.tar.xz
* Start scripts loaded from an archive
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs12
-rw-r--r--OpenSim/Region/Environment/Modules/World/Serialiser/IRegionSerialiser.cs3
-rw-r--r--OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs14
-rw-r--r--OpenSim/Region/Environment/Modules/World/Serialiser/SerialiserModule.cs4
4 files changed, 24 insertions, 9 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
index 15bc265..0f179f4 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
@@ -100,10 +100,18 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
100 m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects", serialisedSceneObjects.Count); 100 m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects", serialisedSceneObjects.Count);
101 101
102 IRegionSerialiser serialiser = m_scene.RequestModuleInterface<IRegionSerialiser>(); 102 IRegionSerialiser serialiser = m_scene.RequestModuleInterface<IRegionSerialiser>();
103 ICollection<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>();
103 104
104 foreach (string serialisedSceneObject in serialisedSceneObjects) 105 foreach (string serialisedSceneObject in serialisedSceneObjects)
105 { 106 {
106 serialiser.LoadGroupFromXml2(m_scene, serialisedSceneObject); 107 sceneObjects.Add(serialiser.LoadGroupFromXml2(m_scene, serialisedSceneObject));
108 }
109
110 m_log.Debug("[ARCHIVER]: Starting scripts");
111
112 foreach (SceneObjectGroup sceneObject in sceneObjects)
113 {
114 sceneObject.CreateScriptInstances(0, true);
107 } 115 }
108 116
109 m_log.InfoFormat("[ARCHIVER]: Successfully loaded archive"); 117 m_log.InfoFormat("[ARCHIVER]: Successfully loaded archive");
@@ -126,7 +134,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
126 { 134 {
127 sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension]; 135 sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension];
128 136
129 m_log.DebugFormat("[ARCHIVER]: Importing asset {0}", filename); 137 m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType);
130 138
131 AssetBase asset = new AssetBase(new LLUUID(uuid), String.Empty); 139 AssetBase asset = new AssetBase(new LLUUID(uuid), String.Empty);
132 asset.Type = assetType; 140 asset.Type = assetType;
diff --git a/OpenSim/Region/Environment/Modules/World/Serialiser/IRegionSerialiser.cs b/OpenSim/Region/Environment/Modules/World/Serialiser/IRegionSerialiser.cs
index 3ae7a54..0fc8ac3 100644
--- a/OpenSim/Region/Environment/Modules/World/Serialiser/IRegionSerialiser.cs
+++ b/OpenSim/Region/Environment/Modules/World/Serialiser/IRegionSerialiser.cs
@@ -85,7 +85,8 @@ namespace OpenSim.Region.Environment.Modules.World.Serialiser
85 /// </summary> 85 /// </summary>
86 /// <param name="scene"></param> 86 /// <param name="scene"></param>
87 /// <param name="xmlString"></param> 87 /// <param name="xmlString"></param>
88 void LoadGroupFromXml2(Scene scene, string xmlString); 88 /// <returns>The scene object created</returns>
89 SceneObjectGroup LoadGroupFromXml2(Scene scene, string xmlString);
89 90
90 /// <summary> 91 /// <summary>
91 /// Serialize an individual scene object into the xml2 format 92 /// Serialize an individual scene object into the xml2 format
diff --git a/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs b/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs
index 9bab2b6..f283ecb 100644
--- a/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs
+++ b/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs
@@ -104,7 +104,7 @@ namespace OpenSim.Region.Environment.Scenes
104 return grp.ToXmlString2(); 104 return grp.ToXmlString2();
105 } 105 }
106 106
107 public static void LoadGroupFromXml2(Scene scene, string xmlString) 107 public static SceneObjectGroup LoadGroupFromXml2(Scene scene, string xmlString)
108 { 108 {
109 XmlDocument doc = new XmlDocument(); 109 XmlDocument doc = new XmlDocument();
110 XmlNode rootNode; 110 XmlNode rootNode;
@@ -126,11 +126,14 @@ namespace OpenSim.Region.Environment.Scenes
126 { 126 {
127 CreatePrimFromXml2(scene, aPrimNode.OuterXml); 127 CreatePrimFromXml2(scene, aPrimNode.OuterXml);
128 } 128 }
129
130 // There is only ever one prim, but it's easiest to return null here since this part should disappear post 0.5.9 anyway
131 return null;
129 } 132 }
130 else 133 else
131 { 134 {
132 CreatePrimFromXml2(scene, rootNode.OuterXml); 135 return CreatePrimFromXml2(scene, rootNode.OuterXml);
133 } 136 }
134 } 137 }
135 138
136 /// <summary> 139 /// <summary>
@@ -177,11 +180,14 @@ namespace OpenSim.Region.Environment.Scenes
177 /// </summary> 180 /// </summary>
178 /// <param name="scene"></param> 181 /// <param name="scene"></param>
179 /// <param name="xmlData"></param> 182 /// <param name="xmlData"></param>
180 protected static void CreatePrimFromXml2(Scene scene, string xmlData) 183 /// <returns>The scene object created</returns>
184 protected static SceneObjectGroup CreatePrimFromXml2(Scene scene, string xmlData)
181 { 185 {
182 SceneObjectGroup obj = new SceneObjectGroup(xmlData); 186 SceneObjectGroup obj = new SceneObjectGroup(xmlData);
183 187
184 scene.AddRestoredSceneObject(obj, true); 188 scene.AddRestoredSceneObject(obj, true);
189
190 return obj;
185 } 191 }
186 192
187 public static void SavePrimsToXml2(Scene scene, string fileName) 193 public static void SavePrimsToXml2(Scene scene, string fileName)
diff --git a/OpenSim/Region/Environment/Modules/World/Serialiser/SerialiserModule.cs b/OpenSim/Region/Environment/Modules/World/Serialiser/SerialiserModule.cs
index c7b5fa5..eb3ab2e 100644
--- a/OpenSim/Region/Environment/Modules/World/Serialiser/SerialiserModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Serialiser/SerialiserModule.cs
@@ -112,9 +112,9 @@ namespace OpenSim.Region.Environment.Modules.World.Serialiser
112 SceneXmlLoader.SavePrimsToXml2(scene, fileName); 112 SceneXmlLoader.SavePrimsToXml2(scene, fileName);
113 } 113 }
114 114
115 public void LoadGroupFromXml2(Scene scene, string xmlString) 115 public SceneObjectGroup LoadGroupFromXml2(Scene scene, string xmlString)
116 { 116 {
117 SceneXmlLoader.LoadGroupFromXml2(scene, xmlString); 117 return SceneXmlLoader.LoadGroupFromXml2(scene, xmlString);
118 } 118 }
119 119
120 public string SaveGroupToXml2(SceneObjectGroup grp) 120 public string SaveGroupToXml2(SceneObjectGroup grp)