aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/MSSQL/MSSQLSimulationData.cs3
-rw-r--r--OpenSim/Data/MySQL/MySQLSimulationData.cs16
-rw-r--r--OpenSim/Data/Null/NullSimulationData.cs3
-rw-r--r--OpenSim/Data/SQLite/SQLiteSimulationData.cs3
-rw-r--r--OpenSim/Data/SQLiteLegacy/SQLiteSimulationData.cs3
-rw-r--r--OpenSim/Framework/RegionInfo.cs1
-rw-r--r--OpenSim/Region/CoreModules/LightShare/LightShareModule.cs3
-rw-r--r--OpenSim/Region/Framework/Interfaces/ISimulationDataService.cs1
-rw-r--r--OpenSim/Region/Framework/Interfaces/ISimulationDataStore.cs1
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs18
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILS_Api.cs1
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LS_Stub.cs10
-rw-r--r--OpenSim/Services/Connectors/Simulation/SimulationDataService.cs4
-rw-r--r--OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs10
14 files changed, 75 insertions, 2 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs
index 1da52b4..80ec65e 100644
--- a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs
@@ -705,6 +705,9 @@ VALUES
705 //Return default LL windlight settings 705 //Return default LL windlight settings
706 return new RegionLightShareData(); 706 return new RegionLightShareData();
707 } 707 }
708 public void RemoveRegionWindlightSettings(UUID regionID)
709 {
710 }
708 public void StoreRegionWindlightSettings(RegionLightShareData wl) 711 public void StoreRegionWindlightSettings(RegionLightShareData wl)
709 { 712 {
710 //This connector doesn't support the windlight module yet 713 //This connector doesn't support the windlight module yet
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs
index e2b6953..ae78814 100644
--- a/OpenSim/Data/MySQL/MySQLSimulationData.cs
+++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs
@@ -817,6 +817,7 @@ namespace OpenSim.Data.MySQL
817 nWP.cloudScrollY = Convert.ToSingle(result["cloud_scroll_y"]); 817 nWP.cloudScrollY = Convert.ToSingle(result["cloud_scroll_y"]);
818 nWP.cloudScrollYLock = Convert.ToBoolean(result["cloud_scroll_y_lock"]); 818 nWP.cloudScrollYLock = Convert.ToBoolean(result["cloud_scroll_y_lock"]);
819 nWP.drawClassicClouds = Convert.ToBoolean(result["draw_classic_clouds"]); 819 nWP.drawClassicClouds = Convert.ToBoolean(result["draw_classic_clouds"]);
820 nWP.valid = true;
820 } 821 }
821 } 822 }
822 } 823 }
@@ -964,6 +965,21 @@ namespace OpenSim.Data.MySQL
964 } 965 }
965 } 966 }
966 967
968 public void RemoveRegionWindlightSettings(UUID regionID)
969 {
970 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
971 {
972 dbcon.Open();
973
974 using (MySqlCommand cmd = dbcon.CreateCommand())
975 {
976 cmd.CommandText = "delete from `regionwindlight` where `region_id`=?regionID";
977 cmd.Parameters.AddWithValue("?regionID", regionID.ToString());
978 ExecuteNonQuery(cmd);
979 }
980 }
981 }
982
967 public void StoreRegionSettings(RegionSettings rs) 983 public void StoreRegionSettings(RegionSettings rs)
968 { 984 {
969 lock (m_dbLock) 985 lock (m_dbLock)
diff --git a/OpenSim/Data/Null/NullSimulationData.cs b/OpenSim/Data/Null/NullSimulationData.cs
index 34d3a4e..eb4e313 100644
--- a/OpenSim/Data/Null/NullSimulationData.cs
+++ b/OpenSim/Data/Null/NullSimulationData.cs
@@ -56,6 +56,9 @@ namespace OpenSim.Data.Null
56 //Return default LL windlight settings 56 //Return default LL windlight settings
57 return new RegionLightShareData(); 57 return new RegionLightShareData();
58 } 58 }
59 public void RemoveRegionWindlightSettings(UUID regionID)
60 {
61 }
59 public void StoreRegionWindlightSettings(RegionLightShareData wl) 62 public void StoreRegionWindlightSettings(RegionLightShareData wl)
60 { 63 {
61 //This connector doesn't support the windlight module yet 64 //This connector doesn't support the windlight module yet
diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
index 9d49fb6..bade0a1 100644
--- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs
+++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
@@ -323,6 +323,9 @@ namespace OpenSim.Data.SQLite
323 //Return default LL windlight settings 323 //Return default LL windlight settings
324 return new RegionLightShareData(); 324 return new RegionLightShareData();
325 } 325 }
326 public void RemoveRegionWindlightSettings(UUID regionID)
327 {
328 }
326 public void StoreRegionWindlightSettings(RegionLightShareData wl) 329 public void StoreRegionWindlightSettings(RegionLightShareData wl)
327 { 330 {
328 //This connector doesn't support the windlight module yet 331 //This connector doesn't support the windlight module yet
diff --git a/OpenSim/Data/SQLiteLegacy/SQLiteSimulationData.cs b/OpenSim/Data/SQLiteLegacy/SQLiteSimulationData.cs
index ce18a42..4952cdf 100644
--- a/OpenSim/Data/SQLiteLegacy/SQLiteSimulationData.cs
+++ b/OpenSim/Data/SQLiteLegacy/SQLiteSimulationData.cs
@@ -286,6 +286,9 @@ namespace OpenSim.Data.SQLiteLegacy
286 //Return default LL windlight settings 286 //Return default LL windlight settings
287 return new RegionLightShareData(); 287 return new RegionLightShareData();
288 } 288 }
289 public void RemoveRegionWindlightSettings(UUID regionID)
290 {
291 }
289 public void StoreRegionWindlightSettings(RegionLightShareData wl) 292 public void StoreRegionWindlightSettings(RegionLightShareData wl)
290 { 293 {
291 //This connector doesn't support the windlight module yet 294 //This connector doesn't support the windlight module yet
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs
index a006f3e..806142f 100644
--- a/OpenSim/Framework/RegionInfo.cs
+++ b/OpenSim/Framework/RegionInfo.cs
@@ -43,6 +43,7 @@ namespace OpenSim.Framework
43 [Serializable] 43 [Serializable]
44 public class RegionLightShareData : ICloneable 44 public class RegionLightShareData : ICloneable
45 { 45 {
46 public bool valid = false;
46 public UUID regionID = UUID.Zero; 47 public UUID regionID = UUID.Zero;
47 public Vector3 waterColor = new Vector3(4.0f,38.0f,64.0f); 48 public Vector3 waterColor = new Vector3(4.0f,38.0f,64.0f);
48 public float waterFogDensityExponent = 4.0f; 49 public float waterFogDensityExponent = 4.0f;
diff --git a/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs b/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs
index 412dbb6..88f392d 100644
--- a/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs
+++ b/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs
@@ -194,7 +194,8 @@ namespace OpenSim.Region.CoreModules.World.LightShare
194 } 194 }
195 private void EventManager_OnSaveNewWindlightProfile() 195 private void EventManager_OnSaveNewWindlightProfile()
196 { 196 {
197 m_scene.ForEachScenePresence(SendProfileToClient); 197 if (m_scene.RegionInfo.WindlightSettings.valid)
198 m_scene.ForEachScenePresence(SendProfileToClient);
198 } 199 }
199 200
200 public void PostInitialise() 201 public void PostInitialise()
diff --git a/OpenSim/Region/Framework/Interfaces/ISimulationDataService.cs b/OpenSim/Region/Framework/Interfaces/ISimulationDataService.cs
index edaa07c..5295a72 100644
--- a/OpenSim/Region/Framework/Interfaces/ISimulationDataService.cs
+++ b/OpenSim/Region/Framework/Interfaces/ISimulationDataService.cs
@@ -94,5 +94,6 @@ namespace OpenSim.Region.Framework.Interfaces
94 RegionSettings LoadRegionSettings(UUID regionUUID); 94 RegionSettings LoadRegionSettings(UUID regionUUID);
95 RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID); 95 RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID);
96 void StoreRegionWindlightSettings(RegionLightShareData wl); 96 void StoreRegionWindlightSettings(RegionLightShareData wl);
97 void RemoveRegionWindlightSettings(UUID regionID);
97 } 98 }
98} 99}
diff --git a/OpenSim/Region/Framework/Interfaces/ISimulationDataStore.cs b/OpenSim/Region/Framework/Interfaces/ISimulationDataStore.cs
index 0a4d531..615f377 100644
--- a/OpenSim/Region/Framework/Interfaces/ISimulationDataStore.cs
+++ b/OpenSim/Region/Framework/Interfaces/ISimulationDataStore.cs
@@ -105,6 +105,7 @@ namespace OpenSim.Region.Framework.Interfaces
105 RegionSettings LoadRegionSettings(UUID regionUUID); 105 RegionSettings LoadRegionSettings(UUID regionUUID);
106 RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID); 106 RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID);
107 void StoreRegionWindlightSettings(RegionLightShareData wl); 107 void StoreRegionWindlightSettings(RegionLightShareData wl);
108 void RemoveRegionWindlightSettings(UUID regionID);
108 109
109 void Shutdown(); 110 void Shutdown();
110 } 111 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs
index 665b39f..645566e 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs
@@ -455,6 +455,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
455 if (LightShareModule.EnableWindlight) 455 if (LightShareModule.EnableWindlight)
456 { 456 {
457 RegionLightShareData wl = getWindlightProfileFromRules(rules); 457 RegionLightShareData wl = getWindlightProfileFromRules(rules);
458 wl.valid = true;
458 m_host.ParentGroup.Scene.StoreWindlightProfile(wl); 459 m_host.ParentGroup.Scene.StoreWindlightProfile(wl);
459 success = 1; 460 success = 1;
460 } 461 }
@@ -465,6 +466,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
465 } 466 }
466 return success; 467 return success;
467 } 468 }
469 public void lsClearWindlightScene()
470 {
471 if (!m_LSFunctionsEnabled)
472 {
473 LSShoutError("LightShare functions are not enabled.");
474 return;
475 }
476 if (!World.RegionInfo.EstateSettings.IsEstateManager(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200)
477 {
478 LSShoutError("lsSetWindlightScene can only be used by estate managers or owners.");
479 return;
480 }
481
482 m_host.ParentGroup.Scene.RegionInfo.WindlightSettings.valid = false;
483 if (m_host.ParentGroup.Scene.SimulationDataService != null)
484 m_host.ParentGroup.Scene.SimulationDataService.RemoveRegionWindlightSettings(m_host.ParentGroup.Scene.RegionInfo.RegionID);
485 }
468 /// <summary> 486 /// <summary>
469 /// Set the current Windlight scene to a target avatar 487 /// Set the current Windlight scene to a target avatar
470 /// </summary> 488 /// </summary>
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILS_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILS_Api.cs
index 9aa437b..f2df094 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILS_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILS_Api.cs
@@ -44,5 +44,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
44 LSL_List lsGetWindlightScene(LSL_List rules); 44 LSL_List lsGetWindlightScene(LSL_List rules);
45 int lsSetWindlightScene(LSL_List rules); 45 int lsSetWindlightScene(LSL_List rules);
46 int lsSetWindlightSceneTargeted(LSL_List rules, key target); 46 int lsSetWindlightSceneTargeted(LSL_List rules, key target);
47 void lsClearWindlightScene();
47 } 48 }
48} 49}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LS_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LS_Stub.cs
index 8280ca5..2e27f16 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LS_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LS_Stub.cs
@@ -73,6 +73,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
73 return m_LS_Functions.lsSetWindlightSceneTargeted(rules, target); 73 return m_LS_Functions.lsSetWindlightSceneTargeted(rules, target);
74 } 74 }
75 75
76 public void lsClearWindlightScene()
77 {
78 m_LS_Functions.lsClearWindlightScene();
79 }
80
76 public LSL_List cmGetWindlightScene(LSL_List rules) 81 public LSL_List cmGetWindlightScene(LSL_List rules)
77 { 82 {
78 return m_LS_Functions.lsGetWindlightScene(rules); 83 return m_LS_Functions.lsGetWindlightScene(rules);
@@ -87,5 +92,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
87 { 92 {
88 return m_LS_Functions.lsSetWindlightSceneTargeted(rules, target); 93 return m_LS_Functions.lsSetWindlightSceneTargeted(rules, target);
89 } 94 }
95
96 public void cmClearWindlightScene()
97 {
98 m_LS_Functions.lsClearWindlightScene();
99 }
90 } 100 }
91} 101}
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs b/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs
index c8ecb18..0df9380 100644
--- a/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs
+++ b/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs
@@ -144,5 +144,9 @@ namespace OpenSim.Services.Connectors
144 { 144 {
145 m_database.StoreRegionWindlightSettings(wl); 145 m_database.StoreRegionWindlightSettings(wl);
146 } 146 }
147 public void RemoveRegionWindlightSettings(UUID regionID)
148 {
149 m_database.RemoveRegionWindlightSettings(regionID);
150 }
147 } 151 }
148} 152}
diff --git a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs
index 2e5020b..2ea36da 100644
--- a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs
+++ b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs
@@ -104,6 +104,10 @@ namespace OpenSim.Data.Null
104 return m_store.LoadRegionWindlightSettings(regionUUID); 104 return m_store.LoadRegionWindlightSettings(regionUUID);
105 } 105 }
106 106
107 public void RemoveRegionWindlightSettings(UUID regionID)
108 {
109 }
110
107 public void StoreRegionWindlightSettings(RegionLightShareData wl) 111 public void StoreRegionWindlightSettings(RegionLightShareData wl)
108 { 112 {
109 m_store.StoreRegionWindlightSettings(wl); 113 m_store.StoreRegionWindlightSettings(wl);
@@ -146,6 +150,10 @@ namespace OpenSim.Data.Null
146 return new RegionLightShareData(); 150 return new RegionLightShareData();
147 } 151 }
148 152
153 public void RemoveRegionWindlightSettings(UUID regionID)
154 {
155 }
156
149 public void StoreRegionWindlightSettings(RegionLightShareData wl) 157 public void StoreRegionWindlightSettings(RegionLightShareData wl)
150 { 158 {
151 //This connector doesn't support the windlight module yet 159 //This connector doesn't support the windlight module yet
@@ -274,4 +282,4 @@ namespace OpenSim.Data.Null
274 { 282 {
275 } 283 }
276 } 284 }
277} \ No newline at end of file 285}