From 7e21c1eadf28e86b29fdd24b33e29950e195c6db Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 12 Feb 2011 00:46:01 +0000
Subject: Hack in a crude temporary "estate show" command
This will show the estate for each region, along with that estate's id and the estate owner.
This is temporary because the command output might change.
This commit also converts the estate module from the old to the new region module format
---
.../World/Estate/EstateManagementCommands.cs | 74 +++++++++++++++++++++-
.../World/Estate/EstateManagementModule.cs | 40 ++++++------
.../Region/Framework/Interfaces/IEstateModule.cs | 2 +-
3 files changed, 94 insertions(+), 22 deletions(-)
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs
index 14f5b1e..f6d1a82 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs
@@ -30,21 +30,29 @@ using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Security;
+using System.Text;
using log4net;
using Nini.Config;
using OpenMetaverse;
using OpenSim.Framework;
+using OpenSim.Framework.Console;
+using OpenSim.Region.CoreModules.Framework.InterfaceCommander;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
namespace OpenSim.Region.CoreModules.World.Estate
{
+ ///
+ /// Estate management console commands.
+ ///
public class EstateManagementCommands
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected EstateManagementModule m_module;
+ protected Commander m_commander = new Commander("estate");
+
public EstateManagementCommands(EstateManagementModule module)
{
m_module = module;
@@ -52,20 +60,60 @@ namespace OpenSim.Region.CoreModules.World.Estate
public void Initialise()
{
- m_module.Scene.AddCommand(this, "set terrain texture",
+ m_log.DebugFormat("[ESTATE MODULE]: Setting up estate commands for region {0}", m_module.Scene.RegionInfo.RegionName);
+
+ m_module.Scene.AddCommand(m_module, "set terrain texture",
"set terrain texture [] []",
"Sets the terrain to , if or are specified, it will only " +
"set it on regions with a matching coordinate. Specify -1 in or to wildcard" +
" that coordinate.",
consoleSetTerrainTexture);
- m_module.Scene.AddCommand(this, "set terrain heights",
+ m_module.Scene.AddCommand(m_module, "set terrain heights",
"set terrain heights [] []",
"Sets the terrain texture heights on corner # to /, if or are specified, it will only " +
"set it on regions with a matching coordinate. Specify -1 in or to wildcard" +
" that coordinate. Corner # SW = 0, NW = 1, SE = 2, NE = 3.",
consoleSetTerrainHeights);
- }
+
+ Command showCommand
+ = new Command("show", CommandIntentions.COMMAND_STATISTICAL, ShowEstatesCommand, "Shows all estates on the simulator.");
+
+ m_commander.RegisterCommand("show", showCommand);
+
+ m_module.Scene.RegisterModuleCommander(m_commander);
+
+ m_module.Scene.EventManager.OnPluginConsole += EventManagerOnPluginConsole;
+ }
+
+ public void Close()
+ {
+ m_module.Scene.EventManager.OnPluginConsole -= EventManagerOnPluginConsole;
+ m_module.Scene.UnregisterModuleCommander(m_commander.Name);
+ }
+
+ ///
+ /// Processes commandline input. Do not call directly.
+ ///
+ /// Commandline arguments
+ protected void EventManagerOnPluginConsole(string[] args)
+ {
+ if (args[0] == "estate")
+ {
+ if (args.Length == 1)
+ {
+ m_commander.ProcessConsoleCommand("help", new string[0]);
+ return;
+ }
+
+ string[] tmpArgs = new string[args.Length - 2];
+ int i;
+ for (i = 2; i < args.Length; i++)
+ tmpArgs[i - 2] = args[i];
+
+ m_commander.ProcessConsoleCommand(args[1], tmpArgs);
+ }
+ }
protected void consoleSetTerrainTexture(string module, string[] args)
{
@@ -152,5 +200,25 @@ namespace OpenSim.Region.CoreModules.World.Estate
}
}
}
+
+ protected void ShowEstatesCommand(Object[] args)
+ {
+ StringBuilder report = new StringBuilder();
+ RegionInfo ri = m_module.Scene.RegionInfo;
+ EstateSettings es = ri.EstateSettings;
+
+ report.AppendFormat("Estate information for region {0}\n", ri.RegionName);
+ report.AppendFormat(
+ "{0,-20} {1,-7} {2,-20}\n",
+ "Estate Name",
+ "ID",
+ "Owner");
+
+ report.AppendFormat(
+ "{0,-20} {1,-7} {2,-20}\n",
+ es.EstateName, es.EstateID, m_module.UserManager.GetUserName(es.EstateOwner));
+
+ MainConsole.Instance.Output(report.ToString());
+ }
}
}
\ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
index 54d3c61..57ab135 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
@@ -31,6 +31,7 @@ using System.IO;
using System.Reflection;
using System.Security;
using log4net;
+using Mono.Addins;
using Nini.Config;
using OpenMetaverse;
using OpenSim.Framework;
@@ -39,15 +40,17 @@ using OpenSim.Region.Framework.Scenes;
namespace OpenSim.Region.CoreModules.World.Estate
{
- public class EstateManagementModule : IEstateModule
+ [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "EstateManagementModule")]
+ public class EstateManagementModule : IEstateModule, INonSharedRegionModule
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private delegate void LookupUUIDS(List uuidLst);
public Scene Scene { get; private set; }
+ public IUserManagement UserManager { get; private set; }
- protected EstateManagementCommands m_commands;
+ protected EstateManagementCommands m_commands;
private EstateTerrainXferHandler TerrainUploader;
@@ -895,9 +898,15 @@ namespace OpenSim.Region.CoreModules.World.Estate
#endregion
#region IRegionModule Members
+
+ public string Name { get { return "EstateManagementModule"; } }
+
+ public Type ReplaceableInterface { get { return null; } }
- public void Initialise(Scene scene, IConfigSource source)
- {
+ public void Initialise(IConfigSource source) {}
+
+ public void AddRegion(Scene scene)
+ {
Scene = scene;
Scene.RegisterModuleInterface(this);
Scene.EventManager.OnNewClient += EventManager_OnNewClient;
@@ -906,26 +915,21 @@ namespace OpenSim.Region.CoreModules.World.Estate
m_commands = new EstateManagementCommands(this);
m_commands.Initialise();
}
-
- public void PostInitialise()
+
+ public void RemoveRegion(Scene scene) {}
+
+ public void RegionLoaded(Scene scene)
{
// Sets up the sun module based no the saved Estate and Region Settings
// DO NOT REMOVE or the sun will stop working
- Scene.TriggerEstateSunUpdate();
- }
-
- public void Close()
- {
- }
-
- public string Name
- {
- get { return "EstateManagementModule"; }
+ scene.TriggerEstateSunUpdate();
+
+ UserManager = scene.RequestModuleInterface();
}
- public bool IsSharedModule
+ public void Close()
{
- get { return false; }
+ m_commands.Close();
}
#endregion
diff --git a/OpenSim/Region/Framework/Interfaces/IEstateModule.cs b/OpenSim/Region/Framework/Interfaces/IEstateModule.cs
index c850f7f..721f0ee 100644
--- a/OpenSim/Region/Framework/Interfaces/IEstateModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IEstateModule.cs
@@ -32,7 +32,7 @@ namespace OpenSim.Region.Framework.Interfaces
public delegate void ChangeDelegate(UUID regionID);
public delegate void MessageDelegate(UUID regionID, UUID fromID, string fromName, string message);
- public interface IEstateModule : IRegionModule
+ public interface IEstateModule
{
event ChangeDelegate OnRegionInfoChange;
event ChangeDelegate OnEstateInfoChange;
--
cgit v1.1
From 03d82a5a8524cfba07d95456d59be6f35ab72048 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 12 Feb 2011 01:08:56 +0000
Subject: Fix bug where "My estate" name was always used even if the user
entered a different name on initial setup.
Turns out we had stopped saving estate settings immediately after the name change. The scene constructor then reloade the settings and oblitereted the different name.
This code could be more efficient since there's no reason for scene to reload the settings when they are already known to be valid.
Thanks to Thoneve for the spot on this.
---
OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs | 2 ++
OpenSim/Region/Application/OpenSimBase.cs | 12 ++++++++----
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs
index 7ef0f5f..f37c399 100644
--- a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs
+++ b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs
@@ -122,9 +122,11 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
m_log.Debug("[LOADREGIONS]: Creating Region: " + regionsToLoad[i].RegionName + " (ThreadID: " +
Thread.CurrentThread.ManagedThreadId.ToString() +
")");
+
m_openSim.PopulateRegionEstateInfo(regionsToLoad[i]);
m_openSim.CreateRegion(regionsToLoad[i], true, out scene);
regionsToLoad[i].EstateSettings.Save();
+
if (scene != null)
{
m_newRegionCreatedHandler = OnNewRegionCreated;
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 1652b82..e950613 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -795,9 +795,7 @@ namespace OpenSim
///
/// Load the estate information for the provided RegionInfo object.
///
- ///
- /// A
- ///
+ ///
public void PopulateRegionEstateInfo(RegionInfo regInfo)
{
IEstateDataService estateDataService = EstateDataService;
@@ -819,7 +817,13 @@ namespace OpenSim
regInfo.EstateSettings = estateDataService.LoadEstateSettings(regInfo.RegionID, true);
regInfo.EstateSettings.EstateName = MainConsole.Instance.CmdPrompt("New estate name", regInfo.EstateSettings.EstateName);
- //regInfo.EstateSettings.Save();
+
+ // FIXME: Later on, the scene constructor will reload the estate settings no matter what.
+ // Therefore, we need to do an initial save here otherwise the new estate name will be reset
+ // back to the default. The reloading of estate settings by scene could be eliminated if it
+ // knows that the passed in settings in RegionInfo are already valid. Also, it might be
+ // possible to eliminate some additional later saves made by callers of this method.
+ regInfo.EstateSettings.Save();
break;
}
else
--
cgit v1.1
From 9801bf03f8ab59e1fe8d439a216ca48a5bd68dc7 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 12 Feb 2011 01:14:12 +0000
Subject: minor: add comment explaining that GetRegionsByName needs to stay in
TeleportAgent for its side effects.
---
OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 2 ++
1 file changed, 2 insertions(+)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 3f8735e..688dfe4 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -702,6 +702,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// and convert the regionName to the target region
if (regionName.Contains(".") && regionName.Contains(":"))
{
+ // Even though we use none of the results, we need to perform this call because it appears
+ // to have some the side effect of setting up hypergrid teleport locations.
World.GridService.GetRegionsByName(World.RegionInfo.ScopeID, regionName, 1);
// List regions = World.GridService.GetRegionsByName(World.RegionInfo.ScopeID, regionName, 1);
--
cgit v1.1
From a8ced66e873d09bd1c9fd0cfe5d0487bf0ee27e7 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Sat, 12 Feb 2011 07:28:21 -0800
Subject: Improved error message on TP failure
---
.../Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 80a8041..1337143 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -243,7 +243,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
}
catch (Exception e)
{
- m_log.WarnFormat("[ENTITY TRANSFER MODULE]: Exception on teleport: {0}\n{1}", e.Message, e.StackTrace);
+ m_log.WarnFormat("[ENTITY TRANSFER MODULE]: Exception on teleport: {0} {1}", e.Message, e.StackTrace);
sp.ControllingClient.SendTeleportFailed("Internal error");
}
}
--
cgit v1.1
From 059e9eaf98c93c0befd84b99c88d9411ddd73817 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Sat, 12 Feb 2011 14:38:46 -0800
Subject: Fixed a couple of tests in the HttpServer. Not sure if this is
enough. Mantis #5373 and #5384
---
bin/HttpServer_OpenSim.dll | Bin 115712 -> 115712 bytes
bin/HttpServer_OpenSim.pdb | Bin 409088 -> 409088 bytes
2 files changed, 0 insertions(+), 0 deletions(-)
diff --git a/bin/HttpServer_OpenSim.dll b/bin/HttpServer_OpenSim.dll
index d7503a0..a7a1303 100644
Binary files a/bin/HttpServer_OpenSim.dll and b/bin/HttpServer_OpenSim.dll differ
diff --git a/bin/HttpServer_OpenSim.pdb b/bin/HttpServer_OpenSim.pdb
index 4151588..c6f3b23 100644
Binary files a/bin/HttpServer_OpenSim.pdb and b/bin/HttpServer_OpenSim.pdb differ
--
cgit v1.1
From c169a62f557c9361da73da901e9f188d8b8bdeb8 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Sat, 12 Feb 2011 18:05:25 -0800
Subject: Typo
---
OpenSim/Services/AssetService/AssetService.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/OpenSim/Services/AssetService/AssetService.cs b/OpenSim/Services/AssetService/AssetService.cs
index 3fd2fcf..a81af43 100644
--- a/OpenSim/Services/AssetService/AssetService.cs
+++ b/OpenSim/Services/AssetService/AssetService.cs
@@ -93,7 +93,7 @@ namespace OpenSim.Services.AssetService
if (!UUID.TryParse(id, out assetID))
{
- m_log.WarnFormat("[ASSET SERVICE]: Could not parse requested sset id {0}", id);
+ m_log.WarnFormat("[ASSET SERVICE]: Could not parse requested asset id {0}", id);
return null;
}
--
cgit v1.1
From 19d3792278643af0d45dd09f338a33ad78a138b7 Mon Sep 17 00:00:00 2001
From: Marck
Date: Sat, 12 Feb 2011 20:02:42 +0100
Subject: Fix and simplify QBasedComparer.
Make parsing of qvalues independent from a system's language setting and ensure that the comparison adheres to a descending order.
---
OpenSim/Framework/WebUtil.cs | 20 +++++++-------------
1 file changed, 7 insertions(+), 13 deletions(-)
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs
index d731ac5..1feeeb3 100644
--- a/OpenSim/Framework/WebUtil.cs
+++ b/OpenSim/Framework/WebUtil.cs
@@ -29,6 +29,7 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
+using System.Globalization;
using System.IO;
using System.Net;
using System.Net.Security;
@@ -557,34 +558,27 @@ namespace OpenSim.Framework
{
float qx = GetQ(x);
float qy = GetQ(y);
- if (qx < qy)
- return -1;
- if (qx == qy)
- return 0;
- return 1;
+ return qy.CompareTo(qx); // descending order
}
private float GetQ(Object o)
{
// Example: image/png;q=0.9
+ float qvalue = 1F;
if (o is String)
{
string mime = (string)o;
- string[] parts = mime.Split(new char[] { ';' });
+ string[] parts = mime.Split(';');
if (parts.Length > 1)
{
- string[] kvp = parts[1].Split(new char[] { '=' });
+ string[] kvp = parts[1].Split('=');
if (kvp.Length == 2 && kvp[0] == "q")
- {
- float qvalue = 1F;
- float.TryParse(kvp[1], out qvalue);
- return qvalue;
- }
+ float.TryParse(kvp[1], NumberStyles.Number, CultureInfo.InvariantCulture, out qvalue);
}
}
- return 1F;
+ return qvalue;
}
}
--
cgit v1.1
From c75e916ccfb195554c5010ab4187c4d74b81c4e1 Mon Sep 17 00:00:00 2001
From: BlueWall
Date: Sun, 13 Feb 2011 00:30:43 -0500
Subject: Set filter to send proper rotations for root part
This allows the root prim, alone or in a set, to send it's
rotation. This fixes unsitting the avatar on sit-offsest
type teleports where the sit target is in the root prim of
a linkset.
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 6a92378..4d5eedf 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2099,7 +2099,7 @@ namespace OpenSim.Region.Framework.Scenes
{
Quaternion newRot;
- if (this.LinkNum == 0)
+ if (this.LinkNum == 0 || this.LinkNum == 1)
{
newRot = RotationOffset;
}
--
cgit v1.1
From 5d6d0aa14226fe31e59c4f2e8a9bd6d6dfc4f995 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Tue, 15 Feb 2011 08:38:37 -0800
Subject: Catch HttpServer exception: mantis #5381
---
bin/HttpServer_OpenSim.dll | Bin 115712 -> 115712 bytes
bin/HttpServer_OpenSim.pdb | Bin 409088 -> 409088 bytes
2 files changed, 0 insertions(+), 0 deletions(-)
diff --git a/bin/HttpServer_OpenSim.dll b/bin/HttpServer_OpenSim.dll
index a7a1303..95ea5dd 100644
Binary files a/bin/HttpServer_OpenSim.dll and b/bin/HttpServer_OpenSim.dll differ
diff --git a/bin/HttpServer_OpenSim.pdb b/bin/HttpServer_OpenSim.pdb
index c6f3b23..b6b77f7 100644
Binary files a/bin/HttpServer_OpenSim.pdb and b/bin/HttpServer_OpenSim.pdb differ
--
cgit v1.1