aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/UserServer/MessageServersConnector.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Grid/UserServer/MessageServersConnector.cs')
-rw-r--r--OpenSim/Grid/UserServer/MessageServersConnector.cs53
1 files changed, 52 insertions, 1 deletions
diff --git a/OpenSim/Grid/UserServer/MessageServersConnector.cs b/OpenSim/Grid/UserServer/MessageServersConnector.cs
index 6659617..6da67d7 100644
--- a/OpenSim/Grid/UserServer/MessageServersConnector.cs
+++ b/OpenSim/Grid/UserServer/MessageServersConnector.cs
@@ -259,6 +259,25 @@ namespace OpenSim.Grid.UserServer
259 } 259 }
260 } 260 }
261 261
262 private void TellMessageServersAboutRegionShutdownInternal(UUID regionID)
263 {
264 lock (MessageServers)
265 {
266 if (MessageServers.Count > 0)
267 {
268 m_log.Info("[MSGCONNECTOR]: Sending region down notice to registered message servers");
269 }
270 else
271 {
272// m_log.Debug("[MSGCONNECTOR]: No Message Servers registered, ignoring");
273 }
274 foreach (MessageServerInfo serv in MessageServers.Values)
275 {
276 NotifyMessageServerAboutRegionShutdown(serv,regionID);
277 }
278 }
279 }
280
262 public void TellMessageServersAboutUserLogoff(UUID agentID) 281 public void TellMessageServersAboutUserLogoff(UUID agentID)
263 { 282 {
264 PresenceNotification notification = new PresenceNotification(); 283 PresenceNotification notification = new PresenceNotification();
@@ -269,6 +288,16 @@ namespace OpenSim.Grid.UserServer
269 m_NotifyQueue.Enqueue(notification); 288 m_NotifyQueue.Enqueue(notification);
270 } 289 }
271 290
291 public void TellMessageServersAboutRegionShutdown(UUID regionID)
292 {
293 PresenceNotification notification = new PresenceNotification();
294
295 notification.request = NotificationRequest.Shutdown;
296 notification.RegionID = regionID;
297
298 m_NotifyQueue.Enqueue(notification);
299 }
300
272 private void NotifyMessageServerAboutUserLogoff(MessageServerInfo serv, UUID agentID) 301 private void NotifyMessageServerAboutUserLogoff(MessageServerInfo serv, UUID agentID)
273 { 302 {
274 Hashtable reqparams = new Hashtable(); 303 Hashtable reqparams = new Hashtable();
@@ -289,6 +318,26 @@ namespace OpenSim.Grid.UserServer
289 m_log.Info("[LOGOUT]: Notified : " + serv.URI + " about user logout"); 318 m_log.Info("[LOGOUT]: Notified : " + serv.URI + " about user logout");
290 } 319 }
291 320
321 private void NotifyMessageServerAboutRegionShutdown(MessageServerInfo serv, UUID regionID)
322 {
323 Hashtable reqparams = new Hashtable();
324 reqparams["sendkey"] = serv.sendkey;
325 reqparams["regionid"] = regionID.ToString();
326 ArrayList SendParams = new ArrayList();
327 SendParams.Add(reqparams);
328
329 XmlRpcRequest GridReq = new XmlRpcRequest("process_region_shutdown", SendParams);
330 try
331 {
332 GridReq.Send(serv.URI, 6000);
333 }
334 catch (WebException)
335 {
336 m_log.Warn("[MSGCONNECTOR]: Unable to notify Message Server about region shutdown.");
337 }
338 m_log.Info("[REGION UPDOWN]: Notified : " + serv.URI + " about region state change");
339 }
340
292 private void NotifyMessageServerAboutUser(MessageServerInfo serv, 341 private void NotifyMessageServerAboutUser(MessageServerInfo serv,
293 UUID agentID, UUID sessionID, UUID RegionID, 342 UUID agentID, UUID sessionID, UUID RegionID,
294 ulong regionhandle, float positionX, float positionY, float positionZ, 343 ulong regionhandle, float positionX, float positionY, float positionZ,
@@ -331,7 +380,9 @@ namespace OpenSim.Grid.UserServer
331 PresenceNotification presence = m_NotifyQueue.Dequeue(); 380 PresenceNotification presence = m_NotifyQueue.Dequeue();
332 381
333 if (presence.request == NotificationRequest.Shutdown) 382 if (presence.request == NotificationRequest.Shutdown)
334 return; 383 {
384 TellMessageServersAboutRegionShutdownInternal(presence.RegionID);
385 }
335 386
336 if (presence.request == NotificationRequest.Login) 387 if (presence.request == NotificationRequest.Login)
337 { 388 {