aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModuleState.cs
diff options
context:
space:
mode:
authorSean McNamara2011-04-23 18:29:13 -0400
committerSean McNamara2011-04-23 18:29:13 -0400
commit082fad6dd28513e38120c9d272aeed385de8208f (patch)
treeb8106adb1b0bb2422fc0770cfabfd714a2e3ab88 /OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModuleState.cs
parentFixup the global defaults config parsing code. (diff)
downloadopensim-SC_OLD-082fad6dd28513e38120c9d272aeed385de8208f.zip
opensim-SC_OLD-082fad6dd28513e38120c9d272aeed385de8208f.tar.gz
opensim-SC_OLD-082fad6dd28513e38120c9d272aeed385de8208f.tar.bz2
opensim-SC_OLD-082fad6dd28513e38120c9d272aeed385de8208f.tar.xz
Fix most issues raised by justincc: http://opensimulator.org/mantis/view.php?id=5440
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModuleState.cs109
1 files changed, 109 insertions, 0 deletions
diff --git a/OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModuleState.cs b/OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModuleState.cs
new file mode 100644
index 0000000..1b348af
--- /dev/null
+++ b/OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModuleState.cs
@@ -0,0 +1,109 @@
1#pragma warning disable 1587
2///
3/// Copyright (c) Contributors, http://opensimulator.org/
4/// See CONTRIBUTORS.TXT for a full list of copyright holders.
5///
6/// Redistribution and use in source and binary forms, with or without
7/// modification, are permitted provided that the following conditions are met:
8/// * Redistributions of source code must retain the above copyright
9/// notice, this list of conditions and the following disclaimer.
10/// * Redistributions in binary form must reproduce the above copyright
11/// notice, this list of conditions and the following disclaimer in the
12/// documentation and/or other materials provided with the distribution.
13/// * Neither the name of the OpenSimulator Project nor the
14/// names of its contributors may be used to endorse or promote products
15/// derived from this software without specific prior written permission.
16///
17/// THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
18/// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19/// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20/// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
21/// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22/// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23/// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24/// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25/// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26/// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27///
28
29namespace OpenSim.Region.OptionalModules.World.AutoBackup
30{
31 /// AutoBackupModuleState: Auto-Backup state for one region (scene).
32 public class AutoBackupModuleState
33 {
34 public AutoBackupModuleState()
35 {
36 this.Enabled = false;
37 this.BackupDir = ".";
38 this.BusyCheck = true;
39 this.Timer = null;
40 this.NamingType = NamingType.Time;
41 this.Script = null;
42 }
43
44 public bool Enabled
45 {
46 get;
47 set;
48 }
49
50 public System.Timers.Timer Timer
51 {
52 get;
53 set;
54 }
55
56 public double IntervalMinutes
57 {
58 get
59 {
60 if (this.Timer == null)
61 {
62 return -1.0;
63 }
64 else
65 {
66 return this.Timer.Interval / 60000.0;
67 }
68 }
69 }
70
71 public bool BusyCheck
72 {
73 get;
74 set;
75 }
76
77 public string Script
78 {
79 get;
80 set;
81 }
82
83 public string BackupDir
84 {
85 get;
86 set;
87 }
88
89 public NamingType NamingType
90 {
91 get;
92 set;
93 }
94
95 public new string ToString()
96 {
97 string retval = "";
98
99 retval += "[AUTO BACKUP]: AutoBackup: " + (Enabled ? "ENABLED" : "DISABLED") + "\n";
100 retval += "[AUTO BACKUP]: Interval: " + IntervalMinutes + " minutes" + "\n";
101 retval += "[AUTO BACKUP]: Do Busy Check: " + (BusyCheck ? "Yes" : "No") + "\n";
102 retval += "[AUTO BACKUP]: Naming Type: " + NamingType.ToString() + "\n";
103 retval += "[AUTO BACKUP]: Backup Dir: " + BackupDir + "\n";
104 retval += "[AUTO BACKUP]: Script: " + Script + "\n";
105 return retval;
106 }
107 }
108}
109