From ed300f21f0256e4990a91fec79927b723223fa98 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sun, 23 Nov 2008 06:44:43 +0000 Subject: 05:24:49 - [PRESENCE]: Logging off 888760cb-a3cf-43ac-8ea4-8732fd3ee2bb because the region they were in has gone Or, in other words, a region crash/restart no longer messes up presence. --- OpenSim/Grid/MessagingServer/Main.cs | 1 + OpenSim/Grid/MessagingServer/MessageService.cs | 30 ++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) (limited to 'OpenSim/Grid/MessagingServer') diff --git a/OpenSim/Grid/MessagingServer/Main.cs b/OpenSim/Grid/MessagingServer/Main.cs index 5568f73..0e03df1 100644 --- a/OpenSim/Grid/MessagingServer/Main.cs +++ b/OpenSim/Grid/MessagingServer/Main.cs @@ -90,6 +90,7 @@ namespace OpenSim.Grid.MessagingServer m_httpServer.AddXmlRPCHandler("get_presence_info_bulk", msgsvc.GetPresenceInfoBulk); m_httpServer.AddXmlRPCHandler("region_startup", msgsvc.RegionStartup); m_httpServer.AddXmlRPCHandler("region_shutdown", msgsvc.RegionShutdown); + m_httpServer.AddXmlRPCHandler("process_region_shutdown", msgsvc.ProcessRegionShutdown); m_httpServer.AddXmlRPCHandler("agent_location", msgsvc.AgentLocation); m_httpServer.AddXmlRPCHandler("agent_leaving", msgsvc.AgentLeaving); diff --git a/OpenSim/Grid/MessagingServer/MessageService.cs b/OpenSim/Grid/MessagingServer/MessageService.cs index a4e54c7..a8ee9d5 100644 --- a/OpenSim/Grid/MessagingServer/MessageService.cs +++ b/OpenSim/Grid/MessagingServer/MessageService.cs @@ -666,5 +666,35 @@ namespace OpenSim.Grid.MessagingServer response.Value = result; return response; } + + public XmlRpcResponse ProcessRegionShutdown(XmlRpcRequest request) + { + Hashtable requestData = (Hashtable)request.Params[0]; + Hashtable result = new Hashtable(); + result["success"] = "FALSE"; + + UUID regionID; + if (UUID.TryParse((string)requestData["regionid"], out regionID)) + { + m_log.DebugFormat("[PRESENCE] Processing region restart for {0}", regionID); + result["success"] = "TRUE"; + + foreach (UserPresenceData up in m_presences.Values) + { + if(up.regionData.UUID == regionID) + { + if (up.OnlineYN) + { + m_log.DebugFormat("[PRESENCE] Logging off {0} because the region they were in has gone", up.agentData.AgentID); + ProcessLogOff(up.agentData.AgentID); + } + } + } + } + + XmlRpcResponse response = new XmlRpcResponse(); + response.Value = result; + return response; + } } } -- cgit v1.1