diff options
author | MW | 2009-02-21 18:41:28 +0000 |
---|---|---|
committer | MW | 2009-02-21 18:41:28 +0000 |
commit | e77b5d990d275f3a900d844e955bb92f6dba08aa (patch) | |
tree | 8dc84f9dbc540e13efc0f243fdb9eed1a7ee6b61 /OpenSim/Grid/GridServer/GridXmlRpcModule.cs | |
parent | Thank you kindly, DoranZemlja for a patch that: (diff) | |
download | opensim-SC-e77b5d990d275f3a900d844e955bb92f6dba08aa.zip opensim-SC-e77b5d990d275f3a900d844e955bb92f6dba08aa.tar.gz opensim-SC-e77b5d990d275f3a900d844e955bb92f6dba08aa.tar.bz2 opensim-SC-e77b5d990d275f3a900d844e955bb92f6dba08aa.tar.xz |
More Grid server refactoring
Diffstat (limited to 'OpenSim/Grid/GridServer/GridXmlRpcModule.cs')
-rw-r--r-- | OpenSim/Grid/GridServer/GridXmlRpcModule.cs | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/OpenSim/Grid/GridServer/GridXmlRpcModule.cs b/OpenSim/Grid/GridServer/GridXmlRpcModule.cs index c2cd1d6..86df81c 100644 --- a/OpenSim/Grid/GridServer/GridXmlRpcModule.cs +++ b/OpenSim/Grid/GridServer/GridXmlRpcModule.cs | |||
@@ -46,7 +46,7 @@ namespace OpenSim.Grid.GridServer | |||
46 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 46 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
47 | 47 | ||
48 | private GridDBService m_gridDBService; | 48 | private GridDBService m_gridDBService; |
49 | private IGridCore m_gridCore; | 49 | private IUGAIMCore m_gridCore; |
50 | 50 | ||
51 | protected GridConfig m_config; | 51 | protected GridConfig m_config; |
52 | 52 | ||
@@ -67,12 +67,23 @@ namespace OpenSim.Grid.GridServer | |||
67 | { | 67 | { |
68 | } | 68 | } |
69 | 69 | ||
70 | public void Initialise(string opensimVersion, GridDBService gridDBService, IGridCore gridCore, GridConfig config) | 70 | public void Initialise(string opensimVersion, GridDBService gridDBService, IUGAIMCore gridCore, GridConfig config) |
71 | { | 71 | { |
72 | m_opensimVersion = opensimVersion; | 72 | m_opensimVersion = opensimVersion; |
73 | m_gridDBService = gridDBService; | 73 | m_gridDBService = gridDBService; |
74 | m_gridCore = gridCore; | 74 | m_gridCore = gridCore; |
75 | m_config = config; | 75 | m_config = config; |
76 | RegisterHandlers(); | ||
77 | } | ||
78 | |||
79 | public void PostInitialise() | ||
80 | { | ||
81 | |||
82 | } | ||
83 | |||
84 | public void RegisterHandlers() | ||
85 | { | ||
86 | //have these in separate method as some servers restart the http server and reregister all the handlers. | ||
76 | m_httpServer = m_gridCore.GetHttpServer(); | 87 | m_httpServer = m_gridCore.GetHttpServer(); |
77 | 88 | ||
78 | m_httpServer.AddXmlRPCHandler("simulator_login", XmlRpcSimulatorLoginMethod); | 89 | m_httpServer.AddXmlRPCHandler("simulator_login", XmlRpcSimulatorLoginMethod); |
@@ -81,7 +92,7 @@ namespace OpenSim.Grid.GridServer | |||
81 | m_httpServer.AddXmlRPCHandler("map_block", XmlRpcMapBlockMethod); | 92 | m_httpServer.AddXmlRPCHandler("map_block", XmlRpcMapBlockMethod); |
82 | m_httpServer.AddXmlRPCHandler("search_for_region_by_name", XmlRpcSearchForRegionMethod); | 93 | m_httpServer.AddXmlRPCHandler("search_for_region_by_name", XmlRpcSearchForRegionMethod); |
83 | } | 94 | } |
84 | 95 | ||
85 | /// <summary> | 96 | /// <summary> |
86 | /// Returns a XML String containing a list of the neighbouring regions | 97 | /// Returns a XML String containing a list of the neighbouring regions |
87 | /// </summary> | 98 | /// </summary> |
@@ -305,7 +316,7 @@ namespace OpenSim.Grid.GridServer | |||
305 | return e.XmlRpcErrorResponse; | 316 | return e.XmlRpcErrorResponse; |
306 | } | 317 | } |
307 | 318 | ||
308 | DataResponse insertResponse = m_gridDBService.LoginRegion(sim, existingSim); | 319 | DataResponse insertResponse = m_gridDBService.AddUpdateRegion(sim, existingSim); |
309 | 320 | ||
310 | switch (insertResponse) | 321 | switch (insertResponse) |
311 | { | 322 | { |
@@ -557,7 +568,7 @@ namespace OpenSim.Grid.GridServer | |||
557 | //TheSim = GetRegion(new UUID((string) requestData["UUID"])); | 568 | //TheSim = GetRegion(new UUID((string) requestData["UUID"])); |
558 | uuid = requestData["UUID"].ToString(); | 569 | uuid = requestData["UUID"].ToString(); |
559 | m_log.InfoFormat("[LOGOUT]: Logging out region: {0}", uuid); | 570 | m_log.InfoFormat("[LOGOUT]: Logging out region: {0}", uuid); |
560 | // logToDB((new LLUUID((string)requestData["UUID"])).ToString(),"XmlRpcDeleteRegionMethod","", 5,"Attempting delete with UUID."); | 571 | // logToDB((new LLUUID((string)requestData["UUID"])).ToString(),"XmlRpcDeleteRegionMethod","", 5,"Attempting delete with UUID."); |
561 | } | 572 | } |
562 | else | 573 | else |
563 | { | 574 | { |
@@ -849,13 +860,15 @@ namespace OpenSim.Grid.GridServer | |||
849 | } | 860 | } |
850 | private XmlRpcResponse m_xmlRpcErrorResponse; | 861 | private XmlRpcResponse m_xmlRpcErrorResponse; |
851 | 862 | ||
852 | public LoginException(string message, string xmlRpcMessage) : base(message) | 863 | public LoginException(string message, string xmlRpcMessage) |
864 | : base(message) | ||
853 | { | 865 | { |
854 | // FIXME: Might be neater to refactor and put the method inside here | 866 | // FIXME: Might be neater to refactor and put the method inside here |
855 | m_xmlRpcErrorResponse = GridXmlRpcModule.ErrorResponse(xmlRpcMessage); | 867 | m_xmlRpcErrorResponse = GridXmlRpcModule.ErrorResponse(xmlRpcMessage); |
856 | } | 868 | } |
857 | 869 | ||
858 | public LoginException(string message, string xmlRpcMessage, Exception e) : base(message, e) | 870 | public LoginException(string message, string xmlRpcMessage, Exception e) |
871 | : base(message, e) | ||
859 | { | 872 | { |
860 | // FIXME: Might be neater to refactor and put the method inside here | 873 | // FIXME: Might be neater to refactor and put the method inside here |
861 | m_xmlRpcErrorResponse = GridXmlRpcModule.ErrorResponse(xmlRpcMessage); | 874 | m_xmlRpcErrorResponse = GridXmlRpcModule.ErrorResponse(xmlRpcMessage); |