1
0

IRegionSerialiserModule.cs 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /*
  2. * Copyright (c) Contributors, http://opensimulator.org/
  3. * See CONTRIBUTORS.TXT for a full list of copyright holders.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions are met:
  7. * * Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * * Neither the name of the OpenSimulator Project nor the
  13. * names of its contributors may be used to endorse or promote products
  14. * derived from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
  17. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  18. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  19. * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
  20. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  21. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  22. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  23. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  25. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. */
  27. using System.Collections.Generic;
  28. using System.IO;
  29. using OpenMetaverse;
  30. using OpenSim.Region.Framework.Scenes;
  31. namespace OpenSim.Region.Framework.Interfaces
  32. {
  33. public interface IRegionSerialiserModule
  34. {
  35. List<string> SerialiseRegion(Scene scene, string saveDir);
  36. /// <summary>
  37. /// Load prims from the xml format
  38. /// </summary>
  39. /// <param name="scene"></param>
  40. /// <param name="fileName"></param>
  41. /// <param name="newIDS"></param>
  42. /// <param name="loadOffset"></param>
  43. void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, Vector3 loadOffset);
  44. /// <summary>
  45. /// Save prims in the xml format
  46. /// </summary>
  47. /// <param name="scene"> </param>
  48. /// <param name="fileName"></param>
  49. void SavePrimsToXml(Scene scene, string fileName);
  50. /// <summary>
  51. /// Load prims from the xml2 format
  52. /// </summary>
  53. /// <param name="scene"></param>
  54. /// <param name="fileName"></param>
  55. void LoadPrimsFromXml2(Scene scene, string fileName);
  56. /// <summary>
  57. /// Load prims from the xml2 format
  58. /// </summary>
  59. /// <param name="scene"></param>
  60. /// <param name="reader"></param>
  61. /// <param name="startScripts"></param>
  62. void LoadPrimsFromXml2(Scene scene, TextReader reader, bool startScripts);
  63. /// <summary>
  64. /// Save prims in the xml2 format
  65. /// </summary>
  66. /// <param name="scene"></param>
  67. /// <param name="fileName"></param>
  68. void SavePrimsToXml2(Scene scene, string fileName);
  69. /// <summary>
  70. /// Save prims in the xml2 format, optionally specifying a bounding box for which
  71. /// prims should be saved. If both min and max vectors are Vector3.Zero, then all prims
  72. /// are exported.
  73. /// </summary>
  74. /// <param name="scene"></param>
  75. /// <param name="stream"></param>
  76. /// <param name="min"></param>
  77. /// <param name="max"></param>
  78. void SavePrimsToXml2(Scene scene, TextWriter stream, Vector3 min, Vector3 max);
  79. /// <summary>
  80. /// Save a set of prims in the xml2 format
  81. /// </summary>
  82. /// <param name="entityList"></param>
  83. /// <param name="fileName"></param>
  84. void SavePrimListToXml2(EntityBase[] entityList, string fileName);
  85. /// <summary>
  86. /// Save a set of prims in the xml2 format, optionally specifying a bounding box for which
  87. /// prims should be saved. If both min and max vectors are Vector3.Zero, then all prims
  88. /// are exported.
  89. /// </summary>
  90. /// <param name="entityList"></param>
  91. /// <param name="stream"></param>
  92. /// <param name="min"></param>
  93. /// <param name="max"></param>
  94. void SavePrimListToXml2(EntityBase[] entityList, TextWriter stream, Vector3 min, Vector3 max);
  95. void SaveNamedPrimsToXml2(Scene scene, string primName, string fileName);
  96. /// <summary>
  97. /// Deserializes a scene object from its xml2 representation. This does not load the object into the scene.
  98. /// </summary>
  99. /// <param name="xmlString"></param>
  100. /// <returns>The scene object created</returns>
  101. SceneObjectGroup DeserializeGroupFromXml2(string xmlString);
  102. /// <summary>
  103. /// Serialize an individual scene object into the xml2 format
  104. /// </summary>
  105. /// <param name="grp"></param>
  106. /// <returns></returns>
  107. string SerializeGroupToXml2(SceneObjectGroup grp, Dictionary<string, object> options);
  108. }
  109. }