From 999a0681723f018b9ce85c70e9734226792c0b7b Mon Sep 17 00:00:00 2001 From: Terry Date: Tue, 12 Nov 2019 11:35:30 -0500 Subject: [PATCH] Complete PostGres from previous commit - (Not Tested) Signed-off-by: Terry Signed-off-by: UbitUmarov --- OpenSim/Data/PGSQL/PGSQLRegionData.cs | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/OpenSim/Data/PGSQL/PGSQLRegionData.cs b/OpenSim/Data/PGSQL/PGSQLRegionData.cs index a5d22665c1..adea2e0998 100644 --- a/OpenSim/Data/PGSQL/PGSQLRegionData.cs +++ b/OpenSim/Data/PGSQL/PGSQLRegionData.cs @@ -115,9 +115,25 @@ namespace OpenSim.Data.PGSQL } //BA MOD... - public RegionData GetSpecific(string regionName, UUID ScopeID) + public RegionData GetSpecific(string regionName, UUID scopeID) { - return null; + string sql = "select * from " + m_Realm + " where lower(\"regionName\") = lower(:regionName) "; + if (scopeID != UUID.Zero) + sql += " and \"ScopeID\" = :scopeID"; + + using (NpgsqlConnection conn = new NpgsqlConnection(m_ConnectionString)) + using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn)) + { + cmd.Parameters.Add(m_database.CreateParameter("regionName", regionName)); + if (scopeID != UUID.Zero) + cmd.Parameters.Add(m_database.CreateParameter("scopeID", scopeID)); + conn.Open(); + List ret = RunCommand(cmd); + if (ret.Count == 0) + return null; + + return ret[0]; + } } public RegionData Get(int posX, int posY, UUID scopeID)