From 71918eeab4beee076d53469e8d19addab49135b7 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 7 Mar 2014 01:04:40 +0000 Subject: Add regression test for sending group notices via xmlrpc groups connector. --- OpenSim/Data/Null/NullXGroupData.cs | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) (limited to 'OpenSim/Data/Null/NullXGroupData.cs') diff --git a/OpenSim/Data/Null/NullXGroupData.cs b/OpenSim/Data/Null/NullXGroupData.cs index 7a86b9f..3fa9451 100644 --- a/OpenSim/Data/Null/NullXGroupData.cs +++ b/OpenSim/Data/Null/NullXGroupData.cs @@ -38,7 +38,7 @@ using OpenSim.Data; namespace OpenSim.Data.Null { - public class NullXGroupData : NullGenericDataHandler, IXGroupData + public class NullXGroupData : IXGroupData { // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -56,35 +56,31 @@ namespace OpenSim.Data.Null return true; } - public XGroup[] GetGroups(string field, string val) + public XGroup GetGroup(UUID groupID) { - return GetGroups(new string[] { field }, new string[] { val }); - } + XGroup group = null; - public XGroup[] GetGroups(string[] fields, string[] vals) - { lock (m_groups) - { - List origGroups = Get(fields, vals, m_groups.Values.ToList()); + m_groups.TryGetValue(groupID, out group); - return origGroups.Select(g => g.Clone()).ToArray(); - } + return group; } - public bool DeleteGroups(string field, string val) + public Dictionary GetGroups() { - return DeleteGroups(new string[] { field }, new string[] { val }); + Dictionary groupsClone = new Dictionary(); + + lock (m_groups) + foreach (XGroup group in m_groups.Values) + groupsClone[group.groupID] = group.Clone(); + + return groupsClone; } - public bool DeleteGroups(string[] fields, string[] vals) + public bool DeleteGroup(UUID groupID) { lock (m_groups) - { - XGroup[] groupsToDelete = GetGroups(fields, vals); - Array.ForEach(groupsToDelete, g => m_groups.Remove(g.groupID)); - } - - return true; + return m_groups.Remove(groupID); } } } \ No newline at end of file -- cgit v1.1