aboutsummaryrefslogtreecommitdiffstatshomepage
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
parent* switch terrain archiving to raw32 rather than png to avoid unnecessary post... (diff)
downloadopensim-SC_OLD-0b2fcbfec4ae06b3e3f278d9e42f84c88f556587.zip
opensim-SC_OLD-0b2fcbfec4ae06b3e3f278d9e42f84c88f556587.tar.gz
opensim-SC_OLD-0b2fcbfec4ae06b3e3f278d9e42f84c88f556587.tar.bz2
opensim-SC_OLD-0b2fcbfec4ae06b3e3f278d9e42f84c88f556587.tar.xz
* Start scripts loaded from an archive
-rw-r--r--OpenSim/Framework/Communications/Cache/AssetCache.cs6
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs2
-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
6 files changed, 28 insertions, 13 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs
index f160ce4..7099760 100644
--- a/OpenSim/Framework/Communications/Cache/AssetCache.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs
@@ -348,7 +348,7 @@ namespace OpenSim.Framework.Communications.Cache
348 /// <param name="asset"></param> 348 /// <param name="asset"></param>
349 public void AddAsset(AssetBase asset) 349 public void AddAsset(AssetBase asset)
350 { 350 {
351 if (asset.Type == 0) 351 if (asset.Type == (int)AssetType.Texture)
352 { 352 {
353 if (!Textures.ContainsKey(asset.FullID)) 353 if (!Textures.ContainsKey(asset.FullID))
354 { 354 {
@@ -365,9 +365,9 @@ namespace OpenSim.Framework.Communications.Cache
365 } 365 }
366 } 366 }
367 else 367 else
368 { 368 {
369 if (!Assets.ContainsKey(asset.FullID)) 369 if (!Assets.ContainsKey(asset.FullID))
370 { 370 {
371 AssetInfo assetInf = new AssetInfo(asset); 371 AssetInfo assetInf = new AssetInfo(asset);
372 Assets.Add(assetInf.FullID, assetInf); 372 Assets.Add(assetInf.FullID, assetInf);
373 373
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 2c2ec09..37daf88 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -494,7 +494,7 @@ namespace OpenSim
494 494
495 if (string.IsNullOrEmpty(m_scriptEngine)) 495 if (string.IsNullOrEmpty(m_scriptEngine))
496 { 496 {
497 m_log.Info("[MODULES]: No script engien module specified"); 497 m_log.Info("[MODULES]: No script engine module specified");
498 } 498 }
499 else 499 else
500 { 500 {
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)