diff options
Diffstat (limited to 'OpenSim/Data/Null/NullPresenceData.cs')
-rw-r--r-- | OpenSim/Data/Null/NullPresenceData.cs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/OpenSim/Data/Null/NullPresenceData.cs b/OpenSim/Data/Null/NullPresenceData.cs index 52fdc6f..40700cf 100644 --- a/OpenSim/Data/Null/NullPresenceData.cs +++ b/OpenSim/Data/Null/NullPresenceData.cs | |||
@@ -36,10 +36,15 @@ namespace OpenSim.Data.Null | |||
36 | { | 36 | { |
37 | public class NullPresenceData : IPresenceData | 37 | public class NullPresenceData : IPresenceData |
38 | { | 38 | { |
39 | private static NullPresenceData Instance; | ||
40 | |||
39 | Dictionary<UUID, PresenceData> m_presenceData = new Dictionary<UUID, PresenceData>(); | 41 | Dictionary<UUID, PresenceData> m_presenceData = new Dictionary<UUID, PresenceData>(); |
40 | 42 | ||
41 | public NullPresenceData(string connectionString, string realm) | 43 | public NullPresenceData(string connectionString, string realm) |
42 | { | 44 | { |
45 | if (Instance == null) | ||
46 | Instance = this; | ||
47 | |||
43 | //Console.WriteLine("[XXX] NullRegionData constructor"); | 48 | //Console.WriteLine("[XXX] NullRegionData constructor"); |
44 | // Let's stick in a test presence | 49 | // Let's stick in a test presence |
45 | PresenceData p = new PresenceData(); | 50 | PresenceData p = new PresenceData(); |
@@ -52,12 +57,18 @@ namespace OpenSim.Data.Null | |||
52 | 57 | ||
53 | public bool Store(PresenceData data) | 58 | public bool Store(PresenceData data) |
54 | { | 59 | { |
60 | if (Instance != this) | ||
61 | return Instance.Store(data); | ||
62 | |||
55 | m_presenceData[data.SessionID] = data; | 63 | m_presenceData[data.SessionID] = data; |
56 | return true; | 64 | return true; |
57 | } | 65 | } |
58 | 66 | ||
59 | public PresenceData Get(UUID sessionID) | 67 | public PresenceData Get(UUID sessionID) |
60 | { | 68 | { |
69 | if (Instance != this) | ||
70 | return Instance.Get(sessionID); | ||
71 | |||
61 | if (m_presenceData.ContainsKey(sessionID)) | 72 | if (m_presenceData.ContainsKey(sessionID)) |
62 | return m_presenceData[sessionID]; | 73 | return m_presenceData[sessionID]; |
63 | 74 | ||
@@ -66,6 +77,12 @@ namespace OpenSim.Data.Null | |||
66 | 77 | ||
67 | public void LogoutRegionAgents(UUID regionID) | 78 | public void LogoutRegionAgents(UUID regionID) |
68 | { | 79 | { |
80 | if (Instance != this) | ||
81 | { | ||
82 | Instance.LogoutRegionAgents(regionID); | ||
83 | return; | ||
84 | } | ||
85 | |||
69 | List<UUID> toBeDeleted = new List<UUID>(); | 86 | List<UUID> toBeDeleted = new List<UUID>(); |
70 | foreach (KeyValuePair<UUID, PresenceData> kvp in m_presenceData) | 87 | foreach (KeyValuePair<UUID, PresenceData> kvp in m_presenceData) |
71 | if (kvp.Value.RegionID == regionID) | 88 | if (kvp.Value.RegionID == regionID) |
@@ -77,6 +94,8 @@ namespace OpenSim.Data.Null | |||
77 | 94 | ||
78 | public bool ReportAgent(UUID sessionID, UUID regionID, string position, string lookAt) | 95 | public bool ReportAgent(UUID sessionID, UUID regionID, string position, string lookAt) |
79 | { | 96 | { |
97 | if (Instance != this) | ||
98 | return Instance.ReportAgent(sessionID, regionID, position, lookAt); | ||
80 | if (m_presenceData.ContainsKey(sessionID)) | 99 | if (m_presenceData.ContainsKey(sessionID)) |
81 | { | 100 | { |
82 | m_presenceData[sessionID].RegionID = regionID; | 101 | m_presenceData[sessionID].RegionID = regionID; |
@@ -90,6 +109,9 @@ namespace OpenSim.Data.Null | |||
90 | 109 | ||
91 | public bool SetHomeLocation(string userID, UUID regionID, Vector3 position, Vector3 lookAt) | 110 | public bool SetHomeLocation(string userID, UUID regionID, Vector3 position, Vector3 lookAt) |
92 | { | 111 | { |
112 | if (Instance != this) | ||
113 | return Instance.SetHomeLocation(userID, regionID, position, lookAt); | ||
114 | |||
93 | bool foundone = false; | 115 | bool foundone = false; |
94 | foreach (PresenceData p in m_presenceData.Values) | 116 | foreach (PresenceData p in m_presenceData.Values) |
95 | { | 117 | { |
@@ -107,6 +129,9 @@ namespace OpenSim.Data.Null | |||
107 | 129 | ||
108 | public PresenceData[] Get(string field, string data) | 130 | public PresenceData[] Get(string field, string data) |
109 | { | 131 | { |
132 | if (Instance != this) | ||
133 | return Instance.Get(field, data); | ||
134 | |||
110 | List<PresenceData> presences = new List<PresenceData>(); | 135 | List<PresenceData> presences = new List<PresenceData>(); |
111 | if (field == "UserID") | 136 | if (field == "UserID") |
112 | { | 137 | { |
@@ -152,6 +177,12 @@ namespace OpenSim.Data.Null | |||
152 | 177 | ||
153 | public void Prune(string userID) | 178 | public void Prune(string userID) |
154 | { | 179 | { |
180 | if (Instance != this) | ||
181 | { | ||
182 | Instance.Prune(userID); | ||
183 | return; | ||
184 | } | ||
185 | |||
155 | List<UUID> deleteSessions = new List<UUID>(); | 186 | List<UUID> deleteSessions = new List<UUID>(); |
156 | int online = 0; | 187 | int online = 0; |
157 | 188 | ||
@@ -173,6 +204,9 @@ namespace OpenSim.Data.Null | |||
173 | 204 | ||
174 | public bool Delete(string field, string data) | 205 | public bool Delete(string field, string data) |
175 | { | 206 | { |
207 | if (Instance != this) | ||
208 | return Delete(field, data); | ||
209 | |||
176 | List<UUID> presences = new List<UUID>(); | 210 | List<UUID> presences = new List<UUID>(); |
177 | if (field == "UserID") | 211 | if (field == "UserID") |
178 | { | 212 | { |