diff options
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Framework/EventQueueGetModule.cs')
-rw-r--r-- | OpenSim/Region/Environment/Modules/Framework/EventQueueGetModule.cs | 57 |
1 files changed, 31 insertions, 26 deletions
diff --git a/OpenSim/Region/Environment/Modules/Framework/EventQueueGetModule.cs b/OpenSim/Region/Environment/Modules/Framework/EventQueueGetModule.cs index f77a7c0..95cdaed 100644 --- a/OpenSim/Region/Environment/Modules/Framework/EventQueueGetModule.cs +++ b/OpenSim/Region/Environment/Modules/Framework/EventQueueGetModule.cs | |||
@@ -68,6 +68,7 @@ namespace OpenSim.Region.Environment.Modules.Framework | |||
68 | private Dictionary<UUID, int> m_ids = new Dictionary<UUID, int>(); | 68 | private Dictionary<UUID, int> m_ids = new Dictionary<UUID, int>(); |
69 | 69 | ||
70 | private Dictionary<UUID, BlockingLLSDQueue> queues = new Dictionary<UUID, BlockingLLSDQueue>(); | 70 | private Dictionary<UUID, BlockingLLSDQueue> queues = new Dictionary<UUID, BlockingLLSDQueue>(); |
71 | |||
71 | 72 | ||
72 | #region IRegionModule methods | 73 | #region IRegionModule methods |
73 | public void Initialise(Scene scene, IConfigSource config) | 74 | public void Initialise(Scene scene, IConfigSource config) |
@@ -171,6 +172,14 @@ namespace OpenSim.Region.Environment.Modules.Framework | |||
171 | private void MakeChildAgent(ScenePresence avatar) | 172 | private void MakeChildAgent(ScenePresence avatar) |
172 | { | 173 | { |
173 | m_log.DebugFormat("[EVENTQUEUE]: Make Child agent {0}.", avatar.UUID); | 174 | m_log.DebugFormat("[EVENTQUEUE]: Make Child agent {0}.", avatar.UUID); |
175 | lock (m_ids) | ||
176 | { | ||
177 | if (m_ids.ContainsKey(avatar.UUID)) | ||
178 | { | ||
179 | // close the event queue. | ||
180 | m_ids[avatar.UUID] = -1; | ||
181 | } | ||
182 | } | ||
174 | } | 183 | } |
175 | 184 | ||
176 | public void OnRegisterCaps(UUID agentID, Caps caps) | 185 | public void OnRegisterCaps(UUID agentID, Caps caps) |
@@ -209,18 +218,35 @@ namespace OpenSim.Region.Environment.Modules.Framework | |||
209 | debug += key.ToString() + "=" + request[key].ToString() + " "; | 218 | debug += key.ToString() + "=" + request[key].ToString() + " "; |
210 | } | 219 | } |
211 | m_log.DebugFormat(debug, agentID, m_scene.RegionInfo.RegionName); | 220 | m_log.DebugFormat(debug, agentID, m_scene.RegionInfo.RegionName); |
221 | |||
222 | Hashtable responsedata = new Hashtable(); | ||
212 | 223 | ||
213 | if (element == null) // didn't have an event in 15s | 224 | if (element == null) // didn't have an event in 15s |
214 | { | 225 | { |
215 | // Send it a fake event to keep the client polling! It doesn't like 502s like the proxys say! | 226 | // Send it a fake event to keep the client polling! It doesn't like 502s like the proxys say! |
216 | element = EventQueueHelper.KeepAliveEvent(); | 227 | element = EventQueueHelper.KeepAliveEvent(); |
217 | 228 | ||
218 | ScenePresence avatar; | 229 | //ScenePresence avatar; |
219 | m_scene.TryGetAvatar(agentID, out avatar); | 230 | //m_scene.TryGetAvatar(agentID, out avatar); |
220 | 231 | ||
221 | LLSDArray array = new LLSDArray(); | 232 | LLSDArray array = new LLSDArray(); |
222 | array.Add(element); | 233 | array.Add(element); |
223 | int thisID = m_ids[agentID]; | 234 | int thisID = 0; |
235 | lock (m_ids) | ||
236 | thisID = m_ids[agentID]; | ||
237 | |||
238 | |||
239 | |||
240 | if (thisID == -1) | ||
241 | { | ||
242 | responsedata = new Hashtable(); | ||
243 | responsedata["int_response_code"] = 502; | ||
244 | responsedata["content_type"] = "text/plain"; | ||
245 | responsedata["keepalive"] = false; | ||
246 | responsedata["str_response_string"] = ""; | ||
247 | return responsedata; | ||
248 | } | ||
249 | |||
224 | while (queue.Count() > 0) | 250 | while (queue.Count() > 0) |
225 | { | 251 | { |
226 | array.Add(queue.Dequeue(1)); | 252 | array.Add(queue.Dequeue(1)); |
@@ -234,7 +260,7 @@ namespace OpenSim.Region.Environment.Modules.Framework | |||
234 | { | 260 | { |
235 | m_ids[agentID] = thisID + 1; | 261 | m_ids[agentID] = thisID + 1; |
236 | } | 262 | } |
237 | Hashtable responsedata = new Hashtable(); | 263 | responsedata = new Hashtable(); |
238 | responsedata["int_response_code"] = 200; | 264 | responsedata["int_response_code"] = 200; |
239 | responsedata["content_type"] = "application/llsd+xml"; | 265 | responsedata["content_type"] = "application/llsd+xml"; |
240 | responsedata["keepalive"] = true; | 266 | responsedata["keepalive"] = true; |
@@ -264,7 +290,7 @@ namespace OpenSim.Region.Environment.Modules.Framework | |||
264 | { | 290 | { |
265 | m_ids[agentID] = thisID + 1; | 291 | m_ids[agentID] = thisID + 1; |
266 | } | 292 | } |
267 | Hashtable responsedata = new Hashtable(); | 293 | responsedata = new Hashtable(); |
268 | responsedata["int_response_code"] = 200; | 294 | responsedata["int_response_code"] = 200; |
269 | responsedata["content_type"] = "application/llsd+xml"; | 295 | responsedata["content_type"] = "application/llsd+xml"; |
270 | responsedata["keepalive"] = true; | 296 | responsedata["keepalive"] = true; |
@@ -273,27 +299,6 @@ namespace OpenSim.Region.Environment.Modules.Framework | |||
273 | 299 | ||
274 | return responsedata; | 300 | return responsedata; |
275 | } | 301 | } |
276 | |||
277 | /* | ||
278 | responsedata["int_response_code"] = 200; | ||
279 | responsedata["content_type"] = "application/xml"; | ||
280 | responsedata["keepalive"] = true; | ||
281 | |||
282 | responsedata["str_response_string"] = @"<llsd><map><key>events</key><array><map><key>body</key><map><key>AgentData</key><map><key>AgentID</key> | ||
283 | <uuid>0fd0e798-a54f-40b1-0000-000000000000</uuid><key>SessionID</key><uuid>cc91f1fe-9d52-435d-0000-000000000000 | ||
284 | </uuid></map><key>Info</key><map><key>LookAt</key><array><real>0.9869639873504638671875</real><real> | ||
285 | -0.1609439998865127563476562</real><real>0</real></array><key>Position</key><array><real>1.43747997283935546875 | ||
286 | </real><real>95.30560302734375</real><real>57.3480987548828125</real></array></map><key>RegionData</key><map> | ||
287 | <key>RegionHandle</key><binary encoding=" + "\"base64\"" + @">AAPnAAAD8AA=</binary><key>SeedCapability</key><string> | ||
288 | https://sim7.aditi.lindenlab.com:12043/cap/64015fb3-6fee-9205-0000-000000000000</string><key>SimIP</key><binary | ||
289 | encoding=" + "\"base64\"" + @">yA8FSA==</binary><key>SimPort</key><integer>13005</integer></map></map><key>message</key> | ||
290 | <string>CrossedRegion</string></map></array><key>id</key><integer>1</integer></map></llsd>"; | ||
291 | |||
292 | */ | ||
293 | //string requestbody = (string)request["requestbody"]; | ||
294 | //LLSD llsdRequest = LLSDParser.DeserializeXml(request); | ||
295 | //System.Console.WriteLine(requestbody); | ||
296 | |||
297 | } | 302 | } |
298 | } | 303 | } |
299 | } | 304 | } |