diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/Null/NullXGroupData.cs (renamed from OpenSim/Region/Framework/Scenes/Scripting/NullScriptHost.cs) | 73 |
1 files changed, 36 insertions, 37 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scripting/NullScriptHost.cs b/OpenSim/Data/Null/NullXGroupData.cs index d7198f0..7a86b9f 100644 --- a/OpenSim/Region/Framework/Scenes/Scripting/NullScriptHost.cs +++ b/OpenSim/Data/Null/NullXGroupData.cs | |||
@@ -26,66 +26,65 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using OpenMetaverse; | 29 | using System.Collections; |
30 | using log4net; | 30 | using System.Collections.Generic; |
31 | using System.Linq; | ||
31 | using System.Reflection; | 32 | using System.Reflection; |
33 | using System.Threading; | ||
34 | using log4net; | ||
35 | using OpenMetaverse; | ||
32 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
37 | using OpenSim.Data; | ||
33 | 38 | ||
34 | namespace OpenSim.Region.Framework.Scenes.Scripting | 39 | namespace OpenSim.Data.Null |
35 | { | 40 | { |
36 | public class NullScriptHost : IScriptHost | 41 | public class NullXGroupData : NullGenericDataHandler, IXGroupData |
37 | { | 42 | { |
38 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 43 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
39 | 44 | ||
40 | private Vector3 m_pos = new Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 30); | 45 | private Dictionary<UUID, XGroup> m_groups = new Dictionary<UUID, XGroup>(); |
41 | 46 | ||
42 | public string Name | 47 | public NullXGroupData(string connectionString, string realm) {} |
43 | { | ||
44 | get { return "Object"; } | ||
45 | set { } | ||
46 | } | ||
47 | 48 | ||
48 | public string SitName | 49 | public bool StoreGroup(XGroup group) |
49 | { | 50 | { |
50 | get { return String.Empty; } | 51 | lock (m_groups) |
51 | set { } | 52 | { |
52 | } | 53 | m_groups[group.groupID] = group.Clone(); |
54 | } | ||
53 | 55 | ||
54 | public string TouchName | 56 | return true; |
55 | { | ||
56 | get { return String.Empty; } | ||
57 | set { } | ||
58 | } | 57 | } |
59 | 58 | ||
60 | public string Description | 59 | public XGroup[] GetGroups(string field, string val) |
61 | { | 60 | { |
62 | get { return String.Empty; } | 61 | return GetGroups(new string[] { field }, new string[] { val }); |
63 | set { } | ||
64 | } | 62 | } |
65 | 63 | ||
66 | public UUID UUID | 64 | public XGroup[] GetGroups(string[] fields, string[] vals) |
67 | { | 65 | { |
68 | get { return UUID.Zero; } | 66 | lock (m_groups) |
69 | } | 67 | { |
68 | List<XGroup> origGroups = Get<XGroup>(fields, vals, m_groups.Values.ToList()); | ||
70 | 69 | ||
71 | public UUID OwnerID | 70 | return origGroups.Select(g => g.Clone()).ToArray(); |
72 | { | 71 | } |
73 | get { return UUID.Zero; } | ||
74 | } | 72 | } |
75 | 73 | ||
76 | public UUID CreatorID | 74 | public bool DeleteGroups(string field, string val) |
77 | { | 75 | { |
78 | get { return UUID.Zero; } | 76 | return DeleteGroups(new string[] { field }, new string[] { val }); |
79 | } | 77 | } |
80 | 78 | ||
81 | public Vector3 AbsolutePosition | 79 | public bool DeleteGroups(string[] fields, string[] vals) |
82 | { | 80 | { |
83 | get { return m_pos; } | 81 | lock (m_groups) |
84 | } | 82 | { |
83 | XGroup[] groupsToDelete = GetGroups(fields, vals); | ||
84 | Array.ForEach(groupsToDelete, g => m_groups.Remove(g.groupID)); | ||
85 | } | ||
85 | 86 | ||
86 | public void SetText(string text, Vector3 color, double alpha) | 87 | return true; |
87 | { | ||
88 | m_log.Warn("Tried to SetText "+text+" on NullScriptHost"); | ||
89 | } | 88 | } |
90 | } | 89 | } |
91 | } | 90 | } \ No newline at end of file |