Ejemplo n.º 1
0
        /// <summary>
        /// Load an xml file of prims in OpenSimulator's current 'xml2' file format to the current scene
        /// </summary>
        public void LoadCurrentSceneFromXml2(string filename)
        {
            IRegionSerialiserModule serialiser = CurrentOrFirstScene.RequestModuleInterface <IRegionSerialiserModule>();

            if (serialiser != null)
            {
                serialiser.LoadPrimsFromXml2(CurrentOrFirstScene, filename);
            }
        }
Ejemplo n.º 2
0
        public string LoadPrims(string requestBody, OSHttpRequest request, OSHttpResponse response, Scene scene)
        {
            IRegionSerialiserModule serialiser = scene.RequestModuleInterface <IRegionSerialiserModule>();

            if (serialiser != null)
            {
                serialiser.LoadPrimsFromXml2(scene, new StringReader(requestBody), true);
            }

            return("");
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Load region data from Xml2Format
 /// </summary>
 /// <param name="cmdparams"></param>
 protected void LoadXml2(string[] cmdparams)
 {
     if (cmdparams.Length > 2)
     {
         try
         {
             IRegionSerialiserModule serialiser = GetCurrentOrFirstScene().RequestModuleInterface <IRegionSerialiserModule>();
             if (serialiser != null)
             {
                 serialiser.LoadPrimsFromXml2(GetCurrentOrFirstScene(), cmdparams[2]);
             }
         }
         catch (FileNotFoundException)
         {
             MainConsole.Instance.Info("Specified xml not found. Usage: load xml2 <filename>");
         }
     }
     else
     {
         MainConsole.Instance.Warn("Not enough parameters!");
     }
 }
Ejemplo n.º 4
0
        public void LoadRegion(Scene scene)
        {
            IRegionSerialiserModule serialiser = scene.RequestModuleInterface <IRegionSerialiserModule>();

            if (serialiser != null)
            {
                serialiser.LoadPrimsFromXml2(
                    scene,
                    m_svndir + Slash.DirectorySeparatorChar + scene.RegionInfo.RegionID
                    + Slash.DirectorySeparatorChar + "objects.xml");

                scene.RequestModuleInterface <ITerrainModule>().LoadFromFile(
                    m_svndir + Slash.DirectorySeparatorChar + scene.RegionInfo.RegionID
                    + Slash.DirectorySeparatorChar + "heightmap.r32");

                m_log.Info("[SVNBACKUP]: Region load successful (" + scene.RegionInfo.RegionName + ").");
            }
            else
            {
                m_log.ErrorFormat(
                    "[SVNBACKUP]: Region load of {0} failed - no serialisation module available",
                    scene.RegionInfo.RegionName);
            }
        }