diff options
author | UbitUmarov | 2017-05-06 21:43:22 +0100 |
---|---|---|
committer | UbitUmarov | 2017-05-06 21:43:22 +0100 |
commit | c57215687f6ab0a9585c5331edc2da89a88b8a28 (patch) | |
tree | b392c3a21531baf4c822d03db3e1d03e303e494a /OpenSim/Data/MySQL/MySQLSimulationData.cs | |
parent | don't hold dbconn longer than necessart (diff) | |
download | opensim-SC_OLD-c57215687f6ab0a9585c5331edc2da89a88b8a28.zip opensim-SC_OLD-c57215687f6ab0a9585c5331edc2da89a88b8a28.tar.gz opensim-SC_OLD-c57215687f6ab0a9585c5331edc2da89a88b8a28.tar.bz2 opensim-SC_OLD-c57215687f6ab0a9585c5331edc2da89a88b8a28.tar.xz |
a few more changes on mysql
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLSimulationData.cs | 62 |
1 files changed, 35 insertions, 27 deletions
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index 8d1a4a5..3ea5805 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs | |||
@@ -262,6 +262,7 @@ namespace OpenSim.Data.MySQL | |||
262 | ExecuteNonQuery(cmd); | 262 | ExecuteNonQuery(cmd); |
263 | } | 263 | } |
264 | } | 264 | } |
265 | dbcon.Close(); | ||
265 | } | 266 | } |
266 | } | 267 | } |
267 | } | 268 | } |
@@ -301,6 +302,7 @@ namespace OpenSim.Data.MySQL | |||
301 | cmd.CommandText = "delete from prims where SceneGroupID= ?UUID"; | 302 | cmd.CommandText = "delete from prims where SceneGroupID= ?UUID"; |
302 | ExecuteNonQuery(cmd); | 303 | ExecuteNonQuery(cmd); |
303 | } | 304 | } |
305 | dbcon.Close(); | ||
304 | } | 306 | } |
305 | } | 307 | } |
306 | 308 | ||
@@ -961,6 +963,7 @@ namespace OpenSim.Data.MySQL | |||
961 | public virtual RegionSettings LoadRegionSettings(UUID regionUUID) | 963 | public virtual RegionSettings LoadRegionSettings(UUID regionUUID) |
962 | { | 964 | { |
963 | RegionSettings rs = null; | 965 | RegionSettings rs = null; |
966 | bool needStore = false; | ||
964 | 967 | ||
965 | lock (m_dbLock) | 968 | lock (m_dbLock) |
966 | { | 969 | { |
@@ -986,7 +989,7 @@ namespace OpenSim.Data.MySQL | |||
986 | rs.RegionUUID = regionUUID; | 989 | rs.RegionUUID = regionUUID; |
987 | rs.OnSave += StoreRegionSettings; | 990 | rs.OnSave += StoreRegionSettings; |
988 | 991 | ||
989 | StoreRegionSettings(rs); | 992 | needStore = true; |
990 | } | 993 | } |
991 | } | 994 | } |
992 | } | 995 | } |
@@ -994,6 +997,9 @@ namespace OpenSim.Data.MySQL | |||
994 | } | 997 | } |
995 | } | 998 | } |
996 | 999 | ||
1000 | if(needStore) | ||
1001 | StoreRegionSettings(rs); | ||
1002 | |||
997 | LoadSpawnPoints(rs); | 1003 | LoadSpawnPoints(rs); |
998 | 1004 | ||
999 | return rs; | 1005 | return rs; |
@@ -1007,31 +1013,32 @@ namespace OpenSim.Data.MySQL | |||
1007 | 1013 | ||
1008 | using (MySqlCommand cmd = dbcon.CreateCommand()) | 1014 | using (MySqlCommand cmd = dbcon.CreateCommand()) |
1009 | { | 1015 | { |
1010 | cmd.CommandText = "REPLACE INTO `regionwindlight` (`region_id`, `water_color_r`, `water_color_g`, "; | 1016 | cmd.CommandText = "REPLACE INTO `regionwindlight` (`region_id`, `water_color_r`, `water_color_g`, " |
1011 | cmd.CommandText += "`water_color_b`, `water_fog_density_exponent`, `underwater_fog_modifier`, "; | 1017 | + "`water_color_b`, `water_fog_density_exponent`, `underwater_fog_modifier`, " |
1012 | cmd.CommandText += "`reflection_wavelet_scale_1`, `reflection_wavelet_scale_2`, `reflection_wavelet_scale_3`, "; | 1018 | + "`reflection_wavelet_scale_1`, `reflection_wavelet_scale_2`, `reflection_wavelet_scale_3`, " |
1013 | cmd.CommandText += "`fresnel_scale`, `fresnel_offset`, `refract_scale_above`, `refract_scale_below`, "; | 1019 | + "`fresnel_scale`, `fresnel_offset`, `refract_scale_above`, `refract_scale_below`, " |
1014 | cmd.CommandText += "`blur_multiplier`, `big_wave_direction_x`, `big_wave_direction_y`, `little_wave_direction_x`, "; | 1020 | + "`blur_multiplier`, `big_wave_direction_x`, `big_wave_direction_y`, `little_wave_direction_x`, " |
1015 | cmd.CommandText += "`little_wave_direction_y`, `normal_map_texture`, `horizon_r`, `horizon_g`, `horizon_b`, "; | 1021 | + "`little_wave_direction_y`, `normal_map_texture`, `horizon_r`, `horizon_g`, `horizon_b`, " |
1016 | cmd.CommandText += "`horizon_i`, `haze_horizon`, `blue_density_r`, `blue_density_g`, `blue_density_b`, "; | 1022 | + "`horizon_i`, `haze_horizon`, `blue_density_r`, `blue_density_g`, `blue_density_b`, " |
1017 | cmd.CommandText += "`blue_density_i`, `haze_density`, `density_multiplier`, `distance_multiplier`, `max_altitude`, "; | 1023 | + "`blue_density_i`, `haze_density`, `density_multiplier`, `distance_multiplier`, `max_altitude`, " |
1018 | cmd.CommandText += "`sun_moon_color_r`, `sun_moon_color_g`, `sun_moon_color_b`, `sun_moon_color_i`, `sun_moon_position`, "; | 1024 | + "`sun_moon_color_r`, `sun_moon_color_g`, `sun_moon_color_b`, `sun_moon_color_i`, `sun_moon_position`, " |
1019 | cmd.CommandText += "`ambient_r`, `ambient_g`, `ambient_b`, `ambient_i`, `east_angle`, `sun_glow_focus`, `sun_glow_size`, "; | 1025 | + "`ambient_r`, `ambient_g`, `ambient_b`, `ambient_i`, `east_angle`, `sun_glow_focus`, `sun_glow_size`, " |
1020 | cmd.CommandText += "`scene_gamma`, `star_brightness`, `cloud_color_r`, `cloud_color_g`, `cloud_color_b`, `cloud_color_i`, "; | 1026 | + "`scene_gamma`, `star_brightness`, `cloud_color_r`, `cloud_color_g`, `cloud_color_b`, `cloud_color_i`, " |
1021 | cmd.CommandText += "`cloud_x`, `cloud_y`, `cloud_density`, `cloud_coverage`, `cloud_scale`, `cloud_detail_x`, "; | 1027 | + "`cloud_x`, `cloud_y`, `cloud_density`, `cloud_coverage`, `cloud_scale`, `cloud_detail_x`, " |
1022 | cmd.CommandText += "`cloud_detail_y`, `cloud_detail_density`, `cloud_scroll_x`, `cloud_scroll_x_lock`, `cloud_scroll_y`, "; | 1028 | + "`cloud_detail_y`, `cloud_detail_density`, `cloud_scroll_x`, `cloud_scroll_x_lock`, `cloud_scroll_y`, " |
1023 | cmd.CommandText += "`cloud_scroll_y_lock`, `draw_classic_clouds`) VALUES (?region_id, ?water_color_r, "; | 1029 | + "`cloud_scroll_y_lock`, `draw_classic_clouds`) VALUES (?region_id, ?water_color_r, " |
1024 | cmd.CommandText += "?water_color_g, ?water_color_b, ?water_fog_density_exponent, ?underwater_fog_modifier, ?reflection_wavelet_scale_1, "; | 1030 | + "?water_color_g, ?water_color_b, ?water_fog_density_exponent, ?underwater_fog_modifier, ?reflection_wavelet_scale_1, " |
1025 | cmd.CommandText += "?reflection_wavelet_scale_2, ?reflection_wavelet_scale_3, ?fresnel_scale, ?fresnel_offset, ?refract_scale_above, "; | 1031 | + "?reflection_wavelet_scale_2, ?reflection_wavelet_scale_3, ?fresnel_scale, ?fresnel_offset, ?refract_scale_above, " |
1026 | cmd.CommandText += "?refract_scale_below, ?blur_multiplier, ?big_wave_direction_x, ?big_wave_direction_y, ?little_wave_direction_x, "; | 1032 | + "?refract_scale_below, ?blur_multiplier, ?big_wave_direction_x, ?big_wave_direction_y, ?little_wave_direction_x, " |
1027 | cmd.CommandText += "?little_wave_direction_y, ?normal_map_texture, ?horizon_r, ?horizon_g, ?horizon_b, ?horizon_i, ?haze_horizon, "; | 1033 | + "?little_wave_direction_y, ?normal_map_texture, ?horizon_r, ?horizon_g, ?horizon_b, ?horizon_i, ?haze_horizon, " |
1028 | cmd.CommandText += "?blue_density_r, ?blue_density_g, ?blue_density_b, ?blue_density_i, ?haze_density, ?density_multiplier, "; | 1034 | + "?blue_density_r, ?blue_density_g, ?blue_density_b, ?blue_density_i, ?haze_density, ?density_multiplier, " |
1029 | cmd.CommandText += "?distance_multiplier, ?max_altitude, ?sun_moon_color_r, ?sun_moon_color_g, ?sun_moon_color_b, "; | 1035 | + "?distance_multiplier, ?max_altitude, ?sun_moon_color_r, ?sun_moon_color_g, ?sun_moon_color_b, " |
1030 | cmd.CommandText += "?sun_moon_color_i, ?sun_moon_position, ?ambient_r, ?ambient_g, ?ambient_b, ?ambient_i, ?east_angle, "; | 1036 | + "?sun_moon_color_i, ?sun_moon_position, ?ambient_r, ?ambient_g, ?ambient_b, ?ambient_i, ?east_angle, " |
1031 | cmd.CommandText += "?sun_glow_focus, ?sun_glow_size, ?scene_gamma, ?star_brightness, ?cloud_color_r, ?cloud_color_g, "; | 1037 | + "?sun_glow_focus, ?sun_glow_size, ?scene_gamma, ?star_brightness, ?cloud_color_r, ?cloud_color_g, " |
1032 | cmd.CommandText += "?cloud_color_b, ?cloud_color_i, ?cloud_x, ?cloud_y, ?cloud_density, ?cloud_coverage, ?cloud_scale, "; | 1038 | + "?cloud_color_b, ?cloud_color_i, ?cloud_x, ?cloud_y, ?cloud_density, ?cloud_coverage, ?cloud_scale, " |
1033 | cmd.CommandText += "?cloud_detail_x, ?cloud_detail_y, ?cloud_detail_density, ?cloud_scroll_x, ?cloud_scroll_x_lock, "; | 1039 | + "?cloud_detail_x, ?cloud_detail_y, ?cloud_detail_density, ?cloud_scroll_x, ?cloud_scroll_x_lock, " |
1034 | cmd.CommandText += "?cloud_scroll_y, ?cloud_scroll_y_lock, ?draw_classic_clouds)"; | 1040 | + "?cloud_scroll_y, ?cloud_scroll_y_lock, ?draw_classic_clouds)" |
1041 | ; | ||
1035 | 1042 | ||
1036 | cmd.Parameters.AddWithValue("region_id", wl.regionID); | 1043 | cmd.Parameters.AddWithValue("region_id", wl.regionID); |
1037 | cmd.Parameters.AddWithValue("water_color_r", wl.waterColor.X); | 1044 | cmd.Parameters.AddWithValue("water_color_r", wl.waterColor.X); |
@@ -1137,14 +1144,15 @@ namespace OpenSim.Data.MySQL | |||
1137 | IDataReader result = ExecuteReader(cmd); | 1144 | IDataReader result = ExecuteReader(cmd); |
1138 | if (!result.Read()) | 1145 | if (!result.Read()) |
1139 | { | 1146 | { |
1147 | dbcon.Close(); | ||
1140 | return String.Empty; | 1148 | return String.Empty; |
1141 | } | 1149 | } |
1142 | else | 1150 | else |
1143 | { | 1151 | { |
1152 | dbcon.Close(); | ||
1144 | return Convert.ToString(result["llsd_settings"]); | 1153 | return Convert.ToString(result["llsd_settings"]); |
1145 | } | 1154 | } |
1146 | } | 1155 | } |
1147 | dbcon.Close(); | ||
1148 | } | 1156 | } |
1149 | } | 1157 | } |
1150 | 1158 | ||