From 1f77f05f023f9ab45e9f8fd0109766a1fe151dba Mon Sep 17 00:00:00 2001 From: mores Date: Tue, 2 Nov 2010 21:46:45 -0400 Subject: Admin Server can now bind to a private ip address Signed-off-by: Melanie --- OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | 4 +++- OpenSim/Framework/MainServer.cs | 9 +++++++++ bin/OpenSim.ini.example | 3 +++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 72ac303..cbaa38b 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs @@ -116,7 +116,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController int port = m_config.GetInt("port", 0); m_application = openSim; - m_httpServer = MainServer.GetHttpServer((uint)port); + string bind_ip_address = m_config.GetString("bind_ip_address", "127.0.0.1"); + IPAddress ipaddr = IPAddress.Parse( bind_ip_address ); + m_httpServer = MainServer.GetHttpServer((uint)port,ipaddr); Dictionary availableMethods = new Dictionary(); availableMethods["admin_create_region"] = XmlRpcCreateRegionMethod; diff --git a/OpenSim/Framework/MainServer.cs b/OpenSim/Framework/MainServer.cs index 1f5f208..8ccabec 100644 --- a/OpenSim/Framework/MainServer.cs +++ b/OpenSim/Framework/MainServer.cs @@ -27,6 +27,7 @@ using System.Collections.Generic; using System.Reflection; +using System.Net; using log4net; using OpenSim.Framework.Servers.HttpServer; @@ -48,6 +49,11 @@ namespace OpenSim.Framework public static IHttpServer GetHttpServer(uint port) { + return GetHttpServer(port,null); + } + + public static IHttpServer GetHttpServer(uint port, IPAddress ipaddr) + { if (port == 0) return Instance; if (instance != null && port == Instance.Port) @@ -58,6 +64,9 @@ namespace OpenSim.Framework m_Servers[port] = new BaseHttpServer(port); + if (ipaddr != null ) + m_Servers[port].ListenIPAddress = ipaddr; + m_log.InfoFormat("[MAIN HTTP SERVER]: Starting main http server on port {0}", port); m_Servers[port].Start(); diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index 9d34854..669f534 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -326,6 +326,9 @@ ;; Set this to a nonzero value to have remote admin use a different port ; port = 0 + ;; Set this to the ip address that you want the admin server to bind to + ; bind_ip_address = 127.0.0.1 + ;# {access_password} {enabled:true} {Password for the remote admin interface} {} ;; This password is required to make any XMLRPC call (should be set as ;; the "password" parameter) -- cgit v1.1 From e76980bc496b414908ced8a9451631ff21ba5a17 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 3 Nov 2010 01:09:42 +0000 Subject: Fix config items. Less used / expert items go in OpenSimDefaults.ini The default shown is always the hardcoded default --- bin/OpenSim.ini.example | 3 --- bin/OpenSimDefaults.ini | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index 669f534..9d34854 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -326,9 +326,6 @@ ;; Set this to a nonzero value to have remote admin use a different port ; port = 0 - ;; Set this to the ip address that you want the admin server to bind to - ; bind_ip_address = 127.0.0.1 - ;# {access_password} {enabled:true} {Password for the remote admin interface} {} ;; This password is required to make any XMLRPC call (should be set as ;; the "password" parameter) diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index de7c44c..f98689b 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini @@ -624,6 +624,9 @@ ; Set this to a nonzero value to have remote admin use a different port port = 0 + ; Set this to the ip address that you want the admin server to bind to + bind_ip_address = "0.0.0.0" + ; This password is required to make any XMLRPC call (should be set as the "password" parameter) access_password = unknown -- cgit v1.1 From c25f84e31c9ce20b887d2aba638962984ef20941 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 3 Nov 2010 01:11:04 +0000 Subject: Change the default of the new bind_ip_address RemoteAdmin option to 0.0.0.0 so it reflects the prior default. We are not in the habot of changing default behavior without good reason and making localhost the default would break most current use cases. --- OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index cbaa38b..854307c 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs @@ -116,7 +116,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController int port = m_config.GetInt("port", 0); m_application = openSim; - string bind_ip_address = m_config.GetString("bind_ip_address", "127.0.0.1"); + string bind_ip_address = m_config.GetString("bind_ip_address", "0.0.0.0"); IPAddress ipaddr = IPAddress.Parse( bind_ip_address ); m_httpServer = MainServer.GetHttpServer((uint)port,ipaddr); -- cgit v1.1 From 4ab9d37a8e556fe7f54d70db922eede861bce812 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 3 Nov 2010 02:04:17 +0000 Subject: When LightShare is enabled, the standard day cycle is bypassed and replaced by midday defaults when no specific LightShare profile is set. This prevents LightShare info being send out when the region has no LightShare profile, allowing normal day/night cycles to happen. --- OpenSim/Data/MySQL/MySQLSimulationData.cs | 1 + OpenSim/Framework/RegionInfo.cs | 1 + OpenSim/Region/CoreModules/LightShare/LightShareModule.cs | 3 ++- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index e2b6953..b53c67b 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs @@ -817,6 +817,7 @@ namespace OpenSim.Data.MySQL nWP.cloudScrollY = Convert.ToSingle(result["cloud_scroll_y"]); nWP.cloudScrollYLock = Convert.ToBoolean(result["cloud_scroll_y_lock"]); nWP.drawClassicClouds = Convert.ToBoolean(result["draw_classic_clouds"]); + nWP.valid = true; } } } diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index 08d5398..176a523 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -42,6 +42,7 @@ namespace OpenSim.Framework { public class RegionLightShareData : ICloneable { + public bool valid = false; public UUID regionID = UUID.Zero; public Vector3 waterColor = new Vector3(4.0f,38.0f,64.0f); 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 } private void EventManager_OnSaveNewWindlightProfile() { - m_scene.ForEachScenePresence(SendProfileToClient); + if (m_scene.RegionInfo.WindlightSettings.valid) + m_scene.ForEachScenePresence(SendProfileToClient); } public void PostInitialise() diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs index 665b39f..24a93c5 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 if (LightShareModule.EnableWindlight) { RegionLightShareData wl = getWindlightProfileFromRules(rules); + wl.valid = true; m_host.ParentGroup.Scene.StoreWindlightProfile(wl); success = 1; } -- cgit v1.1 From 6c3b7617b0356f093ef2730f1c517d6228997984 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 3 Nov 2010 02:31:43 +0000 Subject: Add lsClearWindlightScene() to the lightshare module to remove WL settings from a region and allow normal day cycles to be reestablished --- OpenSim/Data/MSSQL/MSSQLSimulationData.cs | 3 +++ OpenSim/Data/MySQL/MySQLSimulationData.cs | 15 +++++++++++++++ OpenSim/Data/Null/NullSimulationData.cs | 3 +++ OpenSim/Data/SQLite/SQLiteSimulationData.cs | 3 +++ OpenSim/Data/SQLiteLegacy/SQLiteSimulationData.cs | 3 +++ .../Framework/Interfaces/ISimulationDataService.cs | 1 + .../Region/Framework/Interfaces/ISimulationDataStore.cs | 1 + .../ScriptEngine/Shared/Api/Implementation/LS_Api.cs | 17 +++++++++++++++++ .../Region/ScriptEngine/Shared/Api/Interface/ILS_Api.cs | 1 + .../Region/ScriptEngine/Shared/Api/Runtime/LS_Stub.cs | 4 ++++ .../Connectors/Simulation/SimulationDataService.cs | 4 ++++ OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs | 10 +++++++++- 12 files changed, 64 insertions(+), 1 deletion(-) 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 //Return default LL windlight settings return new RegionLightShareData(); } + public void RemoveRegionWindlightSettings(UUID regionID) + { + } public void StoreRegionWindlightSettings(RegionLightShareData wl) { //This connector doesn't support the windlight module yet diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index b53c67b..ae78814 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs @@ -965,6 +965,21 @@ namespace OpenSim.Data.MySQL } } + public void RemoveRegionWindlightSettings(UUID regionID) + { + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) + { + dbcon.Open(); + + using (MySqlCommand cmd = dbcon.CreateCommand()) + { + cmd.CommandText = "delete from `regionwindlight` where `region_id`=?regionID"; + cmd.Parameters.AddWithValue("?regionID", regionID.ToString()); + ExecuteNonQuery(cmd); + } + } + } + public void StoreRegionSettings(RegionSettings rs) { 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 //Return default LL windlight settings return new RegionLightShareData(); } + public void RemoveRegionWindlightSettings(UUID regionID) + { + } public void StoreRegionWindlightSettings(RegionLightShareData wl) { //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 //Return default LL windlight settings return new RegionLightShareData(); } + public void RemoveRegionWindlightSettings(UUID regionID) + { + } public void StoreRegionWindlightSettings(RegionLightShareData wl) { //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 //Return default LL windlight settings return new RegionLightShareData(); } + public void RemoveRegionWindlightSettings(UUID regionID) + { + } public void StoreRegionWindlightSettings(RegionLightShareData wl) { //This connector doesn't support the windlight module yet 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 RegionSettings LoadRegionSettings(UUID regionUUID); RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID); void StoreRegionWindlightSettings(RegionLightShareData wl); + void RemoveRegionWindlightSettings(UUID regionID); } } 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 RegionSettings LoadRegionSettings(UUID regionUUID); RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID); void StoreRegionWindlightSettings(RegionLightShareData wl); + void RemoveRegionWindlightSettings(UUID regionID); void Shutdown(); } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs index 24a93c5..645566e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs @@ -466,6 +466,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } return success; } + public void lsClearWindlightScene() + { + if (!m_LSFunctionsEnabled) + { + LSShoutError("LightShare functions are not enabled."); + return; + } + if (!World.RegionInfo.EstateSettings.IsEstateManager(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200) + { + LSShoutError("lsSetWindlightScene can only be used by estate managers or owners."); + return; + } + + m_host.ParentGroup.Scene.RegionInfo.WindlightSettings.valid = false; + if (m_host.ParentGroup.Scene.SimulationDataService != null) + m_host.ParentGroup.Scene.SimulationDataService.RemoveRegionWindlightSettings(m_host.ParentGroup.Scene.RegionInfo.RegionID); + } /// /// Set the current Windlight scene to a target avatar /// 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 LSL_List lsGetWindlightScene(LSL_List rules); int lsSetWindlightScene(LSL_List rules); int lsSetWindlightSceneTargeted(LSL_List rules, key target); + void lsClearWindlightScene(); } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LS_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LS_Stub.cs index f8dbe03..143b497 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LS_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LS_Stub.cs @@ -72,5 +72,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase { return m_LS_Functions.lsSetWindlightSceneTargeted(rules, target); } + public void lsClearWindlightScene() + { + m_LS_Functions.lsClearWindlightScene(); + } } } 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 { m_database.StoreRegionWindlightSettings(wl); } + public void RemoveRegionWindlightSettings(UUID regionID) + { + m_database.RemoveRegionWindlightSettings(regionID); + } } } 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 return m_store.LoadRegionWindlightSettings(regionUUID); } + public void RemoveRegionWindlightSettings(UUID regionID) + { + } + public void StoreRegionWindlightSettings(RegionLightShareData wl) { m_store.StoreRegionWindlightSettings(wl); @@ -146,6 +150,10 @@ namespace OpenSim.Data.Null return new RegionLightShareData(); } + public void RemoveRegionWindlightSettings(UUID regionID) + { + } + public void StoreRegionWindlightSettings(RegionLightShareData wl) { //This connector doesn't support the windlight module yet @@ -274,4 +282,4 @@ namespace OpenSim.Data.Null { } } -} \ No newline at end of file +} -- cgit v1.1