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. --- OpenSim/Data/MySQL/MySQLRegionData.cs | 4 ++-- OpenSim/Data/MySQL/Resources/GridStore.migrations | 7 ++++++ .../EntityTransfer/EntityTransferModule.cs | 2 +- .../EntityTransfer/HGEntityTransferModule.cs | 10 ++++---- OpenSim/Region/Framework/Scenes/Scene.cs | 5 ++-- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 +- .../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 ++-- 11 files changed, 47 insertions(+), 35 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs index efefad9..d04e3dc 100644 --- a/OpenSim/Data/MySQL/MySQLRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLRegionData.cs @@ -212,8 +212,8 @@ namespace OpenSim.Data.MySQL if (data.Data.ContainsKey("locY")) data.Data.Remove("locY"); - if (data.RegionName.Length > 32) - data.RegionName = data.RegionName.Substring(0, 32); + if (data.RegionName.Length > 128) + data.RegionName = data.RegionName.Substring(0, 128); string[] fields = new List(data.Data.Keys).ToArray(); diff --git a/OpenSim/Data/MySQL/Resources/GridStore.migrations b/OpenSim/Data/MySQL/Resources/GridStore.migrations index 523a8ac..eda6dbb 100644 --- a/OpenSim/Data/MySQL/Resources/GridStore.migrations +++ b/OpenSim/Data/MySQL/Resources/GridStore.migrations @@ -87,3 +87,10 @@ ALTER TABLE `regions` ADD COLUMN `Token` varchar(255) NOT NULL; COMMIT; +:VERSION 8 # ------------ + +BEGIN; + +alter table regions modify column regionName varchar(128) default NULL; + +COMMIT; diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 47548c7..fd28ba0 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -495,7 +495,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer protected virtual void SetCallbackURL(AgentData agent, RegionInfo region) { agent.CallbackURI = region.ServerURI + "agent/" + agent.AgentID.ToString() + "/" + region.RegionID.ToString() + "/release/"; - m_log.Debug("Set callback URL to " + agent.CallbackURI); + m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Set callback URL to {0}", agent.CallbackURI); } diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index 7796a08..35dcd95 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs @@ -124,7 +124,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer { m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Destination region {0} is hyperlink", region.RegionID); GridRegion real_destination = m_GatekeeperConnector.GetHyperlinkRegion(region, region.RegionID); - m_log.Debug("GetfinalDestination serveruri -> " + real_destination.ServerURI); + m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: GetFinalDestination serveruri -> {0}", real_destination.ServerURI); return real_destination; } return region; @@ -151,7 +151,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer protected override bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason, out bool logout) { - m_log.Debug("CreateAgent " + reg.ServerURI + " " + finalDestination.ServerURI); + m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: CreateAgent {0} {1}", reg.ServerURI, finalDestination.ServerURI); reason = string.Empty; logout = false; int flags = m_aScene.GridService.GetRegionFlags(m_aScene.RegionInfo.ScopeID, reg.RegionID); @@ -238,9 +238,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer string url = aCircuit.ServiceURLs["HomeURI"].ToString(); IUserAgentService security = new UserAgentServiceConnector(url); return security.VerifyClient(aCircuit.SessionID, token); - } else { - m_log.Debug("this gent does not have a HomeURI OH NO"); - } + } + else + m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Agent {0} {1} does not have a HomeURI OH NO!", aCircuit.firstname, aCircuit.lastname); return false; } diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index fcfb4d7..9ade100 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3691,10 +3691,9 @@ namespace OpenSim.Region.Framework.Scenes } ScenePresence childAgentUpdate = WaitGetScenePresence(cAgentData.AgentID); - m_log.Debug("ICADU -> post wait"); + if (childAgentUpdate != null) { - m_log.Debug("ICADU -> not child agent!"); childAgentUpdate.ChildAgentDataUpdate(cAgentData); return true; } @@ -3710,7 +3709,7 @@ namespace OpenSim.Region.Framework.Scenes /// true if we handled it. public virtual bool IncomingChildAgentDataUpdate(AgentPosition cAgentData) { - m_log.Debug(" XXX Scene IncomingChildAgentDataUpdate POSITION in " + RegionInfo.RegionName); + //m_log.Debug(" XXX Scene IncomingChildAgentDataUpdate POSITION in " + RegionInfo.RegionName); ScenePresence childAgentUpdate = GetScenePresence(cAgentData.AgentID); if (childAgentUpdate != null) { diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index d88526f..a1c80e5 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2933,7 +2933,7 @@ namespace OpenSim.Region.Framework.Scenes public void ChildAgentDataUpdate(AgentData cAgentData) { - m_log.Debug(" >>> ChildAgentDataUpdate <<< " + Scene.RegionInfo.RegionName); + //m_log.Debug(" >>> ChildAgentDataUpdate <<< " + Scene.RegionInfo.RegionName); if (!IsChildAgent) return; 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