From f91ec192247d64786b3eeab66512fdf319273d68 Mon Sep 17 00:00:00 2001 From: Marck Date: Sat, 31 Jul 2010 20:16:39 +0200 Subject: Implemented console command "show hyperlinks". --- OpenSim/Data/MySQL/MySQLRegionData.cs | 49 +++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 23 deletions(-) (limited to 'OpenSim/Data/MySQL') diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs index c7bddac..6dc62c6 100644 --- a/OpenSim/Data/MySQL/MySQLRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLRegionData.cs @@ -280,32 +280,35 @@ namespace OpenSim.Data.MySQL } return false; - } + } + public List GetDefaultRegions(UUID scopeID) - { - string command = "select * from `"+m_Realm+"` where (flags & 1) <> 0"; - if (scopeID != UUID.Zero) - command += " and ScopeID = ?scopeID"; - - MySqlCommand cmd = new MySqlCommand(command); - - cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); - - return RunCommand(cmd); + { + return Get((int)RegionFlags.DefaultRegion, scopeID); } public List GetFallbackRegions(UUID scopeID, int x, int y) - { - string command = "select * from `"+m_Realm+"` where (flags & 2) <> 0"; - if (scopeID != UUID.Zero) - command += " and ScopeID = ?scopeID"; - - MySqlCommand cmd = new MySqlCommand(command); - - cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); - - // TODO: distance-sort results - 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 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); + } } } -- cgit v1.1 From c4ecbd1fb1ce5450b66a7de41a0e34cc3474e04a Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 31 Jul 2010 16:40:58 -0700 Subject: White space from previous commit. --- OpenSim/Data/MySQL/MySQLRegionData.cs | 50 +++++++++++++++++------------------ 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'OpenSim/Data/MySQL') diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs index 6dc62c6..aec37e2 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); + } } } -- cgit v1.1