From 50a88ed2e46e76117d8c33d37b037bb8ae2ad14d Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 15 Aug 2010 17:25:27 -0700 Subject: [PATCH] Thanks Marck for the patch to mantis #4941 (shortening avies' names on HG) --- .../Services/HypergridService/GatekeeperService.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs index 3aaafe8efd..6f041dae21 100644 --- a/OpenSim/Services/HypergridService/GatekeeperService.cs +++ b/OpenSim/Services/HypergridService/GatekeeperService.cs @@ -259,7 +259,16 @@ namespace OpenSim.Services.HypergridService if (account == null && !aCircuit.lastname.StartsWith("@")) { aCircuit.firstname = aCircuit.firstname + "." + aCircuit.lastname; - aCircuit.lastname = "@" + aCircuit.ServiceURLs["HomeURI"].ToString(); + try + { + Uri uri = new Uri(aCircuit.ServiceURLs["HomeURI"].ToString()); + aCircuit.lastname = "@" + uri.Host; // + ":" + uri.Port; + } + catch + { + m_log.WarnFormat("[GATEKEEPER SERVICE]: Malformed HomeURI (this should never happen): {0}", aCircuit.ServiceURLs["HomeURI"]); + aCircuit.lastname = "@" + aCircuit.ServiceURLs["HomeURI"].ToString(); + } } //