1
0

IRegionArchiverModule.cs 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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;
  28. using System.Collections.Generic;
  29. using System.IO;
  30. namespace OpenSim.Region.Framework.Interfaces
  31. {
  32. /// <summary>
  33. /// Interface to region archive functionality
  34. /// </summary>
  35. public interface IRegionArchiverModule
  36. {
  37. void HandleLoadOarConsoleCommand(string module, string[] cmdparams);
  38. void HandleSaveOarConsoleCommand(string module, string[] cmdparams);
  39. /// <summary>
  40. /// Archive the region to the given path
  41. /// </summary>
  42. ///
  43. /// This method occurs asynchronously. If you want notification of when it has completed then subscribe to
  44. /// the EventManager.OnOarFileSaved event.
  45. ///
  46. /// <param name="savePath"></param>
  47. void ArchiveRegion(string savePath, Dictionary<string, object> options);
  48. /// <summary>
  49. /// Archive the region to the given path
  50. /// </summary>
  51. /// <remarks>
  52. /// This method occurs asynchronously. If you want notification of when it has completed then subscribe to
  53. /// the EventManager.OnOarFileSaved event.
  54. /// </remarks>
  55. /// <param name="savePath"></param>
  56. /// <param name="requestId">If supplied, this request Id is later returned in the saved event</param>
  57. /// <param name="options">Options for the save</param>
  58. void ArchiveRegion(string savePath, Guid requestId, Dictionary<string, object> options);
  59. /// <summary>
  60. /// Archive the region to a stream.
  61. /// </summary>
  62. /// <remarks>
  63. /// This method occurs asynchronously. If you want notification of when it has completed then subscribe to
  64. /// the EventManager.OnOarFileSaved event.
  65. /// </remarks>
  66. /// <param name="saveStream"></param>
  67. /// <param name="requestId">If supplied, this request Id is later returned in the saved event</param>
  68. void ArchiveRegion(Stream saveStream, Guid requestId);
  69. /// <summary>
  70. /// Archive the region to a stream.
  71. /// </summary>
  72. /// <remarks>
  73. /// This method occurs asynchronously. If you want notification of when it has completed then subscribe to
  74. /// the EventManager.OnOarFileSaved event.
  75. /// </remarks>
  76. /// <param name="saveStream"></param>
  77. /// <param name="requestId">If supplied, this request Id is later returned in the saved event</param>
  78. /// <param name="options">Options for the save</param>
  79. void ArchiveRegion(Stream saveStream, Guid requestId, Dictionary<string, object> options);
  80. /// <summary>
  81. /// Dearchive the given region archive. This replaces the existing scene.
  82. /// </summary>
  83. /// <remarks>
  84. /// If you want notification of when it has completed then subscribe to the EventManager.OnOarFileLoaded event.
  85. /// </remarks>
  86. /// <param name="loadPath"></param>
  87. void DearchiveRegion(string loadPath);
  88. /// <summary>
  89. /// Dearchive the given region archive. This replaces the existing scene.
  90. /// </summary>
  91. ///
  92. /// If you want notification of when it has completed then subscribe to the EventManager.OnOarFileLoaded event.
  93. ///
  94. /// <param name="loadPath"></param>
  95. /// <param name="merge">
  96. /// If true, the loaded region merges with the existing one rather than replacing it. Any terrain or region
  97. /// settings in the archive will be ignored.
  98. /// </param>
  99. /// <param name="skipAssets">
  100. /// If true, the archive is loaded without loading any assets contained within it. This is useful if the
  101. /// assets are already known to be present in the grid's asset service.
  102. /// </param>
  103. /// <param name="requestId">If supplied, this request Id is later returned in the saved event</param>
  104. void DearchiveRegion(string loadPath, bool merge, bool skipAssets, Guid requestId);
  105. /// <summary>
  106. /// Dearchive a region from a stream. This replaces the existing scene.
  107. /// </summary>
  108. ///
  109. /// If you want notification of when it has completed then subscribe to the EventManager.OnOarFileLoaded event.
  110. ///
  111. /// <param name="loadStream"></param>
  112. void DearchiveRegion(Stream loadStream);
  113. /// <summary>
  114. /// Dearchive a region from a stream. This replaces the existing scene.
  115. /// </summary>
  116. ///
  117. /// If you want notification of when it has completed then subscribe to the EventManager.OnOarFileLoaded event.
  118. ///
  119. /// <param name="loadStream"></param>
  120. /// <param name="merge">
  121. /// If true, the loaded region merges with the existing one rather than replacing it. Any terrain or region
  122. /// settings in the archive will be ignored.
  123. /// </param>
  124. /// <param name="skipAssets">
  125. /// If true, the archive is loaded without loading any assets contained within it. This is useful if the
  126. /// assets are already known to be present in the grid's asset service.
  127. /// </param
  128. /// <param name="requestId">If supplied, this request Id is later returned in the saved event</param>
  129. void DearchiveRegion(Stream loadStream, bool merge, bool skipAssets, Guid requestId);
  130. }
  131. }