aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/PGSQL/PGSQLSimulationData.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/PGSQL/PGSQLSimulationData.cs')
-rw-r--r--OpenSim/Data/PGSQL/PGSQLSimulationData.cs9
1 files changed, 5 insertions, 4 deletions
diff --git a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs
index 69b0beb..354d749 100644
--- a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs
@@ -824,7 +824,7 @@ namespace OpenSim.Data.PGSQL
824 824
825 public void StoreRegionWindlightSettings(RegionLightShareData wl) 825 public void StoreRegionWindlightSettings(RegionLightShareData wl)
826 { 826 {
827 string sql = @"select count (region_id) from regionwindlight where ""region_id"" = :region_id ;"; 827 string sql = @"select region_id from regionwindlight where ""region_id"" = :region_id limit 1;";
828 bool exists = false; 828 bool exists = false;
829 using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString)) 829 using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString))
830 { 830 {
@@ -832,7 +832,8 @@ namespace OpenSim.Data.PGSQL
832 using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn)) 832 using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn))
833 { 833 {
834 cmd.Parameters.Add(_Database.CreateParameter("region_id", wl.regionID.ToString() )); 834 cmd.Parameters.Add(_Database.CreateParameter("region_id", wl.regionID.ToString() ));
835 exists = cmd.ExecuteNonQuery() > 0; 835 NpgsqlDataReader dr = cmd.ExecuteReader();
836 exists = dr.Read();
836 } 837 }
837 } 838 }
838 if (exists) 839 if (exists)
@@ -975,7 +976,7 @@ namespace OpenSim.Data.PGSQL
975 conn.Open(); 976 conn.Open();
976 using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn)) 977 using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn))
977 { 978 {
978 cmd.Parameters.Add(_Database.CreateParameter("region_id", wl.regionID)); 979 cmd.Parameters.Add(_Database.CreateParameter("region_id", wl.regionID.ToString()));
979 cmd.Parameters.Add(_Database.CreateParameter("water_color_r", wl.waterColor.X)); 980 cmd.Parameters.Add(_Database.CreateParameter("water_color_r", wl.waterColor.X));
980 cmd.Parameters.Add(_Database.CreateParameter("water_color_g", wl.waterColor.Y)); 981 cmd.Parameters.Add(_Database.CreateParameter("water_color_g", wl.waterColor.Y));
981 cmd.Parameters.Add(_Database.CreateParameter("water_color_b", wl.waterColor.Z)); 982 cmd.Parameters.Add(_Database.CreateParameter("water_color_b", wl.waterColor.Z));
@@ -993,7 +994,7 @@ namespace OpenSim.Data.PGSQL
993 cmd.Parameters.Add(_Database.CreateParameter("big_wave_direction_y", wl.bigWaveDirection.Y)); 994 cmd.Parameters.Add(_Database.CreateParameter("big_wave_direction_y", wl.bigWaveDirection.Y));
994 cmd.Parameters.Add(_Database.CreateParameter("little_wave_direction_x", wl.littleWaveDirection.X)); 995 cmd.Parameters.Add(_Database.CreateParameter("little_wave_direction_x", wl.littleWaveDirection.X));
995 cmd.Parameters.Add(_Database.CreateParameter("little_wave_direction_y", wl.littleWaveDirection.Y)); 996 cmd.Parameters.Add(_Database.CreateParameter("little_wave_direction_y", wl.littleWaveDirection.Y));
996 cmd.Parameters.Add(_Database.CreateParameter("normal_map_texture", wl.normalMapTexture)); 997 cmd.Parameters.Add(_Database.CreateParameter("normal_map_texture", wl.normalMapTexture.ToString()));
997 cmd.Parameters.Add(_Database.CreateParameter("horizon_r", wl.horizon.X)); 998 cmd.Parameters.Add(_Database.CreateParameter("horizon_r", wl.horizon.X));
998 cmd.Parameters.Add(_Database.CreateParameter("horizon_g", wl.horizon.Y)); 999 cmd.Parameters.Add(_Database.CreateParameter("horizon_g", wl.horizon.Y));
999 cmd.Parameters.Add(_Database.CreateParameter("horizon_b", wl.horizon.Z)); 1000 cmd.Parameters.Add(_Database.CreateParameter("horizon_b", wl.horizon.Z));