From c4ecbd1fb1ce5450b66a7de41a0e34cc3474e04a Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 31 Jul 2010 16:40:58 -0700 Subject: [PATCH] White space from previous commit. --- OpenSim/Data/IRegionData.cs | 8 +-- OpenSim/Data/MSSQL/MSSQLRegionData.cs | 54 ++++++++--------- OpenSim/Data/MySQL/MySQLRegionData.cs | 50 ++++++++-------- OpenSim/Data/Null/NullRegionData.cs | 58 +++++++++---------- .../Services/GridService/HypergridLinker.cs | 42 +++++++------- 5 files changed, 106 insertions(+), 106 deletions(-) diff --git a/OpenSim/Data/IRegionData.cs b/OpenSim/Data/IRegionData.cs index 9f08e04ea0..42533c6668 100644 --- a/OpenSim/Data/IRegionData.cs +++ b/OpenSim/Data/IRegionData.cs @@ -58,11 +58,11 @@ namespace OpenSim.Data bool SetDataItem(UUID principalID, string item, string value); - bool Delete(UUID regionID); - + bool Delete(UUID regionID); + List GetDefaultRegions(UUID scopeID); - List GetFallbackRegions(UUID scopeID, int x, int y); - List GetHyperlinks(UUID scopeID); + List GetFallbackRegions(UUID scopeID, int x, int y); + List GetHyperlinks(UUID scopeID); } [Flags] diff --git a/OpenSim/Data/MSSQL/MSSQLRegionData.cs b/OpenSim/Data/MSSQL/MSSQLRegionData.cs index 73c67d4c8c..9656be14a9 100644 --- a/OpenSim/Data/MSSQL/MSSQLRegionData.cs +++ b/OpenSim/Data/MSSQL/MSSQLRegionData.cs @@ -306,37 +306,37 @@ namespace OpenSim.Data.MSSQL return true; } return false; - } + } public List GetDefaultRegions(UUID scopeID) - { - return Get((int)RegionFlags.DefaultRegion, scopeID); + { + return Get((int)RegionFlags.DefaultRegion, scopeID); } public List GetFallbackRegions(UUID scopeID, int x, int y) - { - // TODO: distance-sort results - return Get((int)RegionFlags.FallbackRegion, scopeID); - } - - public List GetHyperlinks(UUID scopeID) - { - return Get((int)RegionFlags.Hyperlink, scopeID); - } - - private List Get(int regionFlags, UUID scopeID) - { - string sql = "SELECT * FROM [" + m_Realm + "] WHERE (flags & " + regionFlags.ToString() + ") <> 0"; - if (scopeID != UUID.Zero) - sql += " AND ScopeID = @scopeID"; - - using (SqlConnection conn = new SqlConnection(m_ConnectionString)) - using (SqlCommand cmd = new SqlCommand(sql, conn)) - { - cmd.Parameters.Add(m_database.CreateParameter("@scopeID", scopeID)); - conn.Open(); - return RunCommand(cmd); - } - } + { + // TODO: distance-sort results + return Get((int)RegionFlags.FallbackRegion, scopeID); + } + + public List GetHyperlinks(UUID scopeID) + { + return Get((int)RegionFlags.Hyperlink, scopeID); + } + + private List Get(int regionFlags, UUID scopeID) + { + string sql = "SELECT * FROM [" + m_Realm + "] WHERE (flags & " + regionFlags.ToString() + ") <> 0"; + if (scopeID != UUID.Zero) + sql += " AND ScopeID = @scopeID"; + + using (SqlConnection conn = new SqlConnection(m_ConnectionString)) + using (SqlCommand cmd = new SqlCommand(sql, conn)) + { + cmd.Parameters.Add(m_database.CreateParameter("@scopeID", scopeID)); + conn.Open(); + return RunCommand(cmd); + } + } } } diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs index 6dc62c667a..aec37e2bbd 100644 --- a/OpenSim/Data/MySQL/MySQLRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLRegionData.cs @@ -280,35 +280,35 @@ namespace OpenSim.Data.MySQL } return false; - } - + } + public List GetDefaultRegions(UUID scopeID) - { - return Get((int)RegionFlags.DefaultRegion, scopeID); + { + return Get((int)RegionFlags.DefaultRegion, scopeID); } public List GetFallbackRegions(UUID scopeID, int x, int y) - { - // TODO: distance-sort results + { + // TODO: distance-sort results return Get((int)RegionFlags.FallbackRegion, scopeID); - } - - public List GetHyperlinks(UUID scopeID) - { - return Get((int)RegionFlags.Hyperlink, scopeID); - } - - private List Get(int regionFlags, UUID scopeID) - { - string command = "select * from `" + m_Realm + "` where (flags & " + regionFlags.ToString() + ") <> 0"; - if (scopeID != UUID.Zero) - command += " and ScopeID = ?scopeID"; - - MySqlCommand cmd = new MySqlCommand(command); - - cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); - - return RunCommand(cmd); - } + } + + public List GetHyperlinks(UUID scopeID) + { + return Get((int)RegionFlags.Hyperlink, scopeID); + } + + private List Get(int regionFlags, UUID scopeID) + { + string command = "select * from `" + m_Realm + "` where (flags & " + regionFlags.ToString() + ") <> 0"; + if (scopeID != UUID.Zero) + command += " and ScopeID = ?scopeID"; + + MySqlCommand cmd = new MySqlCommand(command); + + cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); + + return RunCommand(cmd); + } } } diff --git a/OpenSim/Data/Null/NullRegionData.cs b/OpenSim/Data/Null/NullRegionData.cs index 397b32da8e..f276d10657 100644 --- a/OpenSim/Data/Null/NullRegionData.cs +++ b/OpenSim/Data/Null/NullRegionData.cs @@ -49,8 +49,8 @@ namespace OpenSim.Data.Null if (Instance == null) Instance = this; //Console.WriteLine("[XXX] NullRegionData constructor"); - } - + } + public List Get(string regionName, UUID scopeID) { if (Instance != this) @@ -160,37 +160,37 @@ namespace OpenSim.Data.Null m_regionData.Remove(regionID); return true; - } - + } + public List GetDefaultRegions(UUID scopeID) - { + { return Get((int)RegionFlags.DefaultRegion, scopeID); } public List GetFallbackRegions(UUID scopeID, int x, int y) - { - return Get((int)RegionFlags.FallbackRegion, scopeID); - } - - public List GetHyperlinks(UUID scopeID) - { - return Get((int)RegionFlags.Hyperlink, scopeID); - } - - private List Get(int regionFlags, UUID scopeID) - { - if (Instance != this) - return Instance.Get(regionFlags, scopeID); - - List ret = new List(); - - foreach (RegionData r in m_regionData.Values) - { - if ((Convert.ToInt32(r.Data["flags"]) & regionFlags) != 0) - ret.Add(r); - } - - return ret; - } + { + return Get((int)RegionFlags.FallbackRegion, scopeID); + } + + public List GetHyperlinks(UUID scopeID) + { + return Get((int)RegionFlags.Hyperlink, scopeID); + } + + private List Get(int regionFlags, UUID scopeID) + { + if (Instance != this) + return Instance.Get(regionFlags, scopeID); + + List ret = new List(); + + foreach (RegionData r in m_regionData.Values) + { + if ((Convert.ToInt32(r.Data["flags"]) & regionFlags) != 0) + ret.Add(r); + } + + return ret; + } } } \ No newline at end of file diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs index 23f00042a0..1f530071bb 100644 --- a/OpenSim/Services/GridService/HypergridLinker.cs +++ b/OpenSim/Services/GridService/HypergridLinker.cs @@ -378,28 +378,28 @@ namespace OpenSim.Services.GridService public void HandleShow(string module, string[] cmd) { - if (cmd.Length != 2) - { - MainConsole.Instance.Output("Syntax: show hyperlinks"); - return; + if (cmd.Length != 2) + { + MainConsole.Instance.Output("Syntax: show hyperlinks"); + return; + } + List regions = m_Database.GetHyperlinks(UUID.Zero); + if (regions == null || regions.Count < 1) + { + MainConsole.Instance.Output("No hyperlinks"); + return; + } + + MainConsole.Instance.Output("Region Name Region UUID"); + MainConsole.Instance.Output("Location URI"); + MainConsole.Instance.Output("-------------------------------------------------------------------------------"); + foreach (RegionData r in regions) + { + MainConsole.Instance.Output(String.Format("{0,-39} {1}\n{2,-39} {3}\n", + r.RegionName, r.RegionID, + String.Format("{0},{1} ({2},{3})", r.posX, r.posY, r.posX / 256, r.posY / 256), + "http://" + r.Data["serverIP"].ToString() + ":" + r.Data["serverHttpPort"].ToString())); } - List regions = m_Database.GetHyperlinks(UUID.Zero); - if (regions == null || regions.Count < 1) - { - MainConsole.Instance.Output("No hyperlinks"); - return; - } - - MainConsole.Instance.Output("Region Name Region UUID"); - MainConsole.Instance.Output("Location URI"); - MainConsole.Instance.Output("-------------------------------------------------------------------------------"); - foreach (RegionData r in regions) - { - MainConsole.Instance.Output(String.Format("{0,-39} {1}\n{2,-39} {3}\n", - r.RegionName, r.RegionID, - String.Format("{0},{1} ({2},{3})", r.posX, r.posY, r.posX / 256, r.posY / 256), - "http://" + r.Data["serverIP"].ToString() + ":" + r.Data["serverHttpPort"].ToString())); - } return; }