diff options
author | PixelTomsen | 2012-05-23 21:06:25 +0200 |
---|---|---|
committer | BlueWall | 2012-05-23 17:04:19 -0400 |
commit | bc543c1797c629a8584dd2e74d3c5f7a67de96c9 (patch) | |
tree | b7521f1875c349929dbfc79ef6562cf7082fd72e /OpenSim/Data/MySQL | |
parent | Format cleanup (diff) | |
download | opensim-SC-bc543c1797c629a8584dd2e74d3c5f7a67de96c9.zip opensim-SC-bc543c1797c629a8584dd2e74d3c5f7a67de96c9.tar.gz opensim-SC-bc543c1797c629a8584dd2e74d3c5f7a67de96c9.tar.bz2 opensim-SC-bc543c1797c629a8584dd2e74d3c5f7a67de96c9.tar.xz |
Environment Module - allows Environment settings for Viewer3 warning: includes database region store migrations for mssql, mysql, sqlite
enable/disable this module:
Cap_EnvironmentSettings = "localhost" (for enable)
Cap_EnvironmentSettings = "" (for disable) at ClientStack.LindenCaps section (OpenSimDefaults.ini file)
or owerwrite in OpenSim.ini
mantis: http://opensimulator.org/mantis/view.php?id=5860
Signed-off-by: BlueWall <jamesh@bluewallgroup.com>
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLSimulationData.cs | 62 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/Resources/RegionStore.migrations | 11 |
2 files changed, 73 insertions, 0 deletions
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index b2a1481..1a2e113 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs | |||
@@ -969,6 +969,68 @@ namespace OpenSim.Data.MySQL | |||
969 | } | 969 | } |
970 | } | 970 | } |
971 | 971 | ||
972 | #region RegionEnvironmentSettings | ||
973 | public string LoadRegionEnvironmentSettings(UUID regionUUID) | ||
974 | { | ||
975 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | ||
976 | { | ||
977 | dbcon.Open(); | ||
978 | |||
979 | string command = "select * from `regionenvironment` where region_id = ?region_id"; | ||
980 | |||
981 | using (MySqlCommand cmd = new MySqlCommand(command)) | ||
982 | { | ||
983 | cmd.Connection = dbcon; | ||
984 | |||
985 | cmd.Parameters.AddWithValue("?region_id", regionUUID.ToString()); | ||
986 | |||
987 | IDataReader result = ExecuteReader(cmd); | ||
988 | if (!result.Read()) | ||
989 | { | ||
990 | return String.Empty; | ||
991 | } | ||
992 | else | ||
993 | { | ||
994 | return Convert.ToString(result["llsd_settings"]); | ||
995 | } | ||
996 | } | ||
997 | } | ||
998 | } | ||
999 | |||
1000 | public void StoreRegionEnvironmentSettings(UUID regionUUID, string settings) | ||
1001 | { | ||
1002 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | ||
1003 | { | ||
1004 | dbcon.Open(); | ||
1005 | |||
1006 | using (MySqlCommand cmd = dbcon.CreateCommand()) | ||
1007 | { | ||
1008 | cmd.CommandText = "REPLACE INTO `regionenvironment` (`region_id`, `llsd_settings`) VALUES (?region_id, ?llsd_settings)"; | ||
1009 | |||
1010 | cmd.Parameters.AddWithValue("region_id", regionUUID); | ||
1011 | cmd.Parameters.AddWithValue("llsd_settings", settings); | ||
1012 | |||
1013 | ExecuteNonQuery(cmd); | ||
1014 | } | ||
1015 | } | ||
1016 | } | ||
1017 | |||
1018 | public void RemoveRegionEnvironmentSettings(UUID regionUUID) | ||
1019 | { | ||
1020 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | ||
1021 | { | ||
1022 | dbcon.Open(); | ||
1023 | |||
1024 | using (MySqlCommand cmd = dbcon.CreateCommand()) | ||
1025 | { | ||
1026 | cmd.CommandText = "delete from `regionenvironment` where region_id = ?region_id"; | ||
1027 | cmd.Parameters.AddWithValue("?region_id", regionUUID.ToString()); | ||
1028 | ExecuteNonQuery(cmd); | ||
1029 | } | ||
1030 | } | ||
1031 | } | ||
1032 | #endregion | ||
1033 | |||
972 | public void StoreRegionSettings(RegionSettings rs) | 1034 | public void StoreRegionSettings(RegionSettings rs) |
973 | { | 1035 | { |
974 | lock (m_dbLock) | 1036 | lock (m_dbLock) |
diff --git a/OpenSim/Data/MySQL/Resources/RegionStore.migrations b/OpenSim/Data/MySQL/Resources/RegionStore.migrations index 099beaf..4a925fb 100644 --- a/OpenSim/Data/MySQL/Resources/RegionStore.migrations +++ b/OpenSim/Data/MySQL/Resources/RegionStore.migrations | |||
@@ -883,4 +883,15 @@ ALTER TABLE `regionsettings` MODIFY COLUMN `TelehubObject` VARCHAR(36) NOT NULL | |||
883 | 883 | ||
884 | COMMIT; | 884 | COMMIT; |
885 | 885 | ||
886 | :VERSION 44 #--------------------- Environment Settings | ||
887 | |||
888 | BEGIN; | ||
889 | |||
890 | CREATE TABLE `regionenvironment` ( | ||
891 | `region_id` varchar(36) NOT NULL, | ||
892 | `llsd_settings` TEXT NOT NULL, | ||
893 | PRIMARY KEY (`region_id`) | ||
894 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
895 | |||
896 | COMMIT; | ||
886 | 897 | ||