diff options
author | Robert Adams | 2013-07-11 20:55:32 -0700 |
---|---|---|
committer | Robert Adams | 2013-07-11 20:55:32 -0700 |
commit | 65239b059fc8a92eee1d27655a6f85826c99306b (patch) | |
tree | c421a98ec1461715e09f911a3a061e31c112e453 /OpenSim/Data/Null | |
parent | Centralize duplicated code in SceneObjectPart for subscribing to (diff) | |
download | opensim-SC_OLD-65239b059fc8a92eee1d27655a6f85826c99306b.zip opensim-SC_OLD-65239b059fc8a92eee1d27655a6f85826c99306b.tar.gz opensim-SC_OLD-65239b059fc8a92eee1d27655a6f85826c99306b.tar.bz2 opensim-SC_OLD-65239b059fc8a92eee1d27655a6f85826c99306b.tar.xz |
Enhance NullEstateData to remember stored estate values and return
them next time asked. This keeps any estate settings from being reset
when the estate dialog is opened in a region with null estate storage.
Diffstat (limited to 'OpenSim/Data/Null')
-rwxr-xr-x | OpenSim/Data/Null/NullEstateData.cs | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/OpenSim/Data/Null/NullEstateData.cs b/OpenSim/Data/Null/NullEstateData.cs index d64136d..1df397d 100755 --- a/OpenSim/Data/Null/NullEstateData.cs +++ b/OpenSim/Data/Null/NullEstateData.cs | |||
@@ -42,6 +42,22 @@ namespace OpenSim.Data.Null | |||
42 | 42 | ||
43 | // private string m_connectionString; | 43 | // private string m_connectionString; |
44 | 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 | |||
45 | protected virtual Assembly Assembly | 61 | protected virtual Assembly Assembly |
46 | { | 62 | { |
47 | get { return GetType().Assembly; } | 63 | get { return GetType().Assembly; } |
@@ -68,21 +84,18 @@ namespace OpenSim.Data.Null | |||
68 | 84 | ||
69 | public EstateSettings LoadEstateSettings(UUID regionID, bool create) | 85 | public EstateSettings LoadEstateSettings(UUID regionID, bool create) |
70 | { | 86 | { |
71 | // This fools the initialization caller into thinking an estate was fetched (a check in OpenSimBase). | 87 | return GetEstate(); |
72 | // The estate info is pretty empty so don't try banning anyone. | ||
73 | EstateSettings oneEstate = new EstateSettings(); | ||
74 | oneEstate.EstateID = 1; | ||
75 | return oneEstate; | ||
76 | } | 88 | } |
77 | 89 | ||
78 | public void StoreEstateSettings(EstateSettings es) | 90 | public void StoreEstateSettings(EstateSettings es) |
79 | { | 91 | { |
92 | m_estate = es; | ||
80 | return; | 93 | return; |
81 | } | 94 | } |
82 | 95 | ||
83 | public EstateSettings LoadEstateSettings(int estateID) | 96 | public EstateSettings LoadEstateSettings(int estateID) |
84 | { | 97 | { |
85 | return new EstateSettings(); | 98 | return GetEstate(); |
86 | } | 99 | } |
87 | 100 | ||
88 | public EstateSettings CreateNewEstate() | 101 | public EstateSettings CreateNewEstate() |
@@ -93,13 +106,14 @@ namespace OpenSim.Data.Null | |||
93 | public List<EstateSettings> LoadEstateSettingsAll() | 106 | public List<EstateSettings> LoadEstateSettingsAll() |
94 | { | 107 | { |
95 | List<EstateSettings> allEstateSettings = new List<EstateSettings>(); | 108 | List<EstateSettings> allEstateSettings = new List<EstateSettings>(); |
96 | allEstateSettings.Add(new EstateSettings()); | 109 | allEstateSettings.Add(GetEstate()); |
97 | return allEstateSettings; | 110 | return allEstateSettings; |
98 | } | 111 | } |
99 | 112 | ||
100 | public List<int> GetEstatesAll() | 113 | public List<int> GetEstatesAll() |
101 | { | 114 | { |
102 | List<int> result = new List<int>(); | 115 | List<int> result = new List<int>(); |
116 | result.Add((int)GetEstate().EstateID); | ||
103 | return result; | 117 | return result; |
104 | } | 118 | } |
105 | 119 | ||