aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL/MySQLSimulationData.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/MySQL/MySQLSimulationData.cs62
1 files changed, 62 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)