aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/MessagingServer
diff options
context:
space:
mode:
authorMelanie Thielker2008-11-23 05:16:07 +0000
committerMelanie Thielker2008-11-23 05:16:07 +0000
commitcbd02218704287640ba5c7b564440a6590e038cf (patch)
treee600fd4868bce3e3d007d6d1894dd814d948692a /OpenSim/Grid/MessagingServer
parentMantis#2660. Thank you kindly, Ruud Lathrop for a patch that: (diff)
downloadopensim-SC_OLD-cbd02218704287640ba5c7b564440a6590e038cf.zip
opensim-SC_OLD-cbd02218704287640ba5c7b564440a6590e038cf.tar.gz
opensim-SC_OLD-cbd02218704287640ba5c7b564440a6590e038cf.tar.bz2
opensim-SC_OLD-cbd02218704287640ba5c7b564440a6590e038cf.tar.xz
Plumb in the presence notifications and region shutdown/restart messages
from the presence module to the message server, through the user server and on into the database. This should fix the "Already logged in" issue that grids see after a sim crashes, or a user crashes out of a sim. Not yet a 100% solution for friends, but getting there.
Diffstat (limited to 'OpenSim/Grid/MessagingServer')
-rw-r--r--OpenSim/Grid/MessagingServer/Main.cs4
-rw-r--r--OpenSim/Grid/MessagingServer/MessageService.cs77
2 files changed, 74 insertions, 7 deletions
diff --git a/OpenSim/Grid/MessagingServer/Main.cs b/OpenSim/Grid/MessagingServer/Main.cs
index 8472571..5568f73 100644
--- a/OpenSim/Grid/MessagingServer/Main.cs
+++ b/OpenSim/Grid/MessagingServer/Main.cs
@@ -88,6 +88,10 @@ namespace OpenSim.Grid.MessagingServer
88 m_httpServer.AddXmlRPCHandler("login_to_simulator", msgsvc.UserLoggedOn); 88 m_httpServer.AddXmlRPCHandler("login_to_simulator", msgsvc.UserLoggedOn);
89 m_httpServer.AddXmlRPCHandler("logout_of_simulator", msgsvc.UserLoggedOff); 89 m_httpServer.AddXmlRPCHandler("logout_of_simulator", msgsvc.UserLoggedOff);
90 m_httpServer.AddXmlRPCHandler("get_presence_info_bulk", msgsvc.GetPresenceInfoBulk); 90 m_httpServer.AddXmlRPCHandler("get_presence_info_bulk", msgsvc.GetPresenceInfoBulk);
91 m_httpServer.AddXmlRPCHandler("region_startup", msgsvc.RegionStartup);
92 m_httpServer.AddXmlRPCHandler("region_shutdown", msgsvc.RegionShutdown);
93 m_httpServer.AddXmlRPCHandler("agent_location", msgsvc.AgentLocation);
94 m_httpServer.AddXmlRPCHandler("agent_leaving", msgsvc.AgentLeaving);
91 95
92 m_httpServer.Start(); 96 m_httpServer.Start();
93 m_log.Info("[SERVER]: Userserver registration was successful"); 97 m_log.Info("[SERVER]: Userserver registration was successful");
diff --git a/OpenSim/Grid/MessagingServer/MessageService.cs b/OpenSim/Grid/MessagingServer/MessageService.cs
index 66916b6..a4e54c7 100644
--- a/OpenSim/Grid/MessagingServer/MessageService.cs
+++ b/OpenSim/Grid/MessagingServer/MessageService.cs
@@ -558,24 +558,30 @@ namespace OpenSim.Grid.MessagingServer
558 558
559 public bool deregisterWithUserServer() 559 public bool deregisterWithUserServer()
560 { 560 {
561 Hashtable UserParams = new Hashtable(); 561 Hashtable request = new Hashtable();
562
563 return SendToUserServer(request, "deregister_messageserver");
564 }
565
566 public bool SendToUserServer(Hashtable request, string method)
567 {
562 // Login / Authentication 568 // Login / Authentication
563 569
564 if (m_cfg.HttpSSL) 570 if (m_cfg.HttpSSL)
565 { 571 {
566 UserParams["uri"] = "https://" + m_cfg.MessageServerIP + ":" + m_cfg.HttpPort; 572 request["uri"] = "https://" + m_cfg.MessageServerIP + ":" + m_cfg.HttpPort;
567 } 573 }
568 else 574 else
569 { 575 {
570 UserParams["uri"] = "http://" + m_cfg.MessageServerIP + ":" + m_cfg.HttpPort; 576 request["uri"] = "http://" + m_cfg.MessageServerIP + ":" + m_cfg.HttpPort;
571 } 577 }
572 578
573 UserParams["recvkey"] = m_cfg.UserRecvKey; 579 request["recvkey"] = m_cfg.UserRecvKey;
574 UserParams["sendkey"] = m_cfg.UserRecvKey; 580 request["sendkey"] = m_cfg.UserRecvKey;
575 581
576 // Package into an XMLRPC Request 582 // Package into an XMLRPC Request
577 ArrayList SendParams = new ArrayList(); 583 ArrayList SendParams = new ArrayList();
578 SendParams.Add(UserParams); 584 SendParams.Add(request);
579 585
580 bool success = true; 586 bool success = true;
581 string[] servers = m_cfg.UserServerURL.Split(' '); 587 string[] servers = m_cfg.UserServerURL.Split(' ');
@@ -585,7 +591,7 @@ namespace OpenSim.Grid.MessagingServer
585 { 591 {
586 try 592 try
587 { 593 {
588 XmlRpcRequest UserReq = new XmlRpcRequest("deregister_messageserver", SendParams); 594 XmlRpcRequest UserReq = new XmlRpcRequest(method, SendParams);
589 XmlRpcResponse UserResp = UserReq.Send(m_cfg.UserServerURL, 16000); 595 XmlRpcResponse UserResp = UserReq.Send(m_cfg.UserServerURL, 16000);
590 // Process Response 596 // Process Response
591 Hashtable UserRespData = (Hashtable)UserResp.Value; 597 Hashtable UserRespData = (Hashtable)UserResp.Value;
@@ -603,5 +609,62 @@ namespace OpenSim.Grid.MessagingServer
603 } 609 }
604 610
605 #endregion 611 #endregion
612
613 public XmlRpcResponse RegionStartup(XmlRpcRequest request)
614 {
615 Hashtable requestData = (Hashtable)request.Params[0];
616 Hashtable result = new Hashtable();
617 result["success"] = "FALSE";
618
619 if(SendToUserServer(requestData, "region_startup"))
620 result["success"] = "TRUE";
621
622 XmlRpcResponse response = new XmlRpcResponse();
623 response.Value = result;
624 return response;
625 }
626
627 public XmlRpcResponse RegionShutdown(XmlRpcRequest request)
628 {
629 Hashtable requestData = (Hashtable)request.Params[0];
630 Hashtable result = new Hashtable();
631 result["success"] = "FALSE";
632
633 if(SendToUserServer(requestData, "region_shutdown"))
634 result["success"] = "TRUE";
635
636 XmlRpcResponse response = new XmlRpcResponse();
637 response.Value = result;
638 return response;
639 }
640
641 public XmlRpcResponse AgentLocation(XmlRpcRequest request)
642 {
643 Hashtable requestData = (Hashtable)request.Params[0];
644 Hashtable result = new Hashtable();
645 result["success"] = "FALSE";
646
647 if(SendToUserServer(requestData, "agent_location"))
648 result["success"] = "TRUE";
649
650
651 XmlRpcResponse response = new XmlRpcResponse();
652 response.Value = result;
653 return response;
654 }
655
656 public XmlRpcResponse AgentLeaving(XmlRpcRequest request)
657 {
658 Hashtable requestData = (Hashtable)request.Params[0];
659 Hashtable result = new Hashtable();
660 result["success"] = "FALSE";
661
662 if(SendToUserServer(requestData, "agent_leaving"))
663 result["success"] = "TRUE";
664
665 XmlRpcResponse response = new XmlRpcResponse();
666 response.Value = result;
667 return response;
668 }
606 } 669 }
607} 670}