aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL/MySQLSimulationData.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLSimulationData.cs')
-rw-r--r--OpenSim/Data/MySQL/MySQLSimulationData.cs570
1 files changed, 290 insertions, 280 deletions
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs
index 851fbc2..81b5ec4 100644
--- a/OpenSim/Data/MySQL/MySQLSimulationData.cs
+++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs
@@ -722,7 +722,7 @@ namespace OpenSim.Data.MySQL
722 "MusicURL, PassHours, PassPrice, SnapshotUUID, " + 722 "MusicURL, PassHours, PassPrice, SnapshotUUID, " +
723 "UserLocationX, UserLocationY, UserLocationZ, " + 723 "UserLocationX, UserLocationY, UserLocationZ, " +
724 "UserLookAtX, UserLookAtY, UserLookAtZ, " + 724 "UserLookAtX, UserLookAtY, UserLookAtZ, " +
725 "AuthbuyerID, OtherCleanTime, MediaType, MediaDescription, " + 725 "AuthbuyerID, OtherCleanTime, Dwell, MediaType, MediaDescription, " +
726 "MediaSize, MediaLoop, ObscureMusic, ObscureMedia, " + 726 "MediaSize, MediaLoop, ObscureMusic, ObscureMedia, " +
727 "SeeAVs, AnyAVSounds, GroupAVSounds) values (" + 727 "SeeAVs, AnyAVSounds, GroupAVSounds) values (" +
728 "?UUID, ?RegionUUID, " + 728 "?UUID, ?RegionUUID, " +
@@ -734,7 +734,7 @@ namespace OpenSim.Data.MySQL
734 "?MusicURL, ?PassHours, ?PassPrice, ?SnapshotUUID, " + 734 "?MusicURL, ?PassHours, ?PassPrice, ?SnapshotUUID, " +
735 "?UserLocationX, ?UserLocationY, ?UserLocationZ, " + 735 "?UserLocationX, ?UserLocationY, ?UserLocationZ, " +
736 "?UserLookAtX, ?UserLookAtY, ?UserLookAtZ, " + 736 "?UserLookAtX, ?UserLookAtY, ?UserLookAtZ, " +
737 "?AuthbuyerID, ?OtherCleanTime, ?MediaType, ?MediaDescription, "+ 737 "?AuthbuyerID, ?OtherCleanTime, ?Dwell, ?MediaType, ?MediaDescription, "+
738 "CONCAT(?MediaWidth, ',', ?MediaHeight), ?MediaLoop, ?ObscureMusic, ?ObscureMedia, " + 738 "CONCAT(?MediaWidth, ',', ?MediaHeight), ?MediaLoop, ?ObscureMusic, ?ObscureMedia, " +
739 "?SeeAVs, ?AnyAVSounds, ?GroupAVSounds)"; 739 "?SeeAVs, ?AnyAVSounds, ?GroupAVSounds)";
740 740
@@ -767,95 +767,92 @@ namespace OpenSim.Data.MySQL
767 RegionLightShareData nWP = new RegionLightShareData(); 767 RegionLightShareData nWP = new RegionLightShareData();
768 nWP.OnSave += StoreRegionWindlightSettings; 768 nWP.OnSave += StoreRegionWindlightSettings;
769 769
770 lock (m_dbLock) 770 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
771 { 771 {
772 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) 772 dbcon.Open();
773
774 string command = "select * from `regionwindlight` where region_id = ?regionID";
775
776 using (MySqlCommand cmd = new MySqlCommand(command))
773 { 777 {
774 dbcon.Open(); 778 cmd.Connection = dbcon;
775 779
776 string command = "select * from `regionwindlight` where region_id = ?regionID"; 780 cmd.Parameters.AddWithValue("?regionID", regionUUID.ToString());
777 781
778 using (MySqlCommand cmd = new MySqlCommand(command)) 782 IDataReader result = ExecuteReader(cmd);
783 if (!result.Read())
779 { 784 {
780 cmd.Connection = dbcon; 785 //No result, so store our default windlight profile and return it
781 786 nWP.regionID = regionUUID;
782 cmd.Parameters.AddWithValue("?regionID", regionUUID.ToString());
783
784 IDataReader result = ExecuteReader(cmd);
785 if (!result.Read())
786 {
787 //No result, so store our default windlight profile and return it
788 nWP.regionID = regionUUID;
789// StoreRegionWindlightSettings(nWP); 787// StoreRegionWindlightSettings(nWP);
790 return nWP; 788 return nWP;
791 } 789 }
792 else 790 else
793 { 791 {
794 nWP.regionID = DBGuid.FromDB(result["region_id"]); 792 nWP.regionID = DBGuid.FromDB(result["region_id"]);
795 nWP.waterColor.X = Convert.ToSingle(result["water_color_r"]); 793 nWP.waterColor.X = Convert.ToSingle(result["water_color_r"]);
796 nWP.waterColor.Y = Convert.ToSingle(result["water_color_g"]); 794 nWP.waterColor.Y = Convert.ToSingle(result["water_color_g"]);
797 nWP.waterColor.Z = Convert.ToSingle(result["water_color_b"]); 795 nWP.waterColor.Z = Convert.ToSingle(result["water_color_b"]);
798 nWP.waterFogDensityExponent = Convert.ToSingle(result["water_fog_density_exponent"]); 796 nWP.waterFogDensityExponent = Convert.ToSingle(result["water_fog_density_exponent"]);
799 nWP.underwaterFogModifier = Convert.ToSingle(result["underwater_fog_modifier"]); 797 nWP.underwaterFogModifier = Convert.ToSingle(result["underwater_fog_modifier"]);
800 nWP.reflectionWaveletScale.X = Convert.ToSingle(result["reflection_wavelet_scale_1"]); 798 nWP.reflectionWaveletScale.X = Convert.ToSingle(result["reflection_wavelet_scale_1"]);
801 nWP.reflectionWaveletScale.Y = Convert.ToSingle(result["reflection_wavelet_scale_2"]); 799 nWP.reflectionWaveletScale.Y = Convert.ToSingle(result["reflection_wavelet_scale_2"]);
802 nWP.reflectionWaveletScale.Z = Convert.ToSingle(result["reflection_wavelet_scale_3"]); 800 nWP.reflectionWaveletScale.Z = Convert.ToSingle(result["reflection_wavelet_scale_3"]);
803 nWP.fresnelScale = Convert.ToSingle(result["fresnel_scale"]); 801 nWP.fresnelScale = Convert.ToSingle(result["fresnel_scale"]);
804 nWP.fresnelOffset = Convert.ToSingle(result["fresnel_offset"]); 802 nWP.fresnelOffset = Convert.ToSingle(result["fresnel_offset"]);
805 nWP.refractScaleAbove = Convert.ToSingle(result["refract_scale_above"]); 803 nWP.refractScaleAbove = Convert.ToSingle(result["refract_scale_above"]);
806 nWP.refractScaleBelow = Convert.ToSingle(result["refract_scale_below"]); 804 nWP.refractScaleBelow = Convert.ToSingle(result["refract_scale_below"]);
807 nWP.blurMultiplier = Convert.ToSingle(result["blur_multiplier"]); 805 nWP.blurMultiplier = Convert.ToSingle(result["blur_multiplier"]);
808 nWP.bigWaveDirection.X = Convert.ToSingle(result["big_wave_direction_x"]); 806 nWP.bigWaveDirection.X = Convert.ToSingle(result["big_wave_direction_x"]);
809 nWP.bigWaveDirection.Y = Convert.ToSingle(result["big_wave_direction_y"]); 807 nWP.bigWaveDirection.Y = Convert.ToSingle(result["big_wave_direction_y"]);
810 nWP.littleWaveDirection.X = Convert.ToSingle(result["little_wave_direction_x"]); 808 nWP.littleWaveDirection.X = Convert.ToSingle(result["little_wave_direction_x"]);
811 nWP.littleWaveDirection.Y = Convert.ToSingle(result["little_wave_direction_y"]); 809 nWP.littleWaveDirection.Y = Convert.ToSingle(result["little_wave_direction_y"]);
812 UUID.TryParse(result["normal_map_texture"].ToString(), out nWP.normalMapTexture); 810 UUID.TryParse(result["normal_map_texture"].ToString(), out nWP.normalMapTexture);
813 nWP.horizon.X = Convert.ToSingle(result["horizon_r"]); 811 nWP.horizon.X = Convert.ToSingle(result["horizon_r"]);
814 nWP.horizon.Y = Convert.ToSingle(result["horizon_g"]); 812 nWP.horizon.Y = Convert.ToSingle(result["horizon_g"]);
815 nWP.horizon.Z = Convert.ToSingle(result["horizon_b"]); 813 nWP.horizon.Z = Convert.ToSingle(result["horizon_b"]);
816 nWP.horizon.W = Convert.ToSingle(result["horizon_i"]); 814 nWP.horizon.W = Convert.ToSingle(result["horizon_i"]);
817 nWP.hazeHorizon = Convert.ToSingle(result["haze_horizon"]); 815 nWP.hazeHorizon = Convert.ToSingle(result["haze_horizon"]);
818 nWP.blueDensity.X = Convert.ToSingle(result["blue_density_r"]); 816 nWP.blueDensity.X = Convert.ToSingle(result["blue_density_r"]);
819 nWP.blueDensity.Y = Convert.ToSingle(result["blue_density_g"]); 817 nWP.blueDensity.Y = Convert.ToSingle(result["blue_density_g"]);
820 nWP.blueDensity.Z = Convert.ToSingle(result["blue_density_b"]); 818 nWP.blueDensity.Z = Convert.ToSingle(result["blue_density_b"]);
821 nWP.blueDensity.W = Convert.ToSingle(result["blue_density_i"]); 819 nWP.blueDensity.W = Convert.ToSingle(result["blue_density_i"]);
822 nWP.hazeDensity = Convert.ToSingle(result["haze_density"]); 820 nWP.hazeDensity = Convert.ToSingle(result["haze_density"]);
823 nWP.densityMultiplier = Convert.ToSingle(result["density_multiplier"]); 821 nWP.densityMultiplier = Convert.ToSingle(result["density_multiplier"]);
824 nWP.distanceMultiplier = Convert.ToSingle(result["distance_multiplier"]); 822 nWP.distanceMultiplier = Convert.ToSingle(result["distance_multiplier"]);
825 nWP.maxAltitude = Convert.ToUInt16(result["max_altitude"]); 823 nWP.maxAltitude = Convert.ToUInt16(result["max_altitude"]);
826 nWP.sunMoonColor.X = Convert.ToSingle(result["sun_moon_color_r"]); 824 nWP.sunMoonColor.X = Convert.ToSingle(result["sun_moon_color_r"]);
827 nWP.sunMoonColor.Y = Convert.ToSingle(result["sun_moon_color_g"]); 825 nWP.sunMoonColor.Y = Convert.ToSingle(result["sun_moon_color_g"]);
828 nWP.sunMoonColor.Z = Convert.ToSingle(result["sun_moon_color_b"]); 826 nWP.sunMoonColor.Z = Convert.ToSingle(result["sun_moon_color_b"]);
829 nWP.sunMoonColor.W = Convert.ToSingle(result["sun_moon_color_i"]); 827 nWP.sunMoonColor.W = Convert.ToSingle(result["sun_moon_color_i"]);
830 nWP.sunMoonPosition = Convert.ToSingle(result["sun_moon_position"]); 828 nWP.sunMoonPosition = Convert.ToSingle(result["sun_moon_position"]);
831 nWP.ambient.X = Convert.ToSingle(result["ambient_r"]); 829 nWP.ambient.X = Convert.ToSingle(result["ambient_r"]);
832 nWP.ambient.Y = Convert.ToSingle(result["ambient_g"]); 830 nWP.ambient.Y = Convert.ToSingle(result["ambient_g"]);
833 nWP.ambient.Z = Convert.ToSingle(result["ambient_b"]); 831 nWP.ambient.Z = Convert.ToSingle(result["ambient_b"]);
834 nWP.ambient.W = Convert.ToSingle(result["ambient_i"]); 832 nWP.ambient.W = Convert.ToSingle(result["ambient_i"]);
835 nWP.eastAngle = Convert.ToSingle(result["east_angle"]); 833 nWP.eastAngle = Convert.ToSingle(result["east_angle"]);
836 nWP.sunGlowFocus = Convert.ToSingle(result["sun_glow_focus"]); 834 nWP.sunGlowFocus = Convert.ToSingle(result["sun_glow_focus"]);
837 nWP.sunGlowSize = Convert.ToSingle(result["sun_glow_size"]); 835 nWP.sunGlowSize = Convert.ToSingle(result["sun_glow_size"]);
838 nWP.sceneGamma = Convert.ToSingle(result["scene_gamma"]); 836 nWP.sceneGamma = Convert.ToSingle(result["scene_gamma"]);
839 nWP.starBrightness = Convert.ToSingle(result["star_brightness"]); 837 nWP.starBrightness = Convert.ToSingle(result["star_brightness"]);
840 nWP.cloudColor.X = Convert.ToSingle(result["cloud_color_r"]); 838 nWP.cloudColor.X = Convert.ToSingle(result["cloud_color_r"]);
841 nWP.cloudColor.Y = Convert.ToSingle(result["cloud_color_g"]); 839 nWP.cloudColor.Y = Convert.ToSingle(result["cloud_color_g"]);
842 nWP.cloudColor.Z = Convert.ToSingle(result["cloud_color_b"]); 840 nWP.cloudColor.Z = Convert.ToSingle(result["cloud_color_b"]);
843 nWP.cloudColor.W = Convert.ToSingle(result["cloud_color_i"]); 841 nWP.cloudColor.W = Convert.ToSingle(result["cloud_color_i"]);
844 nWP.cloudXYDensity.X = Convert.ToSingle(result["cloud_x"]); 842 nWP.cloudXYDensity.X = Convert.ToSingle(result["cloud_x"]);
845 nWP.cloudXYDensity.Y = Convert.ToSingle(result["cloud_y"]); 843 nWP.cloudXYDensity.Y = Convert.ToSingle(result["cloud_y"]);
846 nWP.cloudXYDensity.Z = Convert.ToSingle(result["cloud_density"]); 844 nWP.cloudXYDensity.Z = Convert.ToSingle(result["cloud_density"]);
847 nWP.cloudCoverage = Convert.ToSingle(result["cloud_coverage"]); 845 nWP.cloudCoverage = Convert.ToSingle(result["cloud_coverage"]);
848 nWP.cloudScale = Convert.ToSingle(result["cloud_scale"]); 846 nWP.cloudScale = Convert.ToSingle(result["cloud_scale"]);
849 nWP.cloudDetailXYDensity.X = Convert.ToSingle(result["cloud_detail_x"]); 847 nWP.cloudDetailXYDensity.X = Convert.ToSingle(result["cloud_detail_x"]);
850 nWP.cloudDetailXYDensity.Y = Convert.ToSingle(result["cloud_detail_y"]); 848 nWP.cloudDetailXYDensity.Y = Convert.ToSingle(result["cloud_detail_y"]);
851 nWP.cloudDetailXYDensity.Z = Convert.ToSingle(result["cloud_detail_density"]); 849 nWP.cloudDetailXYDensity.Z = Convert.ToSingle(result["cloud_detail_density"]);
852 nWP.cloudScrollX = Convert.ToSingle(result["cloud_scroll_x"]); 850 nWP.cloudScrollX = Convert.ToSingle(result["cloud_scroll_x"]);
853 nWP.cloudScrollXLock = Convert.ToBoolean(result["cloud_scroll_x_lock"]); 851 nWP.cloudScrollXLock = Convert.ToBoolean(result["cloud_scroll_x_lock"]);
854 nWP.cloudScrollY = Convert.ToSingle(result["cloud_scroll_y"]); 852 nWP.cloudScrollY = Convert.ToSingle(result["cloud_scroll_y"]);
855 nWP.cloudScrollYLock = Convert.ToBoolean(result["cloud_scroll_y_lock"]); 853 nWP.cloudScrollYLock = Convert.ToBoolean(result["cloud_scroll_y_lock"]);
856 nWP.drawClassicClouds = Convert.ToBoolean(result["draw_classic_clouds"]); 854 nWP.drawClassicClouds = Convert.ToBoolean(result["draw_classic_clouds"]);
857 nWP.valid = true; 855 nWP.valid = true;
858 }
859 } 856 }
860 } 857 }
861 } 858 }
@@ -905,124 +902,118 @@ namespace OpenSim.Data.MySQL
905 902
906 public virtual void StoreRegionWindlightSettings(RegionLightShareData wl) 903 public virtual void StoreRegionWindlightSettings(RegionLightShareData wl)
907 { 904 {
908 lock (m_dbLock) 905 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
909 { 906 {
910 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) 907 dbcon.Open();
908
909 using (MySqlCommand cmd = dbcon.CreateCommand())
911 { 910 {
912 dbcon.Open(); 911 cmd.CommandText = "REPLACE INTO `regionwindlight` (`region_id`, `water_color_r`, `water_color_g`, ";
913 912 cmd.CommandText += "`water_color_b`, `water_fog_density_exponent`, `underwater_fog_modifier`, ";
914 using (MySqlCommand cmd = dbcon.CreateCommand()) 913 cmd.CommandText += "`reflection_wavelet_scale_1`, `reflection_wavelet_scale_2`, `reflection_wavelet_scale_3`, ";
915 { 914 cmd.CommandText += "`fresnel_scale`, `fresnel_offset`, `refract_scale_above`, `refract_scale_below`, ";
916 cmd.CommandText = "REPLACE INTO `regionwindlight` (`region_id`, `water_color_r`, `water_color_g`, "; 915 cmd.CommandText += "`blur_multiplier`, `big_wave_direction_x`, `big_wave_direction_y`, `little_wave_direction_x`, ";
917 cmd.CommandText += "`water_color_b`, `water_fog_density_exponent`, `underwater_fog_modifier`, "; 916 cmd.CommandText += "`little_wave_direction_y`, `normal_map_texture`, `horizon_r`, `horizon_g`, `horizon_b`, ";
918 cmd.CommandText += "`reflection_wavelet_scale_1`, `reflection_wavelet_scale_2`, `reflection_wavelet_scale_3`, "; 917 cmd.CommandText += "`horizon_i`, `haze_horizon`, `blue_density_r`, `blue_density_g`, `blue_density_b`, ";
919 cmd.CommandText += "`fresnel_scale`, `fresnel_offset`, `refract_scale_above`, `refract_scale_below`, "; 918 cmd.CommandText += "`blue_density_i`, `haze_density`, `density_multiplier`, `distance_multiplier`, `max_altitude`, ";
920 cmd.CommandText += "`blur_multiplier`, `big_wave_direction_x`, `big_wave_direction_y`, `little_wave_direction_x`, "; 919 cmd.CommandText += "`sun_moon_color_r`, `sun_moon_color_g`, `sun_moon_color_b`, `sun_moon_color_i`, `sun_moon_position`, ";
921 cmd.CommandText += "`little_wave_direction_y`, `normal_map_texture`, `horizon_r`, `horizon_g`, `horizon_b`, "; 920 cmd.CommandText += "`ambient_r`, `ambient_g`, `ambient_b`, `ambient_i`, `east_angle`, `sun_glow_focus`, `sun_glow_size`, ";
922 cmd.CommandText += "`horizon_i`, `haze_horizon`, `blue_density_r`, `blue_density_g`, `blue_density_b`, "; 921 cmd.CommandText += "`scene_gamma`, `star_brightness`, `cloud_color_r`, `cloud_color_g`, `cloud_color_b`, `cloud_color_i`, ";
923 cmd.CommandText += "`blue_density_i`, `haze_density`, `density_multiplier`, `distance_multiplier`, `max_altitude`, "; 922 cmd.CommandText += "`cloud_x`, `cloud_y`, `cloud_density`, `cloud_coverage`, `cloud_scale`, `cloud_detail_x`, ";
924 cmd.CommandText += "`sun_moon_color_r`, `sun_moon_color_g`, `sun_moon_color_b`, `sun_moon_color_i`, `sun_moon_position`, "; 923 cmd.CommandText += "`cloud_detail_y`, `cloud_detail_density`, `cloud_scroll_x`, `cloud_scroll_x_lock`, `cloud_scroll_y`, ";
925 cmd.CommandText += "`ambient_r`, `ambient_g`, `ambient_b`, `ambient_i`, `east_angle`, `sun_glow_focus`, `sun_glow_size`, "; 924 cmd.CommandText += "`cloud_scroll_y_lock`, `draw_classic_clouds`) VALUES (?region_id, ?water_color_r, ";
926 cmd.CommandText += "`scene_gamma`, `star_brightness`, `cloud_color_r`, `cloud_color_g`, `cloud_color_b`, `cloud_color_i`, "; 925 cmd.CommandText += "?water_color_g, ?water_color_b, ?water_fog_density_exponent, ?underwater_fog_modifier, ?reflection_wavelet_scale_1, ";
927 cmd.CommandText += "`cloud_x`, `cloud_y`, `cloud_density`, `cloud_coverage`, `cloud_scale`, `cloud_detail_x`, "; 926 cmd.CommandText += "?reflection_wavelet_scale_2, ?reflection_wavelet_scale_3, ?fresnel_scale, ?fresnel_offset, ?refract_scale_above, ";
928 cmd.CommandText += "`cloud_detail_y`, `cloud_detail_density`, `cloud_scroll_x`, `cloud_scroll_x_lock`, `cloud_scroll_y`, "; 927 cmd.CommandText += "?refract_scale_below, ?blur_multiplier, ?big_wave_direction_x, ?big_wave_direction_y, ?little_wave_direction_x, ";
929 cmd.CommandText += "`cloud_scroll_y_lock`, `draw_classic_clouds`) VALUES (?region_id, ?water_color_r, "; 928 cmd.CommandText += "?little_wave_direction_y, ?normal_map_texture, ?horizon_r, ?horizon_g, ?horizon_b, ?horizon_i, ?haze_horizon, ";
930 cmd.CommandText += "?water_color_g, ?water_color_b, ?water_fog_density_exponent, ?underwater_fog_modifier, ?reflection_wavelet_scale_1, "; 929 cmd.CommandText += "?blue_density_r, ?blue_density_g, ?blue_density_b, ?blue_density_i, ?haze_density, ?density_multiplier, ";
931 cmd.CommandText += "?reflection_wavelet_scale_2, ?reflection_wavelet_scale_3, ?fresnel_scale, ?fresnel_offset, ?refract_scale_above, "; 930 cmd.CommandText += "?distance_multiplier, ?max_altitude, ?sun_moon_color_r, ?sun_moon_color_g, ?sun_moon_color_b, ";
932 cmd.CommandText += "?refract_scale_below, ?blur_multiplier, ?big_wave_direction_x, ?big_wave_direction_y, ?little_wave_direction_x, "; 931 cmd.CommandText += "?sun_moon_color_i, ?sun_moon_position, ?ambient_r, ?ambient_g, ?ambient_b, ?ambient_i, ?east_angle, ";
933 cmd.CommandText += "?little_wave_direction_y, ?normal_map_texture, ?horizon_r, ?horizon_g, ?horizon_b, ?horizon_i, ?haze_horizon, "; 932 cmd.CommandText += "?sun_glow_focus, ?sun_glow_size, ?scene_gamma, ?star_brightness, ?cloud_color_r, ?cloud_color_g, ";
934 cmd.CommandText += "?blue_density_r, ?blue_density_g, ?blue_density_b, ?blue_density_i, ?haze_density, ?density_multiplier, "; 933 cmd.CommandText += "?cloud_color_b, ?cloud_color_i, ?cloud_x, ?cloud_y, ?cloud_density, ?cloud_coverage, ?cloud_scale, ";
935 cmd.CommandText += "?distance_multiplier, ?max_altitude, ?sun_moon_color_r, ?sun_moon_color_g, ?sun_moon_color_b, "; 934 cmd.CommandText += "?cloud_detail_x, ?cloud_detail_y, ?cloud_detail_density, ?cloud_scroll_x, ?cloud_scroll_x_lock, ";
936 cmd.CommandText += "?sun_moon_color_i, ?sun_moon_position, ?ambient_r, ?ambient_g, ?ambient_b, ?ambient_i, ?east_angle, "; 935 cmd.CommandText += "?cloud_scroll_y, ?cloud_scroll_y_lock, ?draw_classic_clouds)";
937 cmd.CommandText += "?sun_glow_focus, ?sun_glow_size, ?scene_gamma, ?star_brightness, ?cloud_color_r, ?cloud_color_g, "; 936
938 cmd.CommandText += "?cloud_color_b, ?cloud_color_i, ?cloud_x, ?cloud_y, ?cloud_density, ?cloud_coverage, ?cloud_scale, "; 937 cmd.Parameters.AddWithValue("region_id", wl.regionID);
939 cmd.CommandText += "?cloud_detail_x, ?cloud_detail_y, ?cloud_detail_density, ?cloud_scroll_x, ?cloud_scroll_x_lock, "; 938 cmd.Parameters.AddWithValue("water_color_r", wl.waterColor.X);
940 cmd.CommandText += "?cloud_scroll_y, ?cloud_scroll_y_lock, ?draw_classic_clouds)"; 939 cmd.Parameters.AddWithValue("water_color_g", wl.waterColor.Y);
941 940 cmd.Parameters.AddWithValue("water_color_b", wl.waterColor.Z);
942 cmd.Parameters.AddWithValue("region_id", wl.regionID); 941 cmd.Parameters.AddWithValue("water_fog_density_exponent", wl.waterFogDensityExponent);
943 cmd.Parameters.AddWithValue("water_color_r", wl.waterColor.X); 942 cmd.Parameters.AddWithValue("underwater_fog_modifier", wl.underwaterFogModifier);
944 cmd.Parameters.AddWithValue("water_color_g", wl.waterColor.Y); 943 cmd.Parameters.AddWithValue("reflection_wavelet_scale_1", wl.reflectionWaveletScale.X);
945 cmd.Parameters.AddWithValue("water_color_b", wl.waterColor.Z); 944 cmd.Parameters.AddWithValue("reflection_wavelet_scale_2", wl.reflectionWaveletScale.Y);
946 cmd.Parameters.AddWithValue("water_fog_density_exponent", wl.waterFogDensityExponent); 945 cmd.Parameters.AddWithValue("reflection_wavelet_scale_3", wl.reflectionWaveletScale.Z);
947 cmd.Parameters.AddWithValue("underwater_fog_modifier", wl.underwaterFogModifier); 946 cmd.Parameters.AddWithValue("fresnel_scale", wl.fresnelScale);
948 cmd.Parameters.AddWithValue("reflection_wavelet_scale_1", wl.reflectionWaveletScale.X); 947 cmd.Parameters.AddWithValue("fresnel_offset", wl.fresnelOffset);
949 cmd.Parameters.AddWithValue("reflection_wavelet_scale_2", wl.reflectionWaveletScale.Y); 948 cmd.Parameters.AddWithValue("refract_scale_above", wl.refractScaleAbove);
950 cmd.Parameters.AddWithValue("reflection_wavelet_scale_3", wl.reflectionWaveletScale.Z); 949 cmd.Parameters.AddWithValue("refract_scale_below", wl.refractScaleBelow);
951 cmd.Parameters.AddWithValue("fresnel_scale", wl.fresnelScale); 950 cmd.Parameters.AddWithValue("blur_multiplier", wl.blurMultiplier);
952 cmd.Parameters.AddWithValue("fresnel_offset", wl.fresnelOffset); 951 cmd.Parameters.AddWithValue("big_wave_direction_x", wl.bigWaveDirection.X);
953 cmd.Parameters.AddWithValue("refract_scale_above", wl.refractScaleAbove); 952 cmd.Parameters.AddWithValue("big_wave_direction_y", wl.bigWaveDirection.Y);
954 cmd.Parameters.AddWithValue("refract_scale_below", wl.refractScaleBelow); 953 cmd.Parameters.AddWithValue("little_wave_direction_x", wl.littleWaveDirection.X);
955 cmd.Parameters.AddWithValue("blur_multiplier", wl.blurMultiplier); 954 cmd.Parameters.AddWithValue("little_wave_direction_y", wl.littleWaveDirection.Y);
956 cmd.Parameters.AddWithValue("big_wave_direction_x", wl.bigWaveDirection.X); 955 cmd.Parameters.AddWithValue("normal_map_texture", wl.normalMapTexture);
957 cmd.Parameters.AddWithValue("big_wave_direction_y", wl.bigWaveDirection.Y); 956 cmd.Parameters.AddWithValue("horizon_r", wl.horizon.X);
958 cmd.Parameters.AddWithValue("little_wave_direction_x", wl.littleWaveDirection.X); 957 cmd.Parameters.AddWithValue("horizon_g", wl.horizon.Y);
959 cmd.Parameters.AddWithValue("little_wave_direction_y", wl.littleWaveDirection.Y); 958 cmd.Parameters.AddWithValue("horizon_b", wl.horizon.Z);
960 cmd.Parameters.AddWithValue("normal_map_texture", wl.normalMapTexture); 959 cmd.Parameters.AddWithValue("horizon_i", wl.horizon.W);
961 cmd.Parameters.AddWithValue("horizon_r", wl.horizon.X); 960 cmd.Parameters.AddWithValue("haze_horizon", wl.hazeHorizon);
962 cmd.Parameters.AddWithValue("horizon_g", wl.horizon.Y); 961 cmd.Parameters.AddWithValue("blue_density_r", wl.blueDensity.X);
963 cmd.Parameters.AddWithValue("horizon_b", wl.horizon.Z); 962 cmd.Parameters.AddWithValue("blue_density_g", wl.blueDensity.Y);
964 cmd.Parameters.AddWithValue("horizon_i", wl.horizon.W); 963 cmd.Parameters.AddWithValue("blue_density_b", wl.blueDensity.Z);
965 cmd.Parameters.AddWithValue("haze_horizon", wl.hazeHorizon); 964 cmd.Parameters.AddWithValue("blue_density_i", wl.blueDensity.W);
966 cmd.Parameters.AddWithValue("blue_density_r", wl.blueDensity.X); 965 cmd.Parameters.AddWithValue("haze_density", wl.hazeDensity);
967 cmd.Parameters.AddWithValue("blue_density_g", wl.blueDensity.Y); 966 cmd.Parameters.AddWithValue("density_multiplier", wl.densityMultiplier);
968 cmd.Parameters.AddWithValue("blue_density_b", wl.blueDensity.Z); 967 cmd.Parameters.AddWithValue("distance_multiplier", wl.distanceMultiplier);
969 cmd.Parameters.AddWithValue("blue_density_i", wl.blueDensity.W); 968 cmd.Parameters.AddWithValue("max_altitude", wl.maxAltitude);
970 cmd.Parameters.AddWithValue("haze_density", wl.hazeDensity); 969 cmd.Parameters.AddWithValue("sun_moon_color_r", wl.sunMoonColor.X);
971 cmd.Parameters.AddWithValue("density_multiplier", wl.densityMultiplier); 970 cmd.Parameters.AddWithValue("sun_moon_color_g", wl.sunMoonColor.Y);
972 cmd.Parameters.AddWithValue("distance_multiplier", wl.distanceMultiplier); 971 cmd.Parameters.AddWithValue("sun_moon_color_b", wl.sunMoonColor.Z);
973 cmd.Parameters.AddWithValue("max_altitude", wl.maxAltitude); 972 cmd.Parameters.AddWithValue("sun_moon_color_i", wl.sunMoonColor.W);
974 cmd.Parameters.AddWithValue("sun_moon_color_r", wl.sunMoonColor.X); 973 cmd.Parameters.AddWithValue("sun_moon_position", wl.sunMoonPosition);
975 cmd.Parameters.AddWithValue("sun_moon_color_g", wl.sunMoonColor.Y); 974 cmd.Parameters.AddWithValue("ambient_r", wl.ambient.X);
976 cmd.Parameters.AddWithValue("sun_moon_color_b", wl.sunMoonColor.Z); 975 cmd.Parameters.AddWithValue("ambient_g", wl.ambient.Y);
977 cmd.Parameters.AddWithValue("sun_moon_color_i", wl.sunMoonColor.W); 976 cmd.Parameters.AddWithValue("ambient_b", wl.ambient.Z);
978 cmd.Parameters.AddWithValue("sun_moon_position", wl.sunMoonPosition); 977 cmd.Parameters.AddWithValue("ambient_i", wl.ambient.W);
979 cmd.Parameters.AddWithValue("ambient_r", wl.ambient.X); 978 cmd.Parameters.AddWithValue("east_angle", wl.eastAngle);
980 cmd.Parameters.AddWithValue("ambient_g", wl.ambient.Y); 979 cmd.Parameters.AddWithValue("sun_glow_focus", wl.sunGlowFocus);
981 cmd.Parameters.AddWithValue("ambient_b", wl.ambient.Z); 980 cmd.Parameters.AddWithValue("sun_glow_size", wl.sunGlowSize);
982 cmd.Parameters.AddWithValue("ambient_i", wl.ambient.W); 981 cmd.Parameters.AddWithValue("scene_gamma", wl.sceneGamma);
983 cmd.Parameters.AddWithValue("east_angle", wl.eastAngle); 982 cmd.Parameters.AddWithValue("star_brightness", wl.starBrightness);
984 cmd.Parameters.AddWithValue("sun_glow_focus", wl.sunGlowFocus); 983 cmd.Parameters.AddWithValue("cloud_color_r", wl.cloudColor.X);
985 cmd.Parameters.AddWithValue("sun_glow_size", wl.sunGlowSize); 984 cmd.Parameters.AddWithValue("cloud_color_g", wl.cloudColor.Y);
986 cmd.Parameters.AddWithValue("scene_gamma", wl.sceneGamma); 985 cmd.Parameters.AddWithValue("cloud_color_b", wl.cloudColor.Z);
987 cmd.Parameters.AddWithValue("star_brightness", wl.starBrightness); 986 cmd.Parameters.AddWithValue("cloud_color_i", wl.cloudColor.W);
988 cmd.Parameters.AddWithValue("cloud_color_r", wl.cloudColor.X); 987 cmd.Parameters.AddWithValue("cloud_x", wl.cloudXYDensity.X);
989 cmd.Parameters.AddWithValue("cloud_color_g", wl.cloudColor.Y); 988 cmd.Parameters.AddWithValue("cloud_y", wl.cloudXYDensity.Y);
990 cmd.Parameters.AddWithValue("cloud_color_b", wl.cloudColor.Z); 989 cmd.Parameters.AddWithValue("cloud_density", wl.cloudXYDensity.Z);
991 cmd.Parameters.AddWithValue("cloud_color_i", wl.cloudColor.W); 990 cmd.Parameters.AddWithValue("cloud_coverage", wl.cloudCoverage);
992 cmd.Parameters.AddWithValue("cloud_x", wl.cloudXYDensity.X); 991 cmd.Parameters.AddWithValue("cloud_scale", wl.cloudScale);
993 cmd.Parameters.AddWithValue("cloud_y", wl.cloudXYDensity.Y); 992 cmd.Parameters.AddWithValue("cloud_detail_x", wl.cloudDetailXYDensity.X);
994 cmd.Parameters.AddWithValue("cloud_density", wl.cloudXYDensity.Z); 993 cmd.Parameters.AddWithValue("cloud_detail_y", wl.cloudDetailXYDensity.Y);
995 cmd.Parameters.AddWithValue("cloud_coverage", wl.cloudCoverage); 994 cmd.Parameters.AddWithValue("cloud_detail_density", wl.cloudDetailXYDensity.Z);
996 cmd.Parameters.AddWithValue("cloud_scale", wl.cloudScale); 995 cmd.Parameters.AddWithValue("cloud_scroll_x", wl.cloudScrollX);
997 cmd.Parameters.AddWithValue("cloud_detail_x", wl.cloudDetailXYDensity.X); 996 cmd.Parameters.AddWithValue("cloud_scroll_x_lock", wl.cloudScrollXLock);
998 cmd.Parameters.AddWithValue("cloud_detail_y", wl.cloudDetailXYDensity.Y); 997 cmd.Parameters.AddWithValue("cloud_scroll_y", wl.cloudScrollY);
999 cmd.Parameters.AddWithValue("cloud_detail_density", wl.cloudDetailXYDensity.Z); 998 cmd.Parameters.AddWithValue("cloud_scroll_y_lock", wl.cloudScrollYLock);
1000 cmd.Parameters.AddWithValue("cloud_scroll_x", wl.cloudScrollX); 999 cmd.Parameters.AddWithValue("draw_classic_clouds", wl.drawClassicClouds);
1001 cmd.Parameters.AddWithValue("cloud_scroll_x_lock", wl.cloudScrollXLock); 1000
1002 cmd.Parameters.AddWithValue("cloud_scroll_y", wl.cloudScrollY); 1001 ExecuteNonQuery(cmd);
1003 cmd.Parameters.AddWithValue("cloud_scroll_y_lock", wl.cloudScrollYLock);
1004 cmd.Parameters.AddWithValue("draw_classic_clouds", wl.drawClassicClouds);
1005
1006 ExecuteNonQuery(cmd);
1007 }
1008 } 1002 }
1009 } 1003 }
1010 } 1004 }
1011 1005
1012 public virtual void RemoveRegionWindlightSettings(UUID regionID) 1006 public virtual void RemoveRegionWindlightSettings(UUID regionID)
1013 { 1007 {
1014 lock (m_dbLock) 1008 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
1015 { 1009 {
1016 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) 1010 dbcon.Open();
1011
1012 using (MySqlCommand cmd = dbcon.CreateCommand())
1017 { 1013 {
1018 dbcon.Open(); 1014 cmd.CommandText = "delete from `regionwindlight` where `region_id`=?regionID";
1019 1015 cmd.Parameters.AddWithValue("?regionID", regionID.ToString());
1020 using (MySqlCommand cmd = dbcon.CreateCommand()) 1016 ExecuteNonQuery(cmd);
1021 {
1022 cmd.CommandText = "delete from `regionwindlight` where `region_id`=?regionID";
1023 cmd.Parameters.AddWithValue("?regionID", regionID.ToString());
1024 ExecuteNonQuery(cmd);
1025 }
1026 } 1017 }
1027 } 1018 }
1028 } 1019 }
@@ -1030,29 +1021,26 @@ namespace OpenSim.Data.MySQL
1030 #region RegionEnvironmentSettings 1021 #region RegionEnvironmentSettings
1031 public string LoadRegionEnvironmentSettings(UUID regionUUID) 1022 public string LoadRegionEnvironmentSettings(UUID regionUUID)
1032 { 1023 {
1033 lock (m_dbLock) 1024 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
1034 { 1025 {
1035 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) 1026 dbcon.Open();
1027
1028 string command = "select * from `regionenvironment` where region_id = ?region_id";
1029
1030 using (MySqlCommand cmd = new MySqlCommand(command))
1036 { 1031 {
1037 dbcon.Open(); 1032 cmd.Connection = dbcon;
1038 1033
1039 string command = "select * from `regionenvironment` where region_id = ?region_id"; 1034 cmd.Parameters.AddWithValue("?region_id", regionUUID.ToString());
1040 1035
1041 using (MySqlCommand cmd = new MySqlCommand(command)) 1036 IDataReader result = ExecuteReader(cmd);
1037 if (!result.Read())
1042 { 1038 {
1043 cmd.Connection = dbcon; 1039 return String.Empty;
1044 1040 }
1045 cmd.Parameters.AddWithValue("?region_id", regionUUID.ToString()); 1041 else
1046 1042 {
1047 IDataReader result = ExecuteReader(cmd); 1043 return Convert.ToString(result["llsd_settings"]);
1048 if (!result.Read())
1049 {
1050 return String.Empty;
1051 }
1052 else
1053 {
1054 return Convert.ToString(result["llsd_settings"]);
1055 }
1056 } 1044 }
1057 } 1045 }
1058 } 1046 }
@@ -1060,39 +1048,33 @@ namespace OpenSim.Data.MySQL
1060 1048
1061 public void StoreRegionEnvironmentSettings(UUID regionUUID, string settings) 1049 public void StoreRegionEnvironmentSettings(UUID regionUUID, string settings)
1062 { 1050 {
1063 lock (m_dbLock) 1051 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
1064 { 1052 {
1065 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) 1053 dbcon.Open();
1054
1055 using (MySqlCommand cmd = dbcon.CreateCommand())
1066 { 1056 {
1067 dbcon.Open(); 1057 cmd.CommandText = "REPLACE INTO `regionenvironment` (`region_id`, `llsd_settings`) VALUES (?region_id, ?llsd_settings)";
1068 1058
1069 using (MySqlCommand cmd = dbcon.CreateCommand()) 1059 cmd.Parameters.AddWithValue("region_id", regionUUID);
1070 { 1060 cmd.Parameters.AddWithValue("llsd_settings", settings);
1071 cmd.CommandText = "REPLACE INTO `regionenvironment` (`region_id`, `llsd_settings`) VALUES (?region_id, ?llsd_settings)"; 1061
1072 1062 ExecuteNonQuery(cmd);
1073 cmd.Parameters.AddWithValue("region_id", regionUUID);
1074 cmd.Parameters.AddWithValue("llsd_settings", settings);
1075
1076 ExecuteNonQuery(cmd);
1077 }
1078 } 1063 }
1079 } 1064 }
1080 } 1065 }
1081 1066
1082 public void RemoveRegionEnvironmentSettings(UUID regionUUID) 1067 public void RemoveRegionEnvironmentSettings(UUID regionUUID)
1083 { 1068 {
1084 lock (m_dbLock) 1069 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
1085 { 1070 {
1086 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) 1071 dbcon.Open();
1072
1073 using (MySqlCommand cmd = dbcon.CreateCommand())
1087 { 1074 {
1088 dbcon.Open(); 1075 cmd.CommandText = "delete from `regionenvironment` where region_id = ?region_id";
1089 1076 cmd.Parameters.AddWithValue("?region_id", regionUUID.ToString());
1090 using (MySqlCommand cmd = dbcon.CreateCommand()) 1077 ExecuteNonQuery(cmd);
1091 {
1092 cmd.CommandText = "delete from `regionenvironment` where region_id = ?region_id";
1093 cmd.Parameters.AddWithValue("?region_id", regionUUID.ToString());
1094 ExecuteNonQuery(cmd);
1095 }
1096 } 1078 }
1097 } 1079 }
1098 } 1080 }
@@ -1100,11 +1082,48 @@ namespace OpenSim.Data.MySQL
1100 1082
1101 public virtual void StoreRegionSettings(RegionSettings rs) 1083 public virtual void StoreRegionSettings(RegionSettings rs)
1102 { 1084 {
1103 lock (m_dbLock) 1085 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
1104 { 1086 {
1105 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) 1087 dbcon.Open();
1088
1089 using (MySqlCommand cmd = dbcon.CreateCommand())
1106 { 1090 {
1107 dbcon.Open(); 1091 cmd.CommandText = "replace into regionsettings (regionUUID, " +
1092 "block_terraform, block_fly, allow_damage, " +
1093 "restrict_pushing, allow_land_resell, " +
1094 "allow_land_join_divide, block_show_in_search, " +
1095 "agent_limit, object_bonus, maturity, " +
1096 "disable_scripts, disable_collisions, " +
1097 "disable_physics, terrain_texture_1, " +
1098 "terrain_texture_2, terrain_texture_3, " +
1099 "terrain_texture_4, elevation_1_nw, " +
1100 "elevation_2_nw, elevation_1_ne, " +
1101 "elevation_2_ne, elevation_1_se, " +
1102 "elevation_2_se, elevation_1_sw, " +
1103 "elevation_2_sw, water_height, " +
1104 "terrain_raise_limit, terrain_lower_limit, " +
1105 "use_estate_sun, fixed_sun, sun_position, " +
1106 "covenant, covenant_datetime, Sandbox, sunvectorx, sunvectory, " +
1107 "sunvectorz, loaded_creation_datetime, " +
1108 "loaded_creation_id, map_tile_ID, " +
1109 "TelehubObject, parcel_tile_ID) " +
1110 "values (?RegionUUID, ?BlockTerraform, " +
1111 "?BlockFly, ?AllowDamage, ?RestrictPushing, " +
1112 "?AllowLandResell, ?AllowLandJoinDivide, " +
1113 "?BlockShowInSearch, ?AgentLimit, ?ObjectBonus, " +
1114 "?Maturity, ?DisableScripts, ?DisableCollisions, " +
1115 "?DisablePhysics, ?TerrainTexture1, " +
1116 "?TerrainTexture2, ?TerrainTexture3, " +
1117 "?TerrainTexture4, ?Elevation1NW, ?Elevation2NW, " +
1118 "?Elevation1NE, ?Elevation2NE, ?Elevation1SE, " +
1119 "?Elevation2SE, ?Elevation1SW, ?Elevation2SW, " +
1120 "?WaterHeight, ?TerrainRaiseLimit, " +
1121 "?TerrainLowerLimit, ?UseEstateSun, ?FixedSun, " +
1122 "?SunPosition, ?Covenant, ?CovenantChangedDateTime, ?Sandbox, " +
1123 "?SunVectorX, ?SunVectorY, ?SunVectorZ, " +
1124 "?LoadedCreationDateTime, ?LoadedCreationID, " +
1125 "?TerrainImageID, " +
1126 "?TelehubObject, ?ParcelImageID)";
1108 1127
1109 using (MySqlCommand cmd = dbcon.CreateCommand()) 1128 using (MySqlCommand cmd = dbcon.CreateCommand())
1110 { 1129 {
@@ -1145,12 +1164,10 @@ namespace OpenSim.Data.MySQL
1145 "?TerrainImageID, ?block_search, ?casino, " + 1164 "?TerrainImageID, ?block_search, ?casino, " +
1146 "?TelehubObject, ?ParcelImageID)"; 1165 "?TelehubObject, ?ParcelImageID)";
1147 1166
1148 FillRegionSettingsCommand(cmd, rs); 1167 ExecuteNonQuery(cmd);
1149
1150 ExecuteNonQuery(cmd);
1151 }
1152 } 1168 }
1153 } 1169 }
1170
1154 SaveSpawnPoints(rs); 1171 SaveSpawnPoints(rs);
1155 } 1172 }
1156 1173
@@ -1534,6 +1551,7 @@ namespace OpenSim.Data.MySQL
1534 UUID.TryParse((string)row["AuthBuyerID"], out authedbuyer); 1551 UUID.TryParse((string)row["AuthBuyerID"], out authedbuyer);
1535 UUID.TryParse((string)row["SnapshotUUID"], out snapshotID); 1552 UUID.TryParse((string)row["SnapshotUUID"], out snapshotID);
1536 newData.OtherCleanTime = Convert.ToInt32(row["OtherCleanTime"]); 1553 newData.OtherCleanTime = Convert.ToInt32(row["OtherCleanTime"]);
1554 newData.Dwell = Convert.ToSingle(row["Dwell"]);
1537 1555
1538 newData.AuthBuyerID = authedbuyer; 1556 newData.AuthBuyerID = authedbuyer;
1539 newData.SnapshotID = snapshotID; 1557 newData.SnapshotID = snapshotID;
@@ -1912,6 +1930,7 @@ namespace OpenSim.Data.MySQL
1912 cmd.Parameters.AddWithValue("UserLookAtZ", land.UserLookAt.Z); 1930 cmd.Parameters.AddWithValue("UserLookAtZ", land.UserLookAt.Z);
1913 cmd.Parameters.AddWithValue("AuthBuyerID", land.AuthBuyerID); 1931 cmd.Parameters.AddWithValue("AuthBuyerID", land.AuthBuyerID);
1914 cmd.Parameters.AddWithValue("OtherCleanTime", land.OtherCleanTime); 1932 cmd.Parameters.AddWithValue("OtherCleanTime", land.OtherCleanTime);
1933 cmd.Parameters.AddWithValue("Dwell", land.Dwell);
1915 cmd.Parameters.AddWithValue("MediaDescription", land.MediaDescription); 1934 cmd.Parameters.AddWithValue("MediaDescription", land.MediaDescription);
1916 cmd.Parameters.AddWithValue("MediaType", land.MediaType); 1935 cmd.Parameters.AddWithValue("MediaType", land.MediaType);
1917 cmd.Parameters.AddWithValue("MediaWidth", land.MediaWidth); 1936 cmd.Parameters.AddWithValue("MediaWidth", land.MediaWidth);
@@ -2173,41 +2192,35 @@ namespace OpenSim.Data.MySQL
2173 2192
2174 public void SaveExtra(UUID regionID, string name, string val) 2193 public void SaveExtra(UUID regionID, string name, string val)
2175 { 2194 {
2176 lock (m_dbLock) 2195 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
2177 { 2196 {
2178 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) 2197 dbcon.Open();
2179 {
2180 dbcon.Open();
2181 2198
2182 using (MySqlCommand cmd = dbcon.CreateCommand()) 2199 using (MySqlCommand cmd = dbcon.CreateCommand())
2183 { 2200 {
2184 cmd.CommandText = "replace into regionextra values (?RegionID, ?Name, ?value)"; 2201 cmd.CommandText = "replace into regionextra values (?RegionID, ?Name, ?value)";
2185 cmd.Parameters.AddWithValue("?RegionID", regionID.ToString()); 2202 cmd.Parameters.AddWithValue("?RegionID", regionID.ToString());
2186 cmd.Parameters.AddWithValue("?Name", name); 2203 cmd.Parameters.AddWithValue("?Name", name);
2187 cmd.Parameters.AddWithValue("?value", val); 2204 cmd.Parameters.AddWithValue("?value", val);
2188 2205
2189 cmd.ExecuteNonQuery(); 2206 cmd.ExecuteNonQuery();
2190 }
2191 } 2207 }
2192 } 2208 }
2193 } 2209 }
2194 2210
2195 public void RemoveExtra(UUID regionID, string name) 2211 public void RemoveExtra(UUID regionID, string name)
2196 { 2212 {
2197 lock (m_dbLock) 2213 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
2198 { 2214 {
2199 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) 2215 dbcon.Open();
2200 {
2201 dbcon.Open();
2202 2216
2203 using (MySqlCommand cmd = dbcon.CreateCommand()) 2217 using (MySqlCommand cmd = dbcon.CreateCommand())
2204 { 2218 {
2205 cmd.CommandText = "delete from regionextra where RegionID=?RegionID and Name=?Name"; 2219 cmd.CommandText = "delete from regionextra where RegionID=?RegionID and Name=?Name";
2206 cmd.Parameters.AddWithValue("?RegionID", regionID.ToString()); 2220 cmd.Parameters.AddWithValue("?RegionID", regionID.ToString());
2207 cmd.Parameters.AddWithValue("?Name", name); 2221 cmd.Parameters.AddWithValue("?Name", name);
2208 2222
2209 cmd.ExecuteNonQuery(); 2223 cmd.ExecuteNonQuery();
2210 }
2211 } 2224 }
2212 } 2225 }
2213 } 2226 }
@@ -2216,22 +2229,19 @@ namespace OpenSim.Data.MySQL
2216 { 2229 {
2217 Dictionary<string, string> ret = new Dictionary<string, string>(); 2230 Dictionary<string, string> ret = new Dictionary<string, string>();
2218 2231
2219 lock (m_dbLock) 2232 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
2220 { 2233 {
2221 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) 2234 dbcon.Open();
2222 {
2223 dbcon.Open();
2224 2235
2225 using (MySqlCommand cmd = dbcon.CreateCommand()) 2236 using (MySqlCommand cmd = dbcon.CreateCommand())
2237 {
2238 cmd.CommandText = "select * from regionextra where RegionID=?RegionID";
2239 cmd.Parameters.AddWithValue("?RegionID", regionID.ToString());
2240 using (IDataReader r = cmd.ExecuteReader())
2226 { 2241 {
2227 cmd.CommandText = "select * from regionextra where RegionID=?RegionID"; 2242 while (r.Read())
2228 cmd.Parameters.AddWithValue("?RegionID", regionID.ToString());
2229 using (IDataReader r = cmd.ExecuteReader())
2230 { 2243 {
2231 while (r.Read()) 2244 ret[r["Name"].ToString()] = r["value"].ToString();
2232 {
2233 ret[r["Name"].ToString()] = r["value"].ToString();
2234 }
2235 } 2245 }
2236 } 2246 }
2237 } 2247 }