From 9b9f93c4b2f65e85129e50587a2ee63dd1d4f374 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 16 Dec 2016 20:31:07 +0000 Subject: and yes HG uri again --- OpenSim/Framework/Util.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'OpenSim/Framework/Util.cs') diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 5d8a5e0..b622523 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -414,6 +414,26 @@ namespace OpenSim.Framework return regionCoord << 8; } + public static bool checkServiceURI(string uristr, out string serviceURI) + { + serviceURI = string.Empty; + try + { + Uri uri = new Uri(uristr); + serviceURI = uri.AbsoluteUri; + if(uri.Port == 80) + serviceURI = serviceURI.Trim(new char[] { '/', ' ' }) +":80/"; + else if(uri.Port == 443) + serviceURI = serviceURI.Trim(new char[] { '/', ' ' }) +":443/"; + return true; + } + catch + { + serviceURI = string.Empty; + } + return false; + } + public static bool buildHGRegionURI(string inputName, out string serverURI, out string regionName) { serverURI = string.Empty; -- cgit v1.1