aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/GridServer
diff options
context:
space:
mode:
authorTeravus Ovares2008-01-06 20:10:29 +0000
committerTeravus Ovares2008-01-06 20:10:29 +0000
commit04dbcee74c29f5a5876cc5cd14a01699c4716f6d (patch)
tree964e369d29d3e89c7417333431908128238311d3 /OpenSim/Grid/GridServer
parentAdded code to gridserver to prevent new region from connecting at X,Y locatio... (diff)
downloadopensim-SC_OLD-04dbcee74c29f5a5876cc5cd14a01699c4716f6d.zip
opensim-SC_OLD-04dbcee74c29f5a5876cc5cd14a01699c4716f6d.tar.gz
opensim-SC_OLD-04dbcee74c29f5a5876cc5cd14a01699c4716f6d.tar.bz2
opensim-SC_OLD-04dbcee74c29f5a5876cc5cd14a01699c4716f6d.tar.xz
* A few more Message Server comms related updates
Diffstat (limited to 'OpenSim/Grid/GridServer')
-rw-r--r--OpenSim/Grid/GridServer/GridManager.cs63
-rw-r--r--OpenSim/Grid/GridServer/Main.cs5
2 files changed, 67 insertions, 1 deletions
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