diff options
author | Justin Clark-Casey (justincc) | 2012-08-31 00:29:57 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-08-31 00:29:57 +0100 |
commit | 7c6e8fab155ff24d460e8de4597531849c291957 (patch) | |
tree | 7eada533f1cc7034fb0f77fb87c2cc7a83e869af /OpenSim/Data | |
parent | Make ReuseDynamicTextures an experimental config setting in [Textures]. Defa... (diff) | |
download | opensim-SC-7c6e8fab155ff24d460e8de4597531849c291957.zip opensim-SC-7c6e8fab155ff24d460e8de4597531849c291957.tar.gz opensim-SC-7c6e8fab155ff24d460e8de4597531849c291957.tar.bz2 opensim-SC-7c6e8fab155ff24d460e8de4597531849c291957.tar.xz |
Do Windlight storage and removal calls in MySQL under m_dbLock, as is done with all the other database calls.
Diffstat (limited to 'OpenSim/Data')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLSimulationData.cs | 210 |
1 files changed, 108 insertions, 102 deletions
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index 3fc04ee..a021590 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs | |||
@@ -853,118 +853,124 @@ namespace OpenSim.Data.MySQL | |||
853 | 853 | ||
854 | public void StoreRegionWindlightSettings(RegionLightShareData wl) | 854 | public void StoreRegionWindlightSettings(RegionLightShareData wl) |
855 | { | 855 | { |
856 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | 856 | lock (m_dbLock) |
857 | { | 857 | { |
858 | dbcon.Open(); | 858 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) |
859 | |||
860 | using (MySqlCommand cmd = dbcon.CreateCommand()) | ||
861 | { | 859 | { |
862 | cmd.CommandText = "REPLACE INTO `regionwindlight` (`region_id`, `water_color_r`, `water_color_g`, "; | 860 | dbcon.Open(); |
863 | cmd.CommandText += "`water_color_b`, `water_fog_density_exponent`, `underwater_fog_modifier`, "; | 861 | |
864 | cmd.CommandText += "`reflection_wavelet_scale_1`, `reflection_wavelet_scale_2`, `reflection_wavelet_scale_3`, "; | 862 | using (MySqlCommand cmd = dbcon.CreateCommand()) |
865 | cmd.CommandText += "`fresnel_scale`, `fresnel_offset`, `refract_scale_above`, `refract_scale_below`, "; | 863 | { |
866 | cmd.CommandText += "`blur_multiplier`, `big_wave_direction_x`, `big_wave_direction_y`, `little_wave_direction_x`, "; | 864 | cmd.CommandText = "REPLACE INTO `regionwindlight` (`region_id`, `water_color_r`, `water_color_g`, "; |
867 | cmd.CommandText += "`little_wave_direction_y`, `normal_map_texture`, `horizon_r`, `horizon_g`, `horizon_b`, "; | 865 | cmd.CommandText += "`water_color_b`, `water_fog_density_exponent`, `underwater_fog_modifier`, "; |
868 | cmd.CommandText += "`horizon_i`, `haze_horizon`, `blue_density_r`, `blue_density_g`, `blue_density_b`, "; | 866 | cmd.CommandText += "`reflection_wavelet_scale_1`, `reflection_wavelet_scale_2`, `reflection_wavelet_scale_3`, "; |
869 | cmd.CommandText += "`blue_density_i`, `haze_density`, `density_multiplier`, `distance_multiplier`, `max_altitude`, "; | 867 | cmd.CommandText += "`fresnel_scale`, `fresnel_offset`, `refract_scale_above`, `refract_scale_below`, "; |
870 | cmd.CommandText += "`sun_moon_color_r`, `sun_moon_color_g`, `sun_moon_color_b`, `sun_moon_color_i`, `sun_moon_position`, "; | 868 | cmd.CommandText += "`blur_multiplier`, `big_wave_direction_x`, `big_wave_direction_y`, `little_wave_direction_x`, "; |
871 | cmd.CommandText += "`ambient_r`, `ambient_g`, `ambient_b`, `ambient_i`, `east_angle`, `sun_glow_focus`, `sun_glow_size`, "; | 869 | cmd.CommandText += "`little_wave_direction_y`, `normal_map_texture`, `horizon_r`, `horizon_g`, `horizon_b`, "; |
872 | cmd.CommandText += "`scene_gamma`, `star_brightness`, `cloud_color_r`, `cloud_color_g`, `cloud_color_b`, `cloud_color_i`, "; | 870 | cmd.CommandText += "`horizon_i`, `haze_horizon`, `blue_density_r`, `blue_density_g`, `blue_density_b`, "; |
873 | cmd.CommandText += "`cloud_x`, `cloud_y`, `cloud_density`, `cloud_coverage`, `cloud_scale`, `cloud_detail_x`, "; | 871 | cmd.CommandText += "`blue_density_i`, `haze_density`, `density_multiplier`, `distance_multiplier`, `max_altitude`, "; |
874 | cmd.CommandText += "`cloud_detail_y`, `cloud_detail_density`, `cloud_scroll_x`, `cloud_scroll_x_lock`, `cloud_scroll_y`, "; | 872 | cmd.CommandText += "`sun_moon_color_r`, `sun_moon_color_g`, `sun_moon_color_b`, `sun_moon_color_i`, `sun_moon_position`, "; |
875 | cmd.CommandText += "`cloud_scroll_y_lock`, `draw_classic_clouds`) VALUES (?region_id, ?water_color_r, "; | 873 | cmd.CommandText += "`ambient_r`, `ambient_g`, `ambient_b`, `ambient_i`, `east_angle`, `sun_glow_focus`, `sun_glow_size`, "; |
876 | cmd.CommandText += "?water_color_g, ?water_color_b, ?water_fog_density_exponent, ?underwater_fog_modifier, ?reflection_wavelet_scale_1, "; | 874 | cmd.CommandText += "`scene_gamma`, `star_brightness`, `cloud_color_r`, `cloud_color_g`, `cloud_color_b`, `cloud_color_i`, "; |
877 | cmd.CommandText += "?reflection_wavelet_scale_2, ?reflection_wavelet_scale_3, ?fresnel_scale, ?fresnel_offset, ?refract_scale_above, "; | 875 | cmd.CommandText += "`cloud_x`, `cloud_y`, `cloud_density`, `cloud_coverage`, `cloud_scale`, `cloud_detail_x`, "; |
878 | cmd.CommandText += "?refract_scale_below, ?blur_multiplier, ?big_wave_direction_x, ?big_wave_direction_y, ?little_wave_direction_x, "; | 876 | cmd.CommandText += "`cloud_detail_y`, `cloud_detail_density`, `cloud_scroll_x`, `cloud_scroll_x_lock`, `cloud_scroll_y`, "; |
879 | cmd.CommandText += "?little_wave_direction_y, ?normal_map_texture, ?horizon_r, ?horizon_g, ?horizon_b, ?horizon_i, ?haze_horizon, "; | 877 | cmd.CommandText += "`cloud_scroll_y_lock`, `draw_classic_clouds`) VALUES (?region_id, ?water_color_r, "; |
880 | cmd.CommandText += "?blue_density_r, ?blue_density_g, ?blue_density_b, ?blue_density_i, ?haze_density, ?density_multiplier, "; | 878 | cmd.CommandText += "?water_color_g, ?water_color_b, ?water_fog_density_exponent, ?underwater_fog_modifier, ?reflection_wavelet_scale_1, "; |
881 | cmd.CommandText += "?distance_multiplier, ?max_altitude, ?sun_moon_color_r, ?sun_moon_color_g, ?sun_moon_color_b, "; | 879 | cmd.CommandText += "?reflection_wavelet_scale_2, ?reflection_wavelet_scale_3, ?fresnel_scale, ?fresnel_offset, ?refract_scale_above, "; |
882 | cmd.CommandText += "?sun_moon_color_i, ?sun_moon_position, ?ambient_r, ?ambient_g, ?ambient_b, ?ambient_i, ?east_angle, "; | 880 | cmd.CommandText += "?refract_scale_below, ?blur_multiplier, ?big_wave_direction_x, ?big_wave_direction_y, ?little_wave_direction_x, "; |
883 | cmd.CommandText += "?sun_glow_focus, ?sun_glow_size, ?scene_gamma, ?star_brightness, ?cloud_color_r, ?cloud_color_g, "; | 881 | cmd.CommandText += "?little_wave_direction_y, ?normal_map_texture, ?horizon_r, ?horizon_g, ?horizon_b, ?horizon_i, ?haze_horizon, "; |
884 | cmd.CommandText += "?cloud_color_b, ?cloud_color_i, ?cloud_x, ?cloud_y, ?cloud_density, ?cloud_coverage, ?cloud_scale, "; | 882 | cmd.CommandText += "?blue_density_r, ?blue_density_g, ?blue_density_b, ?blue_density_i, ?haze_density, ?density_multiplier, "; |
885 | cmd.CommandText += "?cloud_detail_x, ?cloud_detail_y, ?cloud_detail_density, ?cloud_scroll_x, ?cloud_scroll_x_lock, "; | 883 | cmd.CommandText += "?distance_multiplier, ?max_altitude, ?sun_moon_color_r, ?sun_moon_color_g, ?sun_moon_color_b, "; |
886 | cmd.CommandText += "?cloud_scroll_y, ?cloud_scroll_y_lock, ?draw_classic_clouds)"; | 884 | cmd.CommandText += "?sun_moon_color_i, ?sun_moon_position, ?ambient_r, ?ambient_g, ?ambient_b, ?ambient_i, ?east_angle, "; |
887 | 885 | cmd.CommandText += "?sun_glow_focus, ?sun_glow_size, ?scene_gamma, ?star_brightness, ?cloud_color_r, ?cloud_color_g, "; | |
888 | cmd.Parameters.AddWithValue("region_id", wl.regionID); | 886 | cmd.CommandText += "?cloud_color_b, ?cloud_color_i, ?cloud_x, ?cloud_y, ?cloud_density, ?cloud_coverage, ?cloud_scale, "; |
889 | cmd.Parameters.AddWithValue("water_color_r", wl.waterColor.X); | 887 | cmd.CommandText += "?cloud_detail_x, ?cloud_detail_y, ?cloud_detail_density, ?cloud_scroll_x, ?cloud_scroll_x_lock, "; |
890 | cmd.Parameters.AddWithValue("water_color_g", wl.waterColor.Y); | 888 | cmd.CommandText += "?cloud_scroll_y, ?cloud_scroll_y_lock, ?draw_classic_clouds)"; |
891 | cmd.Parameters.AddWithValue("water_color_b", wl.waterColor.Z); | 889 | |
892 | cmd.Parameters.AddWithValue("water_fog_density_exponent", wl.waterFogDensityExponent); | 890 | cmd.Parameters.AddWithValue("region_id", wl.regionID); |
893 | cmd.Parameters.AddWithValue("underwater_fog_modifier", wl.underwaterFogModifier); | 891 | cmd.Parameters.AddWithValue("water_color_r", wl.waterColor.X); |
894 | cmd.Parameters.AddWithValue("reflection_wavelet_scale_1", wl.reflectionWaveletScale.X); | 892 | cmd.Parameters.AddWithValue("water_color_g", wl.waterColor.Y); |
895 | cmd.Parameters.AddWithValue("reflection_wavelet_scale_2", wl.reflectionWaveletScale.Y); | 893 | cmd.Parameters.AddWithValue("water_color_b", wl.waterColor.Z); |
896 | cmd.Parameters.AddWithValue("reflection_wavelet_scale_3", wl.reflectionWaveletScale.Z); | 894 | cmd.Parameters.AddWithValue("water_fog_density_exponent", wl.waterFogDensityExponent); |
897 | cmd.Parameters.AddWithValue("fresnel_scale", wl.fresnelScale); | 895 | cmd.Parameters.AddWithValue("underwater_fog_modifier", wl.underwaterFogModifier); |
898 | cmd.Parameters.AddWithValue("fresnel_offset", wl.fresnelOffset); | 896 | cmd.Parameters.AddWithValue("reflection_wavelet_scale_1", wl.reflectionWaveletScale.X); |
899 | cmd.Parameters.AddWithValue("refract_scale_above", wl.refractScaleAbove); | 897 | cmd.Parameters.AddWithValue("reflection_wavelet_scale_2", wl.reflectionWaveletScale.Y); |
900 | cmd.Parameters.AddWithValue("refract_scale_below", wl.refractScaleBelow); | 898 | cmd.Parameters.AddWithValue("reflection_wavelet_scale_3", wl.reflectionWaveletScale.Z); |
901 | cmd.Parameters.AddWithValue("blur_multiplier", wl.blurMultiplier); | 899 | cmd.Parameters.AddWithValue("fresnel_scale", wl.fresnelScale); |
902 | cmd.Parameters.AddWithValue("big_wave_direction_x", wl.bigWaveDirection.X); | 900 | cmd.Parameters.AddWithValue("fresnel_offset", wl.fresnelOffset); |
903 | cmd.Parameters.AddWithValue("big_wave_direction_y", wl.bigWaveDirection.Y); | 901 | cmd.Parameters.AddWithValue("refract_scale_above", wl.refractScaleAbove); |
904 | cmd.Parameters.AddWithValue("little_wave_direction_x", wl.littleWaveDirection.X); | 902 | cmd.Parameters.AddWithValue("refract_scale_below", wl.refractScaleBelow); |
905 | cmd.Parameters.AddWithValue("little_wave_direction_y", wl.littleWaveDirection.Y); | 903 | cmd.Parameters.AddWithValue("blur_multiplier", wl.blurMultiplier); |
906 | cmd.Parameters.AddWithValue("normal_map_texture", wl.normalMapTexture); | 904 | cmd.Parameters.AddWithValue("big_wave_direction_x", wl.bigWaveDirection.X); |
907 | cmd.Parameters.AddWithValue("horizon_r", wl.horizon.X); | 905 | cmd.Parameters.AddWithValue("big_wave_direction_y", wl.bigWaveDirection.Y); |
908 | cmd.Parameters.AddWithValue("horizon_g", wl.horizon.Y); | 906 | cmd.Parameters.AddWithValue("little_wave_direction_x", wl.littleWaveDirection.X); |
909 | cmd.Parameters.AddWithValue("horizon_b", wl.horizon.Z); | 907 | cmd.Parameters.AddWithValue("little_wave_direction_y", wl.littleWaveDirection.Y); |
910 | cmd.Parameters.AddWithValue("horizon_i", wl.horizon.W); | 908 | cmd.Parameters.AddWithValue("normal_map_texture", wl.normalMapTexture); |
911 | cmd.Parameters.AddWithValue("haze_horizon", wl.hazeHorizon); | 909 | cmd.Parameters.AddWithValue("horizon_r", wl.horizon.X); |
912 | cmd.Parameters.AddWithValue("blue_density_r", wl.blueDensity.X); | 910 | cmd.Parameters.AddWithValue("horizon_g", wl.horizon.Y); |
913 | cmd.Parameters.AddWithValue("blue_density_g", wl.blueDensity.Y); | 911 | cmd.Parameters.AddWithValue("horizon_b", wl.horizon.Z); |
914 | cmd.Parameters.AddWithValue("blue_density_b", wl.blueDensity.Z); | 912 | cmd.Parameters.AddWithValue("horizon_i", wl.horizon.W); |
915 | cmd.Parameters.AddWithValue("blue_density_i", wl.blueDensity.W); | 913 | cmd.Parameters.AddWithValue("haze_horizon", wl.hazeHorizon); |
916 | cmd.Parameters.AddWithValue("haze_density", wl.hazeDensity); | 914 | cmd.Parameters.AddWithValue("blue_density_r", wl.blueDensity.X); |
917 | cmd.Parameters.AddWithValue("density_multiplier", wl.densityMultiplier); | 915 | cmd.Parameters.AddWithValue("blue_density_g", wl.blueDensity.Y); |
918 | cmd.Parameters.AddWithValue("distance_multiplier", wl.distanceMultiplier); | 916 | cmd.Parameters.AddWithValue("blue_density_b", wl.blueDensity.Z); |
919 | cmd.Parameters.AddWithValue("max_altitude", wl.maxAltitude); | 917 | cmd.Parameters.AddWithValue("blue_density_i", wl.blueDensity.W); |
920 | cmd.Parameters.AddWithValue("sun_moon_color_r", wl.sunMoonColor.X); | 918 | cmd.Parameters.AddWithValue("haze_density", wl.hazeDensity); |
921 | cmd.Parameters.AddWithValue("sun_moon_color_g", wl.sunMoonColor.Y); | 919 | cmd.Parameters.AddWithValue("density_multiplier", wl.densityMultiplier); |
922 | cmd.Parameters.AddWithValue("sun_moon_color_b", wl.sunMoonColor.Z); | 920 | cmd.Parameters.AddWithValue("distance_multiplier", wl.distanceMultiplier); |
923 | cmd.Parameters.AddWithValue("sun_moon_color_i", wl.sunMoonColor.W); | 921 | cmd.Parameters.AddWithValue("max_altitude", wl.maxAltitude); |
924 | cmd.Parameters.AddWithValue("sun_moon_position", wl.sunMoonPosition); | 922 | cmd.Parameters.AddWithValue("sun_moon_color_r", wl.sunMoonColor.X); |
925 | cmd.Parameters.AddWithValue("ambient_r", wl.ambient.X); | 923 | cmd.Parameters.AddWithValue("sun_moon_color_g", wl.sunMoonColor.Y); |
926 | cmd.Parameters.AddWithValue("ambient_g", wl.ambient.Y); | 924 | cmd.Parameters.AddWithValue("sun_moon_color_b", wl.sunMoonColor.Z); |
927 | cmd.Parameters.AddWithValue("ambient_b", wl.ambient.Z); | 925 | cmd.Parameters.AddWithValue("sun_moon_color_i", wl.sunMoonColor.W); |
928 | cmd.Parameters.AddWithValue("ambient_i", wl.ambient.W); | 926 | cmd.Parameters.AddWithValue("sun_moon_position", wl.sunMoonPosition); |
929 | cmd.Parameters.AddWithValue("east_angle", wl.eastAngle); | 927 | cmd.Parameters.AddWithValue("ambient_r", wl.ambient.X); |
930 | cmd.Parameters.AddWithValue("sun_glow_focus", wl.sunGlowFocus); | 928 | cmd.Parameters.AddWithValue("ambient_g", wl.ambient.Y); |
931 | cmd.Parameters.AddWithValue("sun_glow_size", wl.sunGlowSize); | 929 | cmd.Parameters.AddWithValue("ambient_b", wl.ambient.Z); |
932 | cmd.Parameters.AddWithValue("scene_gamma", wl.sceneGamma); | 930 | cmd.Parameters.AddWithValue("ambient_i", wl.ambient.W); |
933 | cmd.Parameters.AddWithValue("star_brightness", wl.starBrightness); | 931 | cmd.Parameters.AddWithValue("east_angle", wl.eastAngle); |
934 | cmd.Parameters.AddWithValue("cloud_color_r", wl.cloudColor.X); | 932 | cmd.Parameters.AddWithValue("sun_glow_focus", wl.sunGlowFocus); |
935 | cmd.Parameters.AddWithValue("cloud_color_g", wl.cloudColor.Y); | 933 | cmd.Parameters.AddWithValue("sun_glow_size", wl.sunGlowSize); |
936 | cmd.Parameters.AddWithValue("cloud_color_b", wl.cloudColor.Z); | 934 | cmd.Parameters.AddWithValue("scene_gamma", wl.sceneGamma); |
937 | cmd.Parameters.AddWithValue("cloud_color_i", wl.cloudColor.W); | 935 | cmd.Parameters.AddWithValue("star_brightness", wl.starBrightness); |
938 | cmd.Parameters.AddWithValue("cloud_x", wl.cloudXYDensity.X); | 936 | cmd.Parameters.AddWithValue("cloud_color_r", wl.cloudColor.X); |
939 | cmd.Parameters.AddWithValue("cloud_y", wl.cloudXYDensity.Y); | 937 | cmd.Parameters.AddWithValue("cloud_color_g", wl.cloudColor.Y); |
940 | cmd.Parameters.AddWithValue("cloud_density", wl.cloudXYDensity.Z); | 938 | cmd.Parameters.AddWithValue("cloud_color_b", wl.cloudColor.Z); |
941 | cmd.Parameters.AddWithValue("cloud_coverage", wl.cloudCoverage); | 939 | cmd.Parameters.AddWithValue("cloud_color_i", wl.cloudColor.W); |
942 | cmd.Parameters.AddWithValue("cloud_scale", wl.cloudScale); | 940 | cmd.Parameters.AddWithValue("cloud_x", wl.cloudXYDensity.X); |
943 | cmd.Parameters.AddWithValue("cloud_detail_x", wl.cloudDetailXYDensity.X); | 941 | cmd.Parameters.AddWithValue("cloud_y", wl.cloudXYDensity.Y); |
944 | cmd.Parameters.AddWithValue("cloud_detail_y", wl.cloudDetailXYDensity.Y); | 942 | cmd.Parameters.AddWithValue("cloud_density", wl.cloudXYDensity.Z); |
945 | cmd.Parameters.AddWithValue("cloud_detail_density", wl.cloudDetailXYDensity.Z); | 943 | cmd.Parameters.AddWithValue("cloud_coverage", wl.cloudCoverage); |
946 | cmd.Parameters.AddWithValue("cloud_scroll_x", wl.cloudScrollX); | 944 | cmd.Parameters.AddWithValue("cloud_scale", wl.cloudScale); |
947 | cmd.Parameters.AddWithValue("cloud_scroll_x_lock", wl.cloudScrollXLock); | 945 | cmd.Parameters.AddWithValue("cloud_detail_x", wl.cloudDetailXYDensity.X); |
948 | cmd.Parameters.AddWithValue("cloud_scroll_y", wl.cloudScrollY); | 946 | cmd.Parameters.AddWithValue("cloud_detail_y", wl.cloudDetailXYDensity.Y); |
949 | cmd.Parameters.AddWithValue("cloud_scroll_y_lock", wl.cloudScrollYLock); | 947 | cmd.Parameters.AddWithValue("cloud_detail_density", wl.cloudDetailXYDensity.Z); |
950 | cmd.Parameters.AddWithValue("draw_classic_clouds", wl.drawClassicClouds); | 948 | cmd.Parameters.AddWithValue("cloud_scroll_x", wl.cloudScrollX); |
951 | 949 | cmd.Parameters.AddWithValue("cloud_scroll_x_lock", wl.cloudScrollXLock); | |
952 | ExecuteNonQuery(cmd); | 950 | cmd.Parameters.AddWithValue("cloud_scroll_y", wl.cloudScrollY); |
951 | cmd.Parameters.AddWithValue("cloud_scroll_y_lock", wl.cloudScrollYLock); | ||
952 | cmd.Parameters.AddWithValue("draw_classic_clouds", wl.drawClassicClouds); | ||
953 | |||
954 | ExecuteNonQuery(cmd); | ||
955 | } | ||
953 | } | 956 | } |
954 | } | 957 | } |
955 | } | 958 | } |
956 | 959 | ||
957 | public void RemoveRegionWindlightSettings(UUID regionID) | 960 | public void RemoveRegionWindlightSettings(UUID regionID) |
958 | { | 961 | { |
959 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | 962 | lock (m_dbLock) |
960 | { | 963 | { |
961 | dbcon.Open(); | 964 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) |
962 | |||
963 | using (MySqlCommand cmd = dbcon.CreateCommand()) | ||
964 | { | 965 | { |
965 | cmd.CommandText = "delete from `regionwindlight` where `region_id`=?regionID"; | 966 | dbcon.Open(); |
966 | cmd.Parameters.AddWithValue("?regionID", regionID.ToString()); | 967 | |
967 | ExecuteNonQuery(cmd); | 968 | using (MySqlCommand cmd = dbcon.CreateCommand()) |
969 | { | ||
970 | cmd.CommandText = "delete from `regionwindlight` where `region_id`=?regionID"; | ||
971 | cmd.Parameters.AddWithValue("?regionID", regionID.ToString()); | ||
972 | ExecuteNonQuery(cmd); | ||
973 | } | ||
968 | } | 974 | } |
969 | } | 975 | } |
970 | } | 976 | } |