diff options
author | Fernando Oliveira | 2013-11-22 23:38:04 -0200 |
---|---|---|
committer | Michael Cerquoni | 2013-11-22 20:48:12 -0500 |
commit | f3f3d390f7751365fe2bf2e53558c405f8446487 (patch) | |
tree | 136bf58bda3bcb062ddd769e7e35270adf3edde5 /OpenSim | |
parent | Remove old *.exe.config files that related to programs that have long been de... (diff) | |
download | opensim-SC-f3f3d390f7751365fe2bf2e53558c405f8446487.zip opensim-SC-f3f3d390f7751365fe2bf2e53558c405f8446487.tar.gz opensim-SC-f3f3d390f7751365fe2bf2e53558c405f8446487.tar.bz2 opensim-SC-f3f3d390f7751365fe2bf2e53558c405f8446487.tar.xz |
Fixed the update StoreRegionWindlightSettings() wasn't updating regionwindlight table, raising PrimaryKey violation;
Signed-off-by: Fernando Oliveira <fernando@oliveira.eti.br>
Signed-off-by: Michael Cerquoni <nebadon2025@gmail.com>
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Data/PGSQL/PGSQLSimulationData.cs | 9 |
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)); |