diff options
author | Justin Clark-Casey (justincc) | 2014-03-07 01:04:40 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-03-07 01:04:54 +0000 |
commit | 71918eeab4beee076d53469e8d19addab49135b7 (patch) | |
tree | a81a76fa046ffa1cada2e6759553ff3fde815edb /OpenSim/Data/Null/NullXGroupData.cs | |
parent | Add scene name to bad parcel add logging (diff) | |
download | opensim-SC-71918eeab4beee076d53469e8d19addab49135b7.zip opensim-SC-71918eeab4beee076d53469e8d19addab49135b7.tar.gz opensim-SC-71918eeab4beee076d53469e8d19addab49135b7.tar.bz2 opensim-SC-71918eeab4beee076d53469e8d19addab49135b7.tar.xz |
Add regression test for sending group notices via xmlrpc groups connector.
Diffstat (limited to 'OpenSim/Data/Null/NullXGroupData.cs')
-rw-r--r-- | OpenSim/Data/Null/NullXGroupData.cs | 34 |
1 files changed, 15 insertions, 19 deletions
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; | |||
38 | 38 | ||
39 | namespace OpenSim.Data.Null | 39 | namespace OpenSim.Data.Null |
40 | { | 40 | { |
41 | public class NullXGroupData : NullGenericDataHandler, IXGroupData | 41 | public class NullXGroupData : IXGroupData |
42 | { | 42 | { |
43 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 43 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
44 | 44 | ||
@@ -56,35 +56,31 @@ namespace OpenSim.Data.Null | |||
56 | return true; | 56 | return true; |
57 | } | 57 | } |
58 | 58 | ||
59 | public XGroup[] GetGroups(string field, string val) | 59 | public XGroup GetGroup(UUID groupID) |
60 | { | 60 | { |
61 | return GetGroups(new string[] { field }, new string[] { val }); | 61 | XGroup group = null; |
62 | } | ||
63 | 62 | ||
64 | public XGroup[] GetGroups(string[] fields, string[] vals) | ||
65 | { | ||
66 | lock (m_groups) | 63 | lock (m_groups) |
67 | { | 64 | m_groups.TryGetValue(groupID, out group); |
68 | List<XGroup> origGroups = Get<XGroup>(fields, vals, m_groups.Values.ToList()); | ||
69 | 65 | ||
70 | return origGroups.Select(g => g.Clone()).ToArray(); | 66 | return group; |
71 | } | ||
72 | } | 67 | } |
73 | 68 | ||
74 | public bool DeleteGroups(string field, string val) | 69 | public Dictionary<UUID, XGroup> GetGroups() |
75 | { | 70 | { |
76 | return DeleteGroups(new string[] { field }, new string[] { val }); | 71 | Dictionary<UUID, XGroup> groupsClone = new Dictionary<UUID, XGroup>(); |
72 | |||
73 | lock (m_groups) | ||
74 | foreach (XGroup group in m_groups.Values) | ||
75 | groupsClone[group.groupID] = group.Clone(); | ||
76 | |||
77 | return groupsClone; | ||
77 | } | 78 | } |
78 | 79 | ||
79 | public bool DeleteGroups(string[] fields, string[] vals) | 80 | public bool DeleteGroup(UUID groupID) |
80 | { | 81 | { |
81 | lock (m_groups) | 82 | lock (m_groups) |
82 | { | 83 | return m_groups.Remove(groupID); |
83 | XGroup[] groupsToDelete = GetGroups(fields, vals); | ||
84 | Array.ForEach(groupsToDelete, g => m_groups.Remove(g.groupID)); | ||
85 | } | ||
86 | |||
87 | return true; | ||
88 | } | 84 | } |
89 | } | 85 | } |
90 | } \ No newline at end of file | 86 | } \ No newline at end of file |