aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL/MySQLSimulationData.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/MySQL/MySQLSimulationData.cs169
1 files changed, 87 insertions, 82 deletions
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs
index 3ea5805..4766372 100644
--- a/OpenSim/Data/MySQL/MySQLSimulationData.cs
+++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs
@@ -878,80 +878,82 @@ namespace OpenSim.Data.MySQL
878 878
879 cmd.Parameters.AddWithValue("?regionID", regionUUID.ToString()); 879 cmd.Parameters.AddWithValue("?regionID", regionUUID.ToString());
880 880
881 IDataReader result = ExecuteReader(cmd); 881 using(IDataReader result = ExecuteReader(cmd))
882 if (!result.Read())
883 { 882 {
884 //No result, so store our default windlight profile and return it 883 if(!result.Read())
885 nWP.regionID = regionUUID; 884 {
886// StoreRegionWindlightSettings(nWP); 885 //No result, so store our default windlight profile and return it
887 return nWP; 886 nWP.regionID = regionUUID;
888 } 887 // StoreRegionWindlightSettings(nWP);
889 else 888 return nWP;
890 { 889 }
891 nWP.regionID = DBGuid.FromDB(result["region_id"]); 890 else
892 nWP.waterColor.X = Convert.ToSingle(result["water_color_r"]); 891 {
893 nWP.waterColor.Y = Convert.ToSingle(result["water_color_g"]); 892 nWP.regionID = DBGuid.FromDB(result["region_id"]);
894 nWP.waterColor.Z = Convert.ToSingle(result["water_color_b"]); 893 nWP.waterColor.X = Convert.ToSingle(result["water_color_r"]);
895 nWP.waterFogDensityExponent = Convert.ToSingle(result["water_fog_density_exponent"]); 894 nWP.waterColor.Y = Convert.ToSingle(result["water_color_g"]);
896 nWP.underwaterFogModifier = Convert.ToSingle(result["underwater_fog_modifier"]); 895 nWP.waterColor.Z = Convert.ToSingle(result["water_color_b"]);
897 nWP.reflectionWaveletScale.X = Convert.ToSingle(result["reflection_wavelet_scale_1"]); 896 nWP.waterFogDensityExponent = Convert.ToSingle(result["water_fog_density_exponent"]);
898 nWP.reflectionWaveletScale.Y = Convert.ToSingle(result["reflection_wavelet_scale_2"]); 897 nWP.underwaterFogModifier = Convert.ToSingle(result["underwater_fog_modifier"]);
899 nWP.reflectionWaveletScale.Z = Convert.ToSingle(result["reflection_wavelet_scale_3"]); 898 nWP.reflectionWaveletScale.X = Convert.ToSingle(result["reflection_wavelet_scale_1"]);
900 nWP.fresnelScale = Convert.ToSingle(result["fresnel_scale"]); 899 nWP.reflectionWaveletScale.Y = Convert.ToSingle(result["reflection_wavelet_scale_2"]);
901 nWP.fresnelOffset = Convert.ToSingle(result["fresnel_offset"]); 900 nWP.reflectionWaveletScale.Z = Convert.ToSingle(result["reflection_wavelet_scale_3"]);
902 nWP.refractScaleAbove = Convert.ToSingle(result["refract_scale_above"]); 901 nWP.fresnelScale = Convert.ToSingle(result["fresnel_scale"]);
903 nWP.refractScaleBelow = Convert.ToSingle(result["refract_scale_below"]); 902 nWP.fresnelOffset = Convert.ToSingle(result["fresnel_offset"]);
904 nWP.blurMultiplier = Convert.ToSingle(result["blur_multiplier"]); 903 nWP.refractScaleAbove = Convert.ToSingle(result["refract_scale_above"]);
905 nWP.bigWaveDirection.X = Convert.ToSingle(result["big_wave_direction_x"]); 904 nWP.refractScaleBelow = Convert.ToSingle(result["refract_scale_below"]);
906 nWP.bigWaveDirection.Y = Convert.ToSingle(result["big_wave_direction_y"]); 905 nWP.blurMultiplier = Convert.ToSingle(result["blur_multiplier"]);
907 nWP.littleWaveDirection.X = Convert.ToSingle(result["little_wave_direction_x"]); 906 nWP.bigWaveDirection.X = Convert.ToSingle(result["big_wave_direction_x"]);
908 nWP.littleWaveDirection.Y = Convert.ToSingle(result["little_wave_direction_y"]); 907 nWP.bigWaveDirection.Y = Convert.ToSingle(result["big_wave_direction_y"]);
909 UUID.TryParse(result["normal_map_texture"].ToString(), out nWP.normalMapTexture); 908 nWP.littleWaveDirection.X = Convert.ToSingle(result["little_wave_direction_x"]);
910 nWP.horizon.X = Convert.ToSingle(result["horizon_r"]); 909 nWP.littleWaveDirection.Y = Convert.ToSingle(result["little_wave_direction_y"]);
911 nWP.horizon.Y = Convert.ToSingle(result["horizon_g"]); 910 UUID.TryParse(result["normal_map_texture"].ToString(),out nWP.normalMapTexture);
912 nWP.horizon.Z = Convert.ToSingle(result["horizon_b"]); 911 nWP.horizon.X = Convert.ToSingle(result["horizon_r"]);
913 nWP.horizon.W = Convert.ToSingle(result["horizon_i"]); 912 nWP.horizon.Y = Convert.ToSingle(result["horizon_g"]);
914 nWP.hazeHorizon = Convert.ToSingle(result["haze_horizon"]); 913 nWP.horizon.Z = Convert.ToSingle(result["horizon_b"]);
915 nWP.blueDensity.X = Convert.ToSingle(result["blue_density_r"]); 914 nWP.horizon.W = Convert.ToSingle(result["horizon_i"]);
916 nWP.blueDensity.Y = Convert.ToSingle(result["blue_density_g"]); 915 nWP.hazeHorizon = Convert.ToSingle(result["haze_horizon"]);
917 nWP.blueDensity.Z = Convert.ToSingle(result["blue_density_b"]); 916 nWP.blueDensity.X = Convert.ToSingle(result["blue_density_r"]);
918 nWP.blueDensity.W = Convert.ToSingle(result["blue_density_i"]); 917 nWP.blueDensity.Y = Convert.ToSingle(result["blue_density_g"]);
919 nWP.hazeDensity = Convert.ToSingle(result["haze_density"]); 918 nWP.blueDensity.Z = Convert.ToSingle(result["blue_density_b"]);
920 nWP.densityMultiplier = Convert.ToSingle(result["density_multiplier"]); 919 nWP.blueDensity.W = Convert.ToSingle(result["blue_density_i"]);
921 nWP.distanceMultiplier = Convert.ToSingle(result["distance_multiplier"]); 920 nWP.hazeDensity = Convert.ToSingle(result["haze_density"]);
922 nWP.maxAltitude = Convert.ToUInt16(result["max_altitude"]); 921 nWP.densityMultiplier = Convert.ToSingle(result["density_multiplier"]);
923 nWP.sunMoonColor.X = Convert.ToSingle(result["sun_moon_color_r"]); 922 nWP.distanceMultiplier = Convert.ToSingle(result["distance_multiplier"]);
924 nWP.sunMoonColor.Y = Convert.ToSingle(result["sun_moon_color_g"]); 923 nWP.maxAltitude = Convert.ToUInt16(result["max_altitude"]);
925 nWP.sunMoonColor.Z = Convert.ToSingle(result["sun_moon_color_b"]); 924 nWP.sunMoonColor.X = Convert.ToSingle(result["sun_moon_color_r"]);
926 nWP.sunMoonColor.W = Convert.ToSingle(result["sun_moon_color_i"]); 925 nWP.sunMoonColor.Y = Convert.ToSingle(result["sun_moon_color_g"]);
927 nWP.sunMoonPosition = Convert.ToSingle(result["sun_moon_position"]); 926 nWP.sunMoonColor.Z = Convert.ToSingle(result["sun_moon_color_b"]);
928 nWP.ambient.X = Convert.ToSingle(result["ambient_r"]); 927 nWP.sunMoonColor.W = Convert.ToSingle(result["sun_moon_color_i"]);
929 nWP.ambient.Y = Convert.ToSingle(result["ambient_g"]); 928 nWP.sunMoonPosition = Convert.ToSingle(result["sun_moon_position"]);
930 nWP.ambient.Z = Convert.ToSingle(result["ambient_b"]); 929 nWP.ambient.X = Convert.ToSingle(result["ambient_r"]);
931 nWP.ambient.W = Convert.ToSingle(result["ambient_i"]); 930 nWP.ambient.Y = Convert.ToSingle(result["ambient_g"]);
932 nWP.eastAngle = Convert.ToSingle(result["east_angle"]); 931 nWP.ambient.Z = Convert.ToSingle(result["ambient_b"]);
933 nWP.sunGlowFocus = Convert.ToSingle(result["sun_glow_focus"]); 932 nWP.ambient.W = Convert.ToSingle(result["ambient_i"]);
934 nWP.sunGlowSize = Convert.ToSingle(result["sun_glow_size"]); 933 nWP.eastAngle = Convert.ToSingle(result["east_angle"]);
935 nWP.sceneGamma = Convert.ToSingle(result["scene_gamma"]); 934 nWP.sunGlowFocus = Convert.ToSingle(result["sun_glow_focus"]);
936 nWP.starBrightness = Convert.ToSingle(result["star_brightness"]); 935 nWP.sunGlowSize = Convert.ToSingle(result["sun_glow_size"]);
937 nWP.cloudColor.X = Convert.ToSingle(result["cloud_color_r"]); 936 nWP.sceneGamma = Convert.ToSingle(result["scene_gamma"]);
938 nWP.cloudColor.Y = Convert.ToSingle(result["cloud_color_g"]); 937 nWP.starBrightness = Convert.ToSingle(result["star_brightness"]);
939 nWP.cloudColor.Z = Convert.ToSingle(result["cloud_color_b"]); 938 nWP.cloudColor.X = Convert.ToSingle(result["cloud_color_r"]);
940 nWP.cloudColor.W = Convert.ToSingle(result["cloud_color_i"]); 939 nWP.cloudColor.Y = Convert.ToSingle(result["cloud_color_g"]);
941 nWP.cloudXYDensity.X = Convert.ToSingle(result["cloud_x"]); 940 nWP.cloudColor.Z = Convert.ToSingle(result["cloud_color_b"]);
942 nWP.cloudXYDensity.Y = Convert.ToSingle(result["cloud_y"]); 941 nWP.cloudColor.W = Convert.ToSingle(result["cloud_color_i"]);
943 nWP.cloudXYDensity.Z = Convert.ToSingle(result["cloud_density"]); 942 nWP.cloudXYDensity.X = Convert.ToSingle(result["cloud_x"]);
944 nWP.cloudCoverage = Convert.ToSingle(result["cloud_coverage"]); 943 nWP.cloudXYDensity.Y = Convert.ToSingle(result["cloud_y"]);
945 nWP.cloudScale = Convert.ToSingle(result["cloud_scale"]); 944 nWP.cloudXYDensity.Z = Convert.ToSingle(result["cloud_density"]);
946 nWP.cloudDetailXYDensity.X = Convert.ToSingle(result["cloud_detail_x"]); 945 nWP.cloudCoverage = Convert.ToSingle(result["cloud_coverage"]);
947 nWP.cloudDetailXYDensity.Y = Convert.ToSingle(result["cloud_detail_y"]); 946 nWP.cloudScale = Convert.ToSingle(result["cloud_scale"]);
948 nWP.cloudDetailXYDensity.Z = Convert.ToSingle(result["cloud_detail_density"]); 947 nWP.cloudDetailXYDensity.X = Convert.ToSingle(result["cloud_detail_x"]);
949 nWP.cloudScrollX = Convert.ToSingle(result["cloud_scroll_x"]); 948 nWP.cloudDetailXYDensity.Y = Convert.ToSingle(result["cloud_detail_y"]);
950 nWP.cloudScrollXLock = Convert.ToBoolean(result["cloud_scroll_x_lock"]); 949 nWP.cloudDetailXYDensity.Z = Convert.ToSingle(result["cloud_detail_density"]);
951 nWP.cloudScrollY = Convert.ToSingle(result["cloud_scroll_y"]); 950 nWP.cloudScrollX = Convert.ToSingle(result["cloud_scroll_x"]);
952 nWP.cloudScrollYLock = Convert.ToBoolean(result["cloud_scroll_y_lock"]); 951 nWP.cloudScrollXLock = Convert.ToBoolean(result["cloud_scroll_x_lock"]);
953 nWP.drawClassicClouds = Convert.ToBoolean(result["draw_classic_clouds"]); 952 nWP.cloudScrollY = Convert.ToSingle(result["cloud_scroll_y"]);
954 nWP.valid = true; 953 nWP.cloudScrollYLock = Convert.ToBoolean(result["cloud_scroll_y_lock"]);
954 nWP.drawClassicClouds = Convert.ToBoolean(result["draw_classic_clouds"]);
955 nWP.valid = true;
956 }
955 } 957 }
956 } 958 }
957 dbcon.Close(); 959 dbcon.Close();
@@ -1141,16 +1143,19 @@ namespace OpenSim.Data.MySQL
1141 1143
1142 cmd.Parameters.AddWithValue("?region_id", regionUUID.ToString()); 1144 cmd.Parameters.AddWithValue("?region_id", regionUUID.ToString());
1143 1145
1144 IDataReader result = ExecuteReader(cmd); 1146 using(IDataReader result = ExecuteReader(cmd))
1145 if (!result.Read())
1146 {
1147 dbcon.Close();
1148 return String.Empty;
1149 }
1150 else
1151 { 1147 {
1152 dbcon.Close(); 1148 if(!result.Read())
1153 return Convert.ToString(result["llsd_settings"]); 1149 {
1150 dbcon.Close();
1151 return String.Empty;
1152 }
1153 else
1154 {
1155 string ret = Convert.ToString(result["llsd_settings"]);
1156 dbcon.Close();
1157 return ret;
1158 }
1154 } 1159 }
1155 } 1160 }
1156 } 1161 }