From 5ddb8b535e33ea6fbe668bad76c25f501f154bae Mon Sep 17 00:00:00 2001 From: Jonathan Freedman Date: Sat, 23 Oct 2010 00:18:19 -0400 Subject: * a bit of additional debugging: --- OpenSim/Services/HypergridService/UserAgentService.cs | 7 +++---- OpenSim/Services/LLLoginService/LLLoginService.cs | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs index eb19fe2..32b4249 100644 --- a/OpenSim/Services/HypergridService/UserAgentService.cs +++ b/OpenSim/Services/HypergridService/UserAgentService.cs @@ -135,8 +135,6 @@ namespace OpenSim.Services.HypergridService { m_log.DebugFormat("[USER AGENT SERVICE]: Request to login user {0} {1} (@{2}) to grid {3}", agentCircuit.firstname, agentCircuit.lastname, ((clientIP == null) ? "stored IP" : clientIP.Address.ToString()), gatekeeper.ServerURI); - - m_log.Debug("LATG final server uri -> " + finalDestination.ServerURI ); // Take the IP address + port of the gatekeeper (reg) plus the info of finalDestination GridRegion region = new GridRegion(gatekeeper); region.ServerURI = gatekeeper.ServerURI; @@ -150,12 +148,13 @@ namespace OpenSim.Services.HypergridService // Generate a new service session agentCircuit.ServiceSessionID = region.ServerURI + ";" + UUID.Random(); TravelingAgentInfo old = UpdateTravelInfo(agentCircuit, region); - - m_log.Debug("region ServerURI -> " + region.ServerURI); bool success = false; string myExternalIP = string.Empty; string gridName = gatekeeper.ServerURI; + + m_log.Debug("m_grid - " + m_GridName + ", gn - " + gridName); + if (m_GridName == gridName) success = m_GatekeeperService.LoginAgent(agentCircuit, finalDestination, out reason); else diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 127c4b2..b0b51c4 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -566,6 +566,7 @@ namespace OpenSim.Services.LLLoginService private GridRegion FindForeignRegion(string domainName, uint port, string regionName, out GridRegion gatekeeper) { + m_log.Debug("attempting to findforeignregion " + domainName + ":" + port.ToString() + ":" + regionName); gatekeeper = new GridRegion(); gatekeeper.ExternalHostName = domainName; gatekeeper.HttpPort = port; @@ -631,11 +632,9 @@ namespace OpenSim.Services.LLLoginService gatekeeper = new GridRegion(destination); gatekeeper.ExternalHostName = hostName; gatekeeper.HttpPort = (uint)port; - - } - else // login to foreign grid - { + gatekeeper.ServerURI = m_GatekeeperURL; } + m_log.Debug("no gatekeeper detected..... using " + m_GatekeeperURL); } bool success = false; -- cgit v1.1 From 0a56cfbfd53e4e5515ecba65466042e0f1b50341 Mon Sep 17 00:00:00 2001 From: Jonathan Freedman Date: Sat, 30 Oct 2010 22:51:52 -0400 Subject: * better semantics for link-region command * actually parse name for new link-region command --- OpenSim/Services/GridService/HypergridLinker.cs | 42 ++++++++++++------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs index 50da1bd..eed3207 100644 --- a/OpenSim/Services/GridService/HypergridLinker.cs +++ b/OpenSim/Services/GridService/HypergridLinker.cs @@ -128,8 +128,8 @@ namespace OpenSim.Services.GridService if (MainConsole.Instance != null) { MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-region", "link-region []", "Link a HyperGrid Region", RunCommand); - MainConsole.Instance.Commands.AddCommand("hypergrid", false, "legacy-link-region", - "legacy-link-region []", + MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-region", + "link-region []", "Link a hypergrid region (deprecated)", RunCommand); MainConsole.Instance.Commands.AddCommand("hypergrid", false, "unlink-region", "unlink-region ", @@ -206,14 +206,14 @@ namespace OpenSim.Services.GridService return null; } - public bool TryCreateLink(UUID scopeID, int xloc, int yloc, string externalRegionName, uint externalPort, string externalHostName, UUID ownerID, out GridRegion regInfo, out string reason) + public bool TryCreateLink(UUID scopeID, int xloc, int yloc, string remoteRegionName, uint externalPort, string externalHostName, UUID ownerID, out GridRegion regInfo, out string reason) { - return TryCreateLink(scopeID, xloc, yloc, externalRegionName, externalPort, externalHostName, null, ownerID, out regInfo, out reason); + return TryCreateLink(scopeID, xloc, yloc, remoteRegionName, externalPort, externalHostName, null, ownerID, out regInfo, out reason); } - public bool TryCreateLink(UUID scopeID, int xloc, int yloc, string externalRegionName, uint externalPort, string externalHostName, string serverURI, UUID ownerID, out GridRegion regInfo, out string reason) + public bool TryCreateLink(UUID scopeID, int xloc, int yloc, string remoteRegionName, uint externalPort, string externalHostName, string serverURI, UUID ownerID, out GridRegion regInfo, out string reason) { - m_log.DebugFormat("[HYPERGRID LINKER]: Link to {0}:{1}:{2}, in {3}-{4}", externalHostName, externalPort, externalRegionName, xloc, yloc); + m_log.DebugFormat("[HYPERGRID LINKER]: Link to {0}:{1}:{2}, in {3}-{4}", externalHostName, externalPort, remoteRegionName, xloc, yloc); reason = string.Empty; regInfo = new GridRegion(); @@ -227,6 +227,9 @@ namespace OpenSim.Services.GridService regInfo.ExternalHostName = "0.0.0.0"; if ( serverURI != null) regInfo.ServerURI = serverURI; + + if ( remoteRegionName != string.Empty ) + regInfo.RegionName = remoteRegionName; regInfo.RegionLocX = xloc; regInfo.RegionLocY = yloc; @@ -326,13 +329,6 @@ namespace OpenSim.Services.GridService } } - //foreach (GridRegion r in m_HyperlinkRegions.Values) - //{ - // m_log.DebugFormat("XXX Comparing {0}:{1} with {2}:{3}", host, port, r.ExternalHostName, r.HttpPort); - // if (host.Equals(r.ExternalHostName) && (port == r.HttpPort)) - // regInfo = r; - //} - if (regInfo != null) { RemoveHyperlinkRegion(regInfo.RegionID); @@ -500,7 +496,7 @@ namespace OpenSim.Services.GridService } return; } - else if (command.Equals("legacy-link-region")) + else if (command.Equals("link-region")) { if (cmdparams.Length < 3) { @@ -515,7 +511,11 @@ namespace OpenSim.Services.GridService return; } - if (cmdparams[2].Contains(":")) + //this should be the prefererred way of setting up hg links now + if ( cmdparams[2].StartsWith("http") && ( cmdparams.Length >= 3 && cmdparams.Length <= 5 )) { + RunLinkRegionCommand(cmdparams); + } + else if (cmdparams[2].Contains(":")) { // New format int xloc, yloc; @@ -578,7 +578,7 @@ namespace OpenSim.Services.GridService xloc = xloc * (int)Constants.RegionSize; yloc = yloc * (int)Constants.RegionSize; string reason = string.Empty; - if (TryCreateLink(UUID.Zero, xloc, yloc, "", externalPort, externalHostName, UUID.Zero, out regInfo, out reason)) + if (TryCreateLink(UUID.Zero, xloc, yloc, string.Empty, externalPort, externalHostName, UUID.Zero, out regInfo, out reason)) { if (cmdparams.Length >= 5) { @@ -592,7 +592,7 @@ namespace OpenSim.Services.GridService } else if (command.Equals("unlink-region")) { - if (cmdparams.Length < 1) + if (cmdparams.Length < 1 || cmdparams.Length > 1) { UnlinkRegionCmdUsage(); return; @@ -680,7 +680,7 @@ namespace OpenSim.Services.GridService xloc = xloc * (int)Constants.RegionSize; yloc = yloc * (int)Constants.RegionSize; string reason = string.Empty; - if (TryCreateLink(UUID.Zero, xloc, yloc, "", externalPort, externalHostName, UUID.Zero, out regInfo, out reason)) + if (TryCreateLink(UUID.Zero, xloc, yloc, string.Empty, externalPort, externalHostName, UUID.Zero, out regInfo, out reason)) { regInfo.RegionName = config.GetString("localName", ""); } @@ -692,14 +692,14 @@ namespace OpenSim.Services.GridService private void LinkRegionCmdUsage() { - MainConsole.Instance.Output("Usage: link-region :[:]"); - MainConsole.Instance.Output("Usage: link-region []"); + MainConsole.Instance.Output("Usage: link-region []"); + MainConsole.Instance.Output("Usage (deprecated): link-region :[:]"); + MainConsole.Instance.Output("Usage (deprecated): link-region []"); MainConsole.Instance.Output("Usage: link-region []"); } private void UnlinkRegionCmdUsage() { - MainConsole.Instance.Output("Usage: unlink-region :"); MainConsole.Instance.Output("Usage: unlink-region "); } -- cgit v1.1 From 72748746d53df1c033207452a4315d93bc780158 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 5 Dec 2010 19:43:24 -0800 Subject: Fixed some inconsistency with trailing /. Made debug messages consistent. Changed the stored region names of HG regions. Increased the size of regionName in DB. --- .../Hypergrid/GatekeeperServiceConnector.cs | 28 +++++++++++----------- OpenSim/Services/GridService/HypergridLinker.cs | 10 ++++---- .../Services/HypergridService/GatekeeperService.cs | 4 +++- .../Services/HypergridService/UserAgentService.cs | 6 +++-- OpenSim/Services/LLLoginService/LLLoginService.cs | 4 ++-- 5 files changed, 29 insertions(+), 23 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs index 70bafda..85c1380 100644 --- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs @@ -107,8 +107,8 @@ namespace OpenSim.Services.Connectors.Hypergrid } hash = (Hashtable)response.Value; - foreach (Object o in hash) - m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value); + //foreach (Object o in hash) + // m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value); try { bool success = false; @@ -116,19 +116,19 @@ namespace OpenSim.Services.Connectors.Hypergrid if (success) { UUID.TryParse((string)hash["uuid"], out regionID); - m_log.Debug(">> HERE, uuid: " + regionID); + //m_log.Debug(">> HERE, uuid: " + regionID); if ((string)hash["handle"] != null) { realHandle = Convert.ToUInt64((string)hash["handle"]); - m_log.Debug(">> HERE, realHandle: " + realHandle); + //m_log.Debug(">> HERE, realHandle: " + realHandle); } if (hash["region_image"] != null) { imageURL = (string)hash["region_image"]; - m_log.Debug(">> HERE, imageURL: " + imageURL); + //m_log.Debug(">> HERE, imageURL: " + imageURL); } if (hash["external_name"] != null) { externalName = (string)hash["external_name"]; - m_log.Debug(">> HERE, externalName: " + externalName); + //m_log.Debug(">> HERE, externalName: " + externalName); } } @@ -221,48 +221,48 @@ namespace OpenSim.Services.Connectors.Hypergrid GridRegion region = new GridRegion(); UUID.TryParse((string)hash["uuid"], out region.RegionID); - m_log.Debug(">> HERE, uuid: " + region.RegionID); + //m_log.Debug(">> HERE, uuid: " + region.RegionID); int n = 0; if (hash["x"] != null) { Int32.TryParse((string)hash["x"], out n); region.RegionLocX = n; - m_log.Debug(">> HERE, x: " + region.RegionLocX); + //m_log.Debug(">> HERE, x: " + region.RegionLocX); } if (hash["y"] != null) { Int32.TryParse((string)hash["y"], out n); region.RegionLocY = n; - m_log.Debug(">> HERE, y: " + region.RegionLocY); + //m_log.Debug(">> HERE, y: " + region.RegionLocY); } if (hash["region_name"] != null) { region.RegionName = (string)hash["region_name"]; - m_log.Debug(">> HERE, region_name: " + region.RegionName); + //m_log.Debug(">> HERE, region_name: " + region.RegionName); } if (hash["hostname"] != null) { region.ExternalHostName = (string)hash["hostname"]; - m_log.Debug(">> HERE, hostname: " + region.ExternalHostName); + //m_log.Debug(">> HERE, hostname: " + region.ExternalHostName); } if (hash["http_port"] != null) { uint p = 0; UInt32.TryParse((string)hash["http_port"], out p); region.HttpPort = p; - m_log.Debug(">> HERE, http_port: " + region.HttpPort); + //m_log.Debug(">> HERE, http_port: " + region.HttpPort); } if (hash["internal_port"] != null) { int p = 0; Int32.TryParse((string)hash["internal_port"], out p); region.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), p); - m_log.Debug(">> HERE, internal_port: " + region.InternalEndPoint); + //m_log.Debug(">> HERE, internal_port: " + region.InternalEndPoint); } if (hash["server_uri"] != null) { region.ServerURI = (string) hash["server_uri"]; - m_log.Debug(">> HERE, server_uri: " + region.ServerURI); + //m_log.Debug(">> HERE, server_uri: " + region.ServerURI); } // Successful return diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs index eed3207..d5d0195 100644 --- a/OpenSim/Services/GridService/HypergridLinker.cs +++ b/OpenSim/Services/GridService/HypergridLinker.cs @@ -127,16 +127,18 @@ namespace OpenSim.Services.GridService if (MainConsole.Instance != null) { - MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-region", "link-region []", "Link a HyperGrid Region", RunCommand); + MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-region", + "link-region []", + "Link a HyperGrid Region", RunCommand); MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-region", "link-region []", "Link a hypergrid region (deprecated)", RunCommand); MainConsole.Instance.Commands.AddCommand("hypergrid", false, "unlink-region", "unlink-region ", "Unlink a hypergrid region", RunCommand); - MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-mapping", "link-mapping [ ] ", + MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-mapping", "link-mapping [ ]", "Set local coordinate to map HG regions to", RunCommand); - MainConsole.Instance.Commands.AddCommand("hypergrid", false, "show hyperlinks", "show hyperlinks ", + MainConsole.Instance.Commands.AddCommand("hypergrid", false, "show hyperlinks", "show hyperlinks", "List the HG regions", HandleShow); } } @@ -281,7 +283,7 @@ namespace OpenSim.Services.GridService else regInfo.RegionName = externalName; - m_log.Debug("naming linked region " + regInfo.RegionName); + m_log.Debug("[HYPERGRID LINKER]: naming linked region " + regInfo.RegionName); // Try get the map image //regInfo.TerrainImage = m_GatekeeperConnector.GetMapImage(regionID, imageURL); diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs index 10e3aee..05be7b8 100644 --- a/OpenSim/Services/HypergridService/GatekeeperService.cs +++ b/OpenSim/Services/HypergridService/GatekeeperService.cs @@ -87,6 +87,8 @@ namespace OpenSim.Services.HypergridService //m_WelcomeMessage = serverConfig.GetString("WelcomeMessage", "Welcome to OpenSim!"); m_AllowTeleportsToAnyRegion = serverConfig.GetBoolean("AllowTeleportsToAnyRegion", true); m_ExternalName = serverConfig.GetString("ExternalName", string.Empty); + if (m_ExternalName != string.Empty && !m_ExternalName.EndsWith("/")) + m_ExternalName = m_ExternalName + "/"; Object[] args = new Object[] { config }; m_GridService = ServerUtils.LoadPlugin(gridService, args); @@ -118,7 +120,7 @@ namespace OpenSim.Services.HypergridService { regionID = UUID.Zero; regionHandle = 0; - externalName = m_ExternalName; + externalName = m_ExternalName + ((regionName != string.Empty) ? " " + regionName : ""); imageURL = string.Empty; reason = string.Empty; diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs index 32b4249..3519250 100644 --- a/OpenSim/Services/HypergridService/UserAgentService.cs +++ b/OpenSim/Services/HypergridService/UserAgentService.cs @@ -101,6 +101,8 @@ namespace OpenSim.Services.HypergridService serverConfig = config.Configs["GatekeeperService"]; m_GridName = serverConfig.GetString("ExternalName", string.Empty); } + else if (!m_GridName.EndsWith("/")) + m_GridName = m_GridName + "/"; } } @@ -152,8 +154,8 @@ namespace OpenSim.Services.HypergridService bool success = false; string myExternalIP = string.Empty; string gridName = gatekeeper.ServerURI; - - m_log.Debug("m_grid - " + m_GridName + ", gn - " + gridName); + + m_log.DebugFormat("[USER AGENT SERVICE]: m_grid - {0}, gn - {1}", m_GridName, gridName); if (m_GridName == gridName) success = m_GatekeeperService.LoginAgent(agentCircuit, finalDestination, out reason); diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index efc0568..25d80bd 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -586,7 +586,7 @@ namespace OpenSim.Services.LLLoginService private GridRegion FindForeignRegion(string domainName, uint port, string regionName, out GridRegion gatekeeper) { - m_log.Debug("attempting to findforeignregion " + domainName + ":" + port.ToString() + ":" + regionName); + m_log.Debug("[LLLOGIN SERVICE]: attempting to findforeignregion " + domainName + ":" + port.ToString() + ":" + regionName); gatekeeper = new GridRegion(); gatekeeper.ExternalHostName = domainName; gatekeeper.HttpPort = port; @@ -654,7 +654,7 @@ namespace OpenSim.Services.LLLoginService gatekeeper.HttpPort = (uint)port; gatekeeper.ServerURI = m_GatekeeperURL; } - m_log.Debug("no gatekeeper detected..... using " + m_GatekeeperURL); + m_log.Debug("[LLLOGIN SERVICE]: no gatekeeper detected..... using " + m_GatekeeperURL); } bool success = false; -- cgit v1.1