diff options
24 files changed, 1047 insertions, 18 deletions
diff --git a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs index 0cae3dd..9f9d151 100644 --- a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs +++ b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs | |||
@@ -902,7 +902,7 @@ namespace OpenSim.Client.MXP.ClientStack | |||
902 | // Need to translate to MXP somehow | 902 | // Need to translate to MXP somehow |
903 | } | 903 | } |
904 | 904 | ||
905 | public void SendGenericMessage(string method, List<string> message) | 905 | public void SendGenericMessage(string method, List<byte[]> message) |
906 | { | 906 | { |
907 | // Need to translate to MXP somehow | 907 | // Need to translate to MXP somehow |
908 | } | 908 | } |
diff --git a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs index fb87c15..533475f 100644 --- a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs +++ b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs | |||
@@ -483,7 +483,7 @@ namespace OpenSim.Client.VWoHTTP.ClientStack | |||
483 | throw new System.NotImplementedException(); | 483 | throw new System.NotImplementedException(); |
484 | } | 484 | } |
485 | 485 | ||
486 | public void SendGenericMessage(string method, List<string> message) | 486 | public void SendGenericMessage(string method, List<byte[]> message) |
487 | { | 487 | { |
488 | throw new System.NotImplementedException(); | 488 | throw new System.NotImplementedException(); |
489 | } | 489 | } |
diff --git a/OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs b/OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs index 6371307..0b430c7 100644 --- a/OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs +++ b/OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs | |||
@@ -671,7 +671,16 @@ VALUES | |||
671 | cmd.ExecuteNonQuery(); | 671 | cmd.ExecuteNonQuery(); |
672 | } | 672 | } |
673 | } | 673 | } |
674 | 674 | public RegionMeta7WindlightData LoadRegionWindlightSettings(UUID regionUUID) | |
675 | { | ||
676 | //This connector doesn't support the windlight module yet | ||
677 | //Return default LL windlight settings | ||
678 | return new RegionMeta7WindlightData(); | ||
679 | } | ||
680 | public void StoreRegionWindlightSettings(RegionMeta7WindlightData wl) | ||
681 | { | ||
682 | //This connector doesn't support the windlight module yet | ||
683 | } | ||
675 | /// <summary> | 684 | /// <summary> |
676 | /// Loads the settings of a region. | 685 | /// Loads the settings of a region. |
677 | /// </summary> | 686 | /// </summary> |
@@ -696,7 +705,7 @@ VALUES | |||
696 | } | 705 | } |
697 | } | 706 | } |
698 | 707 | ||
699 | //If comes here then there is now region setting for that region | 708 | //If we reach this point then there are new region settings for that region |
700 | regionSettings = new RegionSettings(); | 709 | regionSettings = new RegionSettings(); |
701 | regionSettings.RegionUUID = regionUUID; | 710 | regionSettings.RegionUUID = regionUUID; |
702 | regionSettings.OnSave += StoreRegionSettings; | 711 | regionSettings.OnSave += StoreRegionSettings; |
diff --git a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs index aecfaa3..e2a5406 100644 --- a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs | |||
@@ -693,6 +693,97 @@ namespace OpenSim.Data.MySQL | |||
693 | } | 693 | } |
694 | } | 694 | } |
695 | 695 | ||
696 | public RegionMeta7WindlightData LoadRegionWindlightSettings(UUID regionUUID) | ||
697 | { | ||
698 | RegionMeta7WindlightData nWP = new RegionMeta7WindlightData(); | ||
699 | nWP.OnSave += StoreRegionWindlightSettings; | ||
700 | lock (m_Connection) | ||
701 | { | ||
702 | |||
703 | string command = "select * from `regionwindlight` where region_id = ?regionID"; | ||
704 | |||
705 | MySqlCommand cmd = new MySqlCommand(command); | ||
706 | |||
707 | cmd.Parameters.AddWithValue("?regionID", regionUUID.ToString()); | ||
708 | |||
709 | IDataReader result = ExecuteReader(cmd); | ||
710 | if (!result.Read()) | ||
711 | { | ||
712 | //No result, so store our default windlight profile and return it | ||
713 | nWP.regionID = regionUUID; | ||
714 | StoreRegionWindlightSettings(nWP); | ||
715 | return nWP; | ||
716 | } | ||
717 | else | ||
718 | { | ||
719 | UUID.TryParse(result["region_id"].ToString(), out nWP.regionID); | ||
720 | nWP.waterColor.X = Convert.ToSingle(result["water_color_r"]); | ||
721 | nWP.waterColor.Y = Convert.ToSingle(result["water_color_g"]); | ||
722 | nWP.waterColor.Z = Convert.ToSingle(result["water_color_b"]); | ||
723 | nWP.waterFogDensityExponent = Convert.ToSingle(result["water_fog_density_exponent"]); | ||
724 | nWP.underwaterFogModifier = Convert.ToSingle(result["underwater_fog_modifier"]); | ||
725 | nWP.reflectionWaveletScale.X = Convert.ToSingle(result["reflection_wavelet_scale_1"]); | ||
726 | nWP.reflectionWaveletScale.Y = Convert.ToSingle(result["reflection_wavelet_scale_2"]); | ||
727 | nWP.reflectionWaveletScale.Z = Convert.ToSingle(result["reflection_wavelet_scale_3"]); | ||
728 | nWP.fresnelScale = Convert.ToSingle(result["fresnel_scale"]); | ||
729 | nWP.fresnelOffset = Convert.ToSingle(result["fresnel_offset"]); | ||
730 | nWP.refractScaleAbove = Convert.ToSingle(result["refract_scale_above"]); | ||
731 | nWP.refractScaleBelow = Convert.ToSingle(result["refract_scale_below"]); | ||
732 | nWP.blurMultiplier = Convert.ToSingle(result["blur_multiplier"]); | ||
733 | nWP.bigWaveDirection.X = Convert.ToSingle(result["big_wave_direction_x"]); | ||
734 | nWP.bigWaveDirection.Y = Convert.ToSingle(result["big_wave_direction_y"]); | ||
735 | nWP.littleWaveDirection.X = Convert.ToSingle(result["little_wave_direction_x"]); | ||
736 | nWP.littleWaveDirection.Y = Convert.ToSingle(result["little_wave_direction_y"]); | ||
737 | UUID.TryParse(result["normal_map_texture"].ToString(), out nWP.normalMapTexture); | ||
738 | nWP.horizon.X = Convert.ToSingle(result["horizon_r"]); | ||
739 | nWP.horizon.Y = Convert.ToSingle(result["horizon_g"]); | ||
740 | nWP.horizon.Z = Convert.ToSingle(result["horizon_b"]); | ||
741 | nWP.horizon.W = Convert.ToSingle(result["horizon_i"]); | ||
742 | nWP.hazeHorizon = Convert.ToSingle(result["haze_horizon"]); | ||
743 | nWP.blueDensity.X = Convert.ToSingle(result["blue_density_r"]); | ||
744 | nWP.blueDensity.Y = Convert.ToSingle(result["blue_density_g"]); | ||
745 | nWP.blueDensity.Z = Convert.ToSingle(result["blue_density_b"]); | ||
746 | nWP.blueDensity.W = Convert.ToSingle(result["blue_density_i"]); | ||
747 | nWP.hazeDensity = Convert.ToSingle(result["haze_density"]); | ||
748 | nWP.densityMultiplier = Convert.ToSingle(result["density_multiplier"]); | ||
749 | nWP.distanceMultiplier = Convert.ToSingle(result["distance_multiplier"]); | ||
750 | nWP.maxAltitude = Convert.ToUInt16(result["max_altitude"]); | ||
751 | nWP.sunMoonColor.X = Convert.ToSingle(result["sun_moon_color_r"]); | ||
752 | nWP.sunMoonColor.Y = Convert.ToSingle(result["sun_moon_color_g"]); | ||
753 | nWP.sunMoonColor.Z = Convert.ToSingle(result["sun_moon_color_b"]); | ||
754 | nWP.sunMoonColor.W = Convert.ToSingle(result["sun_moon_color_i"]); | ||
755 | nWP.sunMoonPosition = Convert.ToSingle(result["sun_moon_position"]); | ||
756 | nWP.ambient.X = Convert.ToSingle(result["ambient_r"]); | ||
757 | nWP.ambient.Y = Convert.ToSingle(result["ambient_g"]); | ||
758 | nWP.ambient.Z = Convert.ToSingle(result["ambient_b"]); | ||
759 | nWP.ambient.W = Convert.ToSingle(result["ambient_i"]); | ||
760 | nWP.eastAngle = Convert.ToSingle(result["east_angle"]); | ||
761 | nWP.sunGlowFocus = Convert.ToSingle(result["sun_glow_focus"]); | ||
762 | nWP.sunGlowSize = Convert.ToSingle(result["sun_glow_size"]); | ||
763 | nWP.sceneGamma = Convert.ToSingle(result["scene_gamma"]); | ||
764 | nWP.starBrightness = Convert.ToSingle(result["star_brightness"]); | ||
765 | nWP.cloudColor.X = Convert.ToSingle(result["cloud_color_r"]); | ||
766 | nWP.cloudColor.Y = Convert.ToSingle(result["cloud_color_g"]); | ||
767 | nWP.cloudColor.Z = Convert.ToSingle(result["cloud_color_b"]); | ||
768 | nWP.cloudColor.W = Convert.ToSingle(result["cloud_color_i"]); | ||
769 | nWP.cloudXYDensity.X = Convert.ToSingle(result["cloud_x"]); | ||
770 | nWP.cloudXYDensity.Y = Convert.ToSingle(result["cloud_y"]); | ||
771 | nWP.cloudXYDensity.Z = Convert.ToSingle(result["cloud_density"]); | ||
772 | nWP.cloudCoverage = Convert.ToSingle(result["cloud_coverage"]); | ||
773 | nWP.cloudScale = Convert.ToSingle(result["cloud_scale"]); | ||
774 | nWP.cloudDetailXYDensity.X = Convert.ToSingle(result["cloud_detail_x"]); | ||
775 | nWP.cloudDetailXYDensity.Y = Convert.ToSingle(result["cloud_detail_y"]); | ||
776 | nWP.cloudDetailXYDensity.Z = Convert.ToSingle(result["cloud_detail_density"]); | ||
777 | nWP.cloudScrollX = Convert.ToSingle(result["cloud_scroll_x"]); | ||
778 | nWP.cloudScrollXLock = Convert.ToBoolean(result["cloud_scroll_x_lock"]); | ||
779 | nWP.cloudScrollY = Convert.ToSingle(result["cloud_scroll_y"]); | ||
780 | nWP.cloudScrollYLock = Convert.ToBoolean(result["cloud_scroll_y_lock"]); | ||
781 | nWP.drawClassicClouds = Convert.ToBoolean(result["draw_classic_clouds"]); | ||
782 | } | ||
783 | } | ||
784 | return nWP; | ||
785 | } | ||
786 | |||
696 | public RegionSettings LoadRegionSettings(UUID regionUUID) | 787 | public RegionSettings LoadRegionSettings(UUID regionUUID) |
697 | { | 788 | { |
698 | RegionSettings rs = null; | 789 | RegionSettings rs = null; |
@@ -726,6 +817,107 @@ namespace OpenSim.Data.MySQL | |||
726 | return rs; | 817 | return rs; |
727 | } | 818 | } |
728 | 819 | ||
820 | public void StoreRegionWindlightSettings(RegionMeta7WindlightData wl) | ||
821 | { | ||
822 | lock (m_Connection) | ||
823 | { | ||
824 | using (MySqlCommand cmd = m_Connection.CreateCommand()) | ||
825 | { | ||
826 | cmd.CommandText = "REPLACE INTO `regionwindlight` (`region_id`, `water_color_r`, `water_color_g`, "; | ||
827 | cmd.CommandText += "`water_color_b`, `water_fog_density_exponent`, `underwater_fog_modifier`, "; | ||
828 | cmd.CommandText += "`reflection_wavelet_scale_1`, `reflection_wavelet_scale_2`, `reflection_wavelet_scale_3`, "; | ||
829 | cmd.CommandText += "`fresnel_scale`, `fresnel_offset`, `refract_scale_above`, `refract_scale_below`, "; | ||
830 | cmd.CommandText += "`blur_multiplier`, `big_wave_direction_x`, `big_wave_direction_y`, `little_wave_direction_x`, "; | ||
831 | cmd.CommandText += "`little_wave_direction_y`, `normal_map_texture`, `horizon_r`, `horizon_g`, `horizon_b`, "; | ||
832 | cmd.CommandText += "`horizon_i`, `haze_horizon`, `blue_density_r`, `blue_density_g`, `blue_density_b`, "; | ||
833 | cmd.CommandText += "`blue_density_i`, `haze_density`, `density_multiplier`, `distance_multiplier`, `max_altitude`, "; | ||
834 | cmd.CommandText += "`sun_moon_color_r`, `sun_moon_color_g`, `sun_moon_color_b`, `sun_moon_color_i`, `sun_moon_position`, "; | ||
835 | cmd.CommandText += "`ambient_r`, `ambient_g`, `ambient_b`, `ambient_i`, `east_angle`, `sun_glow_focus`, `sun_glow_size`, "; | ||
836 | cmd.CommandText += "`scene_gamma`, `star_brightness`, `cloud_color_r`, `cloud_color_g`, `cloud_color_b`, `cloud_color_i`, "; | ||
837 | cmd.CommandText += "`cloud_x`, `cloud_y`, `cloud_density`, `cloud_coverage`, `cloud_scale`, `cloud_detail_x`, "; | ||
838 | cmd.CommandText += "`cloud_detail_y`, `cloud_detail_density`, `cloud_scroll_x`, `cloud_scroll_x_lock`, `cloud_scroll_y`, "; | ||
839 | cmd.CommandText += "`cloud_scroll_y_lock`, `draw_classic_clouds`) VALUES (?region_id, ?water_color_r, "; | ||
840 | cmd.CommandText += "?water_color_g, ?water_color_b, ?water_fog_density_exponent, ?underwater_fog_modifier, ?reflection_wavelet_scale_1, "; | ||
841 | cmd.CommandText += "?reflection_wavelet_scale_2, ?reflection_wavelet_scale_3, ?fresnel_scale, ?fresnel_offset, ?refract_scale_above, "; | ||
842 | cmd.CommandText += "?refract_scale_below, ?blur_multiplier, ?big_wave_direction_x, ?big_wave_direction_y, ?little_wave_direction_x, "; | ||
843 | cmd.CommandText += "?little_wave_direction_y, ?normal_map_texture, ?horizon_r, ?horizon_g, ?horizon_b, ?horizon_i, ?haze_horizon, "; | ||
844 | cmd.CommandText += "?blue_density_r, ?blue_density_g, ?blue_density_b, ?blue_density_i, ?haze_density, ?density_multiplier, "; | ||
845 | cmd.CommandText += "?distance_multiplier, ?max_altitude, ?sun_moon_color_r, ?sun_moon_color_g, ?sun_moon_color_b, "; | ||
846 | cmd.CommandText += "?sun_moon_color_i, ?sun_moon_position, ?ambient_r, ?ambient_g, ?ambient_b, ?ambient_i, ?east_angle, "; | ||
847 | cmd.CommandText += "?sun_glow_focus, ?sun_glow_size, ?scene_gamma, ?star_brightness, ?cloud_color_r, ?cloud_color_g, "; | ||
848 | cmd.CommandText += "?cloud_color_b, ?cloud_color_i, ?cloud_x, ?cloud_y, ?cloud_density, ?cloud_coverage, ?cloud_scale, "; | ||
849 | cmd.CommandText += "?cloud_detail_x, ?cloud_detail_y, ?cloud_detail_density, ?cloud_scroll_x, ?cloud_scroll_x_lock, "; | ||
850 | cmd.CommandText += "?cloud_scroll_y, ?cloud_scroll_y_lock, ?draw_classic_clouds)"; | ||
851 | |||
852 | cmd.Parameters.AddWithValue("region_id", wl.regionID); | ||
853 | cmd.Parameters.AddWithValue("water_color_r", wl.waterColor.X); | ||
854 | cmd.Parameters.AddWithValue("water_color_g", wl.waterColor.Y); | ||
855 | cmd.Parameters.AddWithValue("water_color_b", wl.waterColor.Z); | ||
856 | cmd.Parameters.AddWithValue("water_fog_density_exponent", wl.waterFogDensityExponent); | ||
857 | cmd.Parameters.AddWithValue("underwater_fog_modifier", wl.underwaterFogModifier); | ||
858 | cmd.Parameters.AddWithValue("reflection_wavelet_scale_1", wl.reflectionWaveletScale.X); | ||
859 | cmd.Parameters.AddWithValue("reflection_wavelet_scale_2", wl.reflectionWaveletScale.Y); | ||
860 | cmd.Parameters.AddWithValue("reflection_wavelet_scale_3", wl.reflectionWaveletScale.Z); | ||
861 | cmd.Parameters.AddWithValue("fresnel_scale", wl.fresnelScale); | ||
862 | cmd.Parameters.AddWithValue("fresnel_offset", wl.fresnelOffset); | ||
863 | cmd.Parameters.AddWithValue("refract_scale_above", wl.refractScaleAbove); | ||
864 | cmd.Parameters.AddWithValue("refract_scale_below", wl.refractScaleBelow); | ||
865 | cmd.Parameters.AddWithValue("blur_multiplier", wl.blurMultiplier); | ||
866 | cmd.Parameters.AddWithValue("big_wave_direction_x", wl.bigWaveDirection.X); | ||
867 | cmd.Parameters.AddWithValue("big_wave_direction_y", wl.bigWaveDirection.Y); | ||
868 | cmd.Parameters.AddWithValue("little_wave_direction_x", wl.littleWaveDirection.X); | ||
869 | cmd.Parameters.AddWithValue("little_wave_direction_y", wl.littleWaveDirection.Y); | ||
870 | cmd.Parameters.AddWithValue("normal_map_texture", wl.normalMapTexture); | ||
871 | cmd.Parameters.AddWithValue("horizon_r", wl.horizon.X); | ||
872 | cmd.Parameters.AddWithValue("horizon_g", wl.horizon.Y); | ||
873 | cmd.Parameters.AddWithValue("horizon_b", wl.horizon.Z); | ||
874 | cmd.Parameters.AddWithValue("horizon_i", wl.horizon.W); | ||
875 | cmd.Parameters.AddWithValue("haze_horizon", wl.hazeHorizon); | ||
876 | cmd.Parameters.AddWithValue("blue_density_r", wl.blueDensity.X); | ||
877 | cmd.Parameters.AddWithValue("blue_density_g", wl.blueDensity.Y); | ||
878 | cmd.Parameters.AddWithValue("blue_density_b", wl.blueDensity.Z); | ||
879 | cmd.Parameters.AddWithValue("blue_density_i", wl.blueDensity.W); | ||
880 | cmd.Parameters.AddWithValue("haze_density", wl.hazeDensity); | ||
881 | cmd.Parameters.AddWithValue("density_multiplier", wl.densityMultiplier); | ||
882 | cmd.Parameters.AddWithValue("distance_multiplier", wl.distanceMultiplier); | ||
883 | cmd.Parameters.AddWithValue("max_altitude", wl.maxAltitude); | ||
884 | cmd.Parameters.AddWithValue("sun_moon_color_r", wl.sunMoonColor.X); | ||
885 | cmd.Parameters.AddWithValue("sun_moon_color_g", wl.sunMoonColor.Y); | ||
886 | cmd.Parameters.AddWithValue("sun_moon_color_b", wl.sunMoonColor.Z); | ||
887 | cmd.Parameters.AddWithValue("sun_moon_color_i", wl.sunMoonColor.W); | ||
888 | cmd.Parameters.AddWithValue("sun_moon_position", wl.sunMoonPosition); | ||
889 | cmd.Parameters.AddWithValue("ambient_r", wl.ambient.X); | ||
890 | cmd.Parameters.AddWithValue("ambient_g", wl.ambient.Y); | ||
891 | cmd.Parameters.AddWithValue("ambient_b", wl.ambient.Z); | ||
892 | cmd.Parameters.AddWithValue("ambient_i", wl.ambient.W); | ||
893 | cmd.Parameters.AddWithValue("east_angle", wl.eastAngle); | ||
894 | cmd.Parameters.AddWithValue("sun_glow_focus", wl.sunGlowFocus); | ||
895 | cmd.Parameters.AddWithValue("sun_glow_size", wl.sunGlowSize); | ||
896 | cmd.Parameters.AddWithValue("scene_gamma", wl.sceneGamma); | ||
897 | cmd.Parameters.AddWithValue("star_brightness", wl.starBrightness); | ||
898 | cmd.Parameters.AddWithValue("cloud_color_r", wl.cloudColor.X); | ||
899 | cmd.Parameters.AddWithValue("cloud_color_g", wl.cloudColor.Y); | ||
900 | cmd.Parameters.AddWithValue("cloud_color_b", wl.cloudColor.Z); | ||
901 | cmd.Parameters.AddWithValue("cloud_color_i", wl.cloudColor.W); | ||
902 | cmd.Parameters.AddWithValue("cloud_x", wl.cloudXYDensity.X); | ||
903 | cmd.Parameters.AddWithValue("cloud_y", wl.cloudXYDensity.Y); | ||
904 | cmd.Parameters.AddWithValue("cloud_density", wl.cloudXYDensity.Z); | ||
905 | cmd.Parameters.AddWithValue("cloud_coverage", wl.cloudCoverage); | ||
906 | cmd.Parameters.AddWithValue("cloud_scale", wl.cloudScale); | ||
907 | cmd.Parameters.AddWithValue("cloud_detail_x", wl.cloudDetailXYDensity.X); | ||
908 | cmd.Parameters.AddWithValue("cloud_detail_y", wl.cloudDetailXYDensity.Y); | ||
909 | cmd.Parameters.AddWithValue("cloud_detail_density", wl.cloudDetailXYDensity.Z); | ||
910 | cmd.Parameters.AddWithValue("cloud_scroll_x", wl.cloudScrollX); | ||
911 | cmd.Parameters.AddWithValue("cloud_scroll_x_lock", wl.cloudScrollXLock); | ||
912 | cmd.Parameters.AddWithValue("cloud_scroll_y", wl.cloudScrollY); | ||
913 | cmd.Parameters.AddWithValue("cloud_scroll_y_lock", wl.cloudScrollYLock); | ||
914 | cmd.Parameters.AddWithValue("draw_classic_clouds", wl.drawClassicClouds); | ||
915 | |||
916 | ExecuteNonQuery(cmd); | ||
917 | } | ||
918 | } | ||
919 | } | ||
920 | |||
729 | public void StoreRegionSettings(RegionSettings rs) | 921 | public void StoreRegionSettings(RegionSettings rs) |
730 | { | 922 | { |
731 | lock (m_Connection) | 923 | lock (m_Connection) |
diff --git a/OpenSim/Data/MySQL/Resources/032_RegionStore.sql b/OpenSim/Data/MySQL/Resources/032_RegionStore.sql new file mode 100644 index 0000000..0545ee1 --- /dev/null +++ b/OpenSim/Data/MySQL/Resources/032_RegionStore.sql | |||
@@ -0,0 +1,70 @@ | |||
1 | BEGIN; | ||
2 | |||
3 | CREATE TABLE `regionwindlight` ( | ||
4 | `region_id` varchar(36) NOT NULL DEFAULT '000000-0000-0000-0000-000000000000', | ||
5 | `water_color_r` float(9,6) unsigned NOT NULL DEFAULT '4.000000', | ||
6 | `water_color_g` float(9,6) unsigned NOT NULL DEFAULT '38.000000', | ||
7 | `water_color_b` float(9,6) unsigned NOT NULL DEFAULT '64.000000', | ||
8 | `water_fog_density_exponent` float(3,1) unsigned NOT NULL DEFAULT '4.0', | ||
9 | `underwater_fog_modifier` float(3,2) unsigned NOT NULL DEFAULT '0.25', | ||
10 | `reflection_wavelet_scale_1` float(3,1) unsigned NOT NULL DEFAULT '2.0', | ||
11 | `reflection_wavelet_scale_2` float(3,1) unsigned NOT NULL DEFAULT '2.0', | ||
12 | `reflection_wavelet_scale_3` float(3,1) unsigned NOT NULL DEFAULT '2.0', | ||
13 | `fresnel_scale` float(3,2) unsigned NOT NULL DEFAULT '0.40', | ||
14 | `fresnel_offset` float(3,2) unsigned NOT NULL DEFAULT '0.50', | ||
15 | `refract_scale_above` float(3,2) unsigned NOT NULL DEFAULT '0.03', | ||
16 | `refract_scale_below` float(3,2) unsigned NOT NULL DEFAULT '0.20', | ||
17 | `blur_multiplier` float(4,3) unsigned NOT NULL DEFAULT '0.040', | ||
18 | `big_wave_direction_x` float(3,2) NOT NULL DEFAULT '1.05', | ||
19 | `big_wave_direction_y` float(3,2) NOT NULL DEFAULT '-0.42', | ||
20 | `little_wave_direction_x` float(3,2) NOT NULL DEFAULT '1.11', | ||
21 | `little_wave_direction_y` float(3,2) NOT NULL DEFAULT '-1.16', | ||
22 | `normal_map_texture` varchar(36) NOT NULL DEFAULT '822ded49-9a6c-f61c-cb89-6df54f42cdf4', | ||
23 | `horizon_r` float(3,2) unsigned NOT NULL DEFAULT '0.26', | ||
24 | `horizon_g` float(3,2) unsigned NOT NULL DEFAULT '0.24', | ||
25 | `horizon_b` float(3,2) unsigned NOT NULL DEFAULT '0.33', | ||
26 | `horizon_i` float(3,2) unsigned NOT NULL DEFAULT '0.33', | ||
27 | `haze_horizon` float(3,2) unsigned NOT NULL DEFAULT '0.19', | ||
28 | `blue_density_r` float(3,2) unsigned NOT NULL DEFAULT '0.10', | ||
29 | `blue_density_g` float(3,2) unsigned NOT NULL DEFAULT '0.93', | ||
30 | `blue_density_b` float(3,2) unsigned NOT NULL DEFAULT '0.02', | ||
31 | `blue_density_i` float(3,2) unsigned NOT NULL DEFAULT '0.93', | ||
32 | `haze_density` float(3,2) unsigned NOT NULL DEFAULT '0.70', | ||
33 | `density_multiplier` float(3,2) unsigned NOT NULL DEFAULT '0.18', | ||
34 | `distance_multiplier` float(4,1) unsigned NOT NULL DEFAULT '0.8', | ||
35 | `max_altitude` int(4) unsigned NOT NULL DEFAULT '1605', | ||
36 | `sun_moon_color_r` float(3,2) unsigned NOT NULL DEFAULT '0.24', | ||
37 | `sun_moon_color_g` float(3,2) unsigned NOT NULL DEFAULT '0.26', | ||
38 | `sun_moon_color_b` float(3,2) unsigned NOT NULL DEFAULT '0.30', | ||
39 | `sun_moon_color_i` float(3,2) unsigned NOT NULL DEFAULT '0.30', | ||
40 | `sun_moon_position` float(4,3) unsigned NOT NULL DEFAULT '0.335', | ||
41 | `ambient_r` float(3,2) unsigned NOT NULL DEFAULT '0.35', | ||
42 | `ambient_g` float(3,2) unsigned NOT NULL DEFAULT '0.35', | ||
43 | `ambient_b` float(3,2) unsigned NOT NULL DEFAULT '0.35', | ||
44 | `ambient_i` float(3,2) unsigned NOT NULL DEFAULT '0.35', | ||
45 | `east_angle` float(3,2) unsigned NOT NULL DEFAULT '0.00', | ||
46 | `sun_glow_focus` float(3,2) unsigned NOT NULL DEFAULT '0.10', | ||
47 | `sun_glow_size` float(3,2) unsigned NOT NULL DEFAULT '1.75', | ||
48 | `scene_gamma` float(4,2) unsigned NOT NULL DEFAULT '1.00', | ||
49 | `star_brightness` float(3,2) unsigned NOT NULL DEFAULT '0.00', | ||
50 | `cloud_color_r` float(3,2) unsigned NOT NULL DEFAULT '0.41', | ||
51 | `cloud_color_g` float(3,2) unsigned NOT NULL DEFAULT '0.41', | ||
52 | `cloud_color_b` float(3,2) unsigned NOT NULL DEFAULT '0.41', | ||
53 | `cloud_color_i` float(3,2) unsigned NOT NULL DEFAULT '0.41', | ||
54 | `cloud_x` float(3,2) unsigned NOT NULL DEFAULT '1.00', | ||
55 | `cloud_y` float(3,2) unsigned NOT NULL DEFAULT '0.53', | ||
56 | `cloud_density` float(3,2) unsigned NOT NULL DEFAULT '1.00', | ||
57 | `cloud_coverage` float(3,2) unsigned NOT NULL DEFAULT '0.27', | ||
58 | `cloud_scale` float(3,2) unsigned NOT NULL DEFAULT '0.42', | ||
59 | `cloud_detail_x` float(3,2) unsigned NOT NULL DEFAULT '1.00', | ||
60 | `cloud_detail_y` float(3,2) unsigned NOT NULL DEFAULT '0.53', | ||
61 | `cloud_detail_density` float(3,2) unsigned NOT NULL DEFAULT '0.12', | ||
62 | `cloud_scroll_x` float(3,2) unsigned NOT NULL DEFAULT '0.20', | ||
63 | `cloud_scroll_x_lock` tinyint(1) unsigned NOT NULL DEFAULT '0', | ||
64 | `cloud_scroll_y` float(3,2) unsigned NOT NULL DEFAULT '0.01', | ||
65 | `cloud_scroll_y_lock` tinyint(1) unsigned NOT NULL DEFAULT '0', | ||
66 | `draw_classic_clouds` tinyint(1) unsigned NOT NULL DEFAULT '0', | ||
67 | PRIMARY KEY (`region_id`) | ||
68 | ); | ||
69 | |||
70 | COMMIT; \ No newline at end of file | ||
diff --git a/OpenSim/Data/Null/NullDataStore.cs b/OpenSim/Data/Null/NullDataStore.cs index 427fa0a..4b6d0f3 100644 --- a/OpenSim/Data/Null/NullDataStore.cs +++ b/OpenSim/Data/Null/NullDataStore.cs | |||
@@ -50,7 +50,16 @@ namespace OpenSim.Data.Null | |||
50 | public void StoreRegionSettings(RegionSettings rs) | 50 | public void StoreRegionSettings(RegionSettings rs) |
51 | { | 51 | { |
52 | } | 52 | } |
53 | 53 | public RegionMeta7WindlightData LoadRegionWindlightSettings(UUID regionUUID) | |
54 | { | ||
55 | //This connector doesn't support the windlight module yet | ||
56 | //Return default LL windlight settings | ||
57 | return new RegionMeta7WindlightData(); | ||
58 | } | ||
59 | public void StoreRegionWindlightSettings(RegionMeta7WindlightData wl) | ||
60 | { | ||
61 | //This connector doesn't support the windlight module yet | ||
62 | } | ||
54 | public RegionSettings LoadRegionSettings(UUID regionUUID) | 63 | public RegionSettings LoadRegionSettings(UUID regionUUID) |
55 | { | 64 | { |
56 | return null; | 65 | return null; |
diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs index b68de1a..f1c1f78 100644 --- a/OpenSim/Data/SQLite/SQLiteRegionData.cs +++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs | |||
@@ -272,7 +272,16 @@ namespace OpenSim.Data.SQLite | |||
272 | Commit(); | 272 | Commit(); |
273 | } | 273 | } |
274 | } | 274 | } |
275 | 275 | public RegionMeta7WindlightData LoadRegionWindlightSettings(UUID regionUUID) | |
276 | { | ||
277 | //This connector doesn't support the windlight module yet | ||
278 | //Return default LL windlight settings | ||
279 | return new RegionMeta7WindlightData(); | ||
280 | } | ||
281 | public void StoreRegionWindlightSettings(RegionMeta7WindlightData wl) | ||
282 | { | ||
283 | //This connector doesn't support the windlight module yet | ||
284 | } | ||
276 | public RegionSettings LoadRegionSettings(UUID regionUUID) | 285 | public RegionSettings LoadRegionSettings(UUID regionUUID) |
277 | { | 286 | { |
278 | lock (ds) | 287 | lock (ds) |
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 04ba9c6..cb136e2 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs | |||
@@ -1077,7 +1077,7 @@ namespace OpenSim.Framework | |||
1077 | 1077 | ||
1078 | void SendInstantMessage(GridInstantMessage im); | 1078 | void SendInstantMessage(GridInstantMessage im); |
1079 | 1079 | ||
1080 | void SendGenericMessage(string method, List<string> message); | 1080 | void SendGenericMessage(string method, List<byte[]> message); |
1081 | 1081 | ||
1082 | void SendLayerData(float[] map); | 1082 | void SendLayerData(float[] map); |
1083 | void SendLayerData(int px, int py, float[] map); | 1083 | void SendLayerData(int px, int py, float[] map); |
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index 721233d..c39cc03 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs | |||
@@ -36,8 +36,59 @@ using OpenMetaverse; | |||
36 | using OpenMetaverse.StructuredData; | 36 | using OpenMetaverse.StructuredData; |
37 | using OpenSim.Framework.Console; | 37 | using OpenSim.Framework.Console; |
38 | 38 | ||
39 | |||
39 | namespace OpenSim.Framework | 40 | namespace OpenSim.Framework |
40 | { | 41 | { |
42 | public class RegionMeta7WindlightData | ||
43 | { | ||
44 | public UUID regionID = UUID.Zero; | ||
45 | public Vector3 waterColor = new Vector3(4.0f,38.0f,64.0f); | ||
46 | public float waterFogDensityExponent = 4.0f; | ||
47 | public float underwaterFogModifier = 0.25f; | ||
48 | public Vector3 reflectionWaveletScale = new Vector3(2.0f,2.0f,2.0f); | ||
49 | public float fresnelScale = 0.40f; | ||
50 | public float fresnelOffset = 0.50f; | ||
51 | public float refractScaleAbove = 0.03f; | ||
52 | public float refractScaleBelow = 0.20f; | ||
53 | public float blurMultiplier = 0.040f; | ||
54 | public Vector2 bigWaveDirection = new Vector2(1.05f,-0.42f); | ||
55 | public Vector2 littleWaveDirection = new Vector2(1.11f,-1.16f); | ||
56 | public UUID normalMapTexture = new UUID("822ded49-9a6c-f61c-cb89-6df54f42cdf4"); | ||
57 | public Vector4 horizon = new Vector4(0.26f, 0.24f, 0.34f, 0.33f); | ||
58 | public float hazeHorizon = 0.19f; | ||
59 | public Vector4 blueDensity = new Vector4(0.10f, 0.93f, 0.02f, 0.93f); | ||
60 | public float hazeDensity = 0.70f; | ||
61 | public float densityMultiplier = 0.18f; | ||
62 | public float distanceMultiplier = 0.8f; | ||
63 | public UInt16 maxAltitude = 1605; | ||
64 | public Vector4 sunMoonColor = new Vector4(0.24f, 0.26f, 0.30f, 0.30f); | ||
65 | public float sunMoonPosition = 0.335f; | ||
66 | public Vector4 ambient = new Vector4(0.35f,0.35f,0.35f,0.35f); | ||
67 | public float eastAngle = 0.0f; | ||
68 | public float sunGlowFocus = 0.10f; | ||
69 | public float sunGlowSize = 0.10f; | ||
70 | public float sceneGamma = 1.0f; | ||
71 | public float starBrightness = 0.0f; | ||
72 | public Vector4 cloudColor = new Vector4(0.41f, 0.41f, 0.41f, 0.41f); | ||
73 | public Vector3 cloudXYDensity = new Vector3(1.00f, 0.53f, 1.00f); | ||
74 | public float cloudCoverage = 0.27f; | ||
75 | public float cloudScale = 0.42f; | ||
76 | public Vector3 cloudDetailXYDensity = new Vector3(1.00f, 0.53f, 0.12f); | ||
77 | public float cloudScrollX = 0.20f; | ||
78 | public bool cloudScrollXLock = false; | ||
79 | public float cloudScrollY = 0.01f; | ||
80 | public bool cloudScrollYLock = false; | ||
81 | public bool drawClassicClouds = false; | ||
82 | |||
83 | public delegate void SaveDelegate(RegionMeta7WindlightData wl); | ||
84 | public event SaveDelegate OnSave; | ||
85 | public void Save() | ||
86 | { | ||
87 | if (OnSave != null) | ||
88 | OnSave(this); | ||
89 | } | ||
90 | } | ||
91 | |||
41 | [Serializable] | 92 | [Serializable] |
42 | public class SimpleRegionInfo | 93 | public class SimpleRegionInfo |
43 | { | 94 | { |
@@ -304,8 +355,7 @@ namespace OpenSim.Framework | |||
304 | private bool m_clampPrimSize = false; | 355 | private bool m_clampPrimSize = false; |
305 | private int m_objectCapacity = 0; | 356 | private int m_objectCapacity = 0; |
306 | private string m_regionType = String.Empty; | 357 | private string m_regionType = String.Empty; |
307 | 358 | private RegionMeta7WindlightData m_windlight = new RegionMeta7WindlightData(); | |
308 | |||
309 | // Apparently, we're applying the same estatesettings regardless of whether it's local or remote. | 359 | // Apparently, we're applying the same estatesettings regardless of whether it's local or remote. |
310 | 360 | ||
311 | // MT: Yes. Estates can't span trust boundaries. Therefore, it can be | 361 | // MT: Yes. Estates can't span trust boundaries. Therefore, it can be |
@@ -454,6 +504,21 @@ namespace OpenSim.Framework | |||
454 | set { m_regionSettings = value; } | 504 | set { m_regionSettings = value; } |
455 | } | 505 | } |
456 | 506 | ||
507 | public RegionMeta7WindlightData WindlightSettings | ||
508 | { | ||
509 | get | ||
510 | { | ||
511 | if (m_windlight == null) | ||
512 | { | ||
513 | m_windlight = new RegionMeta7WindlightData(); | ||
514 | } | ||
515 | |||
516 | return m_windlight; | ||
517 | } | ||
518 | |||
519 | set { m_windlight = value; } | ||
520 | } | ||
521 | |||
457 | public int NonphysPrimMax | 522 | public int NonphysPrimMax |
458 | { | 523 | { |
459 | get { return m_nonphysPrimMax; } | 524 | get { return m_nonphysPrimMax; } |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 71f9b90..2b5e632 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -770,16 +770,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
770 | } | 770 | } |
771 | } | 771 | } |
772 | 772 | ||
773 | public void SendGenericMessage(string method, List<string> message) | 773 | public void SendGenericMessage(string method, List<byte[]> message) |
774 | { | 774 | { |
775 | GenericMessagePacket gmp = new GenericMessagePacket(); | 775 | GenericMessagePacket gmp = new GenericMessagePacket(); |
776 | gmp.MethodData.Method = Util.StringToBytes256(method); | 776 | gmp.MethodData.Method = Util.StringToBytes256(method); |
777 | gmp.ParamList = new GenericMessagePacket.ParamListBlock[message.Count]; | 777 | gmp.ParamList = new GenericMessagePacket.ParamListBlock[message.Count]; |
778 | int i = 0; | 778 | int i = 0; |
779 | foreach (string val in message) | 779 | foreach (byte[] val in message) |
780 | { | 780 | { |
781 | gmp.ParamList[i] = new GenericMessagePacket.ParamListBlock(); | 781 | gmp.ParamList[i] = new GenericMessagePacket.ParamListBlock(); |
782 | gmp.ParamList[i++].Parameter = Util.StringToBytes256(val); | 782 | gmp.ParamList[i++].Parameter = val; |
783 | } | 783 | } |
784 | OutPacket(gmp, ThrottleOutPacketType.Task); | 784 | OutPacket(gmp, ThrottleOutPacketType.Task); |
785 | } | 785 | } |
diff --git a/OpenSim/Region/CoreModules/World/Meta7Windlight/Meta7WindlightModule.cs b/OpenSim/Region/CoreModules/World/Meta7Windlight/Meta7WindlightModule.cs new file mode 100644 index 0000000..f180b47 --- /dev/null +++ b/OpenSim/Region/CoreModules/World/Meta7Windlight/Meta7WindlightModule.cs | |||
@@ -0,0 +1,245 @@ | |||
1 | /* | ||
2 | * Copyright (c) Thomas Grimshaw and Magne Metaverse Research | ||
3 | * | ||
4 | * This module is not open source. All rights reserved. | ||
5 | * Unauthorised copying, distribution or public display is prohibited. | ||
6 | * | ||
7 | */ | ||
8 | |||
9 | using System; | ||
10 | using System.Collections.Generic; | ||
11 | using System.IO; | ||
12 | using System.Reflection; | ||
13 | using OpenMetaverse; | ||
14 | using log4net; | ||
15 | using Nini.Config; | ||
16 | using OpenSim.Data; | ||
17 | using OpenSim.Framework; | ||
18 | using OpenSim.Region.CoreModules.Framework.InterfaceCommander; | ||
19 | using OpenSim.Region.Framework.Interfaces; | ||
20 | using OpenSim.Region.Framework.Scenes; | ||
21 | |||
22 | |||
23 | namespace OpenSim.Region.CoreModules.World.Meta7Windlight | ||
24 | { | ||
25 | public class Meta7WindlightModule : IRegionModule, ICommandableModule | ||
26 | { | ||
27 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
28 | private readonly Commander m_commander = new Commander("windlight"); | ||
29 | private Scene m_scene; | ||
30 | private static bool m_enableWindlight; | ||
31 | |||
32 | #region ICommandableModule Members | ||
33 | |||
34 | public ICommander CommandInterface | ||
35 | { | ||
36 | get { return m_commander; } | ||
37 | } | ||
38 | |||
39 | #endregion | ||
40 | |||
41 | #region IRegionModule Members | ||
42 | |||
43 | public static bool EnableWindlight | ||
44 | { | ||
45 | get | ||
46 | { | ||
47 | return m_enableWindlight; | ||
48 | } | ||
49 | set | ||
50 | { | ||
51 | } | ||
52 | } | ||
53 | |||
54 | public void Initialise(Scene scene, IConfigSource config) | ||
55 | { | ||
56 | m_scene = scene; | ||
57 | m_scene.RegisterModuleInterface<IRegionModule>(this); | ||
58 | m_scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole; | ||
59 | |||
60 | // ini file settings | ||
61 | try | ||
62 | { | ||
63 | m_enableWindlight = config.Configs["Meta7Windlight"].GetBoolean("enable_windlight", false); | ||
64 | } | ||
65 | catch (Exception) | ||
66 | { | ||
67 | m_log.Debug("[WINDLIGHT]: ini failure for enable_windlight - using default"); | ||
68 | } | ||
69 | |||
70 | if (m_enableWindlight) | ||
71 | { | ||
72 | m_scene.EventManager.OnMakeRootAgent += EventManager_OnMakeRootAgent; | ||
73 | m_scene.EventManager.OnSaveNewWindlightProfile += EventManager_OnSaveNewWindlightProfile; | ||
74 | } | ||
75 | |||
76 | InstallCommands(); | ||
77 | |||
78 | m_log.Debug("[WINDLIGHT]: Initialised windlight module"); | ||
79 | } | ||
80 | public void SendProfileToClient(ScenePresence presence) | ||
81 | { | ||
82 | if (m_enableWindlight) | ||
83 | { | ||
84 | if (presence.IsChildAgent == false) | ||
85 | { | ||
86 | IClientAPI client = presence.ControllingClient; | ||
87 | RegionMeta7WindlightData wl = m_scene.RegionInfo.WindlightSettings; | ||
88 | byte[] mBlock = new Byte[249]; | ||
89 | int pos = 0; | ||
90 | |||
91 | wl.waterColor.ToBytes(mBlock, 0); pos += 12; | ||
92 | Utils.FloatToBytes(wl.waterFogDensityExponent).CopyTo(mBlock, pos); pos += 4; | ||
93 | Utils.FloatToBytes(wl.underwaterFogModifier).CopyTo(mBlock, pos); pos += 4; | ||
94 | wl.reflectionWaveletScale.ToBytes(mBlock, pos); pos += 12; | ||
95 | Utils.FloatToBytes(wl.fresnelScale).CopyTo(mBlock, pos); pos += 4; | ||
96 | Utils.FloatToBytes(wl.fresnelOffset).CopyTo(mBlock, pos); pos += 4; | ||
97 | Utils.FloatToBytes(wl.refractScaleAbove).CopyTo(mBlock, pos); pos += 4; | ||
98 | Utils.FloatToBytes(wl.refractScaleBelow).CopyTo(mBlock, pos); pos += 4; | ||
99 | Utils.FloatToBytes(wl.blurMultiplier).CopyTo(mBlock, pos); pos += 4; | ||
100 | wl.bigWaveDirection.ToBytes(mBlock, pos); pos += 8; | ||
101 | wl.littleWaveDirection.ToBytes(mBlock, pos); pos += 8; | ||
102 | wl.normalMapTexture.ToBytes(mBlock, pos); pos += 16; | ||
103 | wl.horizon.ToBytes(mBlock, pos); pos += 16; | ||
104 | Utils.FloatToBytes(wl.hazeHorizon).CopyTo(mBlock, pos); pos += 4; | ||
105 | wl.blueDensity.ToBytes(mBlock, pos); pos += 16; | ||
106 | Utils.FloatToBytes(wl.hazeDensity).CopyTo(mBlock, pos); pos += 4; | ||
107 | Utils.FloatToBytes(wl.densityMultiplier).CopyTo(mBlock, pos); pos += 4; | ||
108 | Utils.FloatToBytes(wl.distanceMultiplier).CopyTo(mBlock, pos); pos += 4; | ||
109 | wl.sunMoonColor.ToBytes(mBlock, pos); pos += 16; | ||
110 | Utils.FloatToBytes(wl.sunMoonPosition).CopyTo(mBlock, pos); pos += 4; | ||
111 | wl.ambient.ToBytes(mBlock, pos); pos += 16; | ||
112 | Utils.FloatToBytes(wl.eastAngle).CopyTo(mBlock, pos); pos += 4; | ||
113 | Utils.FloatToBytes(wl.sunGlowFocus).CopyTo(mBlock, pos); pos += 4; | ||
114 | Utils.FloatToBytes(wl.sunGlowSize).CopyTo(mBlock, pos); pos += 4; | ||
115 | Utils.FloatToBytes(wl.sceneGamma).CopyTo(mBlock, pos); pos += 4; | ||
116 | Utils.FloatToBytes(wl.starBrightness).CopyTo(mBlock, pos); pos += 4; | ||
117 | wl.cloudColor.ToBytes(mBlock, pos); pos += 16; | ||
118 | wl.cloudXYDensity.ToBytes(mBlock, pos); pos += 12; | ||
119 | Utils.FloatToBytes(wl.cloudCoverage).CopyTo(mBlock, pos); pos += 4; | ||
120 | Utils.FloatToBytes(wl.cloudScale).CopyTo(mBlock, pos); pos += 4; | ||
121 | wl.cloudDetailXYDensity.ToBytes(mBlock, pos); pos += 12; | ||
122 | Utils.FloatToBytes(wl.cloudScrollX).CopyTo(mBlock, pos); pos += 4; | ||
123 | Utils.FloatToBytes(wl.cloudScrollY).CopyTo(mBlock, pos); pos += 4; | ||
124 | Utils.UInt16ToBytes(wl.maxAltitude).CopyTo(mBlock, pos); pos += 2; | ||
125 | mBlock[pos] = Convert.ToByte(wl.cloudScrollXLock); pos++; | ||
126 | mBlock[pos] = Convert.ToByte(wl.cloudScrollYLock); pos++; | ||
127 | mBlock[pos] = Convert.ToByte(wl.drawClassicClouds); pos++; | ||
128 | List<byte[]> param = new List<byte[]>(); | ||
129 | param.Add(mBlock); | ||
130 | |||
131 | client.SendGenericMessage("Windlight", param); | ||
132 | } | ||
133 | } | ||
134 | else | ||
135 | { | ||
136 | //We probably don't want to spam chat with this.. probably | ||
137 | //m_log.Debug("[WINDLIGHT]: Module disabled"); | ||
138 | } | ||
139 | } | ||
140 | private void EventManager_OnMakeRootAgent(ScenePresence presence) | ||
141 | { | ||
142 | m_log.Debug("[WINDLIGHT]: Sending windlight scene to new client"); | ||
143 | SendProfileToClient(presence); | ||
144 | } | ||
145 | |||
146 | private void EventManager_OnSaveNewWindlightProfile() | ||
147 | { | ||
148 | m_scene.ForEachScenePresence(SendProfileToClient); | ||
149 | } | ||
150 | |||
151 | public void PostInitialise() | ||
152 | { | ||
153 | |||
154 | } | ||
155 | |||
156 | public void Close() | ||
157 | { | ||
158 | } | ||
159 | |||
160 | public string Name | ||
161 | { | ||
162 | get { return "Meta7WindlightModule"; } | ||
163 | } | ||
164 | |||
165 | public bool IsSharedModule | ||
166 | { | ||
167 | get { return false; } | ||
168 | } | ||
169 | |||
170 | #endregion | ||
171 | |||
172 | #region events | ||
173 | |||
174 | #endregion | ||
175 | |||
176 | #region ICommandableModule Members | ||
177 | |||
178 | private void InstallCommands() | ||
179 | { | ||
180 | Command wlload = new Command("load", CommandIntentions.COMMAND_NON_HAZARDOUS, HandleLoad, "Load windlight profile from the database and broadcast"); | ||
181 | Command wlenable = new Command("enable", CommandIntentions.COMMAND_NON_HAZARDOUS, HandleEnable, "Enable the windlight plugin"); | ||
182 | Command wldisable = new Command("disable", CommandIntentions.COMMAND_NON_HAZARDOUS, HandleDisable, "Enable the windlight plugin"); | ||
183 | |||
184 | m_commander.RegisterCommand("load", wlload); | ||
185 | m_commander.RegisterCommand("enable", wlenable); | ||
186 | m_commander.RegisterCommand("disable", wldisable); | ||
187 | |||
188 | m_scene.RegisterModuleCommander(m_commander); | ||
189 | } | ||
190 | |||
191 | private void HandleLoad(Object[] args) | ||
192 | { | ||
193 | if (!m_enableWindlight) | ||
194 | { | ||
195 | m_log.InfoFormat("[WINDLIGHT]: Cannot load windlight profile, module disabled. Use 'windlight enable' first."); | ||
196 | } | ||
197 | else | ||
198 | { | ||
199 | m_log.InfoFormat("[WINDLIGHT]: Loading Windlight profile from database"); | ||
200 | m_scene.LoadWindlightProfile(); | ||
201 | m_log.InfoFormat("[WINDLIGHT]: Load complete"); | ||
202 | } | ||
203 | } | ||
204 | |||
205 | private void HandleDisable(Object[] args) | ||
206 | { | ||
207 | m_log.InfoFormat("[WINDLIGHT]: Plugin now disabled"); | ||
208 | m_enableWindlight=false; | ||
209 | } | ||
210 | |||
211 | private void HandleEnable(Object[] args) | ||
212 | { | ||
213 | m_log.InfoFormat("[WINDLIGHT]: Plugin now enabled"); | ||
214 | m_enableWindlight = true; | ||
215 | } | ||
216 | |||
217 | /// <summary> | ||
218 | /// Processes commandline input. Do not call directly. | ||
219 | /// </summary> | ||
220 | /// <param name="args">Commandline arguments</param> | ||
221 | private void EventManager_OnPluginConsole(string[] args) | ||
222 | { | ||
223 | if (args[0] == "windlight") | ||
224 | { | ||
225 | if (args.Length == 1) | ||
226 | { | ||
227 | m_commander.ProcessConsoleCommand("add", new string[0]); | ||
228 | return; | ||
229 | } | ||
230 | |||
231 | string[] tmpArgs = new string[args.Length - 2]; | ||
232 | int i; | ||
233 | for (i = 2; i < args.Length; i++) | ||
234 | { | ||
235 | tmpArgs[i - 2] = args[i]; | ||
236 | } | ||
237 | |||
238 | m_commander.ProcessConsoleCommand(args[1], tmpArgs); | ||
239 | } | ||
240 | } | ||
241 | #endregion | ||
242 | |||
243 | } | ||
244 | } | ||
245 | |||
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index 9754da3..816060f 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs | |||
@@ -433,7 +433,7 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
433 | 433 | ||
434 | } | 434 | } |
435 | 435 | ||
436 | public void SendGenericMessage(string method, List<string> message) | 436 | public void SendGenericMessage(string method, List<byte[]> message) |
437 | { | 437 | { |
438 | 438 | ||
439 | } | 439 | } |
diff --git a/OpenSim/Region/Framework/Interfaces/IRegionDataStore.cs b/OpenSim/Region/Framework/Interfaces/IRegionDataStore.cs index 78bd622..7312799 100644 --- a/OpenSim/Region/Framework/Interfaces/IRegionDataStore.cs +++ b/OpenSim/Region/Framework/Interfaces/IRegionDataStore.cs | |||
@@ -103,6 +103,8 @@ namespace OpenSim.Region.Framework.Interfaces | |||
103 | 103 | ||
104 | void StoreRegionSettings(RegionSettings rs); | 104 | void StoreRegionSettings(RegionSettings rs); |
105 | RegionSettings LoadRegionSettings(UUID regionUUID); | 105 | RegionSettings LoadRegionSettings(UUID regionUUID); |
106 | RegionMeta7WindlightData LoadRegionWindlightSettings(UUID regionUUID); | ||
107 | void StoreRegionWindlightSettings(RegionMeta7WindlightData wl); | ||
106 | 108 | ||
107 | void Shutdown(); | 109 | void Shutdown(); |
108 | } | 110 | } |
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 753344d..a86e263 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -193,7 +193,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
193 | public event OnMakeChildAgentDelegate OnMakeChildAgent; | 193 | public event OnMakeChildAgentDelegate OnMakeChildAgent; |
194 | 194 | ||
195 | public delegate void OnMakeRootAgentDelegate(ScenePresence presence); | 195 | public delegate void OnMakeRootAgentDelegate(ScenePresence presence); |
196 | public delegate void OnSaveNewWindlightProfileDelegate(); | ||
196 | public event OnMakeRootAgentDelegate OnMakeRootAgent; | 197 | public event OnMakeRootAgentDelegate OnMakeRootAgent; |
198 | public event OnSaveNewWindlightProfileDelegate OnSaveNewWindlightProfile; | ||
197 | 199 | ||
198 | public delegate void NewInventoryItemUploadComplete(UUID avatarID, UUID assetID, string name, int userlevel); | 200 | public delegate void NewInventoryItemUploadComplete(UUID avatarID, UUID assetID, string name, int userlevel); |
199 | 201 | ||
@@ -411,6 +413,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
411 | private IncomingInstantMessage handlerUnhandledInstantMessage = null; //OnUnhandledInstantMessage; | 413 | private IncomingInstantMessage handlerUnhandledInstantMessage = null; //OnUnhandledInstantMessage; |
412 | private ClientClosed handlerClientClosed = null; //OnClientClosed; | 414 | private ClientClosed handlerClientClosed = null; //OnClientClosed; |
413 | private OnMakeChildAgentDelegate handlerMakeChildAgent = null; //OnMakeChildAgent; | 415 | private OnMakeChildAgentDelegate handlerMakeChildAgent = null; //OnMakeChildAgent; |
416 | private OnSaveNewWindlightProfileDelegate handlerSaveNewWindlightProfile = null; //OnSaveNewWindlightProfile; | ||
414 | private OnMakeRootAgentDelegate handlerMakeRootAgent = null; //OnMakeRootAgent; | 417 | private OnMakeRootAgentDelegate handlerMakeRootAgent = null; //OnMakeRootAgent; |
415 | private OnTerrainTickDelegate handlerTerrainTick = null; // OnTerainTick; | 418 | private OnTerrainTickDelegate handlerTerrainTick = null; // OnTerainTick; |
416 | private RegisterCapsEvent handlerRegisterCaps = null; // OnRegisterCaps; | 419 | private RegisterCapsEvent handlerRegisterCaps = null; // OnRegisterCaps; |
@@ -772,6 +775,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
772 | } | 775 | } |
773 | } | 776 | } |
774 | 777 | ||
778 | public void TriggerOnSaveNewWindlightProfile() | ||
779 | { | ||
780 | handlerSaveNewWindlightProfile = OnSaveNewWindlightProfile; | ||
781 | if (handlerSaveNewWindlightProfile != null) | ||
782 | { | ||
783 | handlerSaveNewWindlightProfile(); | ||
784 | } | ||
785 | } | ||
786 | |||
775 | public void TriggerOnMakeRootAgent(ScenePresence presence) | 787 | public void TriggerOnMakeRootAgent(ScenePresence presence) |
776 | { | 788 | { |
777 | handlerMakeRootAgent = OnMakeRootAgent; | 789 | handlerMakeRootAgent = OnMakeRootAgent; |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index a8bab5a..1b275b0 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -539,6 +539,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
539 | 539 | ||
540 | // Load region settings | 540 | // Load region settings |
541 | m_regInfo.RegionSettings = m_storageManager.DataStore.LoadRegionSettings(m_regInfo.RegionID); | 541 | m_regInfo.RegionSettings = m_storageManager.DataStore.LoadRegionSettings(m_regInfo.RegionID); |
542 | m_regInfo.WindlightSettings = m_storageManager.DataStore.LoadRegionWindlightSettings(m_regInfo.RegionID); | ||
543 | |||
542 | if (m_storageManager.EstateDataStore != null) | 544 | if (m_storageManager.EstateDataStore != null) |
543 | { | 545 | { |
544 | m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID); | 546 | m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID); |
@@ -1502,6 +1504,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
1502 | { | 1504 | { |
1503 | m_storageManager.DataStore.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID); | 1505 | m_storageManager.DataStore.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID); |
1504 | } | 1506 | } |
1507 | |||
1508 | public void StoreWindlightProfile(RegionMeta7WindlightData wl) | ||
1509 | { | ||
1510 | m_regInfo.WindlightSettings = wl; | ||
1511 | m_storageManager.DataStore.StoreRegionWindlightSettings(wl); | ||
1512 | m_eventManager.TriggerOnSaveNewWindlightProfile(); | ||
1513 | } | ||
1514 | |||
1515 | public void LoadWindlightProfile() | ||
1516 | { | ||
1517 | m_regInfo.WindlightSettings = m_storageManager.DataStore.LoadRegionWindlightSettings(RegionInfo.RegionID); | ||
1518 | m_eventManager.TriggerOnSaveNewWindlightProfile(); | ||
1519 | } | ||
1505 | 1520 | ||
1506 | /// <summary> | 1521 | /// <summary> |
1507 | /// Loads the World heightmap | 1522 | /// Loads the World heightmap |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs index 8a27b7b..5abbb82 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs | |||
@@ -101,7 +101,16 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
101 | { | 101 | { |
102 | throw new NotImplementedException(); | 102 | throw new NotImplementedException(); |
103 | } | 103 | } |
104 | 104 | public RegionMeta7WindlightData LoadRegionWindlightSettings(UUID regionUUID) | |
105 | { | ||
106 | //This connector doesn't support the windlight module yet | ||
107 | //Return default LL windlight settings | ||
108 | return new RegionMeta7WindlightData(); | ||
109 | } | ||
110 | public void StoreRegionWindlightSettings(RegionMeta7WindlightData wl) | ||
111 | { | ||
112 | //This connector doesn't support the windlight module yet | ||
113 | } | ||
105 | public RegionSettings LoadRegionSettings(UUID regionUUID) | 114 | public RegionSettings LoadRegionSettings(UUID regionUUID) |
106 | { | 115 | { |
107 | return null; | 116 | return null; |
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index 6c3e7eb..bdf1574 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs | |||
@@ -936,7 +936,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
936 | // TODO | 936 | // TODO |
937 | } | 937 | } |
938 | 938 | ||
939 | public void SendGenericMessage(string method, List<string> message) | 939 | public void SendGenericMessage(string method, List<byte[]> message) |
940 | { | 940 | { |
941 | 941 | ||
942 | } | 942 | } |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index cf36d08..975033a 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | |||
@@ -522,7 +522,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
522 | 522 | ||
523 | } | 523 | } |
524 | 524 | ||
525 | public void SendGenericMessage(string method, List<string> message) | 525 | public void SendGenericMessage(string method, List<byte[]> message) |
526 | { | 526 | { |
527 | 527 | ||
528 | } | 528 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 7f739b1..33c67d5 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -42,6 +42,7 @@ using OpenSim.Region.CoreModules.Avatar.NPC; | |||
42 | using OpenSim.Region.Framework.Interfaces; | 42 | using OpenSim.Region.Framework.Interfaces; |
43 | using OpenSim.Region.Framework.Scenes; | 43 | using OpenSim.Region.Framework.Scenes; |
44 | using OpenSim.Region.Framework.Scenes.Hypergrid; | 44 | using OpenSim.Region.Framework.Scenes.Hypergrid; |
45 | using OpenSim.Region.CoreModules.World.Meta7Windlight; | ||
45 | using OpenSim.Region.ScriptEngine.Shared; | 46 | using OpenSim.Region.ScriptEngine.Shared; |
46 | using OpenSim.Region.ScriptEngine.Shared.Api.Plugins; | 47 | using OpenSim.Region.ScriptEngine.Shared.Api.Plugins; |
47 | using OpenSim.Region.ScriptEngine.Shared.ScriptBase; | 48 | using OpenSim.Region.ScriptEngine.Shared.ScriptBase; |
@@ -1974,5 +1975,337 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1974 | return ret; | 1975 | return ret; |
1975 | } | 1976 | } |
1976 | 1977 | ||
1978 | /// <summary> | ||
1979 | /// Get the current Windlight scene | ||
1980 | /// </summary> | ||
1981 | /// <returns>List of windlight parameters</returns> | ||
1982 | public LSL_List osGetWindlightScene(LSL_List rules) | ||
1983 | { | ||
1984 | CheckThreatLevel(ThreatLevel.Low, "osGetWindlightScene"); | ||
1985 | m_host.AddScriptLPS(1); | ||
1986 | RegionMeta7WindlightData wl = m_host.ParentGroup.Scene.RegionInfo.WindlightSettings; | ||
1987 | |||
1988 | LSL_List values = new LSL_List(); | ||
1989 | int idx = 0; | ||
1990 | while (idx < rules.Length) | ||
1991 | { | ||
1992 | uint rule = (uint)rules.GetLSLIntegerItem(idx); | ||
1993 | LSL_List toadd = new LSL_List(); | ||
1994 | |||
1995 | switch (rule) | ||
1996 | { | ||
1997 | case (int)ScriptBaseClass.WL_AMBIENT: | ||
1998 | toadd.Add(new LSL_Rotation(wl.ambient.X, wl.ambient.Y, wl.ambient.Z, wl.ambient.W)); | ||
1999 | break; | ||
2000 | case (int)ScriptBaseClass.WL_BIG_WAVE_DIRECTION: | ||
2001 | toadd.Add(new LSL_Vector(wl.bigWaveDirection.X, wl.bigWaveDirection.Y, 0.0f)); | ||
2002 | break; | ||
2003 | case (int)ScriptBaseClass.WL_BLUE_DENSITY: | ||
2004 | toadd.Add(new LSL_Rotation(wl.blueDensity.X, wl.blueDensity.Y, wl.blueDensity.Z, wl.blueDensity.W)); | ||
2005 | break; | ||
2006 | case (int)ScriptBaseClass.WL_BLUR_MULTIPLIER: | ||
2007 | toadd.Add(new LSL_Float(wl.blurMultiplier)); | ||
2008 | break; | ||
2009 | case (int)ScriptBaseClass.WL_CLOUD_COLOR: | ||
2010 | toadd.Add(new LSL_Rotation(wl.cloudColor.X, wl.cloudColor.Y, wl.cloudColor.Z, wl.cloudColor.W)); | ||
2011 | break; | ||
2012 | case (int)ScriptBaseClass.WL_CLOUD_COVERAGE: | ||
2013 | toadd.Add(new LSL_Float(wl.cloudCoverage)); | ||
2014 | break; | ||
2015 | case (int)ScriptBaseClass.WL_CLOUD_DETAIL_XY_DENSITY: | ||
2016 | toadd.Add(new LSL_Vector(wl.cloudDetailXYDensity.X, wl.cloudDetailXYDensity.Y, wl.cloudDetailXYDensity.Z)); | ||
2017 | break; | ||
2018 | case (int)ScriptBaseClass.WL_CLOUD_SCALE: | ||
2019 | toadd.Add(new LSL_Float(wl.cloudScale)); | ||
2020 | break; | ||
2021 | case (int)ScriptBaseClass.WL_CLOUD_SCROLL_X: | ||
2022 | toadd.Add(new LSL_Float(wl.cloudScrollX)); | ||
2023 | break; | ||
2024 | case (int)ScriptBaseClass.WL_CLOUD_SCROLL_X_LOCK: | ||
2025 | toadd.Add(new LSL_Integer(wl.cloudScrollXLock ? 1 : 0)); | ||
2026 | break; | ||
2027 | case (int)ScriptBaseClass.WL_CLOUD_SCROLL_Y: | ||
2028 | toadd.Add(new LSL_Float(wl.cloudScrollY)); | ||
2029 | break; | ||
2030 | case (int)ScriptBaseClass.WL_CLOUD_SCROLL_Y_LOCK: | ||
2031 | toadd.Add(new LSL_Integer(wl.cloudScrollYLock ? 1 : 0)); | ||
2032 | break; | ||
2033 | case (int)ScriptBaseClass.WL_CLOUD_XY_DENSITY: | ||
2034 | toadd.Add(new LSL_Vector(wl.cloudXYDensity.X, wl.cloudXYDensity.Y, wl.cloudXYDensity.Z)); | ||
2035 | break; | ||
2036 | case (int)ScriptBaseClass.WL_DENSITY_MULTIPLIER: | ||
2037 | toadd.Add(new LSL_Float(wl.densityMultiplier)); | ||
2038 | break; | ||
2039 | case (int)ScriptBaseClass.WL_DISTANCE_MULTIPLIER: | ||
2040 | toadd.Add(new LSL_Float(wl.distanceMultiplier)); | ||
2041 | break; | ||
2042 | case (int)ScriptBaseClass.WL_DRAW_CLASSIC_CLOUDS: | ||
2043 | toadd.Add(new LSL_Integer(wl.drawClassicClouds ? 1 : 0)); | ||
2044 | break; | ||
2045 | case (int)ScriptBaseClass.WL_EAST_ANGLE: | ||
2046 | toadd.Add(new LSL_Float(wl.eastAngle)); | ||
2047 | break; | ||
2048 | case (int)ScriptBaseClass.WL_FRESNEL_OFFSET: | ||
2049 | toadd.Add(new LSL_Float(wl.fresnelOffset)); | ||
2050 | break; | ||
2051 | case (int)ScriptBaseClass.WL_FRESNEL_SCALE: | ||
2052 | toadd.Add(new LSL_Float(wl.fresnelScale)); | ||
2053 | break; | ||
2054 | case (int)ScriptBaseClass.WL_HAZE_DENSITY: | ||
2055 | toadd.Add(new LSL_Float(wl.hazeDensity)); | ||
2056 | break; | ||
2057 | case (int)ScriptBaseClass.WL_HAZE_HORIZON: | ||
2058 | toadd.Add(new LSL_Float(wl.hazeHorizon)); | ||
2059 | break; | ||
2060 | case (int)ScriptBaseClass.WL_HORIZON: | ||
2061 | toadd.Add(new LSL_Rotation(wl.horizon.X, wl.horizon.Y, wl.horizon.Z, wl.horizon.W)); | ||
2062 | break; | ||
2063 | case (int)ScriptBaseClass.WL_LITTLE_WAVE_DIRECTION: | ||
2064 | toadd.Add(new LSL_Vector(wl.littleWaveDirection.X, wl.littleWaveDirection.Y, 0.0f)); | ||
2065 | break; | ||
2066 | case (int)ScriptBaseClass.WL_MAX_ALTITUDE: | ||
2067 | toadd.Add(new LSL_Integer(wl.maxAltitude)); | ||
2068 | break; | ||
2069 | case (int)ScriptBaseClass.WL_NORMAL_MAP_TEXTURE: | ||
2070 | toadd.Add(new LSL_Key(wl.normalMapTexture.ToString())); | ||
2071 | break; | ||
2072 | case (int)ScriptBaseClass.WL_REFLECTION_WAVELET_SCALE: | ||
2073 | toadd.Add(new LSL_Vector(wl.reflectionWaveletScale.X, wl.reflectionWaveletScale.Y, wl.reflectionWaveletScale.Z)); | ||
2074 | break; | ||
2075 | case (int)ScriptBaseClass.WL_REFRACT_SCALE_ABOVE: | ||
2076 | toadd.Add(new LSL_Float(wl.refractScaleAbove)); | ||
2077 | break; | ||
2078 | case (int)ScriptBaseClass.WL_REFRACT_SCALE_BELOW: | ||
2079 | toadd.Add(new LSL_Float(wl.refractScaleBelow)); | ||
2080 | break; | ||
2081 | case (int)ScriptBaseClass.WL_SCENE_GAMMA: | ||
2082 | toadd.Add(new LSL_Float(wl.sceneGamma)); | ||
2083 | break; | ||
2084 | case (int)ScriptBaseClass.WL_STAR_BRIGHTNESS: | ||
2085 | toadd.Add(new LSL_Float(wl.starBrightness)); | ||
2086 | break; | ||
2087 | case (int)ScriptBaseClass.WL_SUN_GLOW_FOCUS: | ||
2088 | toadd.Add(new LSL_Float(wl.sunGlowFocus)); | ||
2089 | break; | ||
2090 | case (int)ScriptBaseClass.WL_SUN_GLOW_SIZE: | ||
2091 | toadd.Add(new LSL_Float(wl.sunGlowSize)); | ||
2092 | break; | ||
2093 | case (int)ScriptBaseClass.WL_SUN_MOON_COLOR: | ||
2094 | toadd.Add(new LSL_Rotation(wl.sunMoonColor.X, wl.sunMoonColor.Y, wl.sunMoonColor.Z, wl.sunMoonColor.W)); | ||
2095 | break; | ||
2096 | case (int)ScriptBaseClass.WL_UNDERWATER_FOG_MODIFIER: | ||
2097 | toadd.Add(new LSL_Float(wl.underwaterFogModifier)); | ||
2098 | break; | ||
2099 | case (int)ScriptBaseClass.WL_WATER_COLOR: | ||
2100 | toadd.Add(new LSL_Vector(wl.waterColor.X, wl.waterColor.Y, wl.waterColor.Z)); | ||
2101 | break; | ||
2102 | case (int)ScriptBaseClass.WL_WATER_FOG_DENSITY_EXPONENT: | ||
2103 | toadd.Add(new LSL_Float(wl.waterFogDensityExponent)); | ||
2104 | break; | ||
2105 | } | ||
2106 | |||
2107 | if (toadd.Length > 0) | ||
2108 | { | ||
2109 | values.Add(rule); | ||
2110 | values.Add(toadd.Data[0]); | ||
2111 | } | ||
2112 | idx++; | ||
2113 | } | ||
2114 | |||
2115 | |||
2116 | return values; | ||
2117 | |||
2118 | } | ||
2119 | |||
2120 | /// <summary> | ||
2121 | /// Set the current Windlight scene | ||
2122 | /// </summary> | ||
2123 | /// <param name="rules"></param> | ||
2124 | /// <returns>success: true or false</returns> | ||
2125 | public int osSetWindlightScene(LSL_List rules) | ||
2126 | { | ||
2127 | CheckThreatLevel(ThreatLevel.High, "osSetWindlightScene"); | ||
2128 | int success = 0; | ||
2129 | m_host.AddScriptLPS(1); | ||
2130 | if (Meta7WindlightModule.EnableWindlight) | ||
2131 | { | ||
2132 | RegionMeta7WindlightData wl = m_host.ParentGroup.Scene.RegionInfo.WindlightSettings; | ||
2133 | |||
2134 | LSL_List values = new LSL_List(); | ||
2135 | int idx = 0; | ||
2136 | success = 1; | ||
2137 | while (idx < rules.Length) | ||
2138 | { | ||
2139 | uint rule = (uint)rules.GetLSLIntegerItem(idx); | ||
2140 | LSL_Types.Quaternion iQ; | ||
2141 | LSL_Types.Vector3 iV; | ||
2142 | switch (rule) | ||
2143 | { | ||
2144 | case (int)ScriptBaseClass.WL_AMBIENT: | ||
2145 | idx++; | ||
2146 | iQ = rules.GetQuaternionItem(idx); | ||
2147 | wl.ambient = new Vector4((float)iQ.x, (float)iQ.y, (float)iQ.z, (float)iQ.s); | ||
2148 | break; | ||
2149 | case (int)ScriptBaseClass.WL_BIG_WAVE_DIRECTION: | ||
2150 | idx++; | ||
2151 | iV = rules.GetVector3Item(idx); | ||
2152 | wl.bigWaveDirection = new Vector2((float)iV.x, (float)iV.y); | ||
2153 | break; | ||
2154 | case (int)ScriptBaseClass.WL_BLUE_DENSITY: | ||
2155 | idx++; | ||
2156 | iQ = rules.GetQuaternionItem(idx); | ||
2157 | wl.blueDensity = new Vector4((float)iQ.x, (float)iQ.y, (float)iQ.z, (float)iQ.s); | ||
2158 | break; | ||
2159 | case (int)ScriptBaseClass.WL_BLUR_MULTIPLIER: | ||
2160 | idx++; | ||
2161 | wl.blurMultiplier = (float)rules.GetLSLFloatItem(idx); | ||
2162 | break; | ||
2163 | case (int)ScriptBaseClass.WL_CLOUD_COLOR: | ||
2164 | idx++; | ||
2165 | iQ = rules.GetQuaternionItem(idx); | ||
2166 | wl.cloudColor = new Vector4((float)iQ.x, (float)iQ.y, (float)iQ.z, (float)iQ.s); | ||
2167 | break; | ||
2168 | case (int)ScriptBaseClass.WL_CLOUD_COVERAGE: | ||
2169 | idx++; | ||
2170 | wl.cloudCoverage = (float)rules.GetLSLFloatItem(idx); | ||
2171 | break; | ||
2172 | case (int)ScriptBaseClass.WL_CLOUD_DETAIL_XY_DENSITY: | ||
2173 | idx++; | ||
2174 | iV = rules.GetVector3Item(idx); | ||
2175 | wl.cloudDetailXYDensity = new Vector3((float)iV.x, (float)iV.y, (float)iV.z); | ||
2176 | break; | ||
2177 | case (int)ScriptBaseClass.WL_CLOUD_SCALE: | ||
2178 | idx++; | ||
2179 | wl.cloudScale = (float)rules.GetLSLFloatItem(idx); | ||
2180 | break; | ||
2181 | case (int)ScriptBaseClass.WL_CLOUD_SCROLL_X: | ||
2182 | idx++; | ||
2183 | wl.cloudScrollX = (float)rules.GetLSLFloatItem(idx); | ||
2184 | break; | ||
2185 | case (int)ScriptBaseClass.WL_CLOUD_SCROLL_X_LOCK: | ||
2186 | idx++; | ||
2187 | wl.cloudScrollXLock = rules.GetLSLIntegerItem(idx).value == 1 ? true : false; | ||
2188 | break; | ||
2189 | case (int)ScriptBaseClass.WL_CLOUD_SCROLL_Y: | ||
2190 | idx++; | ||
2191 | wl.cloudScrollY = (float)rules.GetLSLFloatItem(idx); | ||
2192 | break; | ||
2193 | case (int)ScriptBaseClass.WL_CLOUD_SCROLL_Y_LOCK: | ||
2194 | idx++; | ||
2195 | wl.cloudScrollYLock = rules.GetLSLIntegerItem(idx).value == 1 ? true : false; | ||
2196 | break; | ||
2197 | case (int)ScriptBaseClass.WL_CLOUD_XY_DENSITY: | ||
2198 | idx++; | ||
2199 | iV = rules.GetVector3Item(idx); | ||
2200 | wl.cloudDetailXYDensity = new Vector3((float)iV.x, (float)iV.y, (float)iV.z); | ||
2201 | break; | ||
2202 | case (int)ScriptBaseClass.WL_DENSITY_MULTIPLIER: | ||
2203 | idx++; | ||
2204 | wl.densityMultiplier = (float)rules.GetLSLFloatItem(idx); | ||
2205 | break; | ||
2206 | case (int)ScriptBaseClass.WL_DISTANCE_MULTIPLIER: | ||
2207 | idx++; | ||
2208 | wl.distanceMultiplier = (float)rules.GetLSLFloatItem(idx); | ||
2209 | break; | ||
2210 | case (int)ScriptBaseClass.WL_DRAW_CLASSIC_CLOUDS: | ||
2211 | idx++; | ||
2212 | wl.drawClassicClouds = rules.GetLSLIntegerItem(idx).value == 1 ? true : false; | ||
2213 | break; | ||
2214 | case (int)ScriptBaseClass.WL_EAST_ANGLE: | ||
2215 | idx++; | ||
2216 | wl.eastAngle = (float)rules.GetLSLFloatItem(idx); | ||
2217 | break; | ||
2218 | case (int)ScriptBaseClass.WL_FRESNEL_OFFSET: | ||
2219 | idx++; | ||
2220 | wl.fresnelOffset = (float)rules.GetLSLFloatItem(idx); | ||
2221 | break; | ||
2222 | case (int)ScriptBaseClass.WL_FRESNEL_SCALE: | ||
2223 | idx++; | ||
2224 | wl.fresnelScale = (float)rules.GetLSLFloatItem(idx); | ||
2225 | break; | ||
2226 | case (int)ScriptBaseClass.WL_HAZE_DENSITY: | ||
2227 | idx++; | ||
2228 | wl.hazeDensity = (float)rules.GetLSLFloatItem(idx); | ||
2229 | break; | ||
2230 | case (int)ScriptBaseClass.WL_HAZE_HORIZON: | ||
2231 | idx++; | ||
2232 | wl.hazeHorizon= (float)rules.GetLSLFloatItem(idx); | ||
2233 | break; | ||
2234 | case (int)ScriptBaseClass.WL_HORIZON: | ||
2235 | idx++; | ||
2236 | iQ = rules.GetQuaternionItem(idx); | ||
2237 | wl.horizon = new Vector4((float)iQ.x, (float)iQ.y, (float)iQ.z, (float)iQ.s); | ||
2238 | break; | ||
2239 | case (int)ScriptBaseClass.WL_LITTLE_WAVE_DIRECTION: | ||
2240 | idx++; | ||
2241 | iV = rules.GetVector3Item(idx); | ||
2242 | wl.littleWaveDirection = new Vector2((float)iV.x, (float)iV.y); | ||
2243 | break; | ||
2244 | case (int)ScriptBaseClass.WL_MAX_ALTITUDE: | ||
2245 | idx++; | ||
2246 | wl.maxAltitude = (ushort)rules.GetLSLIntegerItem(idx).value; | ||
2247 | break; | ||
2248 | case (int)ScriptBaseClass.WL_NORMAL_MAP_TEXTURE: | ||
2249 | idx++; | ||
2250 | wl.normalMapTexture = new UUID(rules.GetLSLStringItem(idx).m_string); | ||
2251 | break; | ||
2252 | case (int)ScriptBaseClass.WL_REFLECTION_WAVELET_SCALE: | ||
2253 | idx++; | ||
2254 | iV = rules.GetVector3Item(idx); | ||
2255 | wl.reflectionWaveletScale= new Vector3((float)iV.x, (float)iV.y, (float)iV.z); | ||
2256 | break; | ||
2257 | case (int)ScriptBaseClass.WL_REFRACT_SCALE_ABOVE: | ||
2258 | idx++; | ||
2259 | wl.refractScaleAbove = (float)rules.GetLSLFloatItem(idx); | ||
2260 | break; | ||
2261 | case (int)ScriptBaseClass.WL_REFRACT_SCALE_BELOW: | ||
2262 | idx++; | ||
2263 | wl.refractScaleBelow = (float)rules.GetLSLFloatItem(idx); | ||
2264 | break; | ||
2265 | case (int)ScriptBaseClass.WL_SCENE_GAMMA: | ||
2266 | idx++; | ||
2267 | wl.sceneGamma = (float)rules.GetLSLFloatItem(idx); | ||
2268 | break; | ||
2269 | case (int)ScriptBaseClass.WL_STAR_BRIGHTNESS: | ||
2270 | idx++; | ||
2271 | wl.starBrightness= (float)rules.GetLSLFloatItem(idx); | ||
2272 | break; | ||
2273 | case (int)ScriptBaseClass.WL_SUN_GLOW_FOCUS: | ||
2274 | idx++; | ||
2275 | wl.sunGlowFocus= (float)rules.GetLSLFloatItem(idx); | ||
2276 | break; | ||
2277 | case (int)ScriptBaseClass.WL_SUN_GLOW_SIZE: | ||
2278 | idx++; | ||
2279 | wl.sunGlowSize= (float)rules.GetLSLFloatItem(idx); | ||
2280 | break; | ||
2281 | case (int)ScriptBaseClass.WL_SUN_MOON_COLOR: | ||
2282 | idx++; | ||
2283 | iQ = rules.GetQuaternionItem(idx); | ||
2284 | wl.sunMoonColor = new Vector4((float)iQ.x, (float)iQ.y, (float)iQ.z, (float)iQ.s); | ||
2285 | break; | ||
2286 | case (int)ScriptBaseClass.WL_UNDERWATER_FOG_MODIFIER: | ||
2287 | idx++; | ||
2288 | wl.underwaterFogModifier = (float)rules.GetLSLFloatItem(idx); | ||
2289 | break; | ||
2290 | case (int)ScriptBaseClass.WL_WATER_COLOR: | ||
2291 | idx++; | ||
2292 | iV = rules.GetVector3Item(idx); | ||
2293 | wl.waterColor = new Vector3((float)iV.x, (float)iV.y, (float)iV.z); | ||
2294 | break; | ||
2295 | case (int)ScriptBaseClass.WL_WATER_FOG_DENSITY_EXPONENT: | ||
2296 | idx++; | ||
2297 | wl.waterFogDensityExponent = (float)rules.GetLSLFloatItem(idx); | ||
2298 | break; | ||
2299 | default: | ||
2300 | success = 0; | ||
2301 | break; | ||
2302 | } | ||
2303 | idx++; | ||
2304 | } | ||
2305 | m_host.ParentGroup.Scene.StoreWindlightProfile(wl); | ||
2306 | |||
2307 | } | ||
2308 | return success; | ||
2309 | } | ||
1977 | } | 2310 | } |
1978 | } | 2311 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 0b0dc00..dd2869b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | |||
@@ -80,7 +80,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
80 | // Avatar Info Commands | 80 | // Avatar Info Commands |
81 | string osGetAgentIP(string agent); | 81 | string osGetAgentIP(string agent); |
82 | LSL_List osGetAgents(); | 82 | LSL_List osGetAgents(); |
83 | 83 | ||
84 | // Teleport commands | 84 | // Teleport commands |
85 | void osTeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat); | 85 | void osTeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat); |
86 | void osTeleportAgent(string agent, int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat); | 86 | void osTeleportAgent(string agent, int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat); |
@@ -163,5 +163,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
163 | key osGetMapTexture(); | 163 | key osGetMapTexture(); |
164 | key osGetRegionMapTexture(string regionName); | 164 | key osGetRegionMapTexture(string regionName); |
165 | LSL_List osGetRegionStats(); | 165 | LSL_List osGetRegionStats(); |
166 | |||
167 | // Windlight Functions | ||
168 | LSL_List osGetWindlightScene(LSL_List rules); | ||
169 | int osSetWindlightScene(LSL_List rules); | ||
170 | |||
166 | } | 171 | } |
167 | } | 172 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs index acff8fb..4956c28 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs | |||
@@ -539,5 +539,43 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
539 | public const int STATS_ACTIVE_SCRIPTS = 19; | 539 | public const int STATS_ACTIVE_SCRIPTS = 19; |
540 | public const int STATS_SCRIPT_LPS = 20; | 540 | public const int STATS_SCRIPT_LPS = 20; |
541 | 541 | ||
542 | // Constants for osWindlight* | ||
543 | public const int WL_WATER_COLOR = 0; | ||
544 | public const int WL_WATER_FOG_DENSITY_EXPONENT = 1; | ||
545 | public const int WL_UNDERWATER_FOG_MODIFIER = 2; | ||
546 | public const int WL_REFLECTION_WAVELET_SCALE = 3; | ||
547 | public const int WL_FRESNEL_SCALE = 4; | ||
548 | public const int WL_FRESNEL_OFFSET = 5; | ||
549 | public const int WL_REFRACT_SCALE_ABOVE = 6; | ||
550 | public const int WL_REFRACT_SCALE_BELOW = 7; | ||
551 | public const int WL_BLUR_MULTIPLIER = 8; | ||
552 | public const int WL_BIG_WAVE_DIRECTION = 9; | ||
553 | public const int WL_LITTLE_WAVE_DIRECTION = 10; | ||
554 | public const int WL_NORMAL_MAP_TEXTURE = 11; | ||
555 | public const int WL_HORIZON = 12; | ||
556 | public const int WL_HAZE_HORIZON = 13; | ||
557 | public const int WL_BLUE_DENSITY = 14; | ||
558 | public const int WL_HAZE_DENSITY = 15; | ||
559 | public const int WL_DENSITY_MULTIPLIER = 16; | ||
560 | public const int WL_DISTANCE_MULTIPLIER = 17; | ||
561 | public const int WL_MAX_ALTITUDE = 18; | ||
562 | public const int WL_SUN_MOON_COLOR = 19; | ||
563 | public const int WL_AMBIENT = 20; | ||
564 | public const int WL_EAST_ANGLE = 21; | ||
565 | public const int WL_SUN_GLOW_FOCUS = 22; | ||
566 | public const int WL_SUN_GLOW_SIZE = 23; | ||
567 | public const int WL_SCENE_GAMMA = 24; | ||
568 | public const int WL_STAR_BRIGHTNESS = 25; | ||
569 | public const int WL_CLOUD_COLOR = 26; | ||
570 | public const int WL_CLOUD_XY_DENSITY = 27; | ||
571 | public const int WL_CLOUD_COVERAGE = 28; | ||
572 | public const int WL_CLOUD_SCALE = 29; | ||
573 | public const int WL_CLOUD_DETAIL_XY_DENSITY = 30; | ||
574 | public const int WL_CLOUD_SCROLL_X = 31; | ||
575 | public const int WL_CLOUD_SCROLL_Y = 32; | ||
576 | public const int WL_CLOUD_SCROLL_Y_LOCK = 33; | ||
577 | public const int WL_CLOUD_SCROLL_X_LOCK = 34; | ||
578 | public const int WL_DRAW_CLASSIC_CLOUDS = 35; | ||
579 | |||
542 | } | 580 | } |
543 | } | 581 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 519463e..1480b8b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | |||
@@ -637,5 +637,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
637 | { | 637 | { |
638 | return m_OSSL_Functions.osGetRegionStats(); | 638 | return m_OSSL_Functions.osGetRegionStats(); |
639 | } | 639 | } |
640 | |||
641 | public LSL_List osGetWindlightScene(LSL_List rules) | ||
642 | { | ||
643 | return m_OSSL_Functions.osGetWindlightScene(rules); | ||
644 | } | ||
645 | |||
646 | public int osSetWindlightScene(LSL_List rules) | ||
647 | { | ||
648 | return m_OSSL_Functions.osSetWindlightScene(rules); | ||
649 | } | ||
640 | } | 650 | } |
641 | } | 651 | } |
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 27025d9..5f172c4 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs | |||
@@ -491,7 +491,7 @@ namespace OpenSim.Tests.Common.Mock | |||
491 | 491 | ||
492 | } | 492 | } |
493 | 493 | ||
494 | public void SendGenericMessage(string method, List<string> message) | 494 | public void SendGenericMessage(string method, List<byte[]> message) |
495 | { | 495 | { |
496 | 496 | ||
497 | } | 497 | } |
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index 62aceb1..b7f7c3c 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example | |||
@@ -825,6 +825,12 @@ | |||
825 | ; default is 1000 | 825 | ; default is 1000 |
826 | cloud_update_rate = 1000 | 826 | cloud_update_rate = 1000 |
827 | 827 | ||
828 | [Meta7Windlight] | ||
829 | |||
830 | ; This enables the transmission of Windlight scenes to supporting clients, such as the Meta7 viewer. | ||
831 | ; It has no ill effect on viewers which do not support server-side windlight settings. | ||
832 | ; Currently we only have support for MySQL databases. | ||
833 | enable_windlight = false; | ||
828 | 834 | ||
829 | [Trees] | 835 | [Trees] |
830 | ; Enable this to allow the tree module to manage your sim trees, including growing, reproducing and dying | 836 | ; Enable this to allow the tree module to manage your sim trees, including growing, reproducing and dying |