diff options
Diffstat (limited to 'OpenSim/Data/Null/NullEstateData.cs')
-rw-r--r-- | OpenSim/Data/Null/NullEstateData.cs | 152 |
1 files changed, 152 insertions, 0 deletions
diff --git a/OpenSim/Data/Null/NullEstateData.cs b/OpenSim/Data/Null/NullEstateData.cs new file mode 100644 index 0000000..9f22896 --- /dev/null +++ b/OpenSim/Data/Null/NullEstateData.cs | |||
@@ -0,0 +1,152 @@ | |||
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 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Reflection; | ||
31 | using log4net; | ||
32 | using OpenMetaverse; | ||
33 | using OpenSim.Framework; | ||
34 | using OpenSim.Region.Framework; | ||
35 | using OpenSim.Region.Framework.Interfaces; | ||
36 | |||
37 | namespace OpenSim.Data.Null | ||
38 | { | ||
39 | public class NullEstateStore : IEstateDataStore | ||
40 | { | ||
41 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
42 | |||
43 | // private string m_connectionString; | ||
44 | |||
45 | // private Dictionary<uint, EstateSettings> m_knownEstates = new Dictionary<uint, EstateSettings>(); | ||
46 | private EstateSettings m_estate = null; | ||
47 | |||
48 | private EstateSettings GetEstate() | ||
49 | { | ||
50 | if (m_estate == null) | ||
51 | { | ||
52 | // This fools the initialization caller into thinking an estate was fetched (a check in OpenSimBase). | ||
53 | // The estate info is pretty empty so don't try banning anyone. | ||
54 | m_estate = new EstateSettings(); | ||
55 | m_estate.EstateID = 1; | ||
56 | m_estate.OnSave += StoreEstateSettings; | ||
57 | } | ||
58 | return m_estate; | ||
59 | } | ||
60 | |||
61 | protected virtual Assembly Assembly | ||
62 | { | ||
63 | get { return GetType().Assembly; } | ||
64 | } | ||
65 | |||
66 | public NullEstateStore() | ||
67 | { | ||
68 | } | ||
69 | |||
70 | public NullEstateStore(string connectionString) | ||
71 | { | ||
72 | Initialise(connectionString); | ||
73 | } | ||
74 | |||
75 | public void Initialise(string connectionString) | ||
76 | { | ||
77 | // m_connectionString = connectionString; | ||
78 | } | ||
79 | |||
80 | private string[] FieldList | ||
81 | { | ||
82 | get { return new string[0]; } | ||
83 | } | ||
84 | |||
85 | public EstateSettings LoadEstateSettings(UUID regionID, bool create) | ||
86 | { | ||
87 | return GetEstate(); | ||
88 | } | ||
89 | |||
90 | public void StoreEstateSettings(EstateSettings es) | ||
91 | { | ||
92 | m_estate = es; | ||
93 | return; | ||
94 | } | ||
95 | |||
96 | public EstateSettings LoadEstateSettings(int estateID) | ||
97 | { | ||
98 | return GetEstate(); | ||
99 | } | ||
100 | |||
101 | public EstateSettings CreateNewEstate() | ||
102 | { | ||
103 | return new EstateSettings(); | ||
104 | } | ||
105 | |||
106 | public List<EstateSettings> LoadEstateSettingsAll() | ||
107 | { | ||
108 | List<EstateSettings> allEstateSettings = new List<EstateSettings>(); | ||
109 | allEstateSettings.Add(GetEstate()); | ||
110 | return allEstateSettings; | ||
111 | } | ||
112 | |||
113 | public List<int> GetEstatesAll() | ||
114 | { | ||
115 | List<int> result = new List<int>(); | ||
116 | result.Add((int)GetEstate().EstateID); | ||
117 | return result; | ||
118 | } | ||
119 | |||
120 | public List<int> GetEstates(string search) | ||
121 | { | ||
122 | List<int> result = new List<int>(); | ||
123 | return result; | ||
124 | } | ||
125 | |||
126 | public bool LinkRegion(UUID regionID, int estateID) | ||
127 | { | ||
128 | return false; | ||
129 | } | ||
130 | |||
131 | public List<UUID> GetRegions(int estateID) | ||
132 | { | ||
133 | List<UUID> result = new List<UUID>(); | ||
134 | return result; | ||
135 | } | ||
136 | |||
137 | public bool DeleteEstate(int estateID) | ||
138 | { | ||
139 | return false; | ||
140 | } | ||
141 | |||
142 | #region IEstateDataStore Members | ||
143 | |||
144 | |||
145 | public List<int> GetEstatesByOwner(UUID ownerID) | ||
146 | { | ||
147 | return new List<int>(); | ||
148 | } | ||
149 | |||
150 | #endregion | ||
151 | } | ||
152 | } | ||