aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorMelanie2013-11-23 19:13:22 +0000
committerMelanie2013-11-23 19:13:22 +0000
commit3589acdab1721ee7d227a23dbeb2ccf91cbcb996 (patch)
treea833014a1fedd774e7a9a01cd89a7edddb4210ba /OpenSim/Region/CoreModules
parentMerge branch 'master' into careminster (diff)
parentRevert "Fix issue where sitting on non-root linked prims would send camera to... (diff)
downloadopensim-SC-3589acdab1721ee7d227a23dbeb2ccf91cbcb996.zip
opensim-SC-3589acdab1721ee7d227a23dbeb2ccf91cbcb996.tar.gz
opensim-SC-3589acdab1721ee7d227a23dbeb2ccf91cbcb996.tar.bz2
opensim-SC-3589acdab1721ee7d227a23dbeb2ccf91cbcb996.tar.xz
Merge branch 'master' into careminster
Conflicts: .gitignore OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs prebuild.xml runprebuild.bat
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs4
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs2
-rw-r--r--OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs6
-rw-r--r--OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/Scripting/VectorRender/Tests/VectorRenderModuleTests.cs4
-rw-r--r--OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs4
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs176
11 files changed, 146 insertions, 64 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index 051e959..d47ca4b 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -366,7 +366,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
366 } 366 }
367 catch (Exception e) 367 catch (Exception e)
368 { 368 {
369 UUID agentId = (sp.ControllingClient == null) ? (UUID)null : sp.ControllingClient.AgentId; 369 UUID agentId = (sp.ControllingClient == null) ? default(UUID) : sp.ControllingClient.AgentId;
370 m_log.ErrorFormat("[ATTACHMENTS MODULE]: Unable to rez attachment with itemID {0}, assetID {1}, point {2} for {3}: {4}\n{5}", 370 m_log.ErrorFormat("[ATTACHMENTS MODULE]: Unable to rez attachment with itemID {0}, assetID {1}, point {2} for {3}: {4}\n{5}",
371 attach.ItemID, attach.AssetID, attachmentPt, agentId, e.Message, e.StackTrace); 371 attach.ItemID, attach.AssetID, attachmentPt, agentId, e.Message, e.StackTrace);
372 } 372 }
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
index d56e469..5a8544e 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
@@ -421,7 +421,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
421 item.CreatorId = ospResolvedId.ToString(); 421 item.CreatorId = ospResolvedId.ToString();
422 item.CreatorData = string.Empty; 422 item.CreatorData = string.Empty;
423 } 423 }
424 else if (item.CreatorData == null || item.CreatorData == String.Empty) 424 else if (string.IsNullOrEmpty(item.CreatorData))
425 { 425 {
426 item.CreatorId = m_userInfo.PrincipalID.ToString(); 426 item.CreatorId = m_userInfo.PrincipalID.ToString();
427// item.CreatorIdAsUuid = new UUID(item.CreatorId); 427// item.CreatorIdAsUuid = new UUID(item.CreatorId);
@@ -522,7 +522,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
522 522
523 foreach (SceneObjectGroup sog in sceneObjects) 523 foreach (SceneObjectGroup sog in sceneObjects)
524 foreach (SceneObjectPart sop in sog.Parts) 524 foreach (SceneObjectPart sop in sog.Parts)
525 if (sop.CreatorData == null || sop.CreatorData == "") 525 if (string.IsNullOrEmpty(sop.CreatorData))
526 sop.CreatorID = m_creatorIdForAssetId[assetId]; 526 sop.CreatorID = m_creatorIdForAssetId[assetId];
527 527
528 if (coa != null) 528 if (coa != null)
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs
index 144895c..b7a4d1a 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs
@@ -174,7 +174,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
174 174
175 private void AdjustIdentifiers(AssetMetadata meta) 175 private void AdjustIdentifiers(AssetMetadata meta)
176 { 176 {
177 if (meta.CreatorID != null && meta.CreatorID != string.Empty) 177 if (!string.IsNullOrEmpty(meta.CreatorID))
178 { 178 {
179 UUID uuid = UUID.Zero; 179 UUID uuid = UUID.Zero;
180 UUID.TryParse(meta.CreatorID, out uuid); 180 UUID.TryParse(meta.CreatorID, out uuid);
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
index d3926cc..3fb5195 100644
--- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
@@ -466,7 +466,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
466 return userdata.ServerURLs[serverType].ToString(); 466 return userdata.ServerURLs[serverType].ToString();
467 } 467 }
468 468
469 if (userdata.HomeURL != null && userdata.HomeURL != string.Empty) 469 if (!string.IsNullOrEmpty(userdata.HomeURL))
470 { 470 {
471 //m_log.DebugFormat( 471 //m_log.DebugFormat(
472 // "[USER MANAGEMENT MODULE]: Did not find url type {0} so requesting urls from '{1}' for {2}", 472 // "[USER MANAGEMENT MODULE]: Did not find url type {0} so requesting urls from '{1}' for {2}",
@@ -552,7 +552,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
552 552
553 if (oldUser != null) 553 if (oldUser != null)
554 { 554 {
555 if (creatorData == null || creatorData == String.Empty) 555 if (string.IsNullOrEmpty(creatorData))
556 { 556 {
557 //ignore updates without creator data 557 //ignore updates without creator data
558 return; 558 return;
diff --git a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs
index 6eb25ef..5541063 100644
--- a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs
+++ b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs
@@ -500,9 +500,9 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
500 Request.Headers.Add(HttpCustomHeaders[i], 500 Request.Headers.Add(HttpCustomHeaders[i],
501 HttpCustomHeaders[i+1]); 501 HttpCustomHeaders[i+1]);
502 } 502 }
503 if (proxyurl != null && proxyurl.Length > 0) 503 if (!string.IsNullOrEmpty(proxyurl))
504 { 504 {
505 if (proxyexcepts != null && proxyexcepts.Length > 0) 505 if (!string.IsNullOrEmpty(proxyexcepts))
506 { 506 {
507 string[] elist = proxyexcepts.Split(';'); 507 string[] elist = proxyexcepts.Split(';');
508 Request.Proxy = new WebProxy(proxyurl, true, elist); 508 Request.Proxy = new WebProxy(proxyurl, true, elist);
@@ -520,7 +520,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
520 Request.Headers[entry.Key] = entry.Value; 520 Request.Headers[entry.Key] = entry.Value;
521 521
522 // Encode outbound data 522 // Encode outbound data
523 if (OutboundBody.Length > 0) 523 if (!string.IsNullOrEmpty(OutboundBody))
524 { 524 {
525 byte[] data = Util.UTF8.GetBytes(OutboundBody); 525 byte[] data = Util.UTF8.GetBytes(OutboundBody);
526 526
diff --git a/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs b/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs
index 65737fa..baf9f2f 100644
--- a/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs
@@ -161,9 +161,9 @@ namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL
161 { 161 {
162 WebRequest request = HttpWebRequest.Create(url); 162 WebRequest request = HttpWebRequest.Create(url);
163 163
164 if (m_proxyurl != null && m_proxyurl.Length > 0) 164 if (!string.IsNullOrEmpty(m_proxyurl))
165 { 165 {
166 if (m_proxyexcepts != null && m_proxyexcepts.Length > 0) 166 if (!string.IsNullOrEmpty(m_proxyexcepts))
167 { 167 {
168 string[] elist = m_proxyexcepts.Split(';'); 168 string[] elist = m_proxyexcepts.Split(';');
169 request.Proxy = new WebProxy(m_proxyurl, true, elist); 169 request.Proxy = new WebProxy(m_proxyurl, true, elist);
diff --git a/OpenSim/Region/CoreModules/Scripting/VectorRender/Tests/VectorRenderModuleTests.cs b/OpenSim/Region/CoreModules/Scripting/VectorRender/Tests/VectorRenderModuleTests.cs
index 41baccc..7119137 100644
--- a/OpenSim/Region/CoreModules/Scripting/VectorRender/Tests/VectorRenderModuleTests.cs
+++ b/OpenSim/Region/CoreModules/Scripting/VectorRender/Tests/VectorRenderModuleTests.cs
@@ -152,7 +152,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender.Tests
152 TestHelpers.InMethod(); 152 TestHelpers.InMethod();
153 153
154 string dtText 154 string dtText
155 = "PenColour BLACK; MoveTo 40,220; FontSize 32; Text Hello World; Image http://localhost/shouldnotexist.png"; 155 = "PenColour BLACK; MoveTo 40,220; FontSize 32; Text Hello World; Image http://0.0.0.0/shouldnotexist.png";
156 156
157 SetupScene(false); 157 SetupScene(false);
158 SceneObjectGroup so = SceneHelpers.AddSceneObject(m_scene); 158 SceneObjectGroup so = SceneHelpers.AddSceneObject(m_scene);
@@ -307,7 +307,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender.Tests
307 TestHelpers.InMethod(); 307 TestHelpers.InMethod();
308 308
309 string dtText 309 string dtText
310 = "PenColour BLACK; MoveTo 40,220; FontSize 32; Text Hello World; Image http://localhost/shouldnotexist.png"; 310 = "PenColour BLACK; MoveTo 40,220; FontSize 32; Text Hello World; Image http://0.0.0.0/shouldnotexist.png";
311 311
312 SetupScene(true); 312 SetupScene(true);
313 SceneObjectGroup so = SceneHelpers.AddSceneObject(m_scene); 313 SceneObjectGroup so = SceneHelpers.AddSceneObject(m_scene);
diff --git a/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs b/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs
index cbffca7..c6e05b1 100644
--- a/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs
@@ -677,7 +677,7 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC
677 // if not, use as method name 677 // if not, use as method name
678 UUID parseUID; 678 UUID parseUID;
679 string mName = "llRemoteData"; 679 string mName = "llRemoteData";
680 if ((Channel != null) && (Channel != "")) 680 if (!string.IsNullOrEmpty(Channel))
681 if (!UUID.TryParse(Channel, out parseUID)) 681 if (!UUID.TryParse(Channel, out parseUID))
682 mName = Channel; 682 mName = Channel;
683 else 683 else
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
index 58576d1..77a3c82 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
@@ -259,7 +259,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
259 if (sp == null) 259 if (sp == null)
260 { 260 {
261 inventoryURL = UserManagementModule.GetUserServerURL(userID, "InventoryServerURI"); 261 inventoryURL = UserManagementModule.GetUserServerURL(userID, "InventoryServerURI");
262 if (inventoryURL != null && inventoryURL != string.Empty) 262 if (!string.IsNullOrEmpty(inventoryURL))
263 { 263 {
264 inventoryURL = inventoryURL.Trim(new char[] { '/' }); 264 inventoryURL = inventoryURL.Trim(new char[] { '/' });
265 m_InventoryURLs.Add(userID, inventoryURL); 265 m_InventoryURLs.Add(userID, inventoryURL);
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
index fcfdf7c..efc4998 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
@@ -464,7 +464,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
464 // or creator data is present. Otherwise, use the estate owner instead. 464 // or creator data is present. Otherwise, use the estate owner instead.
465 foreach (SceneObjectPart part in sceneObject.Parts) 465 foreach (SceneObjectPart part in sceneObject.Parts)
466 { 466 {
467 if (part.CreatorData == null || part.CreatorData == string.Empty) 467 if (string.IsNullOrEmpty(part.CreatorData))
468 { 468 {
469 if (!ResolveUserUuid(scene, part.CreatorID)) 469 if (!ResolveUserUuid(scene, part.CreatorID))
470 part.CreatorID = scene.RegionInfo.EstateSettings.EstateOwner; 470 part.CreatorID = scene.RegionInfo.EstateSettings.EstateOwner;
@@ -515,7 +515,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
515 kvp.Value.OwnerID = scene.RegionInfo.EstateSettings.EstateOwner; 515 kvp.Value.OwnerID = scene.RegionInfo.EstateSettings.EstateOwner;
516 } 516 }
517 517
518 if (kvp.Value.CreatorData == null || kvp.Value.CreatorData == string.Empty) 518 if (string.IsNullOrEmpty(kvp.Value.CreatorData))
519 { 519 {
520 if (!ResolveUserUuid(scene, kvp.Value.CreatorID)) 520 if (!ResolveUserUuid(scene, kvp.Value.CreatorID))
521 kvp.Value.CreatorID = scene.RegionInfo.EstateSettings.EstateOwner; 521 kvp.Value.CreatorID = scene.RegionInfo.EstateSettings.EstateOwner;
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
index dbc9296..399e9b0 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
@@ -42,7 +42,6 @@ using OpenSim.Framework.Capabilities;
42using OpenSim.Framework.Console; 42using OpenSim.Framework.Console;
43using OpenSim.Framework.Servers; 43using OpenSim.Framework.Servers;
44using OpenSim.Framework.Servers.HttpServer; 44using OpenSim.Framework.Servers.HttpServer;
45using OpenSim.Region.CoreModules.Framework.InterfaceCommander;
46using OpenSim.Region.Framework.Interfaces; 45using OpenSim.Region.Framework.Interfaces;
47using OpenSim.Region.Framework.Scenes; 46using OpenSim.Region.Framework.Scenes;
48using OpenSim.Region.Physics.Manager; 47using OpenSim.Region.Physics.Manager;
@@ -70,7 +69,6 @@ namespace OpenSim.Region.CoreModules.World.Land
70 69
71 private LandChannel landChannel; 70 private LandChannel landChannel;
72 private Scene m_scene; 71 private Scene m_scene;
73 protected Commander m_commander = new Commander("land");
74 72
75 protected IUserManagement m_userManager; 73 protected IUserManagement m_userManager;
76 protected IPrimCountModule m_primCountModule; 74 protected IPrimCountModule m_primCountModule;
@@ -148,14 +146,13 @@ namespace OpenSim.Region.CoreModules.World.Land
148 m_scene.EventManager.OnIncomingLandDataFromStorage += EventManagerOnIncomingLandDataFromStorage; 146 m_scene.EventManager.OnIncomingLandDataFromStorage += EventManagerOnIncomingLandDataFromStorage;
149 m_scene.EventManager.OnSetAllowForcefulBan += EventManagerOnSetAllowedForcefulBan; 147 m_scene.EventManager.OnSetAllowForcefulBan += EventManagerOnSetAllowedForcefulBan;
150 m_scene.EventManager.OnRegisterCaps += EventManagerOnRegisterCaps; 148 m_scene.EventManager.OnRegisterCaps += EventManagerOnRegisterCaps;
151 m_scene.EventManager.OnPluginConsole += EventManagerOnPluginConsole;
152 149
153 lock (m_scene) 150 lock (m_scene)
154 { 151 {
155 m_scene.LandChannel = (ILandChannel)landChannel; 152 m_scene.LandChannel = (ILandChannel)landChannel;
156 } 153 }
157 154
158 InstallInterfaces(); 155 RegisterCommands();
159 } 156 }
160 157
161 public void RegionLoaded(Scene scene) 158 public void RegionLoaded(Scene scene)
@@ -167,34 +164,15 @@ namespace OpenSim.Region.CoreModules.World.Land
167 164
168 public void RemoveRegion(Scene scene) 165 public void RemoveRegion(Scene scene)
169 { 166 {
170 // TODO: Also release other event manager listeners here 167 // TODO: Release event manager listeners here
171
172 m_scene.EventManager.OnPluginConsole -= EventManagerOnPluginConsole;
173 m_scene.UnregisterModuleCommander(m_commander.Name);
174 } 168 }
175 169
176 /// <summary> 170// private bool OnVerifyUserConnection(ScenePresence scenePresence, out string reason)
177 /// Processes commandline input. Do not call directly. 171// {
178 /// </summary> 172// ILandObject nearestParcel = m_scene.GetNearestAllowedParcel(scenePresence.UUID, scenePresence.AbsolutePosition.X, scenePresence.AbsolutePosition.Y);
179 /// <param name="args">Commandline arguments</param> 173// reason = "You are not allowed to enter this sim.";
180 protected void EventManagerOnPluginConsole(string[] args) 174// return nearestParcel != null;
181 { 175// }
182 if (args[0] == "land")
183 {
184 if (args.Length == 1)
185 {
186 m_commander.ProcessConsoleCommand("help", new string[0]);
187 return;
188 }
189
190 string[] tmpArgs = new string[args.Length - 2];
191 int i;
192 for (i = 2; i < args.Length; i++)
193 tmpArgs[i - 2] = args[i];
194
195 m_commander.ProcessConsoleCommand(args[1], tmpArgs);
196 }
197 }
198 176
199 void EventManagerOnNewClient(IClientAPI client) 177 void EventManagerOnNewClient(IClientAPI client)
200 { 178 {
@@ -1946,43 +1924,84 @@ namespace OpenSim.Region.CoreModules.World.Land
1946 m_Dialog.SendAlertToUser(remoteClient, "You are not allowed to set your home location in this parcel."); 1924 m_Dialog.SendAlertToUser(remoteClient, "You are not allowed to set your home location in this parcel.");
1947 } 1925 }
1948 1926
1949 protected void InstallInterfaces() 1927 protected void RegisterCommands()
1950 { 1928 {
1951 Command clearCommand 1929 ICommands commands = MainConsole.Instance.Commands;
1952 = new Command("clear", CommandIntentions.COMMAND_HAZARDOUS, ClearCommand, "Clears all the parcels from the region.");
1953 Command showCommand
1954 = new Command("show", CommandIntentions.COMMAND_STATISTICAL, ShowParcelsCommand, "Shows all parcels on the region.");
1955 1930
1956 m_commander.RegisterCommand("clear", clearCommand); 1931 commands.AddCommand(
1957 m_commander.RegisterCommand("show", showCommand); 1932 "Land", false, "land clear",
1933 "land clear",
1934 "Clear all the parcels from the region.",
1935 "Command will ask for confirmation before proceeding.",
1936 HandleClearCommand);
1958 1937
1959 // Add this to our scene so scripts can call these functions 1938 commands.AddCommand(
1960 m_scene.RegisterModuleCommander(m_commander); 1939 "Land", false, "land show",
1940 "land show [<local-land-id>]",
1941 "Show information about the parcels on the region.",
1942 "If no local land ID is given, then summary information about all the parcels is shown.\n"
1943 + "If a local land ID is given then full information about that parcel is shown.",
1944 HandleShowCommand);
1961 } 1945 }
1962 1946
1963 protected void ClearCommand(Object[] args) 1947 protected void HandleClearCommand(string module, string[] args)
1964 { 1948 {
1949 if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_scene))
1950 return;
1951
1965 string response = MainConsole.Instance.CmdPrompt( 1952 string response = MainConsole.Instance.CmdPrompt(
1966 string.Format( 1953 string.Format(
1967 "Are you sure that you want to clear all land parcels from {0} (y or n)", 1954 "Are you sure that you want to clear all land parcels from {0} (y or n)", m_scene.Name),
1968 m_scene.RegionInfo.RegionName),
1969 "n"); 1955 "n");
1970 1956
1971 if (response.ToLower() == "y") 1957 if (response.ToLower() == "y")
1972 { 1958 {
1973 Clear(true); 1959 Clear(true);
1974 MainConsole.Instance.OutputFormat("Cleared all parcels from {0}", m_scene.RegionInfo.RegionName); 1960 MainConsole.Instance.OutputFormat("Cleared all parcels from {0}", m_scene.Name);
1975 } 1961 }
1976 else 1962 else
1977 { 1963 {
1978 MainConsole.Instance.OutputFormat("Aborting clear of all parcels from {0}", m_scene.RegionInfo.RegionName); 1964 MainConsole.Instance.OutputFormat("Aborting clear of all parcels from {0}", m_scene.Name);
1979 } 1965 }
1980 } 1966 }
1981 1967
1982 protected void ShowParcelsCommand(Object[] args) 1968 protected void HandleShowCommand(string module, string[] args)
1983 { 1969 {
1984 StringBuilder report = new StringBuilder(); 1970 if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_scene))
1985 1971 return;
1972
1973 StringBuilder report = new StringBuilder();
1974
1975 if (args.Length <= 2)
1976 {
1977 AppendParcelsSummaryReport(report);
1978 }
1979 else
1980 {
1981 int landLocalId;
1982
1983 if (!ConsoleUtil.TryParseConsoleInt(MainConsole.Instance, args[2], out landLocalId))
1984 return;
1985
1986 ILandObject lo;
1987
1988 lock (m_landList)
1989 {
1990 if (!m_landList.TryGetValue(landLocalId, out lo))
1991 {
1992 MainConsole.Instance.OutputFormat("No parcel found with local ID {0}", landLocalId);
1993 return;
1994 }
1995 }
1996
1997 AppendParcelReport(report, lo);
1998 }
1999
2000 MainConsole.Instance.Output(report.ToString());
2001 }
2002
2003 private void AppendParcelsSummaryReport(StringBuilder report)
2004 {
1986 report.AppendFormat("Land information for {0}\n", m_scene.RegionInfo.RegionName); 2005 report.AppendFormat("Land information for {0}\n", m_scene.RegionInfo.RegionName);
1987 report.AppendFormat( 2006 report.AppendFormat(
1988 "{0,-20} {1,-10} {2,-9} {3,-18} {4,-18} {5,-20}\n", 2007 "{0,-20} {1,-10} {2,-9} {3,-18} {4,-18} {5,-20}\n",
@@ -2028,6 +2047,69 @@ namespace OpenSim.Region.CoreModules.World.Land
2028 ForceAvatarToPosition(avatar, avatar.lastKnownAllowedPosition); 2047 ForceAvatarToPosition(avatar, avatar.lastKnownAllowedPosition);
2029 } 2048 }
2030 } 2049 }
2050 }
2051
2052 private void AppendParcelReport(StringBuilder report, ILandObject lo)
2053 {
2054 LandData ld = lo.LandData;
2055
2056 ConsoleDisplayList cdl = new ConsoleDisplayList();
2057 cdl.AddRow("Parcel name", ld.Name);
2058 cdl.AddRow("Local ID", ld.LocalID);
2059 cdl.AddRow("Description", ld.Description);
2060 cdl.AddRow("Snapshot ID", ld.SnapshotID);
2061 cdl.AddRow("Area", ld.Area);
2062 cdl.AddRow("Starts", lo.StartPoint);
2063 cdl.AddRow("Ends", lo.EndPoint);
2064 cdl.AddRow("AABB Min", ld.AABBMin);
2065 cdl.AddRow("AABB Max", ld.AABBMax);
2066
2067 cdl.AddRow("Owner", m_userManager.GetUserName(ld.OwnerID));
2068 cdl.AddRow("Is group owned?", ld.IsGroupOwned);
2069 cdl.AddRow("GroupID", ld.GroupID);
2070
2071 cdl.AddRow("Status", ld.Status);
2072 cdl.AddRow("Flags", (ParcelFlags)ld.Flags);
2073
2074 cdl.AddRow("Landing Type", (LandingType)ld.LandingType);
2075 cdl.AddRow("User Location", ld.UserLocation);
2076 cdl.AddRow("User look at", ld.UserLookAt);
2077
2078 cdl.AddRow("Other clean time", ld.OtherCleanTime);
2079
2080 cdl.AddRow("Max Prims", lo.GetParcelMaxPrimCount());
2081 IPrimCounts pc = lo.PrimCounts;
2082 cdl.AddRow("Owner Prims", pc.Owner);
2083 cdl.AddRow("Group Prims", pc.Group);
2084 cdl.AddRow("Other Prims", pc.Others);
2085 cdl.AddRow("Selected Prims", pc.Selected);
2086 cdl.AddRow("Total Prims", pc.Total);
2087
2088 cdl.AddRow("Music URL", ld.MusicURL);
2089 cdl.AddRow("Obscure Music", ld.ObscureMusic);
2090
2091 cdl.AddRow("Media ID", ld.MediaID);
2092 cdl.AddRow("Media Autoscale", Convert.ToBoolean(ld.MediaAutoScale));
2093 cdl.AddRow("Media URL", ld.MediaURL);
2094 cdl.AddRow("Media Type", ld.MediaType);
2095 cdl.AddRow("Media Description", ld.MediaDescription);
2096 cdl.AddRow("Media Width", ld.MediaWidth);
2097 cdl.AddRow("Media Height", ld.MediaHeight);
2098 cdl.AddRow("Media Loop", ld.MediaLoop);
2099 cdl.AddRow("Obscure Media", ld.ObscureMedia);
2100
2101 cdl.AddRow("Parcel Category", ld.Category);
2102
2103 cdl.AddRow("Claim Date", ld.ClaimDate);
2104 cdl.AddRow("Claim Price", ld.ClaimPrice);
2105 cdl.AddRow("Pass Hours", ld.PassHours);
2106 cdl.AddRow("Pass Price", ld.PassPrice);
2107
2108 cdl.AddRow("Auction ID", ld.AuctionID);
2109 cdl.AddRow("Authorized Buyer ID", ld.AuthBuyerID);
2110 cdl.AddRow("Sale Price", ld.SalePrice);
2111
2112 cdl.AddToStringBuilder(report);
2031 } 2113 }
2032 } 2114 }
2033} 2115}