From 0ad45531a18ad577b36818fbe5f51f23ff4a2a9b Mon Sep 17 00:00:00 2001 From: Fernando Oliveira Date: Mon, 25 Nov 2013 21:20:56 -0200 Subject: Corrected case to get columns from Regions table from PostgreSQL http://opensimulator.org/mantis/view.php?id=6865 Signed-off-by: Michael Cerquoni --- OpenSim/Data/PGSQL/PGSQLRegionData.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenSim/Data/PGSQL/PGSQLRegionData.cs b/OpenSim/Data/PGSQL/PGSQLRegionData.cs index 8a46559..f3e4064 100644 --- a/OpenSim/Data/PGSQL/PGSQLRegionData.cs +++ b/OpenSim/Data/PGSQL/PGSQLRegionData.cs @@ -206,7 +206,7 @@ namespace OpenSim.Data.PGSQL DataTable schemaTable = result.GetSchemaTable(); foreach (DataRow row in schemaTable.Rows) - m_ColumnNames.Add(row["ColumnName"].ToString()); + m_ColumnNames.Add(row["column_name"].ToString()); } foreach (string s in m_ColumnNames) @@ -376,7 +376,7 @@ namespace OpenSim.Data.PGSQL private List Get(int regionFlags, UUID scopeID) { - string sql = "SELECT * FROM " + m_Realm + " WHERE (flags & " + regionFlags.ToString() + ") <> 0"; + string sql = "SELECT * FROM " + m_Realm + " WHERE (\"flags\" & " + regionFlags.ToString() + ") <> 0"; if (scopeID != UUID.Zero) sql += " AND \"ScopeID\" = :scopeID"; -- cgit v1.1 From 5a9ec0748b901051ce0ec54e332ae4af002d570e Mon Sep 17 00:00:00 2001 From: dahlia Date: Tue, 26 Nov 2013 17:18:44 -0800 Subject: add a "rotate scene" console command. Seems to work for prims/sculpts/mesh but not for foliage, don't know why. Also doesn't work on terrain. Successive use of this command will likely introduce floating point error accumulation. Back up your region before using it :) --- OpenSim/Region/Application/OpenSim.cs | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index e31c3fc..beb546d 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -296,6 +296,11 @@ namespace OpenSim "Change the scale of a named prim", HandleEditScale); + m_console.Commands.AddCommand("Objects", false, "rotate scene", + "rotate scene ", + "Rotates all scene objects around x:128, y:128", + HandleRotateScene); + m_console.Commands.AddCommand("Users", false, "kick user", "kick user [--force] [message]", "Kick a user off the simulator", @@ -505,6 +510,34 @@ namespace OpenSim } } + private void HandleRotateScene(string module, string[] args) + { + string usage = "Usage: rotate scene "; + + if (args.Length != 3) + { + MainConsole.Instance.Output(usage); + return; + } + + float angle = (float)(Convert.ToSingle(args[2]) / 180.0 * Math.PI); + OpenMetaverse.Quaternion rot = OpenMetaverse.Quaternion.CreateFromAxisAngle(0, 0, 1, angle); + + SceneManager.ForEachSelectedScene(delegate(Scene scene) + { + scene.ForEachSOG(delegate(SceneObjectGroup sog) + { + if (sog.AttachmentPoint == 0) + { + sog.RootPart.UpdateRotation(rot * sog.GroupRotation); + Vector3 offset = sog.AbsolutePosition - new Vector3(128.0f, 128.0f, 0.0f); + offset *= rot; + sog.UpdateGroupPosition(new Vector3(128.0f, 128.0f, 0.0f) + offset); + } + }); + }); + } + /// /// Creates a new region based on the parameters specified. This will ask the user questions on the console /// -- cgit v1.1 From e52a8d388fb1fe85b78b5b584cbb7d5444f464c0 Mon Sep 17 00:00:00 2001 From: dahlia Date: Tue, 26 Nov 2013 21:07:37 -0800 Subject: "rotate scene" command now uses Constants.RegionSize / 2 to pick the center of rotation and center can be optionally overridden in the command line --- OpenSim/Region/Application/OpenSim.cs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index beb546d..c2d9942 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -512,9 +512,12 @@ namespace OpenSim private void HandleRotateScene(string module, string[] args) { - string usage = "Usage: rotate scene "; + string usage = "Usage: rotate scene [centerX centerY] (centerX and centerY are optional and default to Constants.RegionSize / 2"; - if (args.Length != 3) + float centerX = Constants.RegionSize * 0.5f; + float centerY = Constants.RegionSize * 0.5f; + + if (args.Length < 3 || args.Length == 4) { MainConsole.Instance.Output(usage); return; @@ -523,6 +526,14 @@ namespace OpenSim float angle = (float)(Convert.ToSingle(args[2]) / 180.0 * Math.PI); OpenMetaverse.Quaternion rot = OpenMetaverse.Quaternion.CreateFromAxisAngle(0, 0, 1, angle); + if (args.Length > 4) + { + centerX = Convert.ToSingle(args[3]); + centerY = Convert.ToSingle(args[4]); + } + + Vector3 center = new Vector3(centerX, centerY, 0.0f); + SceneManager.ForEachSelectedScene(delegate(Scene scene) { scene.ForEachSOG(delegate(SceneObjectGroup sog) @@ -530,9 +541,9 @@ namespace OpenSim if (sog.AttachmentPoint == 0) { sog.RootPart.UpdateRotation(rot * sog.GroupRotation); - Vector3 offset = sog.AbsolutePosition - new Vector3(128.0f, 128.0f, 0.0f); + Vector3 offset = sog.AbsolutePosition - center; offset *= rot; - sog.UpdateGroupPosition(new Vector3(128.0f, 128.0f, 0.0f) + offset); + sog.UpdateGroupPosition(center + offset); } }); }); -- cgit v1.1 From 73dadef8df794868f8db59cc2dca0cae090bb536 Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Wed, 27 Nov 2013 12:01:09 -0800 Subject: Change the log level for the LOGIN DISABLED and LOGIN ENABLED messages is the RegionReady module to be warn so that the message will show up in the log for simulators running in a more production mode (knowing when logins are functional is useful). --- .../Scripting/RegionReadyModule/RegionReadyModule.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs index c550c44..c717128 100644 --- a/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs @@ -105,7 +105,8 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady m_scene.LoginLock = true; m_scene.EventManager.OnEmptyScriptCompileQueue += OnEmptyScriptCompileQueue; - m_log.InfoFormat("[RegionReady]: Region {0} - LOGINS DISABLED DURING INITIALIZATION.", m_scene.Name); + // Warn level because the region cannot be used while logins are disabled + m_log.WarnFormat("[RegionReady]: Region {0} - LOGINS DISABLED DURING INITIALIZATION.", m_scene.Name); if (m_uri != string.Empty) { @@ -215,7 +216,8 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady // m_log.InfoFormat("[RegionReady]: Logins enabled for {0}, Oar {1}", // m_scene.RegionInfo.RegionName, m_oarFileLoading.ToString()); - m_log.InfoFormat( + // Warn level because the region cannot be used while logins are disabled + m_log.WarnFormat( "[RegionReady]: INITIALIZATION COMPLETE FOR {0} - LOGINS ENABLED", m_scene.Name); } -- cgit v1.1