aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MSSQL/MSSQLSimulationData.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/MSSQL/MSSQLSimulationData.cs66
1 files changed, 66 insertions, 0 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs
index df496a7..47fb6d7 100644
--- a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs
@@ -1181,6 +1181,72 @@ VALUES
1181 // } 1181 // }
1182 #endregion 1182 #endregion
1183 } 1183 }
1184
1185 #region Environment Settings
1186 public string LoadRegionEnvironmentSettings(UUID regionUUID)
1187 {
1188 string sql = "select * from [regionenvironment] where region_id = @region_id";
1189 using (SqlConnection conn = new SqlConnection(m_connectionString))
1190 using (SqlCommand cmd = new SqlCommand(sql, conn))
1191 {
1192 cmd.Parameters.Add(_Database.CreateParameter("@region_id", regionUUID));
1193 conn.Open();
1194 using (SqlDataReader result = cmd.ExecuteReader())
1195 {
1196 if (!result.Read())
1197 {
1198 return String.Empty;
1199 }
1200 else
1201 {
1202 return Convert.ToString(result["llsd_settings"]);
1203 }
1204 }
1205 }
1206 }
1207
1208 public void StoreRegionEnvironmentSettings(UUID regionUUID, string settings)
1209 {
1210 {
1211 string sql = "DELETE FROM [regionenvironment] WHERE region_id = @region_id";
1212 using (SqlConnection conn = new SqlConnection(m_connectionString))
1213
1214 using (SqlCommand cmd = new SqlCommand(sql, conn))
1215 {
1216 cmd.Parameters.Add(_Database.CreateParameter("@region_id", regionUUID));
1217 conn.Open();
1218 cmd.ExecuteNonQuery();
1219 }
1220
1221 sql = "INSERT INTO [regionenvironment] (region_id, llsd_settings) VALUES (@region_id, @llsd_settings)";
1222
1223 using (SqlConnection conn = new SqlConnection(m_connectionString))
1224
1225 using (SqlCommand cmd = new SqlCommand(sql, conn))
1226 {
1227 cmd.Parameters.Add(_Database.CreateParameter("@region_id", regionUUID));
1228 cmd.Parameters.Add(_Database.CreateParameter("@llsd_settings", settings));
1229
1230 conn.Open();
1231 cmd.ExecuteNonQuery();
1232 }
1233 }
1234 }
1235
1236 public void RemoveRegionEnvironmentSettings(UUID regionUUID)
1237 {
1238 string sql = "delete from [regionenvironment] where region_id = @region_id";
1239 using (SqlConnection conn = new SqlConnection(m_connectionString))
1240 using (SqlCommand cmd = new SqlCommand(sql, conn))
1241 {
1242 cmd.Parameters.Add(_Database.CreateParameter("@region_id", regionUUID));
1243
1244 conn.Open();
1245 cmd.ExecuteNonQuery();
1246 }
1247 }
1248 #endregion
1249
1184 /// <summary> 1250 /// <summary>
1185 /// Loads the settings of a region. 1251 /// Loads the settings of a region.
1186 /// </summary> 1252 /// </summary>