aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-04-15 19:12:37 +0000
committerJustin Clarke Casey2009-04-15 19:12:37 +0000
commit63936d442ca7e6bdc0f09a5e974c57b3b5726353 (patch)
treeadd84f90ce716015e93f9dae721e7876992e6b6c /OpenSim/Region/Framework
parentConvert both script engines to new region module format. Add proper unload (diff)
downloadopensim-SC-63936d442ca7e6bdc0f09a5e974c57b3b5726353.zip
opensim-SC-63936d442ca7e6bdc0f09a5e974c57b3b5726353.tar.gz
opensim-SC-63936d442ca7e6bdc0f09a5e974c57b3b5726353.tar.bz2
opensim-SC-63936d442ca7e6bdc0f09a5e974c57b3b5726353.tar.xz
* Make it possible to add a request id to load and save oar requests
* This allows specific requests to be identified.
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs23
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs14
2 files changed, 27 insertions, 10 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs b/OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs
index 601b83e..530fb79 100644
--- a/OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs
@@ -25,6 +25,7 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using System;
28using System.IO; 29using System.IO;
29 30
30namespace OpenSim.Region.Framework.Interfaces 31namespace OpenSim.Region.Framework.Interfaces
@@ -43,6 +44,17 @@ namespace OpenSim.Region.Framework.Interfaces
43 /// 44 ///
44 /// <param name="savePath"></param> 45 /// <param name="savePath"></param>
45 void ArchiveRegion(string savePath); 46 void ArchiveRegion(string savePath);
47
48 /// <summary>
49 /// Archive the region to the given path
50 /// </summary>
51 ///
52 /// This method occurs asynchronously. If you want notification of when it has completed then subscribe to
53 /// the EventManager.OnOarFileSaved event.
54 ///
55 /// <param name="savePath"></param>
56 /// <param name="requestId">If supplied, this request Id is later returned in the saved event</param>
57 void ArchiveRegion(string savePath, Guid requestId);
46 58
47 /// <summary> 59 /// <summary>
48 /// Archive the region to a stream. 60 /// Archive the region to a stream.
@@ -52,7 +64,8 @@ namespace OpenSim.Region.Framework.Interfaces
52 /// the EventManager.OnOarFileSaved event. 64 /// the EventManager.OnOarFileSaved event.
53 /// 65 ///
54 /// <param name="saveStream"></param> 66 /// <param name="saveStream"></param>
55 void ArchiveRegion(Stream saveStream); 67 /// <param name="requestId">If supplied, this request Id is later returned in the saved event</param>
68 void ArchiveRegion(Stream saveStream, Guid requestId);
56 69
57 /// <summary> 70 /// <summary>
58 /// Dearchive the given region archive. This replaces the existing scene. 71 /// Dearchive the given region archive. This replaces the existing scene.
@@ -74,7 +87,8 @@ namespace OpenSim.Region.Framework.Interfaces
74 /// If true, the loaded region merges with the existing one rather than replacing it. Any terrain or region 87 /// If true, the loaded region merges with the existing one rather than replacing it. Any terrain or region
75 /// settings in the archive will be ignored. 88 /// settings in the archive will be ignored.
76 /// </param> 89 /// </param>
77 void DearchiveRegion(string loadPath, bool merge); 90 /// <param name="requestId">If supplied, this request Id is later returned in the saved event</param>
91 void DearchiveRegion(string loadPath, bool merge, Guid requestId);
78 92
79 /// <summary> 93 /// <summary>
80 /// Dearchive a region from a stream. This replaces the existing scene. 94 /// Dearchive a region from a stream. This replaces the existing scene.
@@ -95,7 +109,8 @@ namespace OpenSim.Region.Framework.Interfaces
95 /// <param name="merge"> 109 /// <param name="merge">
96 /// If true, the loaded region merges with the existing one rather than replacing it. Any terrain or region 110 /// 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. 111 /// settings in the archive will be ignored.
98 /// </param> 112 /// </param>
99 void DearchiveRegion(Stream loadStream, bool merge); 113 /// <param name="requestId">If supplied, this request Id is later returned in the saved event</param>
114 void DearchiveRegion(Stream loadStream, bool merge, Guid requestId);
100 } 115 }
101} 116}
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index 7496af0..469f139 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -279,14 +279,16 @@ namespace OpenSim.Region.Framework.Scenes
279 /// the scripts may not have started yet 279 /// the scripts may not have started yet
280 /// Message is non empty string if there were problems loading the oar file 280 /// Message is non empty string if there were problems loading the oar file
281 /// </summary> 281 /// </summary>
282 public delegate void OarFileLoaded(string message); 282 public delegate void OarFileLoaded(Guid guid, string message);
283 public event OarFileLoaded OnOarFileLoaded; 283 public event OarFileLoaded OnOarFileLoaded;
284 284
285 /// <summary> 285 /// <summary>
286 /// Called when an oar file has finished saving 286 /// Called when an oar file has finished saving
287 /// Message is non empty string if there were problems saving the oar file 287 /// Message is non empty string if there were problems saving the oar file
288 /// If a guid was supplied on the original call to identify, the request, this is returned. Otherwise
289 /// Guid.Empty is returned.
288 /// </summary> 290 /// </summary>
289 public delegate void OarFileSaved(string message); 291 public delegate void OarFileSaved(Guid guid, string message);
290 public event OarFileSaved OnOarFileSaved; 292 public event OarFileSaved OnOarFileSaved;
291 293
292 /// <summary> 294 /// <summary>
@@ -968,18 +970,18 @@ namespace OpenSim.Region.Framework.Scenes
968 return 6; 970 return 6;
969 } 971 }
970 972
971 public void TriggerOarFileLoaded(string message) 973 public void TriggerOarFileLoaded(Guid requestId, string message)
972 { 974 {
973 handlerOarFileLoaded = OnOarFileLoaded; 975 handlerOarFileLoaded = OnOarFileLoaded;
974 if (handlerOarFileLoaded != null) 976 if (handlerOarFileLoaded != null)
975 handlerOarFileLoaded(message); 977 handlerOarFileLoaded(requestId, message);
976 } 978 }
977 979
978 public void TriggerOarFileSaved(string message) 980 public void TriggerOarFileSaved(Guid requestId, string message)
979 { 981 {
980 handlerOarFileSaved = OnOarFileSaved; 982 handlerOarFileSaved = OnOarFileSaved;
981 if (handlerOarFileSaved != null) 983 if (handlerOarFileSaved != null)
982 handlerOarFileSaved(message); 984 handlerOarFileSaved(requestId, message);
983 } 985 }
984 986
985 public void TriggerEmptyScriptCompileQueue(int numScriptsFailed, string message) 987 public void TriggerEmptyScriptCompileQueue(int numScriptsFailed, string message)