diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLRegionData.cs | 4 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLSimulationData.cs | 457 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/Resources/GridUserStore.migrations | 5 |
3 files changed, 221 insertions, 245 deletions
diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs index a2d4ae4..0614879 100644 --- a/OpenSim/Data/MySQL/MySQLRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLRegionData.cs | |||
@@ -30,11 +30,11 @@ using System.Collections; | |||
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Data; | 31 | using System.Data; |
32 | using System.Reflection; | 32 | using System.Reflection; |
33 | using MySql.Data.MySqlClient; | 33 | |
34 | using OpenMetaverse; | 34 | using OpenMetaverse; |
35 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
36 | using OpenSim.Data; | 36 | using OpenSim.Data; |
37 | using RegionFlags = OpenSim.Framework.RegionFlags; | 37 | using MySql.Data.MySqlClient; |
38 | 38 | ||
39 | namespace OpenSim.Data.MySQL | 39 | namespace OpenSim.Data.MySQL |
40 | { | 40 | { |
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index 12c979a..4d7c0c9 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs | |||
@@ -747,99 +747,95 @@ namespace OpenSim.Data.MySQL | |||
747 | RegionLightShareData nWP = new RegionLightShareData(); | 747 | RegionLightShareData nWP = new RegionLightShareData(); |
748 | nWP.OnSave += StoreRegionWindlightSettings; | 748 | nWP.OnSave += StoreRegionWindlightSettings; |
749 | 749 | ||
750 | lock (m_dbLock) | 750 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) |
751 | { | 751 | { |
752 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | 752 | dbcon.Open(); |
753 | |||
754 | string command = "select * from `regionwindlight` where region_id = ?regionID"; | ||
755 | |||
756 | using (MySqlCommand cmd = new MySqlCommand(command)) | ||
753 | { | 757 | { |
754 | dbcon.Open(); | 758 | cmd.Connection = dbcon; |
755 | 759 | ||
756 | string command = "select * from `regionwindlight` where region_id = ?regionID"; | 760 | cmd.Parameters.AddWithValue("?regionID", regionUUID.ToString()); |
757 | 761 | ||
758 | using (MySqlCommand cmd = new MySqlCommand(command)) | 762 | IDataReader result = ExecuteReader(cmd); |
763 | if (!result.Read()) | ||
759 | { | 764 | { |
760 | cmd.Connection = dbcon; | 765 | //No result, so store our default windlight profile and return it |
761 | 766 | nWP.regionID = regionUUID; | |
762 | cmd.Parameters.AddWithValue("?regionID", regionUUID.ToString()); | 767 | // StoreRegionWindlightSettings(nWP); |
763 | 768 | return nWP; | |
764 | IDataReader result = ExecuteReader(cmd); | 769 | } |
765 | if (!result.Read()) | 770 | else |
766 | { | 771 | { |
767 | //No result, so store our default windlight profile and return it | 772 | nWP.regionID = DBGuid.FromDB(result["region_id"]); |
768 | nWP.regionID = regionUUID; | 773 | nWP.waterColor.X = Convert.ToSingle(result["water_color_r"]); |
769 | // StoreRegionWindlightSettings(nWP); | 774 | nWP.waterColor.Y = Convert.ToSingle(result["water_color_g"]); |
770 | return nWP; | 775 | nWP.waterColor.Z = Convert.ToSingle(result["water_color_b"]); |
771 | } | 776 | nWP.waterFogDensityExponent = Convert.ToSingle(result["water_fog_density_exponent"]); |
772 | else | 777 | nWP.underwaterFogModifier = Convert.ToSingle(result["underwater_fog_modifier"]); |
773 | { | 778 | nWP.reflectionWaveletScale.X = Convert.ToSingle(result["reflection_wavelet_scale_1"]); |
774 | nWP.regionID = DBGuid.FromDB(result["region_id"]); | 779 | nWP.reflectionWaveletScale.Y = Convert.ToSingle(result["reflection_wavelet_scale_2"]); |
775 | nWP.waterColor.X = Convert.ToSingle(result["water_color_r"]); | 780 | nWP.reflectionWaveletScale.Z = Convert.ToSingle(result["reflection_wavelet_scale_3"]); |
776 | nWP.waterColor.Y = Convert.ToSingle(result["water_color_g"]); | 781 | nWP.fresnelScale = Convert.ToSingle(result["fresnel_scale"]); |
777 | nWP.waterColor.Z = Convert.ToSingle(result["water_color_b"]); | 782 | nWP.fresnelOffset = Convert.ToSingle(result["fresnel_offset"]); |
778 | nWP.waterFogDensityExponent = Convert.ToSingle(result["water_fog_density_exponent"]); | 783 | nWP.refractScaleAbove = Convert.ToSingle(result["refract_scale_above"]); |
779 | nWP.underwaterFogModifier = Convert.ToSingle(result["underwater_fog_modifier"]); | 784 | nWP.refractScaleBelow = Convert.ToSingle(result["refract_scale_below"]); |
780 | nWP.reflectionWaveletScale.X = Convert.ToSingle(result["reflection_wavelet_scale_1"]); | 785 | nWP.blurMultiplier = Convert.ToSingle(result["blur_multiplier"]); |
781 | nWP.reflectionWaveletScale.Y = Convert.ToSingle(result["reflection_wavelet_scale_2"]); | 786 | nWP.bigWaveDirection.X = Convert.ToSingle(result["big_wave_direction_x"]); |
782 | nWP.reflectionWaveletScale.Z = Convert.ToSingle(result["reflection_wavelet_scale_3"]); | 787 | nWP.bigWaveDirection.Y = Convert.ToSingle(result["big_wave_direction_y"]); |
783 | nWP.fresnelScale = Convert.ToSingle(result["fresnel_scale"]); | 788 | nWP.littleWaveDirection.X = Convert.ToSingle(result["little_wave_direction_x"]); |
784 | nWP.fresnelOffset = Convert.ToSingle(result["fresnel_offset"]); | 789 | nWP.littleWaveDirection.Y = Convert.ToSingle(result["little_wave_direction_y"]); |
785 | nWP.refractScaleAbove = Convert.ToSingle(result["refract_scale_above"]); | 790 | UUID.TryParse(result["normal_map_texture"].ToString(), out nWP.normalMapTexture); |
786 | nWP.refractScaleBelow = Convert.ToSingle(result["refract_scale_below"]); | 791 | nWP.horizon.X = Convert.ToSingle(result["horizon_r"]); |
787 | nWP.blurMultiplier = Convert.ToSingle(result["blur_multiplier"]); | 792 | nWP.horizon.Y = Convert.ToSingle(result["horizon_g"]); |
788 | nWP.bigWaveDirection.X = Convert.ToSingle(result["big_wave_direction_x"]); | 793 | nWP.horizon.Z = Convert.ToSingle(result["horizon_b"]); |
789 | nWP.bigWaveDirection.Y = Convert.ToSingle(result["big_wave_direction_y"]); | 794 | nWP.horizon.W = Convert.ToSingle(result["horizon_i"]); |
790 | nWP.littleWaveDirection.X = Convert.ToSingle(result["little_wave_direction_x"]); | 795 | nWP.hazeHorizon = Convert.ToSingle(result["haze_horizon"]); |
791 | nWP.littleWaveDirection.Y = Convert.ToSingle(result["little_wave_direction_y"]); | 796 | nWP.blueDensity.X = Convert.ToSingle(result["blue_density_r"]); |
792 | UUID.TryParse(result["normal_map_texture"].ToString(), out nWP.normalMapTexture); | 797 | nWP.blueDensity.Y = Convert.ToSingle(result["blue_density_g"]); |
793 | nWP.horizon.X = Convert.ToSingle(result["horizon_r"]); | 798 | nWP.blueDensity.Z = Convert.ToSingle(result["blue_density_b"]); |
794 | nWP.horizon.Y = Convert.ToSingle(result["horizon_g"]); | 799 | nWP.blueDensity.W = Convert.ToSingle(result["blue_density_i"]); |
795 | nWP.horizon.Z = Convert.ToSingle(result["horizon_b"]); | 800 | nWP.hazeDensity = Convert.ToSingle(result["haze_density"]); |
796 | nWP.horizon.W = Convert.ToSingle(result["horizon_i"]); | 801 | nWP.densityMultiplier = Convert.ToSingle(result["density_multiplier"]); |
797 | nWP.hazeHorizon = Convert.ToSingle(result["haze_horizon"]); | 802 | nWP.distanceMultiplier = Convert.ToSingle(result["distance_multiplier"]); |
798 | nWP.blueDensity.X = Convert.ToSingle(result["blue_density_r"]); | 803 | nWP.maxAltitude = Convert.ToUInt16(result["max_altitude"]); |
799 | nWP.blueDensity.Y = Convert.ToSingle(result["blue_density_g"]); | 804 | nWP.sunMoonColor.X = Convert.ToSingle(result["sun_moon_color_r"]); |
800 | nWP.blueDensity.Z = Convert.ToSingle(result["blue_density_b"]); | 805 | nWP.sunMoonColor.Y = Convert.ToSingle(result["sun_moon_color_g"]); |
801 | nWP.blueDensity.W = Convert.ToSingle(result["blue_density_i"]); | 806 | nWP.sunMoonColor.Z = Convert.ToSingle(result["sun_moon_color_b"]); |
802 | nWP.hazeDensity = Convert.ToSingle(result["haze_density"]); | 807 | nWP.sunMoonColor.W = Convert.ToSingle(result["sun_moon_color_i"]); |
803 | nWP.densityMultiplier = Convert.ToSingle(result["density_multiplier"]); | 808 | nWP.sunMoonPosition = Convert.ToSingle(result["sun_moon_position"]); |
804 | nWP.distanceMultiplier = Convert.ToSingle(result["distance_multiplier"]); | 809 | nWP.ambient.X = Convert.ToSingle(result["ambient_r"]); |
805 | nWP.maxAltitude = Convert.ToUInt16(result["max_altitude"]); | 810 | nWP.ambient.Y = Convert.ToSingle(result["ambient_g"]); |
806 | nWP.sunMoonColor.X = Convert.ToSingle(result["sun_moon_color_r"]); | 811 | nWP.ambient.Z = Convert.ToSingle(result["ambient_b"]); |
807 | nWP.sunMoonColor.Y = Convert.ToSingle(result["sun_moon_color_g"]); | 812 | nWP.ambient.W = Convert.ToSingle(result["ambient_i"]); |
808 | nWP.sunMoonColor.Z = Convert.ToSingle(result["sun_moon_color_b"]); | 813 | nWP.eastAngle = Convert.ToSingle(result["east_angle"]); |
809 | nWP.sunMoonColor.W = Convert.ToSingle(result["sun_moon_color_i"]); | 814 | nWP.sunGlowFocus = Convert.ToSingle(result["sun_glow_focus"]); |
810 | nWP.sunMoonPosition = Convert.ToSingle(result["sun_moon_position"]); | 815 | nWP.sunGlowSize = Convert.ToSingle(result["sun_glow_size"]); |
811 | nWP.ambient.X = Convert.ToSingle(result["ambient_r"]); | 816 | nWP.sceneGamma = Convert.ToSingle(result["scene_gamma"]); |
812 | nWP.ambient.Y = Convert.ToSingle(result["ambient_g"]); | 817 | nWP.starBrightness = Convert.ToSingle(result["star_brightness"]); |
813 | nWP.ambient.Z = Convert.ToSingle(result["ambient_b"]); | 818 | nWP.cloudColor.X = Convert.ToSingle(result["cloud_color_r"]); |
814 | nWP.ambient.W = Convert.ToSingle(result["ambient_i"]); | 819 | nWP.cloudColor.Y = Convert.ToSingle(result["cloud_color_g"]); |
815 | nWP.eastAngle = Convert.ToSingle(result["east_angle"]); | 820 | nWP.cloudColor.Z = Convert.ToSingle(result["cloud_color_b"]); |
816 | nWP.sunGlowFocus = Convert.ToSingle(result["sun_glow_focus"]); | 821 | nWP.cloudColor.W = Convert.ToSingle(result["cloud_color_i"]); |
817 | nWP.sunGlowSize = Convert.ToSingle(result["sun_glow_size"]); | 822 | nWP.cloudXYDensity.X = Convert.ToSingle(result["cloud_x"]); |
818 | nWP.sceneGamma = Convert.ToSingle(result["scene_gamma"]); | 823 | nWP.cloudXYDensity.Y = Convert.ToSingle(result["cloud_y"]); |
819 | nWP.starBrightness = Convert.ToSingle(result["star_brightness"]); | 824 | nWP.cloudXYDensity.Z = Convert.ToSingle(result["cloud_density"]); |
820 | nWP.cloudColor.X = Convert.ToSingle(result["cloud_color_r"]); | 825 | nWP.cloudCoverage = Convert.ToSingle(result["cloud_coverage"]); |
821 | nWP.cloudColor.Y = Convert.ToSingle(result["cloud_color_g"]); | 826 | nWP.cloudScale = Convert.ToSingle(result["cloud_scale"]); |
822 | nWP.cloudColor.Z = Convert.ToSingle(result["cloud_color_b"]); | 827 | nWP.cloudDetailXYDensity.X = Convert.ToSingle(result["cloud_detail_x"]); |
823 | nWP.cloudColor.W = Convert.ToSingle(result["cloud_color_i"]); | 828 | nWP.cloudDetailXYDensity.Y = Convert.ToSingle(result["cloud_detail_y"]); |
824 | nWP.cloudXYDensity.X = Convert.ToSingle(result["cloud_x"]); | 829 | nWP.cloudDetailXYDensity.Z = Convert.ToSingle(result["cloud_detail_density"]); |
825 | nWP.cloudXYDensity.Y = Convert.ToSingle(result["cloud_y"]); | 830 | nWP.cloudScrollX = Convert.ToSingle(result["cloud_scroll_x"]); |
826 | nWP.cloudXYDensity.Z = Convert.ToSingle(result["cloud_density"]); | 831 | nWP.cloudScrollXLock = Convert.ToBoolean(result["cloud_scroll_x_lock"]); |
827 | nWP.cloudCoverage = Convert.ToSingle(result["cloud_coverage"]); | 832 | nWP.cloudScrollY = Convert.ToSingle(result["cloud_scroll_y"]); |
828 | nWP.cloudScale = Convert.ToSingle(result["cloud_scale"]); | 833 | nWP.cloudScrollYLock = Convert.ToBoolean(result["cloud_scroll_y_lock"]); |
829 | nWP.cloudDetailXYDensity.X = Convert.ToSingle(result["cloud_detail_x"]); | 834 | nWP.drawClassicClouds = Convert.ToBoolean(result["draw_classic_clouds"]); |
830 | nWP.cloudDetailXYDensity.Y = Convert.ToSingle(result["cloud_detail_y"]); | 835 | nWP.valid = true; |
831 | nWP.cloudDetailXYDensity.Z = Convert.ToSingle(result["cloud_detail_density"]); | ||
832 | nWP.cloudScrollX = Convert.ToSingle(result["cloud_scroll_x"]); | ||
833 | nWP.cloudScrollXLock = Convert.ToBoolean(result["cloud_scroll_x_lock"]); | ||
834 | nWP.cloudScrollY = Convert.ToSingle(result["cloud_scroll_y"]); | ||
835 | nWP.cloudScrollYLock = Convert.ToBoolean(result["cloud_scroll_y_lock"]); | ||
836 | nWP.drawClassicClouds = Convert.ToBoolean(result["draw_classic_clouds"]); | ||
837 | nWP.valid = true; | ||
838 | } | ||
839 | } | 836 | } |
840 | } | 837 | } |
841 | } | 838 | } |
842 | |||
843 | return nWP; | 839 | return nWP; |
844 | } | 840 | } |
845 | 841 | ||
@@ -885,124 +881,118 @@ namespace OpenSim.Data.MySQL | |||
885 | 881 | ||
886 | public virtual void StoreRegionWindlightSettings(RegionLightShareData wl) | 882 | public virtual void StoreRegionWindlightSettings(RegionLightShareData wl) |
887 | { | 883 | { |
888 | lock (m_dbLock) | 884 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) |
889 | { | 885 | { |
890 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | 886 | dbcon.Open(); |
887 | |||
888 | using (MySqlCommand cmd = dbcon.CreateCommand()) | ||
891 | { | 889 | { |
892 | dbcon.Open(); | 890 | cmd.CommandText = "REPLACE INTO `regionwindlight` (`region_id`, `water_color_r`, `water_color_g`, "; |
893 | 891 | cmd.CommandText += "`water_color_b`, `water_fog_density_exponent`, `underwater_fog_modifier`, "; | |
894 | using (MySqlCommand cmd = dbcon.CreateCommand()) | 892 | cmd.CommandText += "`reflection_wavelet_scale_1`, `reflection_wavelet_scale_2`, `reflection_wavelet_scale_3`, "; |
895 | { | 893 | cmd.CommandText += "`fresnel_scale`, `fresnel_offset`, `refract_scale_above`, `refract_scale_below`, "; |
896 | cmd.CommandText = "REPLACE INTO `regionwindlight` (`region_id`, `water_color_r`, `water_color_g`, "; | 894 | cmd.CommandText += "`blur_multiplier`, `big_wave_direction_x`, `big_wave_direction_y`, `little_wave_direction_x`, "; |
897 | cmd.CommandText += "`water_color_b`, `water_fog_density_exponent`, `underwater_fog_modifier`, "; | 895 | cmd.CommandText += "`little_wave_direction_y`, `normal_map_texture`, `horizon_r`, `horizon_g`, `horizon_b`, "; |
898 | cmd.CommandText += "`reflection_wavelet_scale_1`, `reflection_wavelet_scale_2`, `reflection_wavelet_scale_3`, "; | 896 | cmd.CommandText += "`horizon_i`, `haze_horizon`, `blue_density_r`, `blue_density_g`, `blue_density_b`, "; |
899 | cmd.CommandText += "`fresnel_scale`, `fresnel_offset`, `refract_scale_above`, `refract_scale_below`, "; | 897 | cmd.CommandText += "`blue_density_i`, `haze_density`, `density_multiplier`, `distance_multiplier`, `max_altitude`, "; |
900 | cmd.CommandText += "`blur_multiplier`, `big_wave_direction_x`, `big_wave_direction_y`, `little_wave_direction_x`, "; | 898 | cmd.CommandText += "`sun_moon_color_r`, `sun_moon_color_g`, `sun_moon_color_b`, `sun_moon_color_i`, `sun_moon_position`, "; |
901 | cmd.CommandText += "`little_wave_direction_y`, `normal_map_texture`, `horizon_r`, `horizon_g`, `horizon_b`, "; | 899 | cmd.CommandText += "`ambient_r`, `ambient_g`, `ambient_b`, `ambient_i`, `east_angle`, `sun_glow_focus`, `sun_glow_size`, "; |
902 | cmd.CommandText += "`horizon_i`, `haze_horizon`, `blue_density_r`, `blue_density_g`, `blue_density_b`, "; | 900 | cmd.CommandText += "`scene_gamma`, `star_brightness`, `cloud_color_r`, `cloud_color_g`, `cloud_color_b`, `cloud_color_i`, "; |
903 | cmd.CommandText += "`blue_density_i`, `haze_density`, `density_multiplier`, `distance_multiplier`, `max_altitude`, "; | 901 | cmd.CommandText += "`cloud_x`, `cloud_y`, `cloud_density`, `cloud_coverage`, `cloud_scale`, `cloud_detail_x`, "; |
904 | cmd.CommandText += "`sun_moon_color_r`, `sun_moon_color_g`, `sun_moon_color_b`, `sun_moon_color_i`, `sun_moon_position`, "; | 902 | cmd.CommandText += "`cloud_detail_y`, `cloud_detail_density`, `cloud_scroll_x`, `cloud_scroll_x_lock`, `cloud_scroll_y`, "; |
905 | cmd.CommandText += "`ambient_r`, `ambient_g`, `ambient_b`, `ambient_i`, `east_angle`, `sun_glow_focus`, `sun_glow_size`, "; | 903 | cmd.CommandText += "`cloud_scroll_y_lock`, `draw_classic_clouds`) VALUES (?region_id, ?water_color_r, "; |
906 | cmd.CommandText += "`scene_gamma`, `star_brightness`, `cloud_color_r`, `cloud_color_g`, `cloud_color_b`, `cloud_color_i`, "; | 904 | cmd.CommandText += "?water_color_g, ?water_color_b, ?water_fog_density_exponent, ?underwater_fog_modifier, ?reflection_wavelet_scale_1, "; |
907 | cmd.CommandText += "`cloud_x`, `cloud_y`, `cloud_density`, `cloud_coverage`, `cloud_scale`, `cloud_detail_x`, "; | 905 | cmd.CommandText += "?reflection_wavelet_scale_2, ?reflection_wavelet_scale_3, ?fresnel_scale, ?fresnel_offset, ?refract_scale_above, "; |
908 | cmd.CommandText += "`cloud_detail_y`, `cloud_detail_density`, `cloud_scroll_x`, `cloud_scroll_x_lock`, `cloud_scroll_y`, "; | 906 | cmd.CommandText += "?refract_scale_below, ?blur_multiplier, ?big_wave_direction_x, ?big_wave_direction_y, ?little_wave_direction_x, "; |
909 | cmd.CommandText += "`cloud_scroll_y_lock`, `draw_classic_clouds`) VALUES (?region_id, ?water_color_r, "; | 907 | cmd.CommandText += "?little_wave_direction_y, ?normal_map_texture, ?horizon_r, ?horizon_g, ?horizon_b, ?horizon_i, ?haze_horizon, "; |
910 | cmd.CommandText += "?water_color_g, ?water_color_b, ?water_fog_density_exponent, ?underwater_fog_modifier, ?reflection_wavelet_scale_1, "; | 908 | cmd.CommandText += "?blue_density_r, ?blue_density_g, ?blue_density_b, ?blue_density_i, ?haze_density, ?density_multiplier, "; |
911 | cmd.CommandText += "?reflection_wavelet_scale_2, ?reflection_wavelet_scale_3, ?fresnel_scale, ?fresnel_offset, ?refract_scale_above, "; | 909 | cmd.CommandText += "?distance_multiplier, ?max_altitude, ?sun_moon_color_r, ?sun_moon_color_g, ?sun_moon_color_b, "; |
912 | cmd.CommandText += "?refract_scale_below, ?blur_multiplier, ?big_wave_direction_x, ?big_wave_direction_y, ?little_wave_direction_x, "; | 910 | cmd.CommandText += "?sun_moon_color_i, ?sun_moon_position, ?ambient_r, ?ambient_g, ?ambient_b, ?ambient_i, ?east_angle, "; |
913 | cmd.CommandText += "?little_wave_direction_y, ?normal_map_texture, ?horizon_r, ?horizon_g, ?horizon_b, ?horizon_i, ?haze_horizon, "; | 911 | cmd.CommandText += "?sun_glow_focus, ?sun_glow_size, ?scene_gamma, ?star_brightness, ?cloud_color_r, ?cloud_color_g, "; |
914 | cmd.CommandText += "?blue_density_r, ?blue_density_g, ?blue_density_b, ?blue_density_i, ?haze_density, ?density_multiplier, "; | 912 | cmd.CommandText += "?cloud_color_b, ?cloud_color_i, ?cloud_x, ?cloud_y, ?cloud_density, ?cloud_coverage, ?cloud_scale, "; |
915 | cmd.CommandText += "?distance_multiplier, ?max_altitude, ?sun_moon_color_r, ?sun_moon_color_g, ?sun_moon_color_b, "; | 913 | cmd.CommandText += "?cloud_detail_x, ?cloud_detail_y, ?cloud_detail_density, ?cloud_scroll_x, ?cloud_scroll_x_lock, "; |
916 | cmd.CommandText += "?sun_moon_color_i, ?sun_moon_position, ?ambient_r, ?ambient_g, ?ambient_b, ?ambient_i, ?east_angle, "; | 914 | cmd.CommandText += "?cloud_scroll_y, ?cloud_scroll_y_lock, ?draw_classic_clouds)"; |
917 | cmd.CommandText += "?sun_glow_focus, ?sun_glow_size, ?scene_gamma, ?star_brightness, ?cloud_color_r, ?cloud_color_g, "; | 915 | |
918 | cmd.CommandText += "?cloud_color_b, ?cloud_color_i, ?cloud_x, ?cloud_y, ?cloud_density, ?cloud_coverage, ?cloud_scale, "; | 916 | cmd.Parameters.AddWithValue("region_id", wl.regionID); |
919 | cmd.CommandText += "?cloud_detail_x, ?cloud_detail_y, ?cloud_detail_density, ?cloud_scroll_x, ?cloud_scroll_x_lock, "; | 917 | cmd.Parameters.AddWithValue("water_color_r", wl.waterColor.X); |
920 | cmd.CommandText += "?cloud_scroll_y, ?cloud_scroll_y_lock, ?draw_classic_clouds)"; | 918 | cmd.Parameters.AddWithValue("water_color_g", wl.waterColor.Y); |
921 | 919 | cmd.Parameters.AddWithValue("water_color_b", wl.waterColor.Z); | |
922 | cmd.Parameters.AddWithValue("region_id", wl.regionID); | 920 | cmd.Parameters.AddWithValue("water_fog_density_exponent", wl.waterFogDensityExponent); |
923 | cmd.Parameters.AddWithValue("water_color_r", wl.waterColor.X); | 921 | cmd.Parameters.AddWithValue("underwater_fog_modifier", wl.underwaterFogModifier); |
924 | cmd.Parameters.AddWithValue("water_color_g", wl.waterColor.Y); | 922 | cmd.Parameters.AddWithValue("reflection_wavelet_scale_1", wl.reflectionWaveletScale.X); |
925 | cmd.Parameters.AddWithValue("water_color_b", wl.waterColor.Z); | 923 | cmd.Parameters.AddWithValue("reflection_wavelet_scale_2", wl.reflectionWaveletScale.Y); |
926 | cmd.Parameters.AddWithValue("water_fog_density_exponent", wl.waterFogDensityExponent); | 924 | cmd.Parameters.AddWithValue("reflection_wavelet_scale_3", wl.reflectionWaveletScale.Z); |
927 | cmd.Parameters.AddWithValue("underwater_fog_modifier", wl.underwaterFogModifier); | 925 | cmd.Parameters.AddWithValue("fresnel_scale", wl.fresnelScale); |
928 | cmd.Parameters.AddWithValue("reflection_wavelet_scale_1", wl.reflectionWaveletScale.X); | 926 | cmd.Parameters.AddWithValue("fresnel_offset", wl.fresnelOffset); |
929 | cmd.Parameters.AddWithValue("reflection_wavelet_scale_2", wl.reflectionWaveletScale.Y); | 927 | cmd.Parameters.AddWithValue("refract_scale_above", wl.refractScaleAbove); |
930 | cmd.Parameters.AddWithValue("reflection_wavelet_scale_3", wl.reflectionWaveletScale.Z); | 928 | cmd.Parameters.AddWithValue("refract_scale_below", wl.refractScaleBelow); |
931 | cmd.Parameters.AddWithValue("fresnel_scale", wl.fresnelScale); | 929 | cmd.Parameters.AddWithValue("blur_multiplier", wl.blurMultiplier); |
932 | cmd.Parameters.AddWithValue("fresnel_offset", wl.fresnelOffset); | 930 | cmd.Parameters.AddWithValue("big_wave_direction_x", wl.bigWaveDirection.X); |
933 | cmd.Parameters.AddWithValue("refract_scale_above", wl.refractScaleAbove); | 931 | cmd.Parameters.AddWithValue("big_wave_direction_y", wl.bigWaveDirection.Y); |
934 | cmd.Parameters.AddWithValue("refract_scale_below", wl.refractScaleBelow); | 932 | cmd.Parameters.AddWithValue("little_wave_direction_x", wl.littleWaveDirection.X); |
935 | cmd.Parameters.AddWithValue("blur_multiplier", wl.blurMultiplier); | 933 | cmd.Parameters.AddWithValue("little_wave_direction_y", wl.littleWaveDirection.Y); |
936 | cmd.Parameters.AddWithValue("big_wave_direction_x", wl.bigWaveDirection.X); | 934 | cmd.Parameters.AddWithValue("normal_map_texture", wl.normalMapTexture); |
937 | cmd.Parameters.AddWithValue("big_wave_direction_y", wl.bigWaveDirection.Y); | 935 | cmd.Parameters.AddWithValue("horizon_r", wl.horizon.X); |
938 | cmd.Parameters.AddWithValue("little_wave_direction_x", wl.littleWaveDirection.X); | 936 | cmd.Parameters.AddWithValue("horizon_g", wl.horizon.Y); |
939 | cmd.Parameters.AddWithValue("little_wave_direction_y", wl.littleWaveDirection.Y); | 937 | cmd.Parameters.AddWithValue("horizon_b", wl.horizon.Z); |
940 | cmd.Parameters.AddWithValue("normal_map_texture", wl.normalMapTexture); | 938 | cmd.Parameters.AddWithValue("horizon_i", wl.horizon.W); |
941 | cmd.Parameters.AddWithValue("horizon_r", wl.horizon.X); | 939 | cmd.Parameters.AddWithValue("haze_horizon", wl.hazeHorizon); |
942 | cmd.Parameters.AddWithValue("horizon_g", wl.horizon.Y); | 940 | cmd.Parameters.AddWithValue("blue_density_r", wl.blueDensity.X); |
943 | cmd.Parameters.AddWithValue("horizon_b", wl.horizon.Z); | 941 | cmd.Parameters.AddWithValue("blue_density_g", wl.blueDensity.Y); |
944 | cmd.Parameters.AddWithValue("horizon_i", wl.horizon.W); | 942 | cmd.Parameters.AddWithValue("blue_density_b", wl.blueDensity.Z); |
945 | cmd.Parameters.AddWithValue("haze_horizon", wl.hazeHorizon); | 943 | cmd.Parameters.AddWithValue("blue_density_i", wl.blueDensity.W); |
946 | cmd.Parameters.AddWithValue("blue_density_r", wl.blueDensity.X); | 944 | cmd.Parameters.AddWithValue("haze_density", wl.hazeDensity); |
947 | cmd.Parameters.AddWithValue("blue_density_g", wl.blueDensity.Y); | 945 | cmd.Parameters.AddWithValue("density_multiplier", wl.densityMultiplier); |
948 | cmd.Parameters.AddWithValue("blue_density_b", wl.blueDensity.Z); | 946 | cmd.Parameters.AddWithValue("distance_multiplier", wl.distanceMultiplier); |
949 | cmd.Parameters.AddWithValue("blue_density_i", wl.blueDensity.W); | 947 | cmd.Parameters.AddWithValue("max_altitude", wl.maxAltitude); |
950 | cmd.Parameters.AddWithValue("haze_density", wl.hazeDensity); | 948 | cmd.Parameters.AddWithValue("sun_moon_color_r", wl.sunMoonColor.X); |
951 | cmd.Parameters.AddWithValue("density_multiplier", wl.densityMultiplier); | 949 | cmd.Parameters.AddWithValue("sun_moon_color_g", wl.sunMoonColor.Y); |
952 | cmd.Parameters.AddWithValue("distance_multiplier", wl.distanceMultiplier); | 950 | cmd.Parameters.AddWithValue("sun_moon_color_b", wl.sunMoonColor.Z); |
953 | cmd.Parameters.AddWithValue("max_altitude", wl.maxAltitude); | 951 | cmd.Parameters.AddWithValue("sun_moon_color_i", wl.sunMoonColor.W); |
954 | cmd.Parameters.AddWithValue("sun_moon_color_r", wl.sunMoonColor.X); | 952 | cmd.Parameters.AddWithValue("sun_moon_position", wl.sunMoonPosition); |
955 | cmd.Parameters.AddWithValue("sun_moon_color_g", wl.sunMoonColor.Y); | 953 | cmd.Parameters.AddWithValue("ambient_r", wl.ambient.X); |
956 | cmd.Parameters.AddWithValue("sun_moon_color_b", wl.sunMoonColor.Z); | 954 | cmd.Parameters.AddWithValue("ambient_g", wl.ambient.Y); |
957 | cmd.Parameters.AddWithValue("sun_moon_color_i", wl.sunMoonColor.W); | 955 | cmd.Parameters.AddWithValue("ambient_b", wl.ambient.Z); |
958 | cmd.Parameters.AddWithValue("sun_moon_position", wl.sunMoonPosition); | 956 | cmd.Parameters.AddWithValue("ambient_i", wl.ambient.W); |
959 | cmd.Parameters.AddWithValue("ambient_r", wl.ambient.X); | 957 | cmd.Parameters.AddWithValue("east_angle", wl.eastAngle); |
960 | cmd.Parameters.AddWithValue("ambient_g", wl.ambient.Y); | 958 | cmd.Parameters.AddWithValue("sun_glow_focus", wl.sunGlowFocus); |
961 | cmd.Parameters.AddWithValue("ambient_b", wl.ambient.Z); | 959 | cmd.Parameters.AddWithValue("sun_glow_size", wl.sunGlowSize); |
962 | cmd.Parameters.AddWithValue("ambient_i", wl.ambient.W); | 960 | cmd.Parameters.AddWithValue("scene_gamma", wl.sceneGamma); |
963 | cmd.Parameters.AddWithValue("east_angle", wl.eastAngle); | 961 | cmd.Parameters.AddWithValue("star_brightness", wl.starBrightness); |
964 | cmd.Parameters.AddWithValue("sun_glow_focus", wl.sunGlowFocus); | 962 | cmd.Parameters.AddWithValue("cloud_color_r", wl.cloudColor.X); |
965 | cmd.Parameters.AddWithValue("sun_glow_size", wl.sunGlowSize); | 963 | cmd.Parameters.AddWithValue("cloud_color_g", wl.cloudColor.Y); |
966 | cmd.Parameters.AddWithValue("scene_gamma", wl.sceneGamma); | 964 | cmd.Parameters.AddWithValue("cloud_color_b", wl.cloudColor.Z); |
967 | cmd.Parameters.AddWithValue("star_brightness", wl.starBrightness); | 965 | cmd.Parameters.AddWithValue("cloud_color_i", wl.cloudColor.W); |
968 | cmd.Parameters.AddWithValue("cloud_color_r", wl.cloudColor.X); | 966 | cmd.Parameters.AddWithValue("cloud_x", wl.cloudXYDensity.X); |
969 | cmd.Parameters.AddWithValue("cloud_color_g", wl.cloudColor.Y); | 967 | cmd.Parameters.AddWithValue("cloud_y", wl.cloudXYDensity.Y); |
970 | cmd.Parameters.AddWithValue("cloud_color_b", wl.cloudColor.Z); | 968 | cmd.Parameters.AddWithValue("cloud_density", wl.cloudXYDensity.Z); |
971 | cmd.Parameters.AddWithValue("cloud_color_i", wl.cloudColor.W); | 969 | cmd.Parameters.AddWithValue("cloud_coverage", wl.cloudCoverage); |
972 | cmd.Parameters.AddWithValue("cloud_x", wl.cloudXYDensity.X); | 970 | cmd.Parameters.AddWithValue("cloud_scale", wl.cloudScale); |
973 | cmd.Parameters.AddWithValue("cloud_y", wl.cloudXYDensity.Y); | 971 | cmd.Parameters.AddWithValue("cloud_detail_x", wl.cloudDetailXYDensity.X); |
974 | cmd.Parameters.AddWithValue("cloud_density", wl.cloudXYDensity.Z); | 972 | cmd.Parameters.AddWithValue("cloud_detail_y", wl.cloudDetailXYDensity.Y); |
975 | cmd.Parameters.AddWithValue("cloud_coverage", wl.cloudCoverage); | 973 | cmd.Parameters.AddWithValue("cloud_detail_density", wl.cloudDetailXYDensity.Z); |
976 | cmd.Parameters.AddWithValue("cloud_scale", wl.cloudScale); | 974 | cmd.Parameters.AddWithValue("cloud_scroll_x", wl.cloudScrollX); |
977 | cmd.Parameters.AddWithValue("cloud_detail_x", wl.cloudDetailXYDensity.X); | 975 | cmd.Parameters.AddWithValue("cloud_scroll_x_lock", wl.cloudScrollXLock); |
978 | cmd.Parameters.AddWithValue("cloud_detail_y", wl.cloudDetailXYDensity.Y); | 976 | cmd.Parameters.AddWithValue("cloud_scroll_y", wl.cloudScrollY); |
979 | cmd.Parameters.AddWithValue("cloud_detail_density", wl.cloudDetailXYDensity.Z); | 977 | cmd.Parameters.AddWithValue("cloud_scroll_y_lock", wl.cloudScrollYLock); |
980 | cmd.Parameters.AddWithValue("cloud_scroll_x", wl.cloudScrollX); | 978 | cmd.Parameters.AddWithValue("draw_classic_clouds", wl.drawClassicClouds); |
981 | cmd.Parameters.AddWithValue("cloud_scroll_x_lock", wl.cloudScrollXLock); | 979 | |
982 | cmd.Parameters.AddWithValue("cloud_scroll_y", wl.cloudScrollY); | 980 | ExecuteNonQuery(cmd); |
983 | cmd.Parameters.AddWithValue("cloud_scroll_y_lock", wl.cloudScrollYLock); | ||
984 | cmd.Parameters.AddWithValue("draw_classic_clouds", wl.drawClassicClouds); | ||
985 | |||
986 | ExecuteNonQuery(cmd); | ||
987 | } | ||
988 | } | 981 | } |
989 | } | 982 | } |
990 | } | 983 | } |
991 | 984 | ||
992 | public virtual void RemoveRegionWindlightSettings(UUID regionID) | 985 | public virtual void RemoveRegionWindlightSettings(UUID regionID) |
993 | { | 986 | { |
994 | lock (m_dbLock) | 987 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) |
995 | { | 988 | { |
996 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | 989 | dbcon.Open(); |
990 | |||
991 | using (MySqlCommand cmd = dbcon.CreateCommand()) | ||
997 | { | 992 | { |
998 | dbcon.Open(); | 993 | cmd.CommandText = "delete from `regionwindlight` where `region_id`=?regionID"; |
999 | 994 | cmd.Parameters.AddWithValue("?regionID", regionID.ToString()); | |
1000 | using (MySqlCommand cmd = dbcon.CreateCommand()) | 995 | ExecuteNonQuery(cmd); |
1001 | { | ||
1002 | cmd.CommandText = "delete from `regionwindlight` where `region_id`=?regionID"; | ||
1003 | cmd.Parameters.AddWithValue("?regionID", regionID.ToString()); | ||
1004 | ExecuteNonQuery(cmd); | ||
1005 | } | ||
1006 | } | 996 | } |
1007 | } | 997 | } |
1008 | } | 998 | } |
@@ -1010,29 +1000,26 @@ namespace OpenSim.Data.MySQL | |||
1010 | #region RegionEnvironmentSettings | 1000 | #region RegionEnvironmentSettings |
1011 | public string LoadRegionEnvironmentSettings(UUID regionUUID) | 1001 | public string LoadRegionEnvironmentSettings(UUID regionUUID) |
1012 | { | 1002 | { |
1013 | lock (m_dbLock) | 1003 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) |
1014 | { | 1004 | { |
1015 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | 1005 | dbcon.Open(); |
1006 | |||
1007 | string command = "select * from `regionenvironment` where region_id = ?region_id"; | ||
1008 | |||
1009 | using (MySqlCommand cmd = new MySqlCommand(command)) | ||
1016 | { | 1010 | { |
1017 | dbcon.Open(); | 1011 | cmd.Connection = dbcon; |
1018 | 1012 | ||
1019 | string command = "select * from `regionenvironment` where region_id = ?region_id"; | 1013 | cmd.Parameters.AddWithValue("?region_id", regionUUID.ToString()); |
1020 | 1014 | ||
1021 | using (MySqlCommand cmd = new MySqlCommand(command)) | 1015 | IDataReader result = ExecuteReader(cmd); |
1016 | if (!result.Read()) | ||
1022 | { | 1017 | { |
1023 | cmd.Connection = dbcon; | 1018 | return String.Empty; |
1024 | 1019 | } | |
1025 | cmd.Parameters.AddWithValue("?region_id", regionUUID.ToString()); | 1020 | else |
1026 | 1021 | { | |
1027 | IDataReader result = ExecuteReader(cmd); | 1022 | return Convert.ToString(result["llsd_settings"]); |
1028 | if (!result.Read()) | ||
1029 | { | ||
1030 | return String.Empty; | ||
1031 | } | ||
1032 | else | ||
1033 | { | ||
1034 | return Convert.ToString(result["llsd_settings"]); | ||
1035 | } | ||
1036 | } | 1023 | } |
1037 | } | 1024 | } |
1038 | } | 1025 | } |
@@ -1040,39 +1027,33 @@ namespace OpenSim.Data.MySQL | |||
1040 | 1027 | ||
1041 | public void StoreRegionEnvironmentSettings(UUID regionUUID, string settings) | 1028 | public void StoreRegionEnvironmentSettings(UUID regionUUID, string settings) |
1042 | { | 1029 | { |
1043 | lock (m_dbLock) | 1030 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) |
1044 | { | 1031 | { |
1045 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | 1032 | dbcon.Open(); |
1033 | |||
1034 | using (MySqlCommand cmd = dbcon.CreateCommand()) | ||
1046 | { | 1035 | { |
1047 | dbcon.Open(); | 1036 | cmd.CommandText = "REPLACE INTO `regionenvironment` (`region_id`, `llsd_settings`) VALUES (?region_id, ?llsd_settings)"; |
1048 | 1037 | ||
1049 | using (MySqlCommand cmd = dbcon.CreateCommand()) | 1038 | cmd.Parameters.AddWithValue("region_id", regionUUID); |
1050 | { | 1039 | cmd.Parameters.AddWithValue("llsd_settings", settings); |
1051 | cmd.CommandText = "REPLACE INTO `regionenvironment` (`region_id`, `llsd_settings`) VALUES (?region_id, ?llsd_settings)"; | 1040 | |
1052 | 1041 | ExecuteNonQuery(cmd); | |
1053 | cmd.Parameters.AddWithValue("region_id", regionUUID); | ||
1054 | cmd.Parameters.AddWithValue("llsd_settings", settings); | ||
1055 | |||
1056 | ExecuteNonQuery(cmd); | ||
1057 | } | ||
1058 | } | 1042 | } |
1059 | } | 1043 | } |
1060 | } | 1044 | } |
1061 | 1045 | ||
1062 | public void RemoveRegionEnvironmentSettings(UUID regionUUID) | 1046 | public void RemoveRegionEnvironmentSettings(UUID regionUUID) |
1063 | { | 1047 | { |
1064 | lock (m_dbLock) | 1048 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) |
1065 | { | 1049 | { |
1066 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | 1050 | dbcon.Open(); |
1051 | |||
1052 | using (MySqlCommand cmd = dbcon.CreateCommand()) | ||
1067 | { | 1053 | { |
1068 | dbcon.Open(); | 1054 | cmd.CommandText = "delete from `regionenvironment` where region_id = ?region_id"; |
1069 | 1055 | cmd.Parameters.AddWithValue("?region_id", regionUUID.ToString()); | |
1070 | using (MySqlCommand cmd = dbcon.CreateCommand()) | 1056 | ExecuteNonQuery(cmd); |
1071 | { | ||
1072 | cmd.CommandText = "delete from `regionenvironment` where region_id = ?region_id"; | ||
1073 | cmd.Parameters.AddWithValue("?region_id", regionUUID.ToString()); | ||
1074 | ExecuteNonQuery(cmd); | ||
1075 | } | ||
1076 | } | 1057 | } |
1077 | } | 1058 | } |
1078 | } | 1059 | } |
diff --git a/OpenSim/Data/MySQL/Resources/GridUserStore.migrations b/OpenSim/Data/MySQL/Resources/GridUserStore.migrations index d08e096..32b85ee 100644 --- a/OpenSim/Data/MySQL/Resources/GridUserStore.migrations +++ b/OpenSim/Data/MySQL/Resources/GridUserStore.migrations | |||
@@ -17,8 +17,3 @@ CREATE TABLE `GridUser` ( | |||
17 | ) ENGINE=InnoDB; | 17 | ) ENGINE=InnoDB; |
18 | 18 | ||
19 | COMMIT; | 19 | COMMIT; |
20 | |||
21 | :VERSION 2 # -------------------------- | ||
22 | BEGIN; | ||
23 | |||
24 | COMMIT; | ||