From b2fbadeae82f0bdbfb3b7bdc8e14cb7f5b693092 Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Mon, 4 Apr 2011 20:02:13 -0700 Subject: Updates NullStorage plugin. Thanks MisterBlue... --- OpenSim/Data/Null/NullEstateData.cs | 123 ++++++++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100755 OpenSim/Data/Null/NullEstateData.cs (limited to 'OpenSim/Data/Null/NullEstateData.cs') diff --git a/OpenSim/Data/Null/NullEstateData.cs b/OpenSim/Data/Null/NullEstateData.cs new file mode 100755 index 0000000..6ce7a36 --- /dev/null +++ b/OpenSim/Data/Null/NullEstateData.cs @@ -0,0 +1,123 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using System.Reflection; +using log4net; +using OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Region.Framework; +using OpenSim.Region.Framework.Interfaces; + +namespace OpenSim.Data.Null +{ + public class NullEstateStore : IEstateDataStore + { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + private string m_connectionString; + + protected virtual Assembly Assembly + { + get { return GetType().Assembly; } + } + + public NullEstateStore() + { + } + + public NullEstateStore(string connectionString) + { + Initialise(connectionString); + } + + public void Initialise(string connectionString) + { + m_connectionString = connectionString; + } + + private string[] FieldList + { + get { return new string[0]; } + } + + public EstateSettings LoadEstateSettings(UUID regionID, bool create) + { + // This fools the initialization caller into thinking an estate was fetched (a check in OpenSimBase). + // The estate info is pretty empty so don't try banning anyone. + EstateSettings oneEstate = new EstateSettings(); + oneEstate.EstateID = 1; + return oneEstate; + } + + public void StoreEstateSettings(EstateSettings es) + { + return; + } + + public EstateSettings LoadEstateSettings(int estateID) + { + return new EstateSettings(); + } + + public List LoadEstateSettingsAll() + { + List allEstateSettings = new List(); + allEstateSettings.Add(new EstateSettings()); + return allEstateSettings; + } + + public List GetEstatesAll() + { + List result = new List(); + return result; + } + + public List GetEstates(string search) + { + List result = new List(); + return result; + } + + public bool LinkRegion(UUID regionID, int estateID) + { + return false; + } + + public List GetRegions(int estateID) + { + List result = new List(); + return result; + } + + public bool DeleteEstate(int estateID) + { + return false; + } + } +} -- cgit v1.1 From 18e206d2ed5cc1828f2ada27ff4698bdc0b84352 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Mon, 4 Apr 2011 23:45:28 -0400 Subject: * Bugfix - Compile NullEstateData implement public List IEstateDataStore.GetEstatesByOwner(UUID) --- OpenSim/Data/Null/NullEstateData.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'OpenSim/Data/Null/NullEstateData.cs') diff --git a/OpenSim/Data/Null/NullEstateData.cs b/OpenSim/Data/Null/NullEstateData.cs index 6ce7a36..0cebff5 100755 --- a/OpenSim/Data/Null/NullEstateData.cs +++ b/OpenSim/Data/Null/NullEstateData.cs @@ -119,5 +119,15 @@ namespace OpenSim.Data.Null { return false; } + + #region IEstateDataStore Members + + + public List GetEstatesByOwner(UUID ownerID) + { + return new List(); + } + + #endregion } } -- cgit v1.1 From da4a9653a27cbb1ecc779774a3d8715afb079086 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 12 Apr 2011 22:33:06 +0100 Subject: minor: remove some mono compiler warnings --- OpenSim/Data/Null/NullEstateData.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Data/Null/NullEstateData.cs') diff --git a/OpenSim/Data/Null/NullEstateData.cs b/OpenSim/Data/Null/NullEstateData.cs index 0cebff5..8db8064 100755 --- a/OpenSim/Data/Null/NullEstateData.cs +++ b/OpenSim/Data/Null/NullEstateData.cs @@ -38,9 +38,9 @@ namespace OpenSim.Data.Null { public class NullEstateStore : IEstateDataStore { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); +// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - private string m_connectionString; +// private string m_connectionString; protected virtual Assembly Assembly { @@ -58,7 +58,7 @@ namespace OpenSim.Data.Null public void Initialise(string connectionString) { - m_connectionString = connectionString; +// m_connectionString = connectionString; } private string[] FieldList -- cgit v1.1 From 1458fab82c4dab9901d81419e6b515f47ea7320f Mon Sep 17 00:00:00 2001 From: Kevin Houlihan Date: Mon, 12 Sep 2011 23:08:16 +0100 Subject: Reattaching a region was failing if the estate name had not changed (issue 5035). Using the RemoteAdmin API to close then recreate a region would fail if the estate name had not changed. If the estate name /was/ changed then the existing estate would be renamed rather than a new one being created. The problem really arose from a lack of distinction in the data storage layer between creating new estates and loading existing ones. --- OpenSim/Data/Null/NullEstateData.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim/Data/Null/NullEstateData.cs') diff --git a/OpenSim/Data/Null/NullEstateData.cs b/OpenSim/Data/Null/NullEstateData.cs index 8db8064..d64136d 100755 --- a/OpenSim/Data/Null/NullEstateData.cs +++ b/OpenSim/Data/Null/NullEstateData.cs @@ -84,6 +84,11 @@ namespace OpenSim.Data.Null { return new EstateSettings(); } + + public EstateSettings CreateNewEstate() + { + return new EstateSettings(); + } public List LoadEstateSettingsAll() { -- cgit v1.1 From 65239b059fc8a92eee1d27655a6f85826c99306b Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Thu, 11 Jul 2013 20:55:32 -0700 Subject: 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. --- OpenSim/Data/Null/NullEstateData.cs | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'OpenSim/Data/Null/NullEstateData.cs') 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 // private string m_connectionString; + private Dictionary m_knownEstates = new Dictionary(); + private EstateSettings m_estate = null; + + private EstateSettings GetEstate() + { + if (m_estate == null) + { + // This fools the initialization caller into thinking an estate was fetched (a check in OpenSimBase). + // The estate info is pretty empty so don't try banning anyone. + m_estate = new EstateSettings(); + m_estate.EstateID = 1; + m_estate.OnSave += StoreEstateSettings; + } + return m_estate; + } + protected virtual Assembly Assembly { get { return GetType().Assembly; } @@ -68,21 +84,18 @@ namespace OpenSim.Data.Null public EstateSettings LoadEstateSettings(UUID regionID, bool create) { - // This fools the initialization caller into thinking an estate was fetched (a check in OpenSimBase). - // The estate info is pretty empty so don't try banning anyone. - EstateSettings oneEstate = new EstateSettings(); - oneEstate.EstateID = 1; - return oneEstate; + return GetEstate(); } public void StoreEstateSettings(EstateSettings es) { + m_estate = es; return; } public EstateSettings LoadEstateSettings(int estateID) { - return new EstateSettings(); + return GetEstate(); } public EstateSettings CreateNewEstate() @@ -93,13 +106,14 @@ namespace OpenSim.Data.Null public List LoadEstateSettingsAll() { List allEstateSettings = new List(); - allEstateSettings.Add(new EstateSettings()); + allEstateSettings.Add(GetEstate()); return allEstateSettings; } public List GetEstatesAll() { List result = new List(); + result.Add((int)GetEstate().EstateID); return result; } -- cgit v1.1 From de941d2ec749a8cccdfd0dd35834d32ea34a0913 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 26 Mar 2014 21:00:57 +0000 Subject: minor: remove compiler warning from NullEstateData --- OpenSim/Data/Null/NullEstateData.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Data/Null/NullEstateData.cs') diff --git a/OpenSim/Data/Null/NullEstateData.cs b/OpenSim/Data/Null/NullEstateData.cs index 1df397d..57592f1 100755 --- a/OpenSim/Data/Null/NullEstateData.cs +++ b/OpenSim/Data/Null/NullEstateData.cs @@ -42,7 +42,7 @@ namespace OpenSim.Data.Null // private string m_connectionString; - private Dictionary m_knownEstates = new Dictionary(); +// private Dictionary m_knownEstates = new Dictionary(); private EstateSettings m_estate = null; private EstateSettings GetEstate() -- cgit v1.1