aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules/World')
-rw-r--r--OpenSim/Region/CoreModules/World/Access/AccessModule.cs6
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs15
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs15
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs10
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs47
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs156
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandObject.cs33
-rw-r--r--OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs18
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs18
-rw-r--r--OpenSim/Region/CoreModules/World/Region/RestartModule.cs6
-rw-r--r--OpenSim/Region/CoreModules/World/Sun/SunModule.cs9
-rw-r--r--OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs6
-rw-r--r--OpenSim/Region/CoreModules/World/Terrain/ITerrainLoader.cs15
-rw-r--r--OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs76
-rw-r--r--OpenSim/Region/CoreModules/World/Wind/WindModule.cs19
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs36
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs2
17 files changed, 262 insertions, 225 deletions
diff --git a/OpenSim/Region/CoreModules/World/Access/AccessModule.cs b/OpenSim/Region/CoreModules/World/Access/AccessModule.cs
index 2399134..553a32d 100644
--- a/OpenSim/Region/CoreModules/World/Access/AccessModule.cs
+++ b/OpenSim/Region/CoreModules/World/Access/AccessModule.cs
@@ -47,21 +47,21 @@ namespace OpenSim.Region.CoreModules.World
47 47
48 public void Initialise(IConfigSource config) 48 public void Initialise(IConfigSource config)
49 { 49 {
50 MainConsole.Instance.Commands.AddCommand("access", true, 50 MainConsole.Instance.Commands.AddCommand("Users", true,
51 "login enable", 51 "login enable",
52 "login enable", 52 "login enable",
53 "Enable simulator logins", 53 "Enable simulator logins",
54 String.Empty, 54 String.Empty,
55 HandleLoginCommand); 55 HandleLoginCommand);
56 56
57 MainConsole.Instance.Commands.AddCommand("access", true, 57 MainConsole.Instance.Commands.AddCommand("Users", true,
58 "login disable", 58 "login disable",
59 "login disable", 59 "login disable",
60 "Disable simulator logins", 60 "Disable simulator logins",
61 String.Empty, 61 String.Empty,
62 HandleLoginCommand); 62 HandleLoginCommand);
63 63
64 MainConsole.Instance.Commands.AddCommand("access", true, 64 MainConsole.Instance.Commands.AddCommand("Users", true,
65 "login status", 65 "login status",
66 "login status", 66 "login status",
67 "Show login status", 67 "Show login status",
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs
index 9ec4ebe..c179a34 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs
@@ -108,12 +108,14 @@ namespace OpenSim.Region.CoreModules.World.Archiver
108// "[ARCHIVER]: Received {0} of {1} assets requested", 108// "[ARCHIVER]: Received {0} of {1} assets requested",
109// assetsFoundUuids.Count, assetsFoundUuids.Count + assetsNotFoundUuids.Count); 109// assetsFoundUuids.Count, assetsFoundUuids.Count + assetsNotFoundUuids.Count);
110 110
111 m_log.InfoFormat("[ARCHIVER]: Adding region settings to archive.");
112
111 // Write out region settings 113 // Write out region settings
112 string settingsPath 114 string settingsPath
113 = String.Format("{0}{1}.xml", ArchiveConstants.SETTINGS_PATH, m_scene.RegionInfo.RegionName); 115 = String.Format("{0}{1}.xml", ArchiveConstants.SETTINGS_PATH, m_scene.RegionInfo.RegionName);
114 m_archiveWriter.WriteFile(settingsPath, RegionSettingsSerializer.Serialize(m_scene.RegionInfo.RegionSettings)); 116 m_archiveWriter.WriteFile(settingsPath, RegionSettingsSerializer.Serialize(m_scene.RegionInfo.RegionSettings));
115 117
116 m_log.InfoFormat("[ARCHIVER]: Added region settings to archive."); 118 m_log.InfoFormat("[ARCHIVER]: Adding parcel settings to archive.");
117 119
118 // Write out land data (aka parcel) settings 120 // Write out land data (aka parcel) settings
119 List<ILandObject>landObjects = m_scene.LandChannel.AllParcels(); 121 List<ILandObject>landObjects = m_scene.LandChannel.AllParcels();
@@ -124,7 +126,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
124 landData.GlobalID.ToString()); 126 landData.GlobalID.ToString());
125 m_archiveWriter.WriteFile(landDataPath, LandDataSerializer.Serialize(landData)); 127 m_archiveWriter.WriteFile(landDataPath, LandDataSerializer.Serialize(landData));
126 } 128 }
127 m_log.InfoFormat("[ARCHIVER]: Added parcel settings to archive."); 129
130 m_log.InfoFormat("[ARCHIVER]: Adding terrain information to archive.");
128 131
129 // Write out terrain 132 // Write out terrain
130 string terrainPath 133 string terrainPath
@@ -135,7 +138,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
135 m_archiveWriter.WriteFile(terrainPath, ms.ToArray()); 138 m_archiveWriter.WriteFile(terrainPath, ms.ToArray());
136 ms.Close(); 139 ms.Close();
137 140
138 m_log.InfoFormat("[ARCHIVER]: Added terrain information to archive."); 141 m_log.InfoFormat("[ARCHIVER]: Adding scene objects to archive.");
139 142
140 // Write out scene object metadata 143 // Write out scene object metadata
141 foreach (SceneObjectGroup sceneObject in m_sceneObjects) 144 foreach (SceneObjectGroup sceneObject in m_sceneObjects)
@@ -145,10 +148,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver
145 string serializedObject = m_serialiser.SerializeGroupToXml2(sceneObject, m_options); 148 string serializedObject = m_serialiser.SerializeGroupToXml2(sceneObject, m_options);
146 m_archiveWriter.WriteFile(ArchiveHelpers.CreateObjectPath(sceneObject), serializedObject); 149 m_archiveWriter.WriteFile(ArchiveHelpers.CreateObjectPath(sceneObject), serializedObject);
147 } 150 }
148
149 m_log.InfoFormat("[ARCHIVER]: Added scene objects to archive.");
150 } 151 }
151
152
153 } 152 }
154} 153} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
index ffcf063..4d459bf 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
@@ -219,12 +219,19 @@ namespace OpenSim.Region.CoreModules.World.Archiver
219 m_log.InfoFormat("[ARCHIVER]: Added control file to archive."); 219 m_log.InfoFormat("[ARCHIVER]: Added control file to archive.");
220 220
221 if (SaveAssets) 221 if (SaveAssets)
222 new AssetsRequest( 222 {
223 new AssetsArchiver(archiveWriter), assetUuids, 223 AssetsRequest ar
224 m_scene.AssetService, m_scene.UserAccountService, 224 = new AssetsRequest(
225 m_scene.RegionInfo.ScopeID, options, awre.ReceivedAllAssets).Execute(); 225 new AssetsArchiver(archiveWriter), assetUuids,
226 m_scene.AssetService, m_scene.UserAccountService,
227 m_scene.RegionInfo.ScopeID, options, awre.ReceivedAllAssets);
228
229 Util.FireAndForget(o => ar.Execute());
230 }
226 else 231 else
232 {
227 awre.ReceivedAllAssets(new List<UUID>(), new List<UUID>()); 233 awre.ReceivedAllAssets(new List<UUID>(), new List<UUID>());
234 }
228 } 235 }
229 catch (Exception) 236 catch (Exception)
230 { 237 {
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs
index 8e29e3c..55110dc 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs
@@ -141,13 +141,15 @@ namespace OpenSim.Region.CoreModules.World.Archiver
141 PerformAssetsRequestCallback(null); 141 PerformAssetsRequestCallback(null);
142 return; 142 return;
143 } 143 }
144 144
145 m_requestCallbackTimer.Enabled = true;
146
145 foreach (KeyValuePair<UUID, AssetType> kvp in m_uuids) 147 foreach (KeyValuePair<UUID, AssetType> kvp in m_uuids)
146 { 148 {
147 m_assetService.Get(kvp.Key.ToString(), kvp.Value, PreAssetRequestCallback); 149// m_assetService.Get(kvp.Key.ToString(), kvp.Value, PreAssetRequestCallback);
150 AssetBase asset = m_assetService.Get(kvp.Key.ToString());
151 PreAssetRequestCallback(kvp.Key.ToString(), kvp.Value, asset);
148 } 152 }
149
150 m_requestCallbackTimer.Enabled = true;
151 } 153 }
152 154
153 protected void OnRequestCallbackTimeout(object source, ElapsedEventArgs args) 155 protected void OnRequestCallbackTimeout(object source, ElapsedEventArgs args)
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs
index f6d1a82..d2bbea3 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs
@@ -62,58 +62,25 @@ namespace OpenSim.Region.CoreModules.World.Estate
62 { 62 {
63 m_log.DebugFormat("[ESTATE MODULE]: Setting up estate commands for region {0}", m_module.Scene.RegionInfo.RegionName); 63 m_log.DebugFormat("[ESTATE MODULE]: Setting up estate commands for region {0}", m_module.Scene.RegionInfo.RegionName);
64 64
65 m_module.Scene.AddCommand(m_module, "set terrain texture", 65 m_module.Scene.AddCommand("Regions", m_module, "set terrain texture",
66 "set terrain texture <number> <uuid> [<x>] [<y>]", 66 "set terrain texture <number> <uuid> [<x>] [<y>]",
67 "Sets the terrain <number> to <uuid>, if <x> or <y> are specified, it will only " + 67 "Sets the terrain <number> to <uuid>, if <x> or <y> are specified, it will only " +
68 "set it on regions with a matching coordinate. Specify -1 in <x> or <y> to wildcard" + 68 "set it on regions with a matching coordinate. Specify -1 in <x> or <y> to wildcard" +
69 " that coordinate.", 69 " that coordinate.",
70 consoleSetTerrainTexture); 70 consoleSetTerrainTexture);
71 71
72 m_module.Scene.AddCommand(m_module, "set terrain heights", 72 m_module.Scene.AddCommand("Regions", m_module, "set terrain heights",
73 "set terrain heights <corner> <min> <max> [<x>] [<y>]", 73 "set terrain heights <corner> <min> <max> [<x>] [<y>]",
74 "Sets the terrain texture heights on corner #<corner> to <min>/<max>, if <x> or <y> are specified, it will only " + 74 "Sets the terrain texture heights on corner #<corner> to <min>/<max>, if <x> or <y> are specified, it will only " +
75 "set it on regions with a matching coordinate. Specify -1 in <x> or <y> to wildcard" + 75 "set it on regions with a matching coordinate. Specify -1 in <x> or <y> to wildcard" +
76 " that coordinate. Corner # SW = 0, NW = 1, SE = 2, NE = 3.", 76 " that coordinate. Corner # SW = 0, NW = 1, SE = 2, NE = 3.",
77 consoleSetTerrainHeights); 77 consoleSetTerrainHeights);
78
79 Command showCommand
80 = new Command("show", CommandIntentions.COMMAND_STATISTICAL, ShowEstatesCommand, "Shows all estates on the simulator.");
81
82 m_commander.RegisterCommand("show", showCommand);
83 78
84 m_module.Scene.RegisterModuleCommander(m_commander); 79 m_module.Scene.AddCommand(
85 80 "Estates", m_module, "estate show", "estate show", "Shows all estates on the simulator.", ShowEstatesCommand);
86 m_module.Scene.EventManager.OnPluginConsole += EventManagerOnPluginConsole;
87 } 81 }
88 82
89 public void Close() 83 public void Close() {}
90 {
91 m_module.Scene.EventManager.OnPluginConsole -= EventManagerOnPluginConsole;
92 m_module.Scene.UnregisterModuleCommander(m_commander.Name);
93 }
94
95 /// <summary>
96 /// Processes commandline input. Do not call directly.
97 /// </summary>
98 /// <param name="args">Commandline arguments</param>
99 protected void EventManagerOnPluginConsole(string[] args)
100 {
101 if (args[0] == "estate")
102 {
103 if (args.Length == 1)
104 {
105 m_commander.ProcessConsoleCommand("help", new string[0]);
106 return;
107 }
108
109 string[] tmpArgs = new string[args.Length - 2];
110 int i;
111 for (i = 2; i < args.Length; i++)
112 tmpArgs[i - 2] = args[i];
113
114 m_commander.ProcessConsoleCommand(args[1], tmpArgs);
115 }
116 }
117 84
118 protected void consoleSetTerrainTexture(string module, string[] args) 85 protected void consoleSetTerrainTexture(string module, string[] args)
119 { 86 {
@@ -201,7 +168,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
201 } 168 }
202 } 169 }
203 170
204 protected void ShowEstatesCommand(Object[] args) 171 protected void ShowEstatesCommand(string module, string[] cmd)
205 { 172 {
206 StringBuilder report = new StringBuilder(); 173 StringBuilder report = new StringBuilder();
207 RegionInfo ri = m_module.Scene.RegionInfo; 174 RegionInfo ri = m_module.Scene.RegionInfo;
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
index c303d6d..fc217b0 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
@@ -26,8 +26,10 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Collections;
29using System.Collections.Generic; 30using System.Collections.Generic;
30using System.IO; 31using System.IO;
32using System.Linq;
31using System.Reflection; 33using System.Reflection;
32using System.Security; 34using System.Security;
33using log4net; 35using log4net;
@@ -45,8 +47,6 @@ namespace OpenSim.Region.CoreModules.World.Estate
45 { 47 {
46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
47 49
48 private delegate void LookupUUIDS(List<UUID> uuidLst);
49
50 public Scene Scene { get; private set; } 50 public Scene Scene { get; private set; }
51 public IUserManagement UserManager { get; private set; } 51 public IUserManagement UserManager { get; private set; }
52 52
@@ -604,7 +604,6 @@ namespace OpenSim.Region.CoreModules.World.Estate
604 604
605 public void handleOnEstateManageTelehub (IClientAPI client, UUID invoice, UUID senderID, string cmd, uint param1) 605 public void handleOnEstateManageTelehub (IClientAPI client, UUID invoice, UUID senderID, string cmd, uint param1)
606 { 606 {
607 uint ObjectLocalID;
608 SceneObjectPart part; 607 SceneObjectPart part;
609 608
610 switch (cmd) 609 switch (cmd)
@@ -661,28 +660,23 @@ namespace OpenSim.Region.CoreModules.World.Estate
661 TriggerEstateMessage(senderID, senderName, message); 660 TriggerEstateMessage(senderID, senderName, message);
662 } 661 }
663 662
664 private void handleEstateDebugRegionRequest(IClientAPI remote_client, UUID invoice, UUID senderID, bool scripted, bool collisionEvents, bool physics) 663 private void handleEstateDebugRegionRequest(
664 IClientAPI remote_client, UUID invoice, UUID senderID,
665 bool disableScripts, bool disableCollisions, bool disablePhysics)
665 { 666 {
666 if (physics) 667 Scene.RegionInfo.RegionSettings.DisablePhysics = disablePhysics;
667 Scene.RegionInfo.RegionSettings.DisablePhysics = true; 668 Scene.RegionInfo.RegionSettings.DisableScripts = disableScripts;
668 else 669 Scene.RegionInfo.RegionSettings.DisableCollisions = disableCollisions;
669 Scene.RegionInfo.RegionSettings.DisablePhysics = false;
670
671 if (scripted)
672 Scene.RegionInfo.RegionSettings.DisableScripts = true;
673 else
674 Scene.RegionInfo.RegionSettings.DisableScripts = false;
675
676 if (collisionEvents)
677 Scene.RegionInfo.RegionSettings.DisableCollisions = true;
678 else
679 Scene.RegionInfo.RegionSettings.DisableCollisions = false;
680
681
682 Scene.RegionInfo.RegionSettings.Save(); 670 Scene.RegionInfo.RegionSettings.Save();
683 TriggerRegionInfoChange(); 671 TriggerRegionInfoChange();
684 672
685 Scene.SetSceneCoreDebug(scripted, collisionEvents, physics); 673 Scene.SetSceneCoreDebug(
674 new Dictionary<string, string>() {
675 { "scripting", (!disableScripts).ToString() },
676 { "collisions", (!disableCollisions).ToString() },
677 { "physics", (!disablePhysics).ToString() }
678 }
679 );
686 } 680 }
687 681
688 private void handleEstateTeleportOneUserHomeRequest(IClientAPI remover_client, UUID invoice, UUID senderID, UUID prey) 682 private void handleEstateTeleportOneUserHomeRequest(IClientAPI remover_client, UUID invoice, UUID senderID, UUID prey)
@@ -876,98 +870,76 @@ namespace OpenSim.Region.CoreModules.World.Estate
876 if (!Scene.Permissions.CanIssueEstateCommand(remoteClient.AgentId, false)) 870 if (!Scene.Permissions.CanIssueEstateCommand(remoteClient.AgentId, false))
877 return; 871 return;
878 872
879 Dictionary<uint, float> SceneData = new Dictionary<uint,float>(); 873 Dictionary<uint, float> sceneData = null;
880 List<UUID> uuidNameLookupList = new List<UUID>();
881 874
882 if (reportType == 1) 875 if (reportType == 1)
883 { 876 {
884 SceneData = Scene.PhysicsScene.GetTopColliders(); 877 sceneData = Scene.PhysicsScene.GetTopColliders();
885 } 878 }
886 else if (reportType == 0) 879 else if (reportType == 0)
887 { 880 {
888 SceneData = Scene.SceneGraph.GetTopScripts(); 881 IScriptModule scriptModule = Scene.RequestModuleInterface<IScriptModule>();
882
883 if (scriptModule != null)
884 sceneData = scriptModule.GetObjectScriptsExecutionTimes();
889 } 885 }
890 886
891 List<LandStatReportItem> SceneReport = new List<LandStatReportItem>(); 887 List<LandStatReportItem> SceneReport = new List<LandStatReportItem>();
892 lock (SceneData) 888 if (sceneData != null)
893 { 889 {
894 foreach (uint obj in SceneData.Keys) 890 var sortedSceneData
891 = sceneData.Select(
892 item => new { Measurement = item.Value, Part = Scene.GetSceneObjectPart(item.Key) });
893
894 sortedSceneData.OrderBy(item => item.Measurement);
895
896 int items = 0;
897
898 foreach (var entry in sortedSceneData)
895 { 899 {
896 SceneObjectPart prt = Scene.GetSceneObjectPart(obj); 900 // The object may have been deleted since we received the data.
897 if (prt != null) 901 if (entry.Part == null)
902 continue;
903
904 // Don't show scripts that haven't executed or where execution time is below one microsecond in
905 // order to produce a more readable report.
906 if (entry.Measurement < 0.001)
907 continue;
908
909 items++;
910 SceneObjectGroup so = entry.Part.ParentGroup;
911
912 LandStatReportItem lsri = new LandStatReportItem();
913 lsri.LocationX = so.AbsolutePosition.X;
914 lsri.LocationY = so.AbsolutePosition.Y;
915 lsri.LocationZ = so.AbsolutePosition.Z;
916 lsri.Score = entry.Measurement;
917 lsri.TaskID = so.UUID;
918 lsri.TaskLocalID = so.LocalId;
919 lsri.TaskName = entry.Part.Name;
920 lsri.OwnerName = UserManager.GetUserName(so.OwnerID);
921
922 if (filter.Length != 0)
898 { 923 {
899 SceneObjectGroup sog = prt.ParentGroup; 924 if ((lsri.OwnerName.Contains(filter) || lsri.TaskName.Contains(filter)))
900 LandStatReportItem lsri = new LandStatReportItem();
901 lsri.LocationX = sog.AbsolutePosition.X;
902 lsri.LocationY = sog.AbsolutePosition.Y;
903 lsri.LocationZ = sog.AbsolutePosition.Z;
904 lsri.Score = SceneData[obj];
905 lsri.TaskID = sog.UUID;
906 lsri.TaskLocalID = sog.LocalId;
907 lsri.TaskName = sog.GetPartName(obj);
908 lsri.OwnerName = "waiting";
909 lock (uuidNameLookupList)
910 uuidNameLookupList.Add(sog.OwnerID);
911
912 if (filter.Length != 0)
913 { 925 {
914 if ((lsri.OwnerName.Contains(filter) || lsri.TaskName.Contains(filter)))
915 {
916 }
917 else
918 {
919 continue;
920 }
921 } 926 }
922 927 else
923 SceneReport.Add(lsri); 928 {
929 continue;
930 }
924 } 931 }
932
933 SceneReport.Add(lsri);
934
935 if (items >= 100)
936 break;
925 } 937 }
926 } 938 }
927 939
928 remoteClient.SendLandStatReply(reportType, requestFlags, (uint)SceneReport.Count,SceneReport.ToArray()); 940 remoteClient.SendLandStatReply(reportType, requestFlags, (uint)SceneReport.Count,SceneReport.ToArray());
929
930 if (uuidNameLookupList.Count > 0)
931 LookupUUID(uuidNameLookupList);
932 }
933
934 private static void LookupUUIDSCompleted(IAsyncResult iar)
935 {
936 LookupUUIDS icon = (LookupUUIDS)iar.AsyncState;
937 icon.EndInvoke(iar);
938 } 941 }
939
940 private void LookupUUID(List<UUID> uuidLst)
941 {
942 LookupUUIDS d = LookupUUIDsAsync;
943 942
944 d.BeginInvoke(uuidLst,
945 LookupUUIDSCompleted,
946 d);
947 }
948
949 private void LookupUUIDsAsync(List<UUID> uuidLst)
950 {
951 UUID[] uuidarr;
952
953 lock (uuidLst)
954 {
955 uuidarr = uuidLst.ToArray();
956 }
957
958 for (int i = 0; i < uuidarr.Length; i++)
959 {
960 // string lookupname = m_scene.CommsManager.UUIDNameRequestString(uuidarr[i]);
961
962 IUserManagement userManager = Scene.RequestModuleInterface<IUserManagement>();
963 if (userManager != null)
964 userManager.GetUserName(uuidarr[i]);
965
966 // we drop it. It gets cached though... so we're ready for the next request.
967 // diva commnent 11/21/2010: uh?!? wft?
968 // justincc comment 21/01/2011: A side effect of userManager.GetUserName() I presume.
969 }
970 }
971 #endregion 943 #endregion
972 944
973 #region Outgoing Packets 945 #region Outgoing Packets
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
index cc42f7f..a0ed5a5 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
@@ -448,8 +448,6 @@ namespace OpenSim.Region.CoreModules.World.Land
448 448
449 public bool IsRestrictedFromLand(UUID avatar) 449 public bool IsRestrictedFromLand(UUID avatar)
450 { 450 {
451 ExpireAccessList();
452
453 if (m_scene.Permissions.IsAdministrator(avatar)) 451 if (m_scene.Permissions.IsAdministrator(avatar))
454 return false; 452 return false;
455 453
@@ -459,20 +457,27 @@ namespace OpenSim.Region.CoreModules.World.Land
459 if (avatar == LandData.OwnerID) 457 if (avatar == LandData.OwnerID)
460 return false; 458 return false;
461 459
462 if ((LandData.Flags & (uint) ParcelFlags.UseAccessList) > 0) 460 if ((LandData.Flags & (uint) ParcelFlags.UseAccessList) == 0)
461 return false;
462
463 return (!IsInLandAccessList(avatar));
464 }
465
466 public bool IsInLandAccessList(UUID avatar)
467 {
468 ExpireAccessList();
469
470 if (LandData.ParcelAccessList.FindIndex(
471 delegate(LandAccessEntry e)
472 {
473 if (e.AgentID == avatar && e.Flags == AccessList.Access)
474 return true;
475 return false;
476 }) == -1)
463 { 477 {
464 if (LandData.ParcelAccessList.FindIndex( 478 return false;
465 delegate(LandAccessEntry e)
466 {
467 if (e.AgentID == avatar && e.Flags == AccessList.Access)
468 return true;
469 return false;
470 }) == -1)
471 {
472 return true;
473 }
474 } 479 }
475 return false; 480 return true;
476 } 481 }
477 482
478 public void SendLandUpdateToClient(IClientAPI remote_client) 483 public void SendLandUpdateToClient(IClientAPI remote_client)
diff --git a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs
index e3d04cd..f5a5c92 100644
--- a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs
@@ -78,45 +78,45 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
78 m_scene = scene; 78 m_scene = scene;
79 m_console = MainConsole.Instance; 79 m_console = MainConsole.Instance;
80 80
81 m_console.Commands.AddCommand("region", false, "delete object owner", 81 m_console.Commands.AddCommand("Regions", false, "delete object owner",
82 "delete object owner <UUID>", 82 "delete object owner <UUID>",
83 "Delete a scene object by owner", HandleDeleteObject); 83 "Delete a scene object by owner", HandleDeleteObject);
84 m_console.Commands.AddCommand("region", false, "delete object creator", 84 m_console.Commands.AddCommand("Regions", false, "delete object creator",
85 "delete object creator <UUID>", 85 "delete object creator <UUID>",
86 "Delete a scene object by creator", HandleDeleteObject); 86 "Delete a scene object by creator", HandleDeleteObject);
87 m_console.Commands.AddCommand("region", false, "delete object uuid", 87 m_console.Commands.AddCommand("Regions", false, "delete object uuid",
88 "delete object uuid <UUID>", 88 "delete object uuid <UUID>",
89 "Delete a scene object by uuid", HandleDeleteObject); 89 "Delete a scene object by uuid", HandleDeleteObject);
90 m_console.Commands.AddCommand("region", false, "delete object name", 90 m_console.Commands.AddCommand("Regions", false, "delete object name",
91 "delete object name <name>", 91 "delete object name <name>",
92 "Delete a scene object by name", HandleDeleteObject); 92 "Delete a scene object by name", HandleDeleteObject);
93 m_console.Commands.AddCommand("region", false, "delete object outside", 93 m_console.Commands.AddCommand("Regions", false, "delete object outside",
94 "delete object outside", 94 "delete object outside",
95 "Delete all scene objects outside region boundaries", HandleDeleteObject); 95 "Delete all scene objects outside region boundaries", HandleDeleteObject);
96 96
97 m_console.Commands.AddCommand( 97 m_console.Commands.AddCommand(
98 "region", 98 "Regions",
99 false, 99 false,
100 "show object uuid", 100 "show object uuid",
101 "show object uuid <UUID>", 101 "show object uuid <UUID>",
102 "Show details of a scene object with the given UUID", HandleShowObjectByUuid); 102 "Show details of a scene object with the given UUID", HandleShowObjectByUuid);
103 103
104 m_console.Commands.AddCommand( 104 m_console.Commands.AddCommand(
105 "region", 105 "Regions",
106 false, 106 false,
107 "show object name", 107 "show object name",
108 "show object name <name>", 108 "show object name <name>",
109 "Show details of scene objects with the given name", HandleShowObjectByName); 109 "Show details of scene objects with the given name", HandleShowObjectByName);
110 110
111 m_console.Commands.AddCommand( 111 m_console.Commands.AddCommand(
112 "region", 112 "Regions",
113 false, 113 false,
114 "show part uuid", 114 "show part uuid",
115 "show part uuid <UUID>", 115 "show part uuid <UUID>",
116 "Show details of a scene object parts with the given UUID", HandleShowPartByUuid); 116 "Show details of a scene object parts with the given UUID", HandleShowPartByUuid);
117 117
118 m_console.Commands.AddCommand( 118 m_console.Commands.AddCommand(
119 "region", 119 "Regions",
120 false, 120 false,
121 "show part name", 121 "show part name",
122 "show part name <name>", 122 "show part name <name>",
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index 7023984..ac03747 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -94,7 +94,9 @@ namespace OpenSim.Region.CoreModules.World.Permissions
94 private bool m_RegionOwnerIsGod = false; 94 private bool m_RegionOwnerIsGod = false;
95 private bool m_RegionManagerIsGod = false; 95 private bool m_RegionManagerIsGod = false;
96 private bool m_ParcelOwnerIsGod = false; 96 private bool m_ParcelOwnerIsGod = false;
97 97
98 private bool m_SimpleBuildPermissions = false;
99
98 /// <value> 100 /// <value>
99 /// The set of users that are allowed to create scripts. This is only active if permissions are not being 101 /// The set of users that are allowed to create scripts. This is only active if permissions are not being
100 /// bypassed. This overrides normal permissions. 102 /// bypassed. This overrides normal permissions.
@@ -139,7 +141,9 @@ namespace OpenSim.Region.CoreModules.World.Permissions
139 m_RegionOwnerIsGod = myConfig.GetBoolean("region_owner_is_god", true); 141 m_RegionOwnerIsGod = myConfig.GetBoolean("region_owner_is_god", true);
140 m_RegionManagerIsGod = myConfig.GetBoolean("region_manager_is_god", false); 142 m_RegionManagerIsGod = myConfig.GetBoolean("region_manager_is_god", false);
141 m_ParcelOwnerIsGod = myConfig.GetBoolean("parcel_owner_is_god", true); 143 m_ParcelOwnerIsGod = myConfig.GetBoolean("parcel_owner_is_god", true);
142 144
145 m_SimpleBuildPermissions = myConfig.GetBoolean("simple_build_permissions", false);
146
143 m_allowedScriptCreators 147 m_allowedScriptCreators
144 = ParseUserSetConfigSetting(myConfig, "allowed_script_creators", m_allowedScriptCreators); 148 = ParseUserSetConfigSetting(myConfig, "allowed_script_creators", m_allowedScriptCreators);
145 m_allowedScriptEditors 149 m_allowedScriptEditors
@@ -206,17 +210,17 @@ namespace OpenSim.Region.CoreModules.World.Permissions
206 m_scene.Permissions.OnControlPrimMedia += CanControlPrimMedia; 210 m_scene.Permissions.OnControlPrimMedia += CanControlPrimMedia;
207 m_scene.Permissions.OnInteractWithPrimMedia += CanInteractWithPrimMedia; 211 m_scene.Permissions.OnInteractWithPrimMedia += CanInteractWithPrimMedia;
208 212
209 m_scene.AddCommand(this, "bypass permissions", 213 m_scene.AddCommand("Users", this, "bypass permissions",
210 "bypass permissions <true / false>", 214 "bypass permissions <true / false>",
211 "Bypass permission checks", 215 "Bypass permission checks",
212 HandleBypassPermissions); 216 HandleBypassPermissions);
213 217
214 m_scene.AddCommand(this, "force permissions", 218 m_scene.AddCommand("Users", this, "force permissions",
215 "force permissions <true / false>", 219 "force permissions <true / false>",
216 "Force permissions on or off", 220 "Force permissions on or off",
217 HandleForcePermissions); 221 HandleForcePermissions);
218 222
219 m_scene.AddCommand(this, "debug permissions", 223 m_scene.AddCommand("Users", this, "debug permissions",
220 "debug permissions <true / false>", 224 "debug permissions <true / false>",
221 "Turn on permissions debugging", 225 "Turn on permissions debugging",
222 HandleDebugPermissions); 226 HandleDebugPermissions);
@@ -824,6 +828,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions
824 permission = true; 828 permission = true;
825 } 829 }
826 830
831 if (m_SimpleBuildPermissions &&
832 (parcel.LandData.Flags & (uint)ParcelFlags.UseAccessList) == 0 && parcel.IsInLandAccessList(user))
833 permission = true;
834
827 return permission; 835 return permission;
828 } 836 }
829 837
diff --git a/OpenSim/Region/CoreModules/World/Region/RestartModule.cs b/OpenSim/Region/CoreModules/World/Region/RestartModule.cs
index 0f37ddd..fea4de0 100644
--- a/OpenSim/Region/CoreModules/World/Region/RestartModule.cs
+++ b/OpenSim/Region/CoreModules/World/Region/RestartModule.cs
@@ -66,21 +66,21 @@ namespace OpenSim.Region.CoreModules.World.Region
66 m_Scene = scene; 66 m_Scene = scene;
67 67
68 scene.RegisterModuleInterface<IRestartModule>(this); 68 scene.RegisterModuleInterface<IRestartModule>(this);
69 MainConsole.Instance.Commands.AddCommand("RestartModule", 69 MainConsole.Instance.Commands.AddCommand("Regions",
70 false, "region restart bluebox", 70 false, "region restart bluebox",
71 "region restart bluebox <message> <delta seconds>+", 71 "region restart bluebox <message> <delta seconds>+",
72 "Schedule a region restart", 72 "Schedule a region restart",
73 "Schedule a region restart after a given number of seconds. If one delta is given then the region is restarted in delta seconds time. A time to restart is sent to users in the region as a dismissable bluebox notice. If multiple deltas are given then a notice is sent when we reach each delta.", 73 "Schedule a region restart after a given number of seconds. If one delta is given then the region is restarted in delta seconds time. A time to restart is sent to users in the region as a dismissable bluebox notice. If multiple deltas are given then a notice is sent when we reach each delta.",
74 HandleRegionRestart); 74 HandleRegionRestart);
75 75
76 MainConsole.Instance.Commands.AddCommand("RestartModule", 76 MainConsole.Instance.Commands.AddCommand("Regions",
77 false, "region restart notice", 77 false, "region restart notice",
78 "region restart notice <message> <delta seconds>+", 78 "region restart notice <message> <delta seconds>+",
79 "Schedule a region restart", 79 "Schedule a region restart",
80 "Schedule a region restart after a given number of seconds. If one delta is given then the region is restarted in delta seconds time. A time to restart is sent to users in the region as a transient notice. If multiple deltas are given then a notice is sent when we reach each delta.", 80 "Schedule a region restart after a given number of seconds. If one delta is given then the region is restarted in delta seconds time. A time to restart is sent to users in the region as a transient notice. If multiple deltas are given then a notice is sent when we reach each delta.",
81 HandleRegionRestart); 81 HandleRegionRestart);
82 82
83 MainConsole.Instance.Commands.AddCommand("RestartModule", 83 MainConsole.Instance.Commands.AddCommand("Regions",
84 false, "region restart abort", 84 false, "region restart abort",
85 "region restart abort [<message>]", 85 "region restart abort [<message>]",
86 "Abort a region restart", HandleRegionRestart); 86 "Abort a region restart", HandleRegionRestart);
diff --git a/OpenSim/Region/CoreModules/World/Sun/SunModule.cs b/OpenSim/Region/CoreModules/World/Sun/SunModule.cs
index a838e1e..9a954b8 100644
--- a/OpenSim/Region/CoreModules/World/Sun/SunModule.cs
+++ b/OpenSim/Region/CoreModules/World/Sun/SunModule.cs
@@ -277,18 +277,19 @@ namespace OpenSim.Region.CoreModules
277 m_frame = 0; 277 m_frame = 0;
278 278
279 // This one puts an entry in the main help screen 279 // This one puts an entry in the main help screen
280 m_scene.AddCommand(this, String.Empty, "sun", "Usage: sun [param] [value] - Get or Update Sun module paramater", null); 280// m_scene.AddCommand("Regions", this, "sun", "sun", "Usage: sun [param] [value] - Get or Update Sun module paramater", null);
281 281
282 // This one enables the ability to type just "sun" without any parameters 282 // This one enables the ability to type just "sun" without any parameters
283 m_scene.AddCommand(this, "sun", "", "", HandleSunConsoleCommand); 283// m_scene.AddCommand("Regions", this, "sun", "", "", HandleSunConsoleCommand);
284 foreach (KeyValuePair<string, string> kvp in GetParamList()) 284 foreach (KeyValuePair<string, string> kvp in GetParamList())
285 { 285 {
286 m_scene.AddCommand(this, String.Format("sun {0}", kvp.Key), String.Format("{0} - {1}", kvp.Key, kvp.Value), "", HandleSunConsoleCommand); 286 string sunCommand = string.Format("sun {0}", kvp.Key);
287 m_scene.AddCommand("Regions", this, sunCommand, string.Format("{0} [<value>]", sunCommand), kvp.Value, "", HandleSunConsoleCommand);
287 } 288 }
288 289
289 TimeZone local = TimeZone.CurrentTimeZone; 290 TimeZone local = TimeZone.CurrentTimeZone;
290 TicksUTCOffset = local.GetUtcOffset(local.ToLocalTime(DateTime.Now)).Ticks; 291 TicksUTCOffset = local.GetUtcOffset(local.ToLocalTime(DateTime.Now)).Ticks;
291 m_log.Debug("[SUN]: localtime offset is " + TicksUTCOffset); 292 m_log.DebugFormat("[SUN]: localtime offset is {0}", TicksUTCOffset);
292 293
293 // Align ticks with Second Life 294 // Align ticks with Second Life
294 295
diff --git a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs
index 21a9999..58925fd 100644
--- a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs
+++ b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs
@@ -132,13 +132,13 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
132 { 132 {
133 // We need to do this because: 133 // We need to do this because:
134 // "Saving the image to the same file it was constructed from is not allowed and throws an exception." 134 // "Saving the image to the same file it was constructed from is not allowed and throws an exception."
135 string tempName = offsetX + "_ " + offsetY + "_" + filename; 135 string tempName = Path.GetTempFileName();
136 136
137 Bitmap entireBitmap = null; 137 Bitmap entireBitmap = null;
138 Bitmap thisBitmap = null; 138 Bitmap thisBitmap = null;
139 if (File.Exists(filename)) 139 if (File.Exists(filename))
140 { 140 {
141 File.Copy(filename, tempName); 141 File.Copy(filename, tempName, true);
142 entireBitmap = new Bitmap(tempName); 142 entireBitmap = new Bitmap(tempName);
143 if (entireBitmap.Width != fileWidth * regionSizeX || entireBitmap.Height != fileHeight * regionSizeY) 143 if (entireBitmap.Width != fileWidth * regionSizeX || entireBitmap.Height != fileHeight * regionSizeY)
144 { 144 {
@@ -152,7 +152,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
152 } 152 }
153 153
154 thisBitmap = CreateGrayscaleBitmapFromMap(m_channel); 154 thisBitmap = CreateGrayscaleBitmapFromMap(m_channel);
155 Console.WriteLine("offsetX=" + offsetX + " offsetY=" + offsetY); 155// Console.WriteLine("offsetX=" + offsetX + " offsetY=" + offsetY);
156 for (int x = 0; x < regionSizeX; x++) 156 for (int x = 0; x < regionSizeX; x++)
157 for (int y = 0; y < regionSizeY; y++) 157 for (int y = 0; y < regionSizeY; y++)
158 entireBitmap.SetPixel(x + offsetX * regionSizeX, y + (fileHeight - 1 - offsetY) * regionSizeY, thisBitmap.GetPixel(x, y)); 158 entireBitmap.SetPixel(x + offsetX * regionSizeX, y + (fileHeight - 1 - offsetY) * regionSizeY, thisBitmap.GetPixel(x, y));
diff --git a/OpenSim/Region/CoreModules/World/Terrain/ITerrainLoader.cs b/OpenSim/Region/CoreModules/World/Terrain/ITerrainLoader.cs
index 7237f90..d407617 100644
--- a/OpenSim/Region/CoreModules/World/Terrain/ITerrainLoader.cs
+++ b/OpenSim/Region/CoreModules/World/Terrain/ITerrainLoader.cs
@@ -38,6 +38,21 @@ namespace OpenSim.Region.CoreModules.World.Terrain
38 ITerrainChannel LoadStream(Stream stream); 38 ITerrainChannel LoadStream(Stream stream);
39 void SaveFile(string filename, ITerrainChannel map); 39 void SaveFile(string filename, ITerrainChannel map);
40 void SaveStream(Stream stream, ITerrainChannel map); 40 void SaveStream(Stream stream, ITerrainChannel map);
41
42 /// <summary>
43 /// Save a number of map tiles to a single big image file.
44 /// </summary>
45 /// <remarks>
46 /// If the image file already exists then the tiles saved will replace those already in the file - other tiles
47 /// will be untouched.
48 /// </remarks>
49 /// <param name="filename">The terrain file to save</param>
50 /// <param name="offsetX">The map x co-ordinate at which to begin the save.</param>
51 /// <param name="offsetY">The may y co-ordinate at which to begin the save.</param>
52 /// <param name="fileWidth">The number of tiles to save along the X axis.</param>
53 /// <param name="fileHeight">The number of tiles to save along the Y axis.</param>
54 /// <param name="regionSizeX">The width of a map tile.</param>
55 /// <param name="regionSizeY">The height of a map tile.</param>
41 void SaveFile(ITerrainChannel map, string filename, int offsetX, int offsetY, int fileWidth, int fileHeight, int regionSizeX, int regionSizeY); 56 void SaveFile(ITerrainChannel map, string filename, int offsetX, int offsetY, int fileWidth, int fileHeight, int regionSizeX, int regionSizeY);
42 } 57 }
43} \ No newline at end of file 58} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
index cf000a4..b3c2969 100644
--- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
+++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
@@ -86,6 +86,8 @@ namespace OpenSim.Region.CoreModules.World.Terrain
86 private volatile bool m_tainted; 86 private volatile bool m_tainted;
87 private readonly Stack<LandUndoState> m_undo = new Stack<LandUndoState>(5); 87 private readonly Stack<LandUndoState> m_undo = new Stack<LandUndoState>(5);
88 88
89 private String m_InitialTerrain = "pinhead-island";
90
89 /// <summary> 91 /// <summary>
90 /// Human readable list of terrain file extensions that are supported. 92 /// Human readable list of terrain file extensions that are supported.
91 /// </summary> 93 /// </summary>
@@ -109,6 +111,9 @@ namespace OpenSim.Region.CoreModules.World.Terrain
109 /// <param name="config">Config for the region</param> 111 /// <param name="config">Config for the region</param>
110 public void Initialise(IConfigSource config) 112 public void Initialise(IConfigSource config)
111 { 113 {
114 IConfig terrainConfig = config.Configs["Terrain"];
115 if (terrainConfig != null)
116 m_InitialTerrain = terrainConfig.GetString("InitialTerrain", m_InitialTerrain);
112 } 117 }
113 118
114 public void AddRegion(Scene scene) 119 public void AddRegion(Scene scene)
@@ -120,7 +125,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
120 { 125 {
121 if (m_scene.Heightmap == null) 126 if (m_scene.Heightmap == null)
122 { 127 {
123 m_channel = new TerrainChannel(); 128 m_channel = new TerrainChannel(m_InitialTerrain);
124 m_scene.Heightmap = m_channel; 129 m_scene.Heightmap = m_channel;
125 m_revert = new TerrainChannel(); 130 m_revert = new TerrainChannel();
126 UpdateRevertMap(); 131 UpdateRevertMap();
@@ -556,43 +561,56 @@ namespace OpenSim.Region.CoreModules.World.Terrain
556 } 561 }
557 562
558 /// <summary> 563 /// <summary>
559 /// Saves the terrain to a larger terrain file. 564 /// Save a number of map tiles to a single big image file.
560 /// </summary> 565 /// </summary>
566 /// <remarks>
567 /// If the image file already exists then the tiles saved will replace those already in the file - other tiles
568 /// will be untouched.
569 /// </remarks>
561 /// <param name="filename">The terrain file to save</param> 570 /// <param name="filename">The terrain file to save</param>
562 /// <param name="fileWidth">The width of the file in units</param> 571 /// <param name="fileWidth">The number of tiles to save along the X axis.</param>
563 /// <param name="fileHeight">The height of the file in units</param> 572 /// <param name="fileHeight">The number of tiles to save along the Y axis.</param>
564 /// <param name="fileStartX">Where to begin our slice</param> 573 /// <param name="fileStartX">The map x co-ordinate at which to begin the save.</param>
565 /// <param name="fileStartY">Where to begin our slice</param> 574 /// <param name="fileStartY">The may y co-ordinate at which to begin the save.</param>
566 public void SaveToFile(string filename, int fileWidth, int fileHeight, int fileStartX, int fileStartY) 575 public void SaveToFile(string filename, int fileWidth, int fileHeight, int fileStartX, int fileStartY)
567 { 576 {
568 int offsetX = (int)m_scene.RegionInfo.RegionLocX - fileStartX; 577 int offsetX = (int)m_scene.RegionInfo.RegionLocX - fileStartX;
569 int offsetY = (int)m_scene.RegionInfo.RegionLocY - fileStartY; 578 int offsetY = (int)m_scene.RegionInfo.RegionLocY - fileStartY;
570 579
571 if (offsetX >= 0 && offsetX < fileWidth && offsetY >= 0 && offsetY < fileHeight) 580 if (offsetX < 0 || offsetX >= fileWidth || offsetY < 0 || offsetY >= fileHeight)
572 { 581 {
573 // this region is included in the tile request 582 MainConsole.Instance.OutputFormat(
574 foreach (KeyValuePair<string, ITerrainLoader> loader in m_loaders) 583 "ERROR: file width + minimum X tile and file height + minimum Y tile must incorporate the current region at ({0},{1}). File width {2} from {3} and file height {4} from {5} does not.",
584 m_scene.RegionInfo.RegionLocX, m_scene.RegionInfo.RegionLocY, fileWidth, fileStartX, fileHeight, fileStartY);
585
586 return;
587 }
588
589 // this region is included in the tile request
590 foreach (KeyValuePair<string, ITerrainLoader> loader in m_loaders)
591 {
592 if (filename.EndsWith(loader.Key))
575 { 593 {
576 if (filename.EndsWith(loader.Key)) 594 lock (m_scene)
577 { 595 {
578 lock (m_scene) 596 loader.Value.SaveFile(m_channel, filename, offsetX, offsetY,
579 { 597 fileWidth, fileHeight,
580 loader.Value.SaveFile(m_channel, filename, offsetX, offsetY, 598 (int)Constants.RegionSize,
581 fileWidth, fileHeight, 599 (int)Constants.RegionSize);
582 (int)Constants.RegionSize, 600
583 (int)Constants.RegionSize); 601 MainConsole.Instance.OutputFormat(
584 602 "Saved terrain from ({0},{1}) to ({2},{3}) from {4} to {5}",
585 m_log.InfoFormat("[TERRAIN]: Saved terrain from {0} to {1}", m_scene.RegionInfo.RegionName, filename); 603 fileStartX, fileStartY, fileStartX + fileWidth - 1, fileStartY + fileHeight - 1,
586 } 604 m_scene.RegionInfo.RegionName, filename);
587
588 return;
589 } 605 }
606
607 return;
590 } 608 }
591
592 m_log.ErrorFormat(
593 "[TERRAIN]: Could not save terrain from {0} to {1}. Valid file extensions are {2}",
594 m_scene.RegionInfo.RegionName, filename, m_supportedFileExtensions);
595 } 609 }
610
611 MainConsole.Instance.OutputFormat(
612 "ERROR: Could not save terrain from {0} to {1}. Valid file extensions are {2}",
613 m_scene.RegionInfo.RegionName, filename, m_supportedFileExtensions);
596 } 614 }
597 615
598 /// <summary> 616 /// <summary>
@@ -1179,8 +1197,12 @@ namespace OpenSim.Region.CoreModules.World.Terrain
1179 saveToTileCommand.AddArgument("file height", "The height of the file in tiles", "Integer"); 1197 saveToTileCommand.AddArgument("file height", "The height of the file in tiles", "Integer");
1180 saveToTileCommand.AddArgument("minimum X tile", "The X region coordinate of the first section on the file", 1198 saveToTileCommand.AddArgument("minimum X tile", "The X region coordinate of the first section on the file",
1181 "Integer"); 1199 "Integer");
1182 saveToTileCommand.AddArgument("minimum Y tile", "The Y region coordinate of the first section on the file", 1200 saveToTileCommand.AddArgument("minimum Y tile", "The Y region coordinate of the first tile on the file\n"
1183 "Integer"); 1201 + "= Example =\n"
1202 + "To save a PNG file for a set of map tiles 2 regions wide and 3 regions high from map co-ordinate (9910,10234)\n"
1203 + " # terrain save-tile ST06.png 2 3 9910 10234\n",
1204 "Integer");
1205
1184 // Terrain adjustments 1206 // Terrain adjustments
1185 Command fillRegionCommand = 1207 Command fillRegionCommand =
1186 new Command("fill", CommandIntentions.COMMAND_HAZARDOUS, InterfaceFillTerrain, "Fills the current heightmap with a specified value."); 1208 new Command("fill", CommandIntentions.COMMAND_HAZARDOUS, InterfaceFillTerrain, "Fills the current heightmap with a specified value.");
diff --git a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs
index a488725..7b6fbda 100644
--- a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs
+++ b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs
@@ -117,24 +117,31 @@ namespace OpenSim.Region.CoreModules
117 } 117 }
118 118
119 // This one puts an entry in the main help screen 119 // This one puts an entry in the main help screen
120 m_scene.AddCommand(this, String.Empty, "wind", "Usage: wind <plugin> <param> [value] - Get or Update Wind paramaters", null); 120// m_scene.AddCommand("Regions", this, "wind", "wind", "Usage: wind <plugin> <param> [value] - Get or Update Wind paramaters", null);
121 121
122 // This one enables the ability to type just the base command without any parameters 122 // This one enables the ability to type just the base command without any parameters
123 m_scene.AddCommand(this, "wind", "", "", HandleConsoleCommand); 123// m_scene.AddCommand("Regions", this, "wind", "", "", HandleConsoleCommand);
124 124
125 // Get a list of the parameters for each plugin 125 // Get a list of the parameters for each plugin
126 foreach (IWindModelPlugin windPlugin in m_availableWindPlugins.Values) 126 foreach (IWindModelPlugin windPlugin in m_availableWindPlugins.Values)
127 { 127 {
128 m_scene.AddCommand(this, String.Format("wind base wind_plugin {0}", windPlugin.Name), String.Format("{0} - {1}", windPlugin.Name, windPlugin.Description), "", HandleConsoleBaseCommand); 128// m_scene.AddCommand("Regions", this, String.Format("wind base wind_plugin {0}", windPlugin.Name), String.Format("{0} - {1}", windPlugin.Name, windPlugin.Description), "", HandleConsoleBaseCommand);
129 m_scene.AddCommand(this, String.Format("wind base wind_update_rate"), "Change the wind update rate.", "", HandleConsoleBaseCommand); 129 m_scene.AddCommand(
130 "Regions",
131 this,
132 "wind base wind_update_rate",
133 "wind base wind_update_rate [<value>]",
134 "Get or set the wind update rate.",
135 "",
136 HandleConsoleBaseCommand);
130 137
131 foreach (KeyValuePair<string, string> kvp in windPlugin.WindParams()) 138 foreach (KeyValuePair<string, string> kvp in windPlugin.WindParams())
132 { 139 {
133 m_scene.AddCommand(this, String.Format("wind {0} {1}", windPlugin.Name, kvp.Key), String.Format("{0} : {1} - {2}", windPlugin.Name, kvp.Key, kvp.Value), "", HandleConsoleParamCommand); 140 string windCommand = String.Format("wind {0} {1}", windPlugin.Name, kvp.Key);
141 m_scene.AddCommand("Regions", this, windCommand, string.Format("{0} [<value>]", windCommand), kvp.Value, "", HandleConsoleParamCommand);
134 } 142 }
135 } 143 }
136 144
137
138 // Register event handlers for when Avatars enter the region, and frame ticks 145 // Register event handlers for when Avatars enter the region, and frame ticks
139 m_scene.EventManager.OnFrame += WindUpdate; 146 m_scene.EventManager.OnFrame += WindUpdate;
140 m_scene.EventManager.OnMakeRootAgent += OnAgentEnteredRegion; 147 m_scene.EventManager.OnMakeRootAgent += OnAgentEnteredRegion;
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
index 657975b..f37dd94 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
@@ -92,7 +92,23 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
92 return; 92 return;
93 } 93 }
94 94
95//m_log.DebugFormat("MAP NAME=({0})", mapName); 95 //m_log.DebugFormat("MAP NAME=({0})", mapName);
96
97 // Hack to get around the fact that ll V3 now drops the port from the
98 // map name. See https://jira.secondlife.com/browse/VWR-28570
99 //
100 // Caller, use this magic form instead:
101 // secondlife://http|!!mygrid.com|8002|Region+Name/128/128
102 // or url encode if possible.
103 // the hacks we do with this viewer...
104 //
105 string mapNameOrig = mapName;
106 if (mapName.Contains("|"))
107 mapName = mapName.Replace('|', ':');
108 if (mapName.Contains("+"))
109 mapName = mapName.Replace('+', ' ');
110 if (mapName.Contains("!"))
111 mapName = mapName.Replace('!', '/');
96 112
97 // try to fetch from GridServer 113 // try to fetch from GridServer
98 List<GridRegion> regionInfos = m_scene.GridService.GetRegionsByName(m_scene.RegionInfo.ScopeID, mapName, 20); 114 List<GridRegion> regionInfos = m_scene.GridService.GetRegionsByName(m_scene.RegionInfo.ScopeID, mapName, 20);
@@ -114,7 +130,12 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
114 data.MapImageId = UUID.Zero; 130 data.MapImageId = UUID.Zero;
115 else 131 else
116 data.MapImageId = info.TerrainImage; 132 data.MapImageId = info.TerrainImage;
117 data.Name = info.RegionName; 133 // ugh! V2-3 is very sensitive about the result being
134 // exactly the same as the requested name
135 if (regionInfos.Count == 1 && mapNameOrig.Contains("|") || mapNameOrig.Contains("+"))
136 data.Name = mapNameOrig;
137 else
138 data.Name = info.RegionName;
118 data.RegionFlags = 0; // TODO not used? 139 data.RegionFlags = 0; // TODO not used?
119 data.WaterHeight = 0; // not used 140 data.WaterHeight = 0; // not used
120 data.X = (ushort)(info.RegionLocX / Constants.RegionSize); 141 data.X = (ushort)(info.RegionLocX / Constants.RegionSize);
@@ -138,6 +159,17 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
138 // flags are agent flags sent from the viewer. 159 // flags are agent flags sent from the viewer.
139 // they have different values depending on different viewers, apparently 160 // they have different values depending on different viewers, apparently
140 remoteClient.SendMapBlock(blocks, flags); 161 remoteClient.SendMapBlock(blocks, flags);
162
163 // send extra user messages for V3
164 // because the UI is very confusing
165 // while we don't fix the hard-coded urls
166 if (flags == 2)
167 {
168 if (regionInfos.Count == 0)
169 remoteClient.SendAgentAlertMessage("No regions found with that name.", true);
170 else if (regionInfos.Count == 1)
171 remoteClient.SendAgentAlertMessage("Region found!", false);
172 }
141 } 173 }
142 174
143// private Scene GetClientScene(IClientAPI client) 175// private Scene GetClientScene(IClientAPI client)
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
index fd122da..faaf928 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
@@ -102,7 +102,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
102 m_scene.RegisterModuleInterface<IWorldMapModule>(this); 102 m_scene.RegisterModuleInterface<IWorldMapModule>(this);
103 103
104 m_scene.AddCommand( 104 m_scene.AddCommand(
105 this, "export-map", 105 "Regions", this, "export-map",
106 "export-map [<path>]", 106 "export-map [<path>]",
107 "Save an image of the world map", HandleExportWorldMapConsoleCommand); 107 "Save an image of the world map", HandleExportWorldMapConsoleCommand);
108 108