aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL/MySQLSimulationData.cs
diff options
context:
space:
mode:
authorPixelTomsen2012-05-23 21:06:25 +0200
committerBlueWall2012-05-23 17:04:19 -0400
commitbc543c1797c629a8584dd2e74d3c5f7a67de96c9 (patch)
treeb7521f1875c349929dbfc79ef6562cf7082fd72e /OpenSim/Data/MySQL/MySQLSimulationData.cs
parentFormat cleanup (diff)
downloadopensim-SC_OLD-bc543c1797c629a8584dd2e74d3c5f7a67de96c9.zip
opensim-SC_OLD-bc543c1797c629a8584dd2e74d3c5f7a67de96c9.tar.gz
opensim-SC_OLD-bc543c1797c629a8584dd2e74d3c5f7a67de96c9.tar.bz2
opensim-SC_OLD-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.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)