aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/MessageServerConfig.cs21
-rw-r--r--OpenSim/Framework/Servers/MessageServerInfo.cs4
-rw-r--r--OpenSim/Grid/GridServer/GridManager.cs63
-rw-r--r--OpenSim/Grid/GridServer/Main.cs5
-rw-r--r--OpenSim/Grid/MessagingServer/Main.cs8
-rw-r--r--OpenSim/Grid/UserServer/MessageServersConnector.cs4
6 files changed, 95 insertions, 10 deletions
diff --git a/OpenSim/Framework/MessageServerConfig.cs b/OpenSim/Framework/MessageServerConfig.cs
index 2859c25..5cef362 100644
--- a/OpenSim/Framework/MessageServerConfig.cs
+++ b/OpenSim/Framework/MessageServerConfig.cs
@@ -41,6 +41,10 @@ namespace OpenSim.Framework
41 public string UserSendKey = ""; 41 public string UserSendKey = "";
42 public string UserRecvKey = ""; 42 public string UserRecvKey = "";
43 43
44 public string GridServerURL = "";
45 public string GridSendKey = "";
46 public string GridRecvKey = "";
47
44 public string DatabaseProvider = ""; 48 public string DatabaseProvider = "";
45 public string GridCommsProvider = ""; 49 public string GridCommsProvider = "";
46 50
@@ -68,6 +72,14 @@ namespace OpenSim.Framework
68 "Key to send to user server", "null", false); 72 "Key to send to user server", "null", false);
69 configMember.addConfigurationOption("user_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, 73 configMember.addConfigurationOption("user_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
70 "Key to expect from user server", "null", false); 74 "Key to expect from user server", "null", false);
75 configMember.addConfigurationOption("default_grid_server",
76 ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
77 "Default Grid Server URI",
78 "http://127.0.0.1:8002/", false);
79 configMember.addConfigurationOption("grid_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
80 "Key to send to grid server", "null", false);
81 configMember.addConfigurationOption("grid_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
82 "Key to expect from user server", "null", false);
71 83
72 configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, 84 configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
73 "DLL for database provider", "OpenSim.Framework.Data.MySQL.dll", false); 85 "DLL for database provider", "OpenSim.Framework.Data.MySQL.dll", false);
@@ -96,6 +108,15 @@ namespace OpenSim.Framework
96 case "user_recv_key": 108 case "user_recv_key":
97 UserRecvKey = (string)configuration_result; 109 UserRecvKey = (string)configuration_result;
98 break; 110 break;
111 case "default_grid_server":
112 GridServerURL = (string)configuration_result;
113 break;
114 case "grid_send_key":
115 GridSendKey = (string)configuration_result;
116 break;
117 case "grid_recv_key":
118 GridRecvKey = (string)configuration_result;
119 break;
99 case "database_provider": 120 case "database_provider":
100 DatabaseProvider = (string)configuration_result; 121 DatabaseProvider = (string)configuration_result;
101 break; 122 break;
diff --git a/OpenSim/Framework/Servers/MessageServerInfo.cs b/OpenSim/Framework/Servers/MessageServerInfo.cs
index 13d65f9..9d5fa8a 100644
--- a/OpenSim/Framework/Servers/MessageServerInfo.cs
+++ b/OpenSim/Framework/Servers/MessageServerInfo.cs
@@ -13,5 +13,9 @@ namespace OpenSim.Framework.Servers
13 public MessageServerInfo() 13 public MessageServerInfo()
14 { 14 {
15 } 15 }
16 public override string ToString()
17 {
18 return URI;
19 }
16 } 20 }
17} 21}
diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs
index 31500c0..61f1fd7 100644
--- a/OpenSim/Grid/GridServer/GridManager.cs
+++ b/OpenSim/Grid/GridServer/GridManager.cs
@@ -36,6 +36,8 @@ using Nwc.XmlRpc;
36using OpenSim.Framework; 36using OpenSim.Framework;
37using OpenSim.Framework.Console; 37using OpenSim.Framework.Console;
38using OpenSim.Framework.Data; 38using OpenSim.Framework.Data;
39using OpenSim.Framework.Servers;
40
39 41
40namespace OpenSim.Grid.GridServer 42namespace OpenSim.Grid.GridServer
41{ 43{
@@ -43,6 +45,7 @@ namespace OpenSim.Grid.GridServer
43 { 45 {
44 private Dictionary<string, IGridData> _plugins = new Dictionary<string, IGridData>(); 46 private Dictionary<string, IGridData> _plugins = new Dictionary<string, IGridData>();
45 private Dictionary<string, ILogData> _logplugins = new Dictionary<string, ILogData>(); 47 private Dictionary<string, ILogData> _logplugins = new Dictionary<string, ILogData>();
48 private List<MessageServerInfo> _MessageServers = new List<MessageServerInfo>();
46 49
47 public GridConfig config; 50 public GridConfig config;
48 51
@@ -414,7 +417,20 @@ namespace OpenSim.Grid.GridServer
414 417
415 responseData["allow_forceful_banlines"] = config.AllowForcefulBanlines; 418 responseData["allow_forceful_banlines"] = config.AllowForcefulBanlines;
416 419
420 // Instead of sending a multitude of message servers to the registering sim
421 // we should probably be sending a single one and parhaps it's backup
422 // that has responsibility over routing it's messages.
423
424 // The Sim won't be contacting us again about any of the message server stuff during it's time up.
425
426 responseData["messageserver_count"] = _MessageServers.Count;
417 427
428 for (int i = 0; i < _MessageServers.Count; i++)
429 {
430 responseData["messageserver_uri" + i] = _MessageServers[i].URI;
431 responseData["messageserver_sendkey" + i] = _MessageServers[i].sendkey;
432 responseData["messageserver_recvkey" + i] = _MessageServers[i].recvkey;
433 }
418 return response; 434 return response;
419 435
420 } 436 }
@@ -424,6 +440,7 @@ namespace OpenSim.Grid.GridServer
424 responseData["error"] = "Another region already exists at that location. Try another"; 440 responseData["error"] = "Another region already exists at that location. Try another";
425 return response; 441 return response;
426 } 442 }
443
427 } 444 }
428 445
429 public XmlRpcResponse XmlRpcSimulatorDataRequestMethod(XmlRpcRequest request) 446 public XmlRpcResponse XmlRpcSimulatorDataRequestMethod(XmlRpcRequest request)
@@ -767,5 +784,49 @@ namespace OpenSim.Grid.GridServer
767 return "ERROR! Could not save to database! (" + e.ToString() + ")"; 784 return "ERROR! Could not save to database! (" + e.ToString() + ")";
768 } 785 }
769 } 786 }
787 public XmlRpcResponse XmlRPCRegisterMessageServer(XmlRpcRequest request)
788 {
789 XmlRpcResponse response = new XmlRpcResponse();
790 Hashtable requestData = (Hashtable)request.Params[0];
791 Hashtable responseData = new Hashtable();
792
793 if (requestData.Contains("uri"))
794 {
795 string URI = (string)requestData["URI"];
796 string sendkey = (string)requestData["sendkey"];
797 string recvkey = (string)requestData["recvkey"];
798 MessageServerInfo m = new MessageServerInfo();
799 m.URI = URI;
800 m.sendkey = sendkey;
801 m.recvkey = recvkey;
802 if (!_MessageServers.Contains(m))
803 _MessageServers.Add(m);
804 responseData["responsestring"] = "TRUE";
805 response.Value = responseData;
806 }
807 return response;
808 }
809 public XmlRpcResponse XmlRPCDeRegisterMessageServer(XmlRpcRequest request)
810 {
811 XmlRpcResponse response = new XmlRpcResponse();
812 Hashtable requestData = (Hashtable)request.Params[0];
813 Hashtable responseData = new Hashtable();
814
815 if (requestData.Contains("uri"))
816 {
817 string URI = (string)requestData["uri"];
818 string sendkey = (string)requestData["sendkey"];
819 string recvkey = (string)requestData["recvkey"];
820 MessageServerInfo m = new MessageServerInfo();
821 m.URI = URI;
822 m.sendkey = sendkey;
823 m.recvkey = recvkey;
824 if (_MessageServers.Contains(m))
825 _MessageServers.Remove(m);
826 responseData["responsestring"] = "TRUE";
827 response.Value = responseData;
828 }
829 return response;
830 }
770 } 831 }
771} \ No newline at end of file 832}
diff --git a/OpenSim/Grid/GridServer/Main.cs b/OpenSim/Grid/GridServer/Main.cs
index cdd37c4..6bb4c75 100644
--- a/OpenSim/Grid/GridServer/Main.cs
+++ b/OpenSim/Grid/GridServer/Main.cs
@@ -119,6 +119,11 @@ namespace OpenSim.Grid.GridServer
119 httpServer.AddXmlRPCHandler("simulator_data_request", m_gridManager.XmlRpcSimulatorDataRequestMethod); 119 httpServer.AddXmlRPCHandler("simulator_data_request", m_gridManager.XmlRpcSimulatorDataRequestMethod);
120 httpServer.AddXmlRPCHandler("map_block", m_gridManager.XmlRpcMapBlockMethod); 120 httpServer.AddXmlRPCHandler("map_block", m_gridManager.XmlRpcMapBlockMethod);
121 121
122 // Message Server ---> Grid Server
123 httpServer.AddXmlRPCHandler("register_messageserver", m_gridManager.XmlRPCRegisterMessageServer);
124 httpServer.AddXmlRPCHandler("deregister_messageserver", m_gridManager.XmlRPCDeRegisterMessageServer);
125
126
122 httpServer.AddStreamHandler(new RestStreamHandler("GET", "/sims/", m_gridManager.RestGetSimMethod)); 127 httpServer.AddStreamHandler(new RestStreamHandler("GET", "/sims/", m_gridManager.RestGetSimMethod));
123 httpServer.AddStreamHandler(new RestStreamHandler("POST", "/sims/", m_gridManager.RestSetSimMethod)); 128 httpServer.AddStreamHandler(new RestStreamHandler("POST", "/sims/", m_gridManager.RestSetSimMethod));
124 129
diff --git a/OpenSim/Grid/MessagingServer/Main.cs b/OpenSim/Grid/MessagingServer/Main.cs
index 8f64113..a7c3a2a 100644
--- a/OpenSim/Grid/MessagingServer/Main.cs
+++ b/OpenSim/Grid/MessagingServer/Main.cs
@@ -85,13 +85,7 @@ namespace OpenSim.Grid.MessagingServer
85 { 85 {
86 Cfg = new MessageServerConfig("MESSAGING SERVER", (Path.Combine(Util.configDir(), "MessagingServer_Config.xml"))); 86 Cfg = new MessageServerConfig("MESSAGING SERVER", (Path.Combine(Util.configDir(), "MessagingServer_Config.xml")));
87 87
88 //MainLog.Instance.Verbose("REGION", "Establishing data connection"); 88
89 //m_userManager = new UserManager();
90 //m_userManager._config = Cfg;
91 //m_userManager.AddPlugin(Cfg.DatabaseProvider);
92
93 //m_loginService = new UserLoginService(
94 //m_userManager, new LibraryRootFolder(), Cfg, Cfg.DefaultStartupMsg);
95 89
96 MainLog.Instance.Verbose("REGION", "Starting HTTP process"); 90 MainLog.Instance.Verbose("REGION", "Starting HTTP process");
97 BaseHttpServer httpServer = new BaseHttpServer(Cfg.HttpPort); 91 BaseHttpServer httpServer = new BaseHttpServer(Cfg.HttpPort);
diff --git a/OpenSim/Grid/UserServer/MessageServersConnector.cs b/OpenSim/Grid/UserServer/MessageServersConnector.cs
index deec739..7966868 100644
--- a/OpenSim/Grid/UserServer/MessageServersConnector.cs
+++ b/OpenSim/Grid/UserServer/MessageServersConnector.cs
@@ -72,7 +72,7 @@ namespace OpenSim.Grid.UserServer
72 72
73 if (requestData.Contains("uri")) 73 if (requestData.Contains("uri"))
74 { 74 {
75 string URI = (string)requestData["URI"]; 75 string URI = (string)requestData["uri"];
76 string sendkey=(string)requestData["sendkey"]; 76 string sendkey=(string)requestData["sendkey"];
77 string recvkey=(string)requestData["recvkey"]; 77 string recvkey=(string)requestData["recvkey"];
78 MessageServerInfo m = new MessageServerInfo(); 78 MessageServerInfo m = new MessageServerInfo();
@@ -146,7 +146,7 @@ namespace OpenSim.Grid.UserServer
146 ArrayList SendParams = new ArrayList(); 146 ArrayList SendParams = new ArrayList();
147 SendParams.Add(reqparams); 147 SendParams.Add(reqparams);
148 148
149 XmlRpcRequest GridReq = new XmlRpcRequest("user_login", SendParams); 149 XmlRpcRequest GridReq = new XmlRpcRequest("login_to_simulator", SendParams);
150 XmlRpcResponse GridResp = GridReq.Send(serv.URI, 6000); 150 XmlRpcResponse GridResp = GridReq.Send(serv.URI, 6000);
151 m_log.Verbose("LOGIN","Notified : " + serv.URI + " about user login"); 151 m_log.Verbose("LOGIN","Notified : " + serv.URI + " about user login");
152 152