diff options
author | Adam Frisby | 2009-04-06 04:17:55 +0000 |
---|---|---|
committer | Adam Frisby | 2009-04-06 04:17:55 +0000 |
commit | 918c46688189cc0e6f237f9f2d2ee8892506d56d (patch) | |
tree | f047f3a3640b2ec57e9e0c6397aa008cf869cd98 /OpenSim/Region | |
parent | Changed the asynchronous call to get inventory in HG, so that it properly rep... (diff) | |
download | opensim-SC-918c46688189cc0e6f237f9f2d2ee8892506d56d.zip opensim-SC-918c46688189cc0e6f237f9f2d2ee8892506d56d.tar.gz opensim-SC-918c46688189cc0e6f237f9f2d2ee8892506d56d.tar.bz2 opensim-SC-918c46688189cc0e6f237f9f2d2ee8892506d56d.tar.xz |
* Adds AutoOAR module, this will automatically OAR your regions every 20 minutes to a directory called "autooar", if enabled. Default disabled. Use [autooar] Enabled=true in OpenSim.ini to enable.
* Adds some MRM XMLDOC
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/OptionalModules/Autooar/AutooarModule.cs | 72 | ||||
-rw-r--r-- | OpenSim/Region/OptionalModules/Scripting/Minimodule/Object/IObjectPhysics.cs | 5 |
2 files changed, 77 insertions, 0 deletions
diff --git a/OpenSim/Region/OptionalModules/Autooar/AutooarModule.cs b/OpenSim/Region/OptionalModules/Autooar/AutooarModule.cs new file mode 100644 index 0000000..6c10928 --- /dev/null +++ b/OpenSim/Region/OptionalModules/Autooar/AutooarModule.cs | |||
@@ -0,0 +1,72 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.IO; | ||
4 | using System.Text; | ||
5 | using System.Timers; | ||
6 | using Nini.Config; | ||
7 | using OpenSim.Region.Framework.Interfaces; | ||
8 | using OpenSim.Region.Framework.Scenes; | ||
9 | |||
10 | namespace OpenSim.Region.OptionalModules.Autooar | ||
11 | { | ||
12 | public class AutooarModule : IRegionModule | ||
13 | { | ||
14 | private readonly Timer m_timer = new Timer(60000*20); | ||
15 | private readonly List<Scene> m_scenes = new List<Scene>(); | ||
16 | private IConfigSource config; | ||
17 | private bool m_enabled = false; | ||
18 | |||
19 | |||
20 | public void Initialise(Scene scene, IConfigSource source) | ||
21 | { | ||
22 | m_scenes.Add(scene); | ||
23 | config = source; | ||
24 | } | ||
25 | |||
26 | public void PostInitialise() | ||
27 | { | ||
28 | if(config.Configs["autooar"] != null) | ||
29 | { | ||
30 | m_enabled = config.Configs["autooar"].GetBoolean("Enabled", m_enabled); | ||
31 | } | ||
32 | |||
33 | if(m_enabled) | ||
34 | { | ||
35 | m_timer.Elapsed += m_timer_Elapsed; | ||
36 | m_timer.AutoReset = true; | ||
37 | m_timer.Start(); | ||
38 | } | ||
39 | } | ||
40 | |||
41 | void m_timer_Elapsed(object sender, ElapsedEventArgs e) | ||
42 | { | ||
43 | if (!Directory.Exists("autooars")) | ||
44 | Directory.CreateDirectory("autooars"); | ||
45 | |||
46 | foreach (Scene scene in m_scenes) | ||
47 | { | ||
48 | IRegionArchiverModule archiver = scene.RequestModuleInterface<IRegionArchiverModule>(); | ||
49 | |||
50 | archiver.ArchiveRegion(Path.Combine("autooars", | ||
51 | scene.RegionInfo.RegionName + "_" + scene.RegionInfo.RegionLocX + | ||
52 | "x" + scene.RegionInfo.RegionLocY + ".oar.tar.gz")); | ||
53 | } | ||
54 | } | ||
55 | |||
56 | public void Close() | ||
57 | { | ||
58 | if (m_timer.Enabled) | ||
59 | m_timer.Stop(); | ||
60 | } | ||
61 | |||
62 | public string Name | ||
63 | { | ||
64 | get { return "Automatic OAR Module"; } | ||
65 | } | ||
66 | |||
67 | public bool IsSharedModule | ||
68 | { | ||
69 | get { return true; } | ||
70 | } | ||
71 | } | ||
72 | } | ||
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Object/IObjectPhysics.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Object/IObjectPhysics.cs index 9035db9..6ca4e5f 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Object/IObjectPhysics.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Object/IObjectPhysics.cs | |||
@@ -5,6 +5,11 @@ using OpenMetaverse; | |||
5 | 5 | ||
6 | namespace OpenSim.Region.OptionalModules.Scripting.Minimodule.Object | 6 | namespace OpenSim.Region.OptionalModules.Scripting.Minimodule.Object |
7 | { | 7 | { |
8 | /// <summary> | ||
9 | /// This implements an interface similar to that provided by physics engines to OpenSim internally. | ||
10 | /// Eg, PhysicsActor. It is capable of setting and getting properties related to the current | ||
11 | /// physics scene representation of this object. | ||
12 | /// </summary> | ||
8 | public interface IObjectPhysics | 13 | public interface IObjectPhysics |
9 | { | 14 | { |
10 | bool Enabled { get; set; } | 15 | bool Enabled { get; set; } |