* Start scripts loaded from an archive
parent
9362d9b231
commit
0b2fcbfec4
|
@ -348,7 +348,7 @@ namespace OpenSim.Framework.Communications.Cache
|
|||
/// <param name="asset"></param>
|
||||
public void AddAsset(AssetBase asset)
|
||||
{
|
||||
if (asset.Type == 0)
|
||||
if (asset.Type == (int)AssetType.Texture)
|
||||
{
|
||||
if (!Textures.ContainsKey(asset.FullID))
|
||||
{
|
||||
|
|
|
@ -494,7 +494,7 @@ namespace OpenSim
|
|||
|
||||
if (string.IsNullOrEmpty(m_scriptEngine))
|
||||
{
|
||||
m_log.Info("[MODULES]: No script engien module specified");
|
||||
m_log.Info("[MODULES]: No script engine module specified");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -100,10 +100,18 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
|
|||
m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects", serialisedSceneObjects.Count);
|
||||
|
||||
IRegionSerialiser serialiser = m_scene.RequestModuleInterface<IRegionSerialiser>();
|
||||
ICollection<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>();
|
||||
|
||||
foreach (string serialisedSceneObject in serialisedSceneObjects)
|
||||
{
|
||||
serialiser.LoadGroupFromXml2(m_scene, serialisedSceneObject);
|
||||
sceneObjects.Add(serialiser.LoadGroupFromXml2(m_scene, serialisedSceneObject));
|
||||
}
|
||||
|
||||
m_log.Debug("[ARCHIVER]: Starting scripts");
|
||||
|
||||
foreach (SceneObjectGroup sceneObject in sceneObjects)
|
||||
{
|
||||
sceneObject.CreateScriptInstances(0, true);
|
||||
}
|
||||
|
||||
m_log.InfoFormat("[ARCHIVER]: Successfully loaded archive");
|
||||
|
@ -126,7 +134,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
|
|||
{
|
||||
sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension];
|
||||
|
||||
m_log.DebugFormat("[ARCHIVER]: Importing asset {0}", filename);
|
||||
m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType);
|
||||
|
||||
AssetBase asset = new AssetBase(new LLUUID(uuid), String.Empty);
|
||||
asset.Type = assetType;
|
||||
|
|
|
@ -85,7 +85,8 @@ namespace OpenSim.Region.Environment.Modules.World.Serialiser
|
|||
/// </summary>
|
||||
/// <param name="scene"></param>
|
||||
/// <param name="xmlString"></param>
|
||||
void LoadGroupFromXml2(Scene scene, string xmlString);
|
||||
/// <returns>The scene object created</returns>
|
||||
SceneObjectGroup LoadGroupFromXml2(Scene scene, string xmlString);
|
||||
|
||||
/// <summary>
|
||||
/// Serialize an individual scene object into the xml2 format
|
||||
|
|
|
@ -104,7 +104,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
return grp.ToXmlString2();
|
||||
}
|
||||
|
||||
public static void LoadGroupFromXml2(Scene scene, string xmlString)
|
||||
public static SceneObjectGroup LoadGroupFromXml2(Scene scene, string xmlString)
|
||||
{
|
||||
XmlDocument doc = new XmlDocument();
|
||||
XmlNode rootNode;
|
||||
|
@ -126,10 +126,13 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
{
|
||||
CreatePrimFromXml2(scene, aPrimNode.OuterXml);
|
||||
}
|
||||
|
||||
// There is only ever one prim, but it's easiest to return null here since this part should disappear post 0.5.9 anyway
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
CreatePrimFromXml2(scene, rootNode.OuterXml);
|
||||
return CreatePrimFromXml2(scene, rootNode.OuterXml);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -177,11 +180,14 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
/// </summary>
|
||||
/// <param name="scene"></param>
|
||||
/// <param name="xmlData"></param>
|
||||
protected static void CreatePrimFromXml2(Scene scene, string xmlData)
|
||||
/// <returns>The scene object created</returns>
|
||||
protected static SceneObjectGroup CreatePrimFromXml2(Scene scene, string xmlData)
|
||||
{
|
||||
SceneObjectGroup obj = new SceneObjectGroup(xmlData);
|
||||
|
||||
scene.AddRestoredSceneObject(obj, true);
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
public static void SavePrimsToXml2(Scene scene, string fileName)
|
||||
|
|
|
@ -112,9 +112,9 @@ namespace OpenSim.Region.Environment.Modules.World.Serialiser
|
|||
SceneXmlLoader.SavePrimsToXml2(scene, fileName);
|
||||
}
|
||||
|
||||
public void LoadGroupFromXml2(Scene scene, string xmlString)
|
||||
public SceneObjectGroup LoadGroupFromXml2(Scene scene, string xmlString)
|
||||
{
|
||||
SceneXmlLoader.LoadGroupFromXml2(scene, xmlString);
|
||||
return SceneXmlLoader.LoadGroupFromXml2(scene, xmlString);
|
||||
}
|
||||
|
||||
public string SaveGroupToXml2(SceneObjectGroup grp)
|
||||
|
|
Loading…
Reference in New Issue