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/MSSQL | |
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 'OpenSim/Data/MSSQL')
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLSimulationData.cs | 66 | ||||
-rw-r--r-- | OpenSim/Data/MSSQL/Resources/RegionStore.migrations | 14 |
2 files changed, 80 insertions, 0 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs index d9dfe86..3f29f5b 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> |
diff --git a/OpenSim/Data/MSSQL/Resources/RegionStore.migrations b/OpenSim/Data/MSSQL/Resources/RegionStore.migrations index d6a3be9..350e548 100644 --- a/OpenSim/Data/MSSQL/Resources/RegionStore.migrations +++ b/OpenSim/Data/MSSQL/Resources/RegionStore.migrations | |||
@@ -1134,3 +1134,17 @@ ALTER TABLE landaccesslist ADD Expires integer NOT NULL DEFAULT 0; | |||
1134 | 1134 | ||
1135 | COMMIT | 1135 | COMMIT |
1136 | 1136 | ||
1137 | :VERSION 37 #---------------- Environment Settings | ||
1138 | |||
1139 | BEGIN TRANSACTION | ||
1140 | |||
1141 | CREATE TABLE [dbo].[regionenvironment]( | ||
1142 | [region_id] [uniqueidentifier] NOT NULL, | ||
1143 | [llsd_settings] [varchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, | ||
1144 | PRIMARY KEY CLUSTERED | ||
1145 | ( | ||
1146 | [region_id] ASC | ||
1147 | )WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY] | ||
1148 | ) ON [PRIMARY] | ||
1149 | |||
1150 | COMMIT | ||