aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/MySQL')
-rw-r--r--OpenSim/Data/MySQL/MySQLSimulationData.cs62
-rw-r--r--OpenSim/Data/MySQL/Resources/RegionStore.migrations12
2 files changed, 74 insertions, 0 deletions
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs
index 9467124..faf749f 100644
--- a/OpenSim/Data/MySQL/MySQLSimulationData.cs
+++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs
@@ -994,6 +994,68 @@ namespace OpenSim.Data.MySQL
994 } 994 }
995 } 995 }
996 996
997 #region RegionEnvironmentSettings
998 public string LoadRegionEnvironmentSettings(UUID regionUUID)
999 {
1000 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
1001 {
1002 dbcon.Open();
1003
1004 string command = "select * from `regionenvironment` where region_id = ?region_id";
1005
1006 using (MySqlCommand cmd = new MySqlCommand(command))
1007 {
1008 cmd.Connection = dbcon;
1009
1010 cmd.Parameters.AddWithValue("?region_id", regionUUID.ToString());
1011
1012 IDataReader result = ExecuteReader(cmd);
1013 if (!result.Read())
1014 {
1015 return String.Empty;
1016 }
1017 else
1018 {
1019 return Convert.ToString(result["llsd_settings"]);
1020 }
1021 }
1022 }
1023 }
1024
1025 public void StoreRegionEnvironmentSettings(UUID regionUUID, string settings)
1026 {
1027 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
1028 {
1029 dbcon.Open();
1030
1031 using (MySqlCommand cmd = dbcon.CreateCommand())
1032 {
1033 cmd.CommandText = "REPLACE INTO `regionenvironment` (`region_id`, `llsd_settings`) VALUES (?region_id, ?llsd_settings)";
1034
1035 cmd.Parameters.AddWithValue("region_id", regionUUID);
1036 cmd.Parameters.AddWithValue("llsd_settings", settings);
1037
1038 ExecuteNonQuery(cmd);
1039 }
1040 }
1041 }
1042
1043 public void RemoveRegionEnvironmentSettings(UUID regionUUID)
1044 {
1045 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
1046 {
1047 dbcon.Open();
1048
1049 using (MySqlCommand cmd = dbcon.CreateCommand())
1050 {
1051 cmd.CommandText = "delete from `regionenvironment` where region_id = ?region_id";
1052 cmd.Parameters.AddWithValue("?region_id", regionUUID.ToString());
1053 ExecuteNonQuery(cmd);
1054 }
1055 }
1056 }
1057 #endregion
1058
997 public virtual void StoreRegionSettings(RegionSettings rs) 1059 public virtual void StoreRegionSettings(RegionSettings rs)
998 { 1060 {
999 lock (m_dbLock) 1061 lock (m_dbLock)
diff --git a/OpenSim/Data/MySQL/Resources/RegionStore.migrations b/OpenSim/Data/MySQL/Resources/RegionStore.migrations
index ef99ef8..db0d0ec 100644
--- a/OpenSim/Data/MySQL/Resources/RegionStore.migrations
+++ b/OpenSim/Data/MySQL/Resources/RegionStore.migrations
@@ -883,3 +883,15 @@ ALTER TABLE `regionsettings` MODIFY COLUMN `TelehubObject` VARCHAR(36) NOT NULL
883 883
884COMMIT; 884COMMIT;
885 885
886:VERSION 44 #--------------------- Environment Settings
887
888BEGIN;
889
890CREATE 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
896COMMIT;
897