From 39f340e6875c55927fc9dbeb51af2357c7d28c04 Mon Sep 17 00:00:00 2001 From: Johan Berntsson Date: Mon, 24 Mar 2008 01:37:00 +0000 Subject: XmlRpcCommand refactoring --- OpenSim/Region/Application/OpenSimMain.cs | 37 ++----------------------------- 1 file changed, 2 insertions(+), 35 deletions(-) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index aa5a432..35f146d 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs @@ -461,7 +461,7 @@ namespace OpenSim { // set proxy url to RegionInfo regionInfo.proxyUrl = proxyUrl; - ProxyCommand(proxyUrl, "AddPort", port, port + proxyOffset, regionInfo.ExternalHostName); + Util.XmlRpcCommand(proxyUrl, "AddPort", port, port + proxyOffset, regionInfo.ExternalHostName); } UDPServer udpServer; @@ -618,7 +618,7 @@ namespace OpenSim /// public virtual void Shutdown() { - ProxyCommand(proxyUrl, "Stop"); + Util.XmlRpcCommand(proxyUrl, "Stop"); if (m_startupCommandsFile != String.Empty) { @@ -1200,39 +1200,6 @@ namespace OpenSim #endregion - // TODO: remove me!! (almost same as XmlRpcCommand) - public object ProxyCommand(string url, string methodName, params object[] args) - { - if(proxyUrl.Length==0) return null; - return SendXmlRpcCommand(url, methodName, args); - } - - public object XmlRpcCommand(uint port, string methodName, params object[] args) - { - return SendXmlRpcCommand("http://localhost:"+port, methodName, args); - } - - public object XmlRpcCommand(string url, string methodName, params object[] args) - { - return SendXmlRpcCommand(url, methodName, args); - } - - private object SendXmlRpcCommand(string url, string methodName, object[] args) - { - try { - //MainLog.Instance.Verbose("XMLRPC", "Sending command {0} to {1}", methodName, url); - XmlRpcRequest client = new XmlRpcRequest(methodName, args); - //MainLog.Instance.Verbose("XMLRPC", client.ToString()); - XmlRpcResponse response = client.Send(url, 6000); - if(!response.IsFault) return response.Value; - } - catch(Exception e) - { - m_log.ErrorFormat("XMLRPC Failed to send command {0} to {1}: {2}", methodName, url, e.Message); - } - return null; - } - /// /// Get the start time and up time of Region server /// -- cgit v1.1