diff options
author | Robert Adams | 2013-11-15 14:56:13 -0800 |
---|---|---|
committer | Robert Adams | 2013-11-15 14:56:13 -0800 |
commit | 604b39cea908029c80aa8ee5ff3aee5c8000c0e4 (patch) | |
tree | bea875d6651531a030630e161b658c74d3aaf357 /OpenSim/Region | |
parent | Merge branch 'master' into varregion (diff) | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC_OLD-604b39cea908029c80aa8ee5ff3aee5c8000c0e4.zip opensim-SC_OLD-604b39cea908029c80aa8ee5ff3aee5c8000c0e4.tar.gz opensim-SC_OLD-604b39cea908029c80aa8ee5ff3aee5c8000c0e4.tar.bz2 opensim-SC_OLD-604b39cea908029c80aa8ee5ff3aee5c8000c0e4.tar.xz |
Merge branch 'master' into varregion
Diffstat (limited to 'OpenSim/Region')
19 files changed, 156 insertions, 86 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 70d7ee9..7e7f42e 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -909,7 +909,7 @@ namespace OpenSim | |||
909 | regInfo.EstateSettings = EstateDataService.LoadEstateSettings(regInfo.RegionID, true); | 909 | regInfo.EstateSettings = EstateDataService.LoadEstateSettings(regInfo.RegionID, true); |
910 | 910 | ||
911 | string newName; | 911 | string newName; |
912 | if (estateName != null && estateName != "") | 912 | if (!string.IsNullOrEmpty(estateName)) |
913 | newName = estateName; | 913 | newName = estateName; |
914 | else | 914 | else |
915 | newName = MainConsole.Instance.CmdPrompt("New estate name", regInfo.EstateSettings.EstateName); | 915 | newName = MainConsole.Instance.CmdPrompt("New estate name", regInfo.EstateSettings.EstateName); |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index 31c42d8..f7057fe 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 1a62405..c3a8afd 100644 --- a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs +++ b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs | |||
@@ -460,9 +460,9 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest | |||
460 | Request.Headers.Add(HttpCustomHeaders[i], | 460 | Request.Headers.Add(HttpCustomHeaders[i], |
461 | HttpCustomHeaders[i+1]); | 461 | HttpCustomHeaders[i+1]); |
462 | } | 462 | } |
463 | if (proxyurl != null && proxyurl.Length > 0) | 463 | if (!string.IsNullOrEmpty(proxyurl)) |
464 | { | 464 | { |
465 | if (proxyexcepts != null && proxyexcepts.Length > 0) | 465 | if (!string.IsNullOrEmpty(proxyexcepts)) |
466 | { | 466 | { |
467 | string[] elist = proxyexcepts.Split(';'); | 467 | string[] elist = proxyexcepts.Split(';'); |
468 | Request.Proxy = new WebProxy(proxyurl, true, elist); | 468 | Request.Proxy = new WebProxy(proxyurl, true, elist); |
@@ -483,7 +483,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest | |||
483 | } | 483 | } |
484 | 484 | ||
485 | // Encode outbound data | 485 | // Encode outbound data |
486 | if (OutboundBody != null && OutboundBody.Length > 0) | 486 | if (!string.IsNullOrEmpty(OutboundBody)) |
487 | { | 487 | { |
488 | byte[] data = Util.UTF8.GetBytes(OutboundBody); | 488 | byte[] data = Util.UTF8.GetBytes(OutboundBody); |
489 | 489 | ||
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/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 32d245f..d451b9e 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; |
@@ -498,7 +498,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
498 | kvp.Value.OwnerID = scene.RegionInfo.EstateSettings.EstateOwner; | 498 | kvp.Value.OwnerID = scene.RegionInfo.EstateSettings.EstateOwner; |
499 | } | 499 | } |
500 | 500 | ||
501 | if (kvp.Value.CreatorData == null || kvp.Value.CreatorData == string.Empty) | 501 | if (string.IsNullOrEmpty(kvp.Value.CreatorData)) |
502 | { | 502 | { |
503 | if (!ResolveUserUuid(scene, kvp.Value.CreatorID)) | 503 | if (!ResolveUserUuid(scene, kvp.Value.CreatorID)) |
504 | kvp.Value.CreatorID = scene.RegionInfo.EstateSettings.EstateOwner; | 504 | 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 5b98d97..092dfa3 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; | |||
42 | using OpenSim.Framework.Console; | 42 | using OpenSim.Framework.Console; |
43 | using OpenSim.Framework.Servers; | 43 | using OpenSim.Framework.Servers; |
44 | using OpenSim.Framework.Servers.HttpServer; | 44 | using OpenSim.Framework.Servers.HttpServer; |
45 | using OpenSim.Region.CoreModules.Framework.InterfaceCommander; | ||
46 | using OpenSim.Region.Framework.Interfaces; | 45 | using OpenSim.Region.Framework.Interfaces; |
47 | using OpenSim.Region.Framework.Scenes; | 46 | using OpenSim.Region.Framework.Scenes; |
48 | using OpenSim.Region.Physics.Manager; | 47 | using OpenSim.Region.Physics.Manager; |
@@ -71,7 +70,6 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
71 | 70 | ||
72 | private LandChannel landChannel; | 71 | private LandChannel landChannel; |
73 | private Scene m_scene; | 72 | private Scene m_scene; |
74 | protected Commander m_commander = new Commander("land"); | ||
75 | 73 | ||
76 | protected IUserManagement m_userManager; | 74 | protected IUserManagement m_userManager; |
77 | protected IPrimCountModule m_primCountModule; | 75 | protected IPrimCountModule m_primCountModule; |
@@ -139,14 +137,13 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
139 | m_scene.EventManager.OnIncomingLandDataFromStorage += EventManagerOnIncomingLandDataFromStorage; | 137 | m_scene.EventManager.OnIncomingLandDataFromStorage += EventManagerOnIncomingLandDataFromStorage; |
140 | m_scene.EventManager.OnSetAllowForcefulBan += EventManagerOnSetAllowedForcefulBan; | 138 | m_scene.EventManager.OnSetAllowForcefulBan += EventManagerOnSetAllowedForcefulBan; |
141 | m_scene.EventManager.OnRegisterCaps += EventManagerOnRegisterCaps; | 139 | m_scene.EventManager.OnRegisterCaps += EventManagerOnRegisterCaps; |
142 | m_scene.EventManager.OnPluginConsole += EventManagerOnPluginConsole; | ||
143 | 140 | ||
144 | lock (m_scene) | 141 | lock (m_scene) |
145 | { | 142 | { |
146 | m_scene.LandChannel = (ILandChannel)landChannel; | 143 | m_scene.LandChannel = (ILandChannel)landChannel; |
147 | } | 144 | } |
148 | 145 | ||
149 | InstallInterfaces(); | 146 | RegisterCommands(); |
150 | } | 147 | } |
151 | 148 | ||
152 | public void RegionLoaded(Scene scene) | 149 | public void RegionLoaded(Scene scene) |
@@ -158,10 +155,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
158 | 155 | ||
159 | public void RemoveRegion(Scene scene) | 156 | public void RemoveRegion(Scene scene) |
160 | { | 157 | { |
161 | // TODO: Also release other event manager listeners here | 158 | // TODO: Release event manager listeners here |
162 | |||
163 | m_scene.EventManager.OnPluginConsole -= EventManagerOnPluginConsole; | ||
164 | m_scene.UnregisterModuleCommander(m_commander.Name); | ||
165 | } | 159 | } |
166 | 160 | ||
167 | // private bool OnVerifyUserConnection(ScenePresence scenePresence, out string reason) | 161 | // private bool OnVerifyUserConnection(ScenePresence scenePresence, out string reason) |
@@ -169,30 +163,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
169 | // ILandObject nearestParcel = m_scene.GetNearestAllowedParcel(scenePresence.UUID, scenePresence.AbsolutePosition.X, scenePresence.AbsolutePosition.Y); | 163 | // ILandObject nearestParcel = m_scene.GetNearestAllowedParcel(scenePresence.UUID, scenePresence.AbsolutePosition.X, scenePresence.AbsolutePosition.Y); |
170 | // reason = "You are not allowed to enter this sim."; | 164 | // reason = "You are not allowed to enter this sim."; |
171 | // return nearestParcel != null; | 165 | // return nearestParcel != null; |
172 | // } | 166 | // } |
173 | |||
174 | /// <summary> | ||
175 | /// Processes commandline input. Do not call directly. | ||
176 | /// </summary> | ||
177 | /// <param name="args">Commandline arguments</param> | ||
178 | protected void EventManagerOnPluginConsole(string[] args) | ||
179 | { | ||
180 | if (args[0] == "land") | ||
181 | { | ||
182 | if (args.Length == 1) | ||
183 | { | ||
184 | m_commander.ProcessConsoleCommand("help", new string[0]); | ||
185 | return; | ||
186 | } | ||
187 | |||
188 | string[] tmpArgs = new string[args.Length - 2]; | ||
189 | int i; | ||
190 | for (i = 2; i < args.Length; i++) | ||
191 | tmpArgs[i - 2] = args[i]; | ||
192 | |||
193 | m_commander.ProcessConsoleCommand(args[1], tmpArgs); | ||
194 | } | ||
195 | } | ||
196 | 167 | ||
197 | void EventManagerOnNewClient(IClientAPI client) | 168 | void EventManagerOnNewClient(IClientAPI client) |
198 | { | 169 | { |
@@ -1982,44 +1953,84 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1982 | m_Dialog.SendAlertToUser(remoteClient, "You are not allowed to set your home location in this parcel."); | 1953 | m_Dialog.SendAlertToUser(remoteClient, "You are not allowed to set your home location in this parcel."); |
1983 | } | 1954 | } |
1984 | 1955 | ||
1985 | 1956 | protected void RegisterCommands() | |
1986 | protected void InstallInterfaces() | ||
1987 | { | 1957 | { |
1988 | Command clearCommand | 1958 | ICommands commands = MainConsole.Instance.Commands; |
1989 | = new Command("clear", CommandIntentions.COMMAND_HAZARDOUS, ClearCommand, "Clears all the parcels from the region."); | ||
1990 | Command showCommand | ||
1991 | = new Command("show", CommandIntentions.COMMAND_STATISTICAL, ShowParcelsCommand, "Shows all parcels on the region."); | ||
1992 | 1959 | ||
1993 | m_commander.RegisterCommand("clear", clearCommand); | 1960 | commands.AddCommand( |
1994 | m_commander.RegisterCommand("show", showCommand); | 1961 | "Land", false, "land clear", |
1962 | "land clear", | ||
1963 | "Clear all the parcels from the region.", | ||
1964 | "Command will ask for confirmation before proceeding.", | ||
1965 | HandleClearCommand); | ||
1995 | 1966 | ||
1996 | // Add this to our scene so scripts can call these functions | 1967 | commands.AddCommand( |
1997 | m_scene.RegisterModuleCommander(m_commander); | 1968 | "Land", false, "land show", |
1969 | "land show [<local-land-id>]", | ||
1970 | "Show information about the parcels on the region.", | ||
1971 | "If no local land ID is given, then summary information about all the parcels is shown.\n" | ||
1972 | + "If a local land ID is given then full information about that parcel is shown.", | ||
1973 | HandleShowCommand); | ||
1998 | } | 1974 | } |
1999 | 1975 | ||
2000 | protected void ClearCommand(Object[] args) | 1976 | protected void HandleClearCommand(string module, string[] args) |
2001 | { | 1977 | { |
1978 | if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_scene)) | ||
1979 | return; | ||
1980 | |||
2002 | string response = MainConsole.Instance.CmdPrompt( | 1981 | string response = MainConsole.Instance.CmdPrompt( |
2003 | string.Format( | 1982 | string.Format( |
2004 | "Are you sure that you want to clear all land parcels from {0} (y or n)", | 1983 | "Are you sure that you want to clear all land parcels from {0} (y or n)", m_scene.Name), |
2005 | m_scene.RegionInfo.RegionName), | ||
2006 | "n"); | 1984 | "n"); |
2007 | 1985 | ||
2008 | if (response.ToLower() == "y") | 1986 | if (response.ToLower() == "y") |
2009 | { | 1987 | { |
2010 | Clear(true); | 1988 | Clear(true); |
2011 | MainConsole.Instance.OutputFormat("Cleared all parcels from {0}", m_scene.RegionInfo.RegionName); | 1989 | MainConsole.Instance.OutputFormat("Cleared all parcels from {0}", m_scene.Name); |
2012 | } | 1990 | } |
2013 | else | 1991 | else |
2014 | { | 1992 | { |
2015 | MainConsole.Instance.OutputFormat("Aborting clear of all parcels from {0}", m_scene.RegionInfo.RegionName); | 1993 | MainConsole.Instance.OutputFormat("Aborting clear of all parcels from {0}", m_scene.Name); |
2016 | } | 1994 | } |
2017 | } | 1995 | } |
2018 | 1996 | ||
2019 | protected void ShowParcelsCommand(Object[] args) | 1997 | protected void HandleShowCommand(string module, string[] args) |
2020 | { | 1998 | { |
2021 | StringBuilder report = new StringBuilder(); | 1999 | if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_scene)) |
2022 | 2000 | return; | |
2001 | |||
2002 | StringBuilder report = new StringBuilder(); | ||
2003 | |||
2004 | if (args.Length <= 2) | ||
2005 | { | ||
2006 | AppendParcelsSummaryReport(report); | ||
2007 | } | ||
2008 | else | ||
2009 | { | ||
2010 | int landLocalId; | ||
2011 | |||
2012 | if (!ConsoleUtil.TryParseConsoleInt(MainConsole.Instance, args[2], out landLocalId)) | ||
2013 | return; | ||
2014 | |||
2015 | ILandObject lo; | ||
2016 | |||
2017 | lock (m_landList) | ||
2018 | { | ||
2019 | if (!m_landList.TryGetValue(landLocalId, out lo)) | ||
2020 | { | ||
2021 | MainConsole.Instance.OutputFormat("No parcel found with local ID {0}", landLocalId); | ||
2022 | return; | ||
2023 | } | ||
2024 | } | ||
2025 | |||
2026 | AppendParcelReport(report, lo); | ||
2027 | } | ||
2028 | |||
2029 | MainConsole.Instance.Output(report.ToString()); | ||
2030 | } | ||
2031 | |||
2032 | private void AppendParcelsSummaryReport(StringBuilder report) | ||
2033 | { | ||
2023 | report.AppendFormat("Land information for {0}\n", m_scene.RegionInfo.RegionName); | 2034 | report.AppendFormat("Land information for {0}\n", m_scene.RegionInfo.RegionName); |
2024 | report.AppendFormat( | 2035 | report.AppendFormat( |
2025 | "{0,-20} {1,-10} {2,-9} {3,-18} {4,-18} {5,-20}\n", | 2036 | "{0,-20} {1,-10} {2,-9} {3,-18} {4,-18} {5,-20}\n", |
@@ -2041,8 +2052,69 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
2041 | ld.Name, ld.LocalID, ld.Area, lo.StartPoint, lo.EndPoint, m_userManager.GetUserName(ld.OwnerID)); | 2052 | ld.Name, ld.LocalID, ld.Area, lo.StartPoint, lo.EndPoint, m_userManager.GetUserName(ld.OwnerID)); |
2042 | } | 2053 | } |
2043 | } | 2054 | } |
2044 | 2055 | } | |
2045 | MainConsole.Instance.Output(report.ToString()); | 2056 | |
2046 | } | 2057 | private void AppendParcelReport(StringBuilder report, ILandObject lo) |
2058 | { | ||
2059 | LandData ld = lo.LandData; | ||
2060 | |||
2061 | ConsoleDisplayList cdl = new ConsoleDisplayList(); | ||
2062 | cdl.AddRow("Parcel name", ld.Name); | ||
2063 | cdl.AddRow("Local ID", ld.LocalID); | ||
2064 | cdl.AddRow("Description", ld.Description); | ||
2065 | cdl.AddRow("Snapshot ID", ld.SnapshotID); | ||
2066 | cdl.AddRow("Area", ld.Area); | ||
2067 | cdl.AddRow("Starts", lo.StartPoint); | ||
2068 | cdl.AddRow("Ends", lo.EndPoint); | ||
2069 | cdl.AddRow("AABB Min", ld.AABBMin); | ||
2070 | cdl.AddRow("AABB Max", ld.AABBMax); | ||
2071 | |||
2072 | cdl.AddRow("Owner", m_userManager.GetUserName(ld.OwnerID)); | ||
2073 | cdl.AddRow("Is group owned?", ld.IsGroupOwned); | ||
2074 | cdl.AddRow("GroupID", ld.GroupID); | ||
2075 | |||
2076 | cdl.AddRow("Status", ld.Status); | ||
2077 | cdl.AddRow("Flags", (ParcelFlags)ld.Flags); | ||
2078 | |||
2079 | cdl.AddRow("Landing Type", (LandingType)ld.LandingType); | ||
2080 | cdl.AddRow("User Location", ld.UserLocation); | ||
2081 | cdl.AddRow("User look at", ld.UserLookAt); | ||
2082 | |||
2083 | cdl.AddRow("Other clean time", ld.OtherCleanTime); | ||
2084 | |||
2085 | cdl.AddRow("Max Prims", lo.GetParcelMaxPrimCount()); | ||
2086 | IPrimCounts pc = lo.PrimCounts; | ||
2087 | cdl.AddRow("Owner Prims", pc.Owner); | ||
2088 | cdl.AddRow("Group Prims", pc.Group); | ||
2089 | cdl.AddRow("Other Prims", pc.Others); | ||
2090 | cdl.AddRow("Selected Prims", pc.Selected); | ||
2091 | cdl.AddRow("Total Prims", pc.Total); | ||
2092 | |||
2093 | cdl.AddRow("Music URL", ld.MusicURL); | ||
2094 | cdl.AddRow("Obscure Music", ld.ObscureMusic); | ||
2095 | |||
2096 | cdl.AddRow("Media ID", ld.MediaID); | ||
2097 | cdl.AddRow("Media Autoscale", Convert.ToBoolean(ld.MediaAutoScale)); | ||
2098 | cdl.AddRow("Media URL", ld.MediaURL); | ||
2099 | cdl.AddRow("Media Type", ld.MediaType); | ||
2100 | cdl.AddRow("Media Description", ld.MediaDescription); | ||
2101 | cdl.AddRow("Media Width", ld.MediaWidth); | ||
2102 | cdl.AddRow("Media Height", ld.MediaHeight); | ||
2103 | cdl.AddRow("Media Loop", ld.MediaLoop); | ||
2104 | cdl.AddRow("Obscure Media", ld.ObscureMedia); | ||
2105 | |||
2106 | cdl.AddRow("Parcel Category", ld.Category); | ||
2107 | |||
2108 | cdl.AddRow("Claim Date", ld.ClaimDate); | ||
2109 | cdl.AddRow("Claim Price", ld.ClaimPrice); | ||
2110 | cdl.AddRow("Pass Hours", ld.PassHours); | ||
2111 | cdl.AddRow("Pass Price", ld.PassPrice); | ||
2112 | |||
2113 | cdl.AddRow("Auction ID", ld.AuctionID); | ||
2114 | cdl.AddRow("Authorized Buyer ID", ld.AuthBuyerID); | ||
2115 | cdl.AddRow("Sale Price", ld.SalePrice); | ||
2116 | |||
2117 | cdl.AddToStringBuilder(report); | ||
2118 | } | ||
2047 | } | 2119 | } |
2048 | } | 2120 | } |
diff --git a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs index dd48dd5..0c0a7aa 100644 --- a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs +++ b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs | |||
@@ -307,7 +307,7 @@ namespace OpenSim.Region.DataSnapshot | |||
307 | XmlNode regiondata = requestedSnap.CreateNode(XmlNodeType.Element, "regiondata", ""); | 307 | XmlNode regiondata = requestedSnap.CreateNode(XmlNodeType.Element, "regiondata", ""); |
308 | try | 308 | try |
309 | { | 309 | { |
310 | if (regionName == null || regionName == "") | 310 | if (string.IsNullOrEmpty(regionName)) |
311 | { | 311 | { |
312 | XmlNode timerblock = requestedSnap.CreateNode(XmlNodeType.Element, "expire", ""); | 312 | XmlNode timerblock = requestedSnap.CreateNode(XmlNodeType.Element, "expire", ""); |
313 | timerblock.InnerText = m_period.ToString(); | 313 | timerblock.InnerText = m_period.ToString(); |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 9e6c25d..dcbb509 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -473,7 +473,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
473 | { | 473 | { |
474 | get | 474 | get |
475 | { | 475 | { |
476 | if (CreatorData != null && CreatorData != string.Empty) | 476 | if (!string.IsNullOrEmpty(CreatorData)) |
477 | return CreatorID.ToString() + ';' + CreatorData; | 477 | return CreatorID.ToString() + ';' + CreatorData; |
478 | else | 478 | else |
479 | return CreatorID.ToString(); | 479 | return CreatorID.ToString(); |
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index 3ea936c..f07dee9 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | |||
@@ -1223,7 +1223,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
1223 | 1223 | ||
1224 | WriteUUID(writer, "CreatorID", sop.CreatorID, options); | 1224 | WriteUUID(writer, "CreatorID", sop.CreatorID, options); |
1225 | 1225 | ||
1226 | if (sop.CreatorData != null && sop.CreatorData != string.Empty) | 1226 | if (!string.IsNullOrEmpty(sop.CreatorData)) |
1227 | writer.WriteElementString("CreatorData", sop.CreatorData); | 1227 | writer.WriteElementString("CreatorData", sop.CreatorData); |
1228 | else if (options.ContainsKey("home")) | 1228 | else if (options.ContainsKey("home")) |
1229 | { | 1229 | { |
@@ -1396,7 +1396,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
1396 | 1396 | ||
1397 | WriteUUID(writer, "CreatorID", item.CreatorID, options); | 1397 | WriteUUID(writer, "CreatorID", item.CreatorID, options); |
1398 | 1398 | ||
1399 | if (item.CreatorData != null && item.CreatorData != string.Empty) | 1399 | if (!string.IsNullOrEmpty(item.CreatorData)) |
1400 | writer.WriteElementString("CreatorData", item.CreatorData); | 1400 | writer.WriteElementString("CreatorData", item.CreatorData); |
1401 | else if (options.ContainsKey("home")) | 1401 | else if (options.ContainsKey("home")) |
1402 | { | 1402 | { |
diff --git a/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs b/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs index 5a37fad..b5d9fda 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs | |||
@@ -461,7 +461,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat | |||
461 | 461 | ||
462 | string result = instr; | 462 | string result = instr; |
463 | 463 | ||
464 | if (result == null || result.Length == 0) | 464 | if (string.IsNullOrEmpty(result)) |
465 | return result; | 465 | return result; |
466 | 466 | ||
467 | // Repeatedly scan the string until all possible | 467 | // Repeatedly scan the string until all possible |
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs index cdab116..b4fae9d 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs | |||
@@ -822,11 +822,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
822 | { | 822 | { |
823 | string requrl = String.Format(m_vivoxChannelPath, m_vivoxServer, "create", channelId, m_authToken); | 823 | string requrl = String.Format(m_vivoxChannelPath, m_vivoxServer, "create", channelId, m_authToken); |
824 | 824 | ||
825 | if (parent != null && parent != String.Empty) | 825 | if (!string.IsNullOrEmpty(parent)) |
826 | { | 826 | { |
827 | requrl = String.Format("{0}&chan_parent={1}", requrl, parent); | 827 | requrl = String.Format("{0}&chan_parent={1}", requrl, parent); |
828 | } | 828 | } |
829 | if (description != null && description != String.Empty) | 829 | if (!string.IsNullOrEmpty(description)) |
830 | { | 830 | { |
831 | requrl = String.Format("{0}&chan_desc={1}", requrl, description); | 831 | requrl = String.Format("{0}&chan_desc={1}", requrl, description); |
832 | } | 832 | } |
@@ -862,7 +862,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
862 | // requrl = String.Format("{0}&chan_parent={1}", requrl, parent); | 862 | // requrl = String.Format("{0}&chan_parent={1}", requrl, parent); |
863 | // } | 863 | // } |
864 | 864 | ||
865 | if (description != null && description != String.Empty) | 865 | if (!string.IsNullOrEmpty(description)) |
866 | { | 866 | { |
867 | requrl = String.Format("{0}&chan_desc={1}", requrl, description); | 867 | requrl = String.Format("{0}&chan_desc={1}", requrl, description); |
868 | } | 868 | } |
@@ -1047,7 +1047,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
1047 | private XmlElement VivoxDeleteChannel(string parent, string channelid) | 1047 | private XmlElement VivoxDeleteChannel(string parent, string channelid) |
1048 | { | 1048 | { |
1049 | string requrl = String.Format(m_vivoxChannelDel, m_vivoxServer, "delete", channelid, m_authToken); | 1049 | string requrl = String.Format(m_vivoxChannelDel, m_vivoxServer, "delete", channelid, m_authToken); |
1050 | if (parent != null && parent != String.Empty) | 1050 | if (!string.IsNullOrEmpty(parent)) |
1051 | { | 1051 | { |
1052 | requrl = String.Format("{0}&chan_parent={1}", requrl, parent); | 1052 | requrl = String.Format("{0}&chan_parent={1}", requrl, parent); |
1053 | } | 1053 | } |
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/SimianGroupsServicesConnectorModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/SimianGroupsServicesConnectorModule.cs index 7bae8f7..8095b28 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/SimianGroupsServicesConnectorModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/SimianGroupsServicesConnectorModule.cs | |||
@@ -212,8 +212,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
212 | m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR]: Initializing {0}", this.Name); | 212 | m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR]: Initializing {0}", this.Name); |
213 | 213 | ||
214 | m_groupsServerURI = groupsConfig.GetString("GroupsServerURI", string.Empty); | 214 | m_groupsServerURI = groupsConfig.GetString("GroupsServerURI", string.Empty); |
215 | if ((m_groupsServerURI == null) || | 215 | if (string.IsNullOrEmpty(m_groupsServerURI)) |
216 | (m_groupsServerURI == string.Empty)) | ||
217 | { | 216 | { |
218 | m_log.ErrorFormat("Please specify a valid Simian Server for GroupsServerURI in OpenSim.ini, [Groups]"); | 217 | m_log.ErrorFormat("Please specify a valid Simian Server for GroupsServerURI in OpenSim.ini, [Groups]"); |
219 | m_connectorEnabled = false; | 218 | m_connectorEnabled = false; |
@@ -438,7 +437,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
438 | return null; | 437 | return null; |
439 | } | 438 | } |
440 | } | 439 | } |
441 | else if ((groupName != null) && (groupName != string.Empty)) | 440 | else if (!string.IsNullOrEmpty(groupName)) |
442 | { | 441 | { |
443 | if (!SimianGetFirstGenericEntry("Group", groupName, out groupID, out GroupInfoMap)) | 442 | if (!SimianGetFirstGenericEntry("Group", groupName, out groupID, out GroupInfoMap)) |
444 | { | 443 | { |
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs index 71b24ac..e28d0c2 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs | |||
@@ -168,8 +168,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
168 | m_log.DebugFormat("[XMLRPC-GROUPS-CONNECTOR]: Initializing {0}", this.Name); | 168 | m_log.DebugFormat("[XMLRPC-GROUPS-CONNECTOR]: Initializing {0}", this.Name); |
169 | 169 | ||
170 | m_groupsServerURI = groupsConfig.GetString("GroupsServerURI", string.Empty); | 170 | m_groupsServerURI = groupsConfig.GetString("GroupsServerURI", string.Empty); |
171 | if ((m_groupsServerURI == null) || | 171 | if (string.IsNullOrEmpty(m_groupsServerURI)) |
172 | (m_groupsServerURI == string.Empty)) | ||
173 | { | 172 | { |
174 | m_log.ErrorFormat("Please specify a valid URL for GroupsServerURI in OpenSim.ini, [Groups]"); | 173 | m_log.ErrorFormat("Please specify a valid URL for GroupsServerURI in OpenSim.ini, [Groups]"); |
175 | m_connectorEnabled = false; | 174 | m_connectorEnabled = false; |
@@ -354,7 +353,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
354 | { | 353 | { |
355 | param["GroupID"] = GroupID.ToString(); | 354 | param["GroupID"] = GroupID.ToString(); |
356 | } | 355 | } |
357 | if ((GroupName != null) && (GroupName != string.Empty)) | 356 | if (!string.IsNullOrEmpty(GroupName)) |
358 | { | 357 | { |
359 | param["Name"] = GroupName.ToString(); | 358 | param["Name"] = GroupName.ToString(); |
360 | } | 359 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs index 6e74227..64dc2e2 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs | |||
@@ -367,7 +367,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
367 | 367 | ||
368 | Vector3 ZeroVector = new Vector3(0, 0, 0); | 368 | Vector3 ZeroVector = new Vector3(0, 0, 0); |
369 | 369 | ||
370 | bool nameSearch = (ts.name != null && ts.name != ""); | 370 | bool nameSearch = !string.IsNullOrEmpty(ts.name); |
371 | 371 | ||
372 | foreach (EntityBase ent in Entities) | 372 | foreach (EntityBase ent in Entities) |
373 | { | 373 | { |
@@ -605,7 +605,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
605 | return sensedEntities; | 605 | return sensedEntities; |
606 | senseEntity(sp); | 606 | senseEntity(sp); |
607 | } | 607 | } |
608 | else if (ts.name != null && ts.name != "") | 608 | else if (!string.IsNullOrEmpty(ts.name)) |
609 | { | 609 | { |
610 | ScenePresence sp; | 610 | ScenePresence sp; |
611 | // Try lookup by name will return if/when found | 611 | // Try lookup by name will return if/when found |
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs index 87f7189..a1b8d85 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs | |||
@@ -618,7 +618,7 @@ namespace SecondLife | |||
618 | // error log. | 618 | // error log. |
619 | if (results.Errors.Count > 0) | 619 | if (results.Errors.Count > 0) |
620 | { | 620 | { |
621 | if (!retried && (results.Errors[0].FileName == null || results.Errors[0].FileName == String.Empty) && | 621 | if (!retried && string.IsNullOrEmpty(results.Errors[0].FileName) && |
622 | results.Errors[0].Line == 0) | 622 | results.Errors[0].Line == 0) |
623 | { | 623 | { |
624 | // System.Console.WriteLine("retrying failed compilation"); | 624 | // System.Console.WriteLine("retrying failed compilation"); |