diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World')
22 files changed, 322 insertions, 140 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 376ea8a..65f83fd 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -110,12 +110,12 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
110 | TarArchiveReader.TarEntryType entryType; | 110 | TarArchiveReader.TarEntryType entryType; |
111 | 111 | ||
112 | while ((data = archive.ReadEntry(out filePath, out entryType)) != null) | 112 | while ((data = archive.ReadEntry(out filePath, out entryType)) != null) |
113 | { | 113 | { |
114 | //m_log.DebugFormat( | 114 | //m_log.DebugFormat( |
115 | // "[ARCHIVER]: Successfully read {0} ({1} bytes)", filePath, data.Length); | 115 | // "[ARCHIVER]: Successfully read {0} ({1} bytes)", filePath, data.Length); |
116 | 116 | ||
117 | if (TarArchiveReader.TarEntryType.TYPE_DIRECTORY == entryType) | 117 | if (TarArchiveReader.TarEntryType.TYPE_DIRECTORY == entryType) |
118 | continue; | 118 | continue; |
119 | 119 | ||
120 | if (filePath.StartsWith(ArchiveConstants.OBJECTS_PATH)) | 120 | if (filePath.StartsWith(ArchiveConstants.OBJECTS_PATH)) |
121 | { | 121 | { |
@@ -173,7 +173,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
173 | m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects. Please wait.", serialisedSceneObjects.Count); | 173 | m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects. Please wait.", serialisedSceneObjects.Count); |
174 | 174 | ||
175 | IRegionSerialiserModule serialiser = m_scene.RequestModuleInterface<IRegionSerialiserModule>(); | 175 | IRegionSerialiserModule serialiser = m_scene.RequestModuleInterface<IRegionSerialiserModule>(); |
176 | int sceneObjectsLoadedCount = 0; | 176 | int sceneObjectsLoadedCount = 0; |
177 | 177 | ||
178 | foreach (string serialisedSceneObject in serialisedSceneObjects) | 178 | foreach (string serialisedSceneObject in serialisedSceneObjects) |
179 | { | 179 | { |
@@ -499,7 +499,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
499 | XmlParserContext context = new XmlParserContext(null, nsmgr, null, XmlSpace.None); | 499 | XmlParserContext context = new XmlParserContext(null, nsmgr, null, XmlSpace.None); |
500 | 500 | ||
501 | XmlTextReader xtr | 501 | XmlTextReader xtr |
502 | = new XmlTextReader(m_asciiEncoding.GetString(data), XmlNodeType.Document, context); | 502 | = new XmlTextReader(m_asciiEncoding.GetString(data), XmlNodeType.Document, context); |
503 | 503 | ||
504 | RegionSettings currentRegionSettings = m_scene.RegionInfo.RegionSettings; | 504 | RegionSettings currentRegionSettings = m_scene.RegionInfo.RegionSettings; |
505 | 505 | ||
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs index 63608a8..9e4fbbe 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs | |||
@@ -74,14 +74,14 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
74 | m_scene = scene; | 74 | m_scene = scene; |
75 | m_saveStream = saveStream; | 75 | m_saveStream = saveStream; |
76 | m_requestId = requestId; | 76 | m_requestId = requestId; |
77 | } | 77 | } |
78 | 78 | ||
79 | /// <summary> | 79 | /// <summary> |
80 | /// Archive the region requested. | 80 | /// Archive the region requested. |
81 | /// </summary> | 81 | /// </summary> |
82 | /// <exception cref="System.IO.IOException">if there was an io problem with creating the file</exception> | 82 | /// <exception cref="System.IO.IOException">if there was an io problem with creating the file</exception> |
83 | public void ArchiveRegion() | 83 | public void ArchiveRegion() |
84 | { | 84 | { |
85 | Dictionary<UUID, int> assetUuids = new Dictionary<UUID, int>(); | 85 | Dictionary<UUID, int> assetUuids = new Dictionary<UUID, int>(); |
86 | 86 | ||
87 | List<EntityBase> entities = m_scene.GetEntities(); | 87 | List<EntityBase> entities = m_scene.GetEntities(); |
@@ -137,7 +137,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
137 | m_scene.RequestModuleInterface<IRegionSerialiserModule>(), | 137 | m_scene.RequestModuleInterface<IRegionSerialiserModule>(), |
138 | m_scene, | 138 | m_scene, |
139 | archiveWriter, | 139 | archiveWriter, |
140 | m_requestId); | 140 | m_requestId); |
141 | 141 | ||
142 | new AssetsRequest( | 142 | new AssetsRequest( |
143 | new AssetsArchiver(archiveWriter), assetUuids.Keys, | 143 | new AssetsArchiver(archiveWriter), assetUuids.Keys, |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs index 5c58b69..8d4f91b 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs | |||
@@ -78,7 +78,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
78 | 78 | ||
79 | public void Close() | 79 | public void Close() |
80 | { | 80 | { |
81 | } | 81 | } |
82 | 82 | ||
83 | public void ArchiveRegion(string savePath) | 83 | public void ArchiveRegion(string savePath) |
84 | { | 84 | { |
@@ -90,7 +90,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
90 | m_log.InfoFormat( | 90 | m_log.InfoFormat( |
91 | "[ARCHIVER]: Writing archive for region {0} to {1}", m_scene.RegionInfo.RegionName, savePath); | 91 | "[ARCHIVER]: Writing archive for region {0} to {1}", m_scene.RegionInfo.RegionName, savePath); |
92 | 92 | ||
93 | new ArchiveWriteRequestPreparation(m_scene, savePath, requestId).ArchiveRegion(); | 93 | new ArchiveWriteRequestPreparation(m_scene, savePath, requestId).ArchiveRegion(); |
94 | } | 94 | } |
95 | 95 | ||
96 | public void ArchiveRegion(Stream saveStream) | 96 | public void ArchiveRegion(Stream saveStream) |
@@ -101,7 +101,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
101 | public void ArchiveRegion(Stream saveStream, Guid requestId) | 101 | public void ArchiveRegion(Stream saveStream, Guid requestId) |
102 | { | 102 | { |
103 | new ArchiveWriteRequestPreparation(m_scene, saveStream, requestId).ArchiveRegion(); | 103 | new ArchiveWriteRequestPreparation(m_scene, saveStream, requestId).ArchiveRegion(); |
104 | } | 104 | } |
105 | 105 | ||
106 | public void DearchiveRegion(string loadPath) | 106 | public void DearchiveRegion(string loadPath) |
107 | { | 107 | { |
@@ -114,7 +114,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
114 | "[ARCHIVER]: Loading archive to region {0} from {1}", m_scene.RegionInfo.RegionName, loadPath); | 114 | "[ARCHIVER]: Loading archive to region {0} from {1}", m_scene.RegionInfo.RegionName, loadPath); |
115 | 115 | ||
116 | new ArchiveReadRequest(m_scene, loadPath, merge, requestId).DearchiveRegion(); | 116 | new ArchiveReadRequest(m_scene, loadPath, merge, requestId).DearchiveRegion(); |
117 | } | 117 | } |
118 | 118 | ||
119 | public void DearchiveRegion(Stream loadStream) | 119 | public void DearchiveRegion(Stream loadStream) |
120 | { | 120 | { |
@@ -124,6 +124,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
124 | public void DearchiveRegion(Stream loadStream, bool merge, Guid requestId) | 124 | public void DearchiveRegion(Stream loadStream, bool merge, Guid requestId) |
125 | { | 125 | { |
126 | new ArchiveReadRequest(m_scene, loadStream, merge, requestId).DearchiveRegion(); | 126 | new ArchiveReadRequest(m_scene, loadStream, merge, requestId).DearchiveRegion(); |
127 | } | 127 | } |
128 | } | 128 | } |
129 | } | 129 | } |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs index 330fa3f..95d109c 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs | |||
@@ -65,7 +65,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
65 | /// </summary> | 65 | /// </summary> |
66 | /// <param name="archive"></param> | 66 | /// <param name="archive"></param> |
67 | public void WriteAsset(AssetBase asset) | 67 | public void WriteAsset(AssetBase asset) |
68 | { | 68 | { |
69 | //WriteMetadata(archive); | 69 | //WriteMetadata(archive); |
70 | WriteData(asset); | 70 | WriteData(asset); |
71 | } | 71 | } |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs index 82803bf..fe9c8d9 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs | |||
@@ -115,7 +115,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
115 | 115 | ||
116 | m_requestCallbackTimer = new System.Timers.Timer(TIMEOUT); | 116 | m_requestCallbackTimer = new System.Timers.Timer(TIMEOUT); |
117 | m_requestCallbackTimer.AutoReset = false; | 117 | m_requestCallbackTimer.AutoReset = false; |
118 | m_requestCallbackTimer.Elapsed += new ElapsedEventHandler(OnRequestCallbackTimeout); | 118 | m_requestCallbackTimer.Elapsed += new ElapsedEventHandler(OnRequestCallbackTimeout); |
119 | } | 119 | } |
120 | 120 | ||
121 | protected internal void Execute() | 121 | protected internal void Execute() |
@@ -143,7 +143,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
143 | protected void OnRequestCallbackTimeout(object source, ElapsedEventArgs args) | 143 | protected void OnRequestCallbackTimeout(object source, ElapsedEventArgs args) |
144 | { | 144 | { |
145 | try | 145 | try |
146 | { | 146 | { |
147 | lock (this) | 147 | lock (this) |
148 | { | 148 | { |
149 | // Take care of the possibilty that this thread started but was paused just outside the lock before | 149 | // Take care of the possibilty that this thread started but was paused just outside the lock before |
@@ -155,7 +155,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
155 | } | 155 | } |
156 | 156 | ||
157 | // Calculate which uuids were not found. This is an expensive way of doing it, but this is a failure | 157 | // Calculate which uuids were not found. This is an expensive way of doing it, but this is a failure |
158 | // case anyway. | 158 | // case anyway. |
159 | List<UUID> uuids = new List<UUID>(); | 159 | List<UUID> uuids = new List<UUID>(); |
160 | foreach (UUID uuid in m_uuids) | 160 | foreach (UUID uuid in m_uuids) |
161 | { | 161 | { |
@@ -188,7 +188,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
188 | m_log.ErrorFormat( | 188 | m_log.ErrorFormat( |
189 | "[ARCHIVER]: (... {0} more not shown)", uuids.Count - MAX_UUID_DISPLAY_ON_TIMEOUT); | 189 | "[ARCHIVER]: (... {0} more not shown)", uuids.Count - MAX_UUID_DISPLAY_ON_TIMEOUT); |
190 | 190 | ||
191 | m_log.Error("[ARCHIVER]: OAR save aborted."); | 191 | m_log.Error("[ARCHIVER]: OAR save aborted."); |
192 | } | 192 | } |
193 | catch (Exception e) | 193 | catch (Exception e) |
194 | { | 194 | { |
@@ -213,7 +213,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
213 | { | 213 | { |
214 | //m_log.DebugFormat("[ARCHIVER]: Received callback for asset {0}", id); | 214 | //m_log.DebugFormat("[ARCHIVER]: Received callback for asset {0}", id); |
215 | 215 | ||
216 | m_requestCallbackTimer.Stop(); | 216 | m_requestCallbackTimer.Stop(); |
217 | 217 | ||
218 | if (m_requestState == RequestState.Aborted) | 218 | if (m_requestState == RequestState.Aborted) |
219 | { | 219 | { |
@@ -258,7 +258,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
258 | } | 258 | } |
259 | catch (Exception e) | 259 | catch (Exception e) |
260 | { | 260 | { |
261 | m_log.ErrorFormat("[ARCHIVER]: AssetRequestCallback failed with {0}", e); | 261 | m_log.ErrorFormat("[ARCHIVER]: AssetRequestCallback failed with {0}", e); |
262 | } | 262 | } |
263 | } | 263 | } |
264 | 264 | ||
diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index 5c42e94..edac4a4 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs | |||
@@ -59,7 +59,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
59 | m_lastErrorMessage = errorMessage; | 59 | m_lastErrorMessage = errorMessage; |
60 | Console.WriteLine("About to pulse ArchiverTests on LoadCompleted"); | 60 | Console.WriteLine("About to pulse ArchiverTests on LoadCompleted"); |
61 | 61 | ||
62 | Monitor.PulseAll(this); | 62 | Monitor.PulseAll(this); |
63 | } | 63 | } |
64 | } | 64 | } |
65 | 65 | ||
@@ -138,7 +138,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
138 | archiverModule.ArchiveRegion(archiveWriteStream, requestId); | 138 | archiverModule.ArchiveRegion(archiveWriteStream, requestId); |
139 | //AssetServerBase assetServer = (AssetServerBase)scene.CommsManager.AssetCache.AssetServer; | 139 | //AssetServerBase assetServer = (AssetServerBase)scene.CommsManager.AssetCache.AssetServer; |
140 | //while (assetServer.HasWaitingRequests()) | 140 | //while (assetServer.HasWaitingRequests()) |
141 | // assetServer.ProcessNextRequest(); | 141 | // assetServer.ProcessNextRequest(); |
142 | 142 | ||
143 | Monitor.Wait(this, 60000); | 143 | Monitor.Wait(this, 60000); |
144 | } | 144 | } |
@@ -213,7 +213,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
213 | 213 | ||
214 | // Also check that direct entries which will also have a file entry containing that directory doesn't | 214 | // Also check that direct entries which will also have a file entry containing that directory doesn't |
215 | // upset load | 215 | // upset load |
216 | tar.WriteDir(ArchiveConstants.TERRAINS_PATH); | 216 | tar.WriteDir(ArchiveConstants.TERRAINS_PATH); |
217 | 217 | ||
218 | tar.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, ArchiveWriteRequestExecution.Create0p2ControlFile()); | 218 | tar.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, ArchiveWriteRequestExecution.Create0p2ControlFile()); |
219 | 219 | ||
@@ -251,7 +251,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
251 | { | 251 | { |
252 | scene.EventManager.OnOarFileLoaded += LoadCompleted; | 252 | scene.EventManager.OnOarFileLoaded += LoadCompleted; |
253 | archiverModule.DearchiveRegion(archiveReadStream); | 253 | archiverModule.DearchiveRegion(archiveReadStream); |
254 | } | 254 | } |
255 | 255 | ||
256 | Assert.That(m_lastErrorMessage, Is.Null); | 256 | Assert.That(m_lastErrorMessage, Is.Null); |
257 | 257 | ||
@@ -271,7 +271,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
271 | 271 | ||
272 | /// <summary> | 272 | /// <summary> |
273 | /// Test merging a V0.2 OpenSim Region Archive into an existing scene | 273 | /// Test merging a V0.2 OpenSim Region Archive into an existing scene |
274 | /// </summary> | 274 | /// </summary> |
275 | //[Test] | 275 | //[Test] |
276 | public void TestMergeOarV0_2() | 276 | public void TestMergeOarV0_2() |
277 | { | 277 | { |
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 75b3fe6..4896edf 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | |||
@@ -33,7 +33,6 @@ using log4net; | |||
33 | using Nini.Config; | 33 | using Nini.Config; |
34 | using OpenMetaverse; | 34 | using OpenMetaverse; |
35 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
36 | using OpenSim.Region.CoreModules.World.Terrain; | ||
37 | using OpenSim.Region.Framework.Interfaces; | 36 | using OpenSim.Region.Framework.Interfaces; |
38 | using OpenSim.Region.Framework.Scenes; | 37 | using OpenSim.Region.Framework.Scenes; |
39 | 38 | ||
@@ -47,7 +46,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
47 | 46 | ||
48 | private Scene m_scene; | 47 | private Scene m_scene; |
49 | 48 | ||
50 | private EstateTerrainXferHandler TerrainUploader = null; | 49 | private EstateTerrainXferHandler TerrainUploader; |
51 | 50 | ||
52 | #region Packet Data Responders | 51 | #region Packet Data Responders |
53 | 52 | ||
@@ -155,6 +154,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
155 | break; | 154 | break; |
156 | } | 155 | } |
157 | m_scene.RegionInfo.RegionSettings.Save(); | 156 | m_scene.RegionInfo.RegionSettings.Save(); |
157 | sendRegionInfoPacketToAll(); | ||
158 | } | 158 | } |
159 | 159 | ||
160 | public void setEstateTerrainTextureHeights(IClientAPI client, int corner, float lowValue, float highValue) | 160 | public void setEstateTerrainTextureHeights(IClientAPI client, int corner, float lowValue, float highValue) |
@@ -179,6 +179,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
179 | break; | 179 | break; |
180 | } | 180 | } |
181 | m_scene.RegionInfo.RegionSettings.Save(); | 181 | m_scene.RegionInfo.RegionSettings.Save(); |
182 | sendRegionInfoPacketToAll(); | ||
182 | } | 183 | } |
183 | 184 | ||
184 | private void handleCommitEstateTerrainTextureRequest(IClientAPI remoteClient) | 185 | private void handleCommitEstateTerrainTextureRequest(IClientAPI remoteClient) |
@@ -668,7 +669,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
668 | LookupUUID(uuidNameLookupList); | 669 | LookupUUID(uuidNameLookupList); |
669 | } | 670 | } |
670 | 671 | ||
671 | private void LookupUUIDSCompleted(IAsyncResult iar) | 672 | private static void LookupUUIDSCompleted(IAsyncResult iar) |
672 | { | 673 | { |
673 | LookupUUIDS icon = (LookupUUIDS)iar.AsyncState; | 674 | LookupUUIDS icon = (LookupUUIDS)iar.AsyncState; |
674 | icon.EndInvoke(iar); | 675 | icon.EndInvoke(iar); |
@@ -683,7 +684,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
683 | } | 684 | } |
684 | private void LookupUUIDsAsync(List<UUID> uuidLst) | 685 | private void LookupUUIDsAsync(List<UUID> uuidLst) |
685 | { | 686 | { |
686 | UUID[] uuidarr = new UUID[0]; | 687 | UUID[] uuidarr; |
687 | 688 | ||
688 | lock (uuidLst) | 689 | lock (uuidLst) |
689 | { | 690 | { |
@@ -707,7 +708,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
707 | 708 | ||
708 | for (int i = 0; i < avatars.Count; i++) | 709 | for (int i = 0; i < avatars.Count; i++) |
709 | { | 710 | { |
710 | HandleRegionInfoRequest(avatars[i].ControllingClient); ; | 711 | HandleRegionInfoRequest(avatars[i].ControllingClient); |
711 | } | 712 | } |
712 | } | 713 | } |
713 | 714 | ||
@@ -768,7 +769,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
768 | else | 769 | else |
769 | { | 770 | { |
770 | m_scene.RegionInfo.EstateSettings.UseGlobalTime = false; | 771 | m_scene.RegionInfo.EstateSettings.UseGlobalTime = false; |
771 | m_scene.RegionInfo.EstateSettings.SunPosition = (double)(parms2 - 0x1800)/1024.0; | 772 | m_scene.RegionInfo.EstateSettings.SunPosition = (parms2 - 0x1800)/1024.0; |
772 | } | 773 | } |
773 | 774 | ||
774 | if ((parms1 & 0x00000010) != 0) | 775 | if ((parms1 & 0x00000010) != 0) |
@@ -828,8 +829,108 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
828 | m_scene.RegisterModuleInterface<IEstateModule>(this); | 829 | m_scene.RegisterModuleInterface<IEstateModule>(this); |
829 | m_scene.EventManager.OnNewClient += EventManager_OnNewClient; | 830 | m_scene.EventManager.OnNewClient += EventManager_OnNewClient; |
830 | m_scene.EventManager.OnRequestChangeWaterHeight += changeWaterHeight; | 831 | m_scene.EventManager.OnRequestChangeWaterHeight += changeWaterHeight; |
832 | |||
833 | m_scene.AddCommand(this, "set terrain texture", | ||
834 | "set terrain texture <number> <uuid> [<x>] [<y>]", | ||
835 | "Sets the terrain <number> to <uuid>, if <x> or <y> are specified, it will only " + | ||
836 | "set it on regions with a matching coordinate. Specify -1 in <x> or <y> to wildcard" + | ||
837 | " that coordinate.", | ||
838 | consoleSetTerrainTexture); | ||
839 | |||
840 | m_scene.AddCommand(this, "set terrain heights", | ||
841 | "set terrain heights <corner> <min> <max> [<x>] [<y>]", | ||
842 | "Sets the terrain texture heights on corner #<corner> to <min>/<max>, if <x> or <y> are specified, it will only " + | ||
843 | "set it on regions with a matching coordinate. Specify -1 in <x> or <y> to wildcard" + | ||
844 | " that coordinate. Corner # SW = 0, NW = 1, SE = 2, NE = 3.", | ||
845 | consoleSetTerrainHeights); | ||
846 | } | ||
847 | |||
848 | #region Console Commands | ||
849 | |||
850 | public void consoleSetTerrainTexture(string module, string[] args) | ||
851 | { | ||
852 | string num = args[3]; | ||
853 | string uuid = args[4]; | ||
854 | int x = (args.Length > 5 ? int.Parse(args[5]) : -1); | ||
855 | int y = (args.Length > 6 ? int.Parse(args[6]) : -1); | ||
856 | |||
857 | if (x == -1 || m_scene.RegionInfo.RegionLocX == x) | ||
858 | { | ||
859 | if (y == -1 || m_scene.RegionInfo.RegionLocY == y) | ||
860 | { | ||
861 | int corner = int.Parse(num); | ||
862 | UUID texture = UUID.Parse(uuid); | ||
863 | |||
864 | m_log.Debug("[ESTATEMODULE] Setting terrain textures for " + m_scene.RegionInfo.RegionName + | ||
865 | string.Format(" (C#{0} = {1})", corner, texture)); | ||
866 | |||
867 | switch (corner) | ||
868 | { | ||
869 | case 0: | ||
870 | m_scene.RegionInfo.RegionSettings.TerrainTexture1 = texture; | ||
871 | break; | ||
872 | case 1: | ||
873 | m_scene.RegionInfo.RegionSettings.TerrainTexture2 = texture; | ||
874 | break; | ||
875 | case 2: | ||
876 | m_scene.RegionInfo.RegionSettings.TerrainTexture3 = texture; | ||
877 | break; | ||
878 | case 3: | ||
879 | m_scene.RegionInfo.RegionSettings.TerrainTexture4 = texture; | ||
880 | break; | ||
881 | } | ||
882 | m_scene.RegionInfo.RegionSettings.Save(); | ||
883 | sendRegionInfoPacketToAll(); | ||
884 | |||
885 | } | ||
886 | } | ||
887 | } | ||
888 | |||
889 | public void consoleSetTerrainHeights(string module, string[] args) | ||
890 | { | ||
891 | string num = args[3]; | ||
892 | string min = args[4]; | ||
893 | string max = args[5]; | ||
894 | int x = (args.Length > 6 ? int.Parse(args[6]) : -1); | ||
895 | int y = (args.Length > 7 ? int.Parse(args[7]) : -1); | ||
896 | |||
897 | if (x == -1 || m_scene.RegionInfo.RegionLocX == x) | ||
898 | { | ||
899 | if (y == -1 || m_scene.RegionInfo.RegionLocY == y) | ||
900 | { | ||
901 | int corner = int.Parse(num); | ||
902 | float lowValue = float.Parse(min); | ||
903 | float highValue = float.Parse(max); | ||
904 | |||
905 | m_log.Debug("[ESTATEMODULE] Setting terrain heights " + m_scene.RegionInfo.RegionName + | ||
906 | string.Format(" (C{0}, {1}-{2}", corner, lowValue, highValue)); | ||
907 | |||
908 | switch (corner) | ||
909 | { | ||
910 | case 0: | ||
911 | m_scene.RegionInfo.RegionSettings.Elevation1SW = lowValue; | ||
912 | m_scene.RegionInfo.RegionSettings.Elevation2SW = highValue; | ||
913 | break; | ||
914 | case 1: | ||
915 | m_scene.RegionInfo.RegionSettings.Elevation1NW = lowValue; | ||
916 | m_scene.RegionInfo.RegionSettings.Elevation2NW = highValue; | ||
917 | break; | ||
918 | case 2: | ||
919 | m_scene.RegionInfo.RegionSettings.Elevation1SE = lowValue; | ||
920 | m_scene.RegionInfo.RegionSettings.Elevation2SE = highValue; | ||
921 | break; | ||
922 | case 3: | ||
923 | m_scene.RegionInfo.RegionSettings.Elevation1NE = lowValue; | ||
924 | m_scene.RegionInfo.RegionSettings.Elevation2NE = highValue; | ||
925 | break; | ||
926 | } | ||
927 | m_scene.RegionInfo.RegionSettings.Save(); | ||
928 | sendRegionHandshakeToAll(); | ||
929 | } | ||
930 | } | ||
831 | } | 931 | } |
832 | 932 | ||
933 | #endregion | ||
833 | 934 | ||
834 | public void PostInitialise() | 935 | public void PostInitialise() |
835 | { | 936 | { |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 76ff6da..fdff61e 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -36,10 +36,12 @@ using OpenSim.Framework; | |||
36 | using OpenSim.Framework.Capabilities; | 36 | using OpenSim.Framework.Capabilities; |
37 | using OpenSim.Framework.Servers; | 37 | using OpenSim.Framework.Servers; |
38 | using OpenSim.Framework.Servers.HttpServer; | 38 | using OpenSim.Framework.Servers.HttpServer; |
39 | using OpenSim.Services.Interfaces; | ||
39 | using OpenSim.Region.Framework.Interfaces; | 40 | using OpenSim.Region.Framework.Interfaces; |
40 | using OpenSim.Region.Framework.Scenes; | 41 | using OpenSim.Region.Framework.Scenes; |
41 | using OpenSim.Region.Physics.Manager; | 42 | using OpenSim.Region.Physics.Manager; |
42 | using Caps=OpenSim.Framework.Capabilities.Caps; | 43 | using Caps=OpenSim.Framework.Capabilities.Caps; |
44 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | ||
43 | 45 | ||
44 | namespace OpenSim.Region.CoreModules.World.Land | 46 | namespace OpenSim.Region.CoreModules.World.Land |
45 | { | 47 | { |
@@ -1301,7 +1303,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1301 | else | 1303 | else |
1302 | { | 1304 | { |
1303 | // a parcel request for a parcel in another region. Ask the grid about the region | 1305 | // a parcel request for a parcel in another region. Ask the grid about the region |
1304 | RegionInfo info = m_scene.CommsManager.GridService.RequestNeighbourInfo(regionID); | 1306 | GridRegion info = m_scene.GridService.GetRegionByUUID(UUID.Zero, regionID); |
1305 | if (info != null) | 1307 | if (info != null) |
1306 | parcelID = Util.BuildFakeParcelID(info.RegionHandle, x, y); | 1308 | parcelID = Util.BuildFakeParcelID(info.RegionHandle, x, y); |
1307 | } | 1309 | } |
@@ -1359,9 +1361,10 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1359 | } | 1361 | } |
1360 | else | 1362 | else |
1361 | { | 1363 | { |
1362 | extLandData.landData = m_scene.CommsManager.GridService.RequestLandData(extLandData.regionHandle, | 1364 | ILandService landService = m_scene.RequestModuleInterface<ILandService>(); |
1363 | extLandData.x, | 1365 | extLandData.landData = landService.GetLandData(extLandData.regionHandle, |
1364 | extLandData.y); | 1366 | extLandData.x, |
1367 | extLandData.y); | ||
1365 | if (extLandData.landData == null) | 1368 | if (extLandData.landData == null) |
1366 | { | 1369 | { |
1367 | // we didn't find the region/land => don't cache | 1370 | // we didn't find the region/land => don't cache |
@@ -1373,20 +1376,27 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1373 | 1376 | ||
1374 | if (data != null) // if we found some data, send it | 1377 | if (data != null) // if we found some data, send it |
1375 | { | 1378 | { |
1376 | RegionInfo info; | 1379 | GridRegion info; |
1377 | if (data.regionHandle == m_scene.RegionInfo.RegionHandle) | 1380 | if (data.regionHandle == m_scene.RegionInfo.RegionHandle) |
1378 | { | 1381 | { |
1379 | info = m_scene.RegionInfo; | 1382 | info = new GridRegion(m_scene.RegionInfo); |
1380 | } | 1383 | } |
1381 | else | 1384 | else |
1382 | { | 1385 | { |
1383 | // most likely still cached from building the extLandData entry | 1386 | // most likely still cached from building the extLandData entry |
1384 | info = m_scene.CommsManager.GridService.RequestNeighbourInfo(data.regionHandle); | 1387 | uint x = 0, y = 0; |
1388 | Utils.LongToUInts(data.regionHandle, out x, out y); | ||
1389 | info = m_scene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y); | ||
1385 | } | 1390 | } |
1386 | // we need to transfer the fake parcelID, not the one in landData, so the viewer can match it to the landmark. | 1391 | // we need to transfer the fake parcelID, not the one in landData, so the viewer can match it to the landmark. |
1387 | m_log.DebugFormat("[LAND] got parcelinfo for parcel {0} in region {1}; sending...", | 1392 | m_log.DebugFormat("[LAND] got parcelinfo for parcel {0} in region {1}; sending...", |
1388 | data.landData.Name, data.regionHandle); | 1393 | data.landData.Name, data.regionHandle); |
1389 | remoteClient.SendParcelInfo(info, data.landData, parcelID, data.x, data.y); | 1394 | // HACK for now |
1395 | RegionInfo r = new RegionInfo(); | ||
1396 | r.RegionName = info.RegionName; | ||
1397 | r.RegionLocX = (uint)info.RegionLocX; | ||
1398 | r.RegionLocY = (uint)info.RegionLocY; | ||
1399 | remoteClient.SendParcelInfo(r, data.landData, parcelID, data.x, data.y); | ||
1390 | } | 1400 | } |
1391 | else | 1401 | else |
1392 | m_log.Debug("[LAND] got no parcelinfo; not sending"); | 1402 | m_log.Debug("[LAND] got no parcelinfo; not sending"); |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 2701f60..3be5f45 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs | |||
@@ -954,7 +954,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
954 | public void SetMediaUrl(string url) | 954 | public void SetMediaUrl(string url) |
955 | { | 955 | { |
956 | landData.MediaURL = url; | 956 | landData.MediaURL = url; |
957 | sendLandUpdateToAvatarsOverMe(); | 957 | sendLandUpdateToAvatarsOverMe(); |
958 | } | 958 | } |
959 | 959 | ||
960 | /// <summary> | 960 | /// <summary> |
@@ -964,7 +964,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
964 | public void SetMusicUrl(string url) | 964 | public void SetMusicUrl(string url) |
965 | { | 965 | { |
966 | landData.MusicURL = url; | 966 | landData.MusicURL = url; |
967 | sendLandUpdateToAvatarsOverMe(); | 967 | sendLandUpdateToAvatarsOverMe(); |
968 | } | 968 | } |
969 | } | 969 | } |
970 | } | 970 | } |
diff --git a/OpenSim/Region/CoreModules/World/Land/RegionCombinerIndividualEventForwarder.cs b/OpenSim/Region/CoreModules/World/Land/RegionCombinerIndividualEventForwarder.cs index 65f22b1..2cbaf96 100644 --- a/OpenSim/Region/CoreModules/World/Land/RegionCombinerIndividualEventForwarder.cs +++ b/OpenSim/Region/CoreModules/World/Land/RegionCombinerIndividualEventForwarder.cs | |||
@@ -85,7 +85,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
85 | private void LocalRezObject(IClientAPI remoteclient, UUID itemid, Vector3 rayend, Vector3 raystart, | 85 | private void LocalRezObject(IClientAPI remoteclient, UUID itemid, Vector3 rayend, Vector3 raystart, |
86 | UUID raytargetid, byte bypassraycast, bool rayendisintersection, bool rezselected, bool removeitem, | 86 | UUID raytargetid, byte bypassraycast, bool rayendisintersection, bool rezselected, bool removeitem, |
87 | UUID fromtaskid) | 87 | UUID fromtaskid) |
88 | { | 88 | { |
89 | int differenceX = (int)m_virtScene.RegionInfo.RegionLocX - (int)m_rootScene.RegionInfo.RegionLocX; | 89 | int differenceX = (int)m_virtScene.RegionInfo.RegionLocX - (int)m_rootScene.RegionInfo.RegionLocX; |
90 | int differenceY = (int)m_virtScene.RegionInfo.RegionLocY - (int)m_rootScene.RegionInfo.RegionLocY; | 90 | int differenceY = (int)m_virtScene.RegionInfo.RegionLocY - (int)m_rootScene.RegionInfo.RegionLocY; |
91 | rayend.X += differenceX * (int)Constants.RegionSize; | 91 | rayend.X += differenceX * (int)Constants.RegionSize; |
diff --git a/OpenSim/Region/CoreModules/World/Land/RegionCombinerModule.cs b/OpenSim/Region/CoreModules/World/Land/RegionCombinerModule.cs index 1436912..05d19a2 100644 --- a/OpenSim/Region/CoreModules/World/Land/RegionCombinerModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/RegionCombinerModule.cs | |||
@@ -35,6 +35,7 @@ using OpenSim.Framework; | |||
35 | using OpenSim.Framework.Client; | 35 | using OpenSim.Framework.Client; |
36 | using OpenSim.Region.Framework.Interfaces; | 36 | using OpenSim.Region.Framework.Interfaces; |
37 | using OpenSim.Region.Framework.Scenes; | 37 | using OpenSim.Region.Framework.Scenes; |
38 | using OpenSim.Framework.Console; | ||
38 | 39 | ||
39 | namespace OpenSim.Region.CoreModules.World.Land | 40 | namespace OpenSim.Region.CoreModules.World.Land |
40 | { | 41 | { |
@@ -61,7 +62,10 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
61 | IConfig myConfig = source.Configs["Startup"]; | 62 | IConfig myConfig = source.Configs["Startup"]; |
62 | enabledYN = myConfig.GetBoolean("CombineContiguousRegions", false); | 63 | enabledYN = myConfig.GetBoolean("CombineContiguousRegions", false); |
63 | //enabledYN = true; | 64 | //enabledYN = true; |
64 | } | 65 | if (enabledYN) |
66 | MainConsole.Instance.Commands.AddCommand("RegionCombinerModule", false, "fix-phantoms", | ||
67 | "Fix phantom objects", "Fixes phantom objects after an import to megaregions", FixPhantoms); | ||
68 | } | ||
65 | 69 | ||
66 | public void Close() | 70 | public void Close() |
67 | { | 71 | { |
@@ -79,12 +83,12 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
79 | { | 83 | { |
80 | if (!enabledYN) | 84 | if (!enabledYN) |
81 | return; | 85 | return; |
82 | 86 | /* | |
83 | // For testing on a single instance | 87 | // For testing on a single instance |
84 | if (scene.RegionInfo.RegionLocX == 1004 && scene.RegionInfo.RegionLocY == 1000) | 88 | if (scene.RegionInfo.RegionLocX == 1004 && scene.RegionInfo.RegionLocY == 1000) |
85 | return; | 89 | return; |
86 | // | 90 | // |
87 | 91 | */ | |
88 | lock (m_startingScenes) | 92 | lock (m_startingScenes) |
89 | m_startingScenes.Add(scene.RegionInfo.originRegionID, scene); | 93 | m_startingScenes.Add(scene.RegionInfo.originRegionID, scene); |
90 | 94 | ||
@@ -504,7 +508,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
504 | scene.WestBorders[0].TriggerRegionY = conn.RegionScene.RegionInfo.RegionLocY; | 508 | scene.WestBorders[0].TriggerRegionY = conn.RegionScene.RegionInfo.RegionLocY; |
505 | } | 509 | } |
506 | 510 | ||
507 | /* | 511 | /* |
508 | else | 512 | else |
509 | { | 513 | { |
510 | conn.RegionScene.NorthBorders[0].BorderLine.Z += (int)Constants.RegionSize; | 514 | conn.RegionScene.NorthBorders[0].BorderLine.Z += (int)Constants.RegionSize; |
@@ -876,7 +880,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
876 | VirtualRegion.Permissions.OnDuplicateObject += BigRegion.PermissionModule.CanDuplicateObject; | 880 | VirtualRegion.Permissions.OnDuplicateObject += BigRegion.PermissionModule.CanDuplicateObject; |
877 | VirtualRegion.Permissions.OnDeleteObject += BigRegion.PermissionModule.CanDeleteObject; //MAYBE FULLY IMPLEMENTED | 881 | VirtualRegion.Permissions.OnDeleteObject += BigRegion.PermissionModule.CanDeleteObject; //MAYBE FULLY IMPLEMENTED |
878 | VirtualRegion.Permissions.OnEditObject += BigRegion.PermissionModule.CanEditObject; //MAYBE FULLY IMPLEMENTED | 882 | VirtualRegion.Permissions.OnEditObject += BigRegion.PermissionModule.CanEditObject; //MAYBE FULLY IMPLEMENTED |
879 | VirtualRegion.Permissions.OnEditParcel += BigRegion.PermissionModule.CanEditParcel; //MAYBE FULLY IMPLEMENTED | 883 | VirtualRegion.Permissions.OnEditParcel += BigRegion.PermissionModule.CanEditParcel; //MAYBE FULLY IMPLEMENTED |
880 | VirtualRegion.Permissions.OnInstantMessage += BigRegion.PermissionModule.CanInstantMessage; | 884 | VirtualRegion.Permissions.OnInstantMessage += BigRegion.PermissionModule.CanInstantMessage; |
881 | VirtualRegion.Permissions.OnInventoryTransfer += BigRegion.PermissionModule.CanInventoryTransfer; //NOT YET IMPLEMENTED | 885 | VirtualRegion.Permissions.OnInventoryTransfer += BigRegion.PermissionModule.CanInventoryTransfer; //NOT YET IMPLEMENTED |
882 | VirtualRegion.Permissions.OnIssueEstateCommand += BigRegion.PermissionModule.CanIssueEstateCommand; //FULLY IMPLEMENTED | 886 | VirtualRegion.Permissions.OnIssueEstateCommand += BigRegion.PermissionModule.CanIssueEstateCommand; //FULLY IMPLEMENTED |
@@ -895,11 +899,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
895 | VirtualRegion.Permissions.OnDelinkObject += BigRegion.PermissionModule.CanDelinkObject; //NOT YET IMPLEMENTED | 899 | VirtualRegion.Permissions.OnDelinkObject += BigRegion.PermissionModule.CanDelinkObject; //NOT YET IMPLEMENTED |
896 | VirtualRegion.Permissions.OnBuyLand += BigRegion.PermissionModule.CanBuyLand; //NOT YET IMPLEMENTED | 900 | VirtualRegion.Permissions.OnBuyLand += BigRegion.PermissionModule.CanBuyLand; //NOT YET IMPLEMENTED |
897 | VirtualRegion.Permissions.OnViewNotecard += BigRegion.PermissionModule.CanViewNotecard; //NOT YET IMPLEMENTED | 901 | VirtualRegion.Permissions.OnViewNotecard += BigRegion.PermissionModule.CanViewNotecard; //NOT YET IMPLEMENTED |
898 | VirtualRegion.Permissions.OnViewScript += BigRegion.PermissionModule.CanViewScript; //NOT YET IMPLEMENTED | 902 | VirtualRegion.Permissions.OnViewScript += BigRegion.PermissionModule.CanViewScript; //NOT YET IMPLEMENTED |
899 | VirtualRegion.Permissions.OnEditNotecard += BigRegion.PermissionModule.CanEditNotecard; //NOT YET IMPLEMENTED | 903 | VirtualRegion.Permissions.OnEditNotecard += BigRegion.PermissionModule.CanEditNotecard; //NOT YET IMPLEMENTED |
900 | VirtualRegion.Permissions.OnEditScript += BigRegion.PermissionModule.CanEditScript; //NOT YET IMPLEMENTED | 904 | VirtualRegion.Permissions.OnEditScript += BigRegion.PermissionModule.CanEditScript; //NOT YET IMPLEMENTED |
901 | VirtualRegion.Permissions.OnCreateObjectInventory += BigRegion.PermissionModule.CanCreateObjectInventory; //NOT IMPLEMENTED HERE | 905 | VirtualRegion.Permissions.OnCreateObjectInventory += BigRegion.PermissionModule.CanCreateObjectInventory; //NOT IMPLEMENTED HERE |
902 | VirtualRegion.Permissions.OnEditObjectInventory += BigRegion.PermissionModule.CanEditObjectInventory;//MAYBE FULLY IMPLEMENTED | 906 | VirtualRegion.Permissions.OnEditObjectInventory += BigRegion.PermissionModule.CanEditObjectInventory;//MAYBE FULLY IMPLEMENTED |
903 | VirtualRegion.Permissions.OnCopyObjectInventory += BigRegion.PermissionModule.CanCopyObjectInventory; //NOT YET IMPLEMENTED | 907 | VirtualRegion.Permissions.OnCopyObjectInventory += BigRegion.PermissionModule.CanCopyObjectInventory; //NOT YET IMPLEMENTED |
904 | VirtualRegion.Permissions.OnDeleteObjectInventory += BigRegion.PermissionModule.CanDeleteObjectInventory; //NOT YET IMPLEMENTED | 908 | VirtualRegion.Permissions.OnDeleteObjectInventory += BigRegion.PermissionModule.CanDeleteObjectInventory; //NOT YET IMPLEMENTED |
905 | VirtualRegion.Permissions.OnResetScript += BigRegion.PermissionModule.CanResetScript; | 909 | VirtualRegion.Permissions.OnResetScript += BigRegion.PermissionModule.CanResetScript; |
@@ -910,5 +914,20 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
910 | VirtualRegion.Permissions.OnTeleport += BigRegion.PermissionModule.CanTeleport; //NOT YET IMPLEMENTED | 914 | VirtualRegion.Permissions.OnTeleport += BigRegion.PermissionModule.CanTeleport; //NOT YET IMPLEMENTED |
911 | VirtualRegion.Permissions.OnUseObjectReturn += BigRegion.PermissionModule.CanUseObjectReturn; //NOT YET IMPLEMENTED | 915 | VirtualRegion.Permissions.OnUseObjectReturn += BigRegion.PermissionModule.CanUseObjectReturn; //NOT YET IMPLEMENTED |
912 | } | 916 | } |
917 | |||
918 | #region console commands | ||
919 | public void FixPhantoms(string module, string[] cmdparams) | ||
920 | { | ||
921 | List<Scene> scenes = new List<Scene>(m_startingScenes.Values); | ||
922 | foreach (Scene s in scenes) | ||
923 | { | ||
924 | s.ForEachSOG(delegate(SceneObjectGroup e) | ||
925 | { | ||
926 | e.AbsolutePosition = e.AbsolutePosition; | ||
927 | } | ||
928 | ); | ||
929 | } | ||
930 | } | ||
931 | #endregion | ||
913 | } | 932 | } |
914 | } | 933 | } |
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index f360577..a9e0b7f 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -103,7 +103,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
103 | //private uint PERM_MODIFY = (uint)16384; | 103 | //private uint PERM_MODIFY = (uint)16384; |
104 | private uint PERM_MOVE = (uint)524288; | 104 | private uint PERM_MOVE = (uint)524288; |
105 | private uint PERM_TRANS = (uint)8192; | 105 | private uint PERM_TRANS = (uint)8192; |
106 | private uint PERM_LOCKED = (uint)540672; | 106 | private uint PERM_LOCKED = (uint)540672; |
107 | 107 | ||
108 | /// <value> | 108 | /// <value> |
109 | /// Different user set names that come in from the configuration file. | 109 | /// Different user set names that come in from the configuration file. |
@@ -114,7 +114,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
114 | Administrators | 114 | Administrators |
115 | }; | 115 | }; |
116 | 116 | ||
117 | #endregion | 117 | #endregion |
118 | 118 | ||
119 | #region Bypass Permissions / Debug Permissions Stuff | 119 | #region Bypass Permissions / Debug Permissions Stuff |
120 | 120 | ||
@@ -136,7 +136,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
136 | /// <value> | 136 | /// <value> |
137 | /// The set of users that are allowed to edit (save) scripts. This is only active if | 137 | /// The set of users that are allowed to edit (save) scripts. This is only active if |
138 | /// permissions are not being bypassed. This overrides normal permissions.- | 138 | /// permissions are not being bypassed. This overrides normal permissions.- |
139 | /// </value> | 139 | /// </value> |
140 | private UserSet m_allowedScriptEditors = UserSet.All; | 140 | private UserSet m_allowedScriptEditors = UserSet.All; |
141 | 141 | ||
142 | private Dictionary<string, bool> GrantLSL = new Dictionary<string, bool>(); | 142 | private Dictionary<string, bool> GrantLSL = new Dictionary<string, bool>(); |
@@ -190,7 +190,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
190 | m_scene.Permissions.OnDuplicateObject += CanDuplicateObject; | 190 | m_scene.Permissions.OnDuplicateObject += CanDuplicateObject; |
191 | m_scene.Permissions.OnDeleteObject += CanDeleteObject; //MAYBE FULLY IMPLEMENTED | 191 | m_scene.Permissions.OnDeleteObject += CanDeleteObject; //MAYBE FULLY IMPLEMENTED |
192 | m_scene.Permissions.OnEditObject += CanEditObject; //MAYBE FULLY IMPLEMENTED | 192 | m_scene.Permissions.OnEditObject += CanEditObject; //MAYBE FULLY IMPLEMENTED |
193 | m_scene.Permissions.OnEditParcel += CanEditParcel; //MAYBE FULLY IMPLEMENTED | 193 | m_scene.Permissions.OnEditParcel += CanEditParcel; //MAYBE FULLY IMPLEMENTED |
194 | m_scene.Permissions.OnInstantMessage += CanInstantMessage; | 194 | m_scene.Permissions.OnInstantMessage += CanInstantMessage; |
195 | m_scene.Permissions.OnInventoryTransfer += CanInventoryTransfer; //NOT YET IMPLEMENTED | 195 | m_scene.Permissions.OnInventoryTransfer += CanInventoryTransfer; //NOT YET IMPLEMENTED |
196 | m_scene.Permissions.OnIssueEstateCommand += CanIssueEstateCommand; //FULLY IMPLEMENTED | 196 | m_scene.Permissions.OnIssueEstateCommand += CanIssueEstateCommand; //FULLY IMPLEMENTED |
@@ -210,12 +210,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
210 | m_scene.Permissions.OnBuyLand += CanBuyLand; //NOT YET IMPLEMENTED | 210 | m_scene.Permissions.OnBuyLand += CanBuyLand; //NOT YET IMPLEMENTED |
211 | 211 | ||
212 | m_scene.Permissions.OnViewNotecard += CanViewNotecard; //NOT YET IMPLEMENTED | 212 | m_scene.Permissions.OnViewNotecard += CanViewNotecard; //NOT YET IMPLEMENTED |
213 | m_scene.Permissions.OnViewScript += CanViewScript; //NOT YET IMPLEMENTED | 213 | m_scene.Permissions.OnViewScript += CanViewScript; //NOT YET IMPLEMENTED |
214 | m_scene.Permissions.OnEditNotecard += CanEditNotecard; //NOT YET IMPLEMENTED | 214 | m_scene.Permissions.OnEditNotecard += CanEditNotecard; //NOT YET IMPLEMENTED |
215 | m_scene.Permissions.OnEditScript += CanEditScript; //NOT YET IMPLEMENTED | 215 | m_scene.Permissions.OnEditScript += CanEditScript; //NOT YET IMPLEMENTED |
216 | 216 | ||
217 | m_scene.Permissions.OnCreateObjectInventory += CanCreateObjectInventory; //NOT IMPLEMENTED HERE | 217 | m_scene.Permissions.OnCreateObjectInventory += CanCreateObjectInventory; //NOT IMPLEMENTED HERE |
218 | m_scene.Permissions.OnEditObjectInventory += CanEditObjectInventory;//MAYBE FULLY IMPLEMENTED | 218 | m_scene.Permissions.OnEditObjectInventory += CanEditObjectInventory;//MAYBE FULLY IMPLEMENTED |
219 | m_scene.Permissions.OnCopyObjectInventory += CanCopyObjectInventory; //NOT YET IMPLEMENTED | 219 | m_scene.Permissions.OnCopyObjectInventory += CanCopyObjectInventory; //NOT YET IMPLEMENTED |
220 | m_scene.Permissions.OnDeleteObjectInventory += CanDeleteObjectInventory; //NOT YET IMPLEMENTED | 220 | m_scene.Permissions.OnDeleteObjectInventory += CanDeleteObjectInventory; //NOT YET IMPLEMENTED |
221 | m_scene.Permissions.OnResetScript += CanResetScript; | 221 | m_scene.Permissions.OnResetScript += CanResetScript; |
@@ -249,7 +249,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
249 | foreach (string uuidl in grant.Split(',')) { | 249 | foreach (string uuidl in grant.Split(',')) { |
250 | string uuid = uuidl.Trim(" \t".ToCharArray()); | 250 | string uuid = uuidl.Trim(" \t".ToCharArray()); |
251 | GrantLSL.Add(uuid, true); | 251 | GrantLSL.Add(uuid, true); |
252 | } | 252 | } |
253 | } | 253 | } |
254 | 254 | ||
255 | grant = myConfig.GetString("GrantCS",""); | 255 | grant = myConfig.GetString("GrantCS",""); |
@@ -431,7 +431,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
431 | m_log.ErrorFormat( | 431 | m_log.ErrorFormat( |
432 | "[PERMISSIONS]: {0} is not a valid {1} value, setting to {2}", | 432 | "[PERMISSIONS]: {0} is not a valid {1} value, setting to {2}", |
433 | rawSetting, settingName, userSet); | 433 | rawSetting, settingName, userSet); |
434 | } | 434 | } |
435 | 435 | ||
436 | m_log.DebugFormat("[PERMISSIONS]: {0} {1}", settingName, userSet); | 436 | m_log.DebugFormat("[PERMISSIONS]: {0} {1}", settingName, userSet); |
437 | 437 | ||
@@ -942,7 +942,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
942 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 942 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
943 | 943 | ||
944 | if (m_allowedScriptEditors == UserSet.Administrators && !IsAdministrator(user)) | 944 | if (m_allowedScriptEditors == UserSet.Administrators && !IsAdministrator(user)) |
945 | return false; | 945 | return false; |
946 | 946 | ||
947 | // Ordinarily, if you can view it, you can edit it | 947 | // Ordinarily, if you can view it, you can edit it |
948 | // There is no viewing a no mod script | 948 | // There is no viewing a no mod script |
@@ -957,7 +957,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
957 | /// <param name="objectID"></param> | 957 | /// <param name="objectID"></param> |
958 | /// <param name="user"></param> | 958 | /// <param name="user"></param> |
959 | /// <param name="scene"></param> | 959 | /// <param name="scene"></param> |
960 | /// <returns></returns> | 960 | /// <returns></returns> |
961 | private bool CanEditNotecard(UUID notecard, UUID objectID, UUID user, Scene scene) | 961 | private bool CanEditNotecard(UUID notecard, UUID objectID, UUID user, Scene scene) |
962 | { | 962 | { |
963 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 963 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
@@ -1377,11 +1377,11 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1377 | /// <param name="objectID"></param> | 1377 | /// <param name="objectID"></param> |
1378 | /// <param name="user"></param> | 1378 | /// <param name="user"></param> |
1379 | /// <param name="scene"></param> | 1379 | /// <param name="scene"></param> |
1380 | /// <returns></returns> | 1380 | /// <returns></returns> |
1381 | private bool CanViewScript(UUID script, UUID objectID, UUID user, Scene scene) | 1381 | private bool CanViewScript(UUID script, UUID objectID, UUID user, Scene scene) |
1382 | { | 1382 | { |
1383 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 1383 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
1384 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 1384 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
1385 | 1385 | ||
1386 | if (objectID == UUID.Zero) // User inventory | 1386 | if (objectID == UUID.Zero) // User inventory |
1387 | { | 1387 | { |
@@ -1472,7 +1472,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1472 | /// <param name="objectID"></param> | 1472 | /// <param name="objectID"></param> |
1473 | /// <param name="user"></param> | 1473 | /// <param name="user"></param> |
1474 | /// <param name="scene"></param> | 1474 | /// <param name="scene"></param> |
1475 | /// <returns></returns> | 1475 | /// <returns></returns> |
1476 | private bool CanViewNotecard(UUID notecard, UUID objectID, UUID user, Scene scene) | 1476 | private bool CanViewNotecard(UUID notecard, UUID objectID, UUID user, Scene scene) |
1477 | { | 1477 | { |
1478 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 1478 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
@@ -1609,7 +1609,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1609 | /// </summary> | 1609 | /// </summary> |
1610 | /// <param name="invType"></param> | 1610 | /// <param name="invType"></param> |
1611 | /// <param name="userID"></param> | 1611 | /// <param name="userID"></param> |
1612 | /// <returns></returns> | 1612 | /// <returns></returns> |
1613 | private bool CanCreateUserInventory(int invType, UUID userID) | 1613 | private bool CanCreateUserInventory(int invType, UUID userID) |
1614 | { | 1614 | { |
1615 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 1615 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
@@ -1619,7 +1619,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1619 | if (m_allowedScriptCreators == UserSet.Administrators && !IsAdministrator(userID)) | 1619 | if (m_allowedScriptCreators == UserSet.Administrators && !IsAdministrator(userID)) |
1620 | return false; | 1620 | return false; |
1621 | 1621 | ||
1622 | return true; | 1622 | return true; |
1623 | } | 1623 | } |
1624 | 1624 | ||
1625 | /// <summary> | 1625 | /// <summary> |
@@ -1627,27 +1627,27 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1627 | /// </summary> | 1627 | /// </summary> |
1628 | /// <param name="itemID"></param> | 1628 | /// <param name="itemID"></param> |
1629 | /// <param name="userID"></param> | 1629 | /// <param name="userID"></param> |
1630 | /// <returns></returns> | 1630 | /// <returns></returns> |
1631 | private bool CanCopyUserInventory(UUID itemID, UUID userID) | 1631 | private bool CanCopyUserInventory(UUID itemID, UUID userID) |
1632 | { | 1632 | { |
1633 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 1633 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
1634 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 1634 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
1635 | 1635 | ||
1636 | return true; | 1636 | return true; |
1637 | } | 1637 | } |
1638 | 1638 | ||
1639 | /// <summary> | 1639 | /// <summary> |
1640 | /// Check whether the specified user is allowed to edit the given inventory item within their own inventory. | 1640 | /// Check whether the specified user is allowed to edit the given inventory item within their own inventory. |
1641 | /// </summary> | 1641 | /// </summary> |
1642 | /// <param name="itemID"></param> | 1642 | /// <param name="itemID"></param> |
1643 | /// <param name="userID"></param> | 1643 | /// <param name="userID"></param> |
1644 | /// <returns></returns> | 1644 | /// <returns></returns> |
1645 | private bool CanEditUserInventory(UUID itemID, UUID userID) | 1645 | private bool CanEditUserInventory(UUID itemID, UUID userID) |
1646 | { | 1646 | { |
1647 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 1647 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
1648 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 1648 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
1649 | 1649 | ||
1650 | return true; | 1650 | return true; |
1651 | } | 1651 | } |
1652 | 1652 | ||
1653 | /// <summary> | 1653 | /// <summary> |
@@ -1655,14 +1655,14 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1655 | /// </summary> | 1655 | /// </summary> |
1656 | /// <param name="itemID"></param> | 1656 | /// <param name="itemID"></param> |
1657 | /// <param name="userID"></param> | 1657 | /// <param name="userID"></param> |
1658 | /// <returns></returns> | 1658 | /// <returns></returns> |
1659 | private bool CanDeleteUserInventory(UUID itemID, UUID userID) | 1659 | private bool CanDeleteUserInventory(UUID itemID, UUID userID) |
1660 | { | 1660 | { |
1661 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 1661 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
1662 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 1662 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
1663 | 1663 | ||
1664 | return true; | 1664 | return true; |
1665 | } | 1665 | } |
1666 | 1666 | ||
1667 | private bool CanTeleport(UUID userID, Scene scene) | 1667 | private bool CanTeleport(UUID userID, Scene scene) |
1668 | { | 1668 | { |
diff --git a/OpenSim/Region/CoreModules/World/Serialiser/SerialiserModule.cs b/OpenSim/Region/CoreModules/World/Serialiser/SerialiserModule.cs index e0331d3..58e4261 100644 --- a/OpenSim/Region/CoreModules/World/Serialiser/SerialiserModule.cs +++ b/OpenSim/Region/CoreModules/World/Serialiser/SerialiserModule.cs | |||
@@ -153,7 +153,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser | |||
153 | public void SaveNamedPrimsToXml2(Scene scene, string primName, string fileName) | 153 | public void SaveNamedPrimsToXml2(Scene scene, string primName, string fileName) |
154 | { | 154 | { |
155 | SceneXmlLoader.SaveNamedPrimsToXml2(scene, primName, fileName); | 155 | SceneXmlLoader.SaveNamedPrimsToXml2(scene, primName, fileName); |
156 | } | 156 | } |
157 | 157 | ||
158 | public SceneObjectGroup DeserializeGroupFromXml2(string xmlString) | 158 | public SceneObjectGroup DeserializeGroupFromXml2(string xmlString) |
159 | { | 159 | { |
diff --git a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs index 373b6ab..799a448 100644 --- a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs +++ b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs | |||
@@ -238,7 +238,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
238 | { | 238 | { |
239 | m_serialiserModule = new SerialiserModule(); | 239 | m_serialiserModule = new SerialiserModule(); |
240 | m_scene = SceneSetupHelpers.SetupScene(""); | 240 | m_scene = SceneSetupHelpers.SetupScene(""); |
241 | SceneSetupHelpers.SetupSceneModules(m_scene, m_serialiserModule); | 241 | SceneSetupHelpers.SetupSceneModules(m_scene, m_serialiserModule); |
242 | } | 242 | } |
243 | 243 | ||
244 | [Test] | 244 | [Test] |
@@ -299,7 +299,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
299 | continue; | 299 | continue; |
300 | 300 | ||
301 | switch (xtr.Name) | 301 | switch (xtr.Name) |
302 | { | 302 | { |
303 | case "UUID": | 303 | case "UUID": |
304 | xtr.ReadStartElement("UUID"); | 304 | xtr.ReadStartElement("UUID"); |
305 | uuid = UUID.Parse(xtr.ReadElementString("Guid")); | 305 | uuid = UUID.Parse(xtr.ReadElementString("Guid")); |
@@ -311,7 +311,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
311 | case "CreatorID": | 311 | case "CreatorID": |
312 | xtr.ReadStartElement("CreatorID"); | 312 | xtr.ReadStartElement("CreatorID"); |
313 | creatorId = UUID.Parse(xtr.ReadElementString("Guid")); | 313 | creatorId = UUID.Parse(xtr.ReadElementString("Guid")); |
314 | xtr.ReadEndElement(); | 314 | xtr.ReadEndElement(); |
315 | break; | 315 | break; |
316 | } | 316 | } |
317 | } | 317 | } |
@@ -325,8 +325,8 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
325 | // TODO: More checks | 325 | // TODO: More checks |
326 | Assert.That(uuid, Is.EqualTo(rpUuid)); | 326 | Assert.That(uuid, Is.EqualTo(rpUuid)); |
327 | Assert.That(name, Is.EqualTo(rpName)); | 327 | Assert.That(name, Is.EqualTo(rpName)); |
328 | Assert.That(creatorId, Is.EqualTo(rpCreatorId)); | 328 | Assert.That(creatorId, Is.EqualTo(rpCreatorId)); |
329 | } | 329 | } |
330 | 330 | ||
331 | [Test] | 331 | [Test] |
332 | public void TestDeserializeXml2() | 332 | public void TestDeserializeXml2() |
@@ -372,7 +372,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
372 | string xml2 = m_serialiserModule.SerializeGroupToXml2(so); | 372 | string xml2 = m_serialiserModule.SerializeGroupToXml2(so); |
373 | 373 | ||
374 | XmlTextReader xtr = new XmlTextReader(new StringReader(xml2)); | 374 | XmlTextReader xtr = new XmlTextReader(new StringReader(xml2)); |
375 | xtr.ReadStartElement("SceneObjectGroup"); | 375 | xtr.ReadStartElement("SceneObjectGroup"); |
376 | xtr.ReadStartElement("SceneObjectPart"); | 376 | xtr.ReadStartElement("SceneObjectPart"); |
377 | 377 | ||
378 | UUID uuid = UUID.Zero; | 378 | UUID uuid = UUID.Zero; |
@@ -385,7 +385,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
385 | continue; | 385 | continue; |
386 | 386 | ||
387 | switch (xtr.Name) | 387 | switch (xtr.Name) |
388 | { | 388 | { |
389 | case "UUID": | 389 | case "UUID": |
390 | xtr.ReadStartElement("UUID"); | 390 | xtr.ReadStartElement("UUID"); |
391 | uuid = UUID.Parse(xtr.ReadElementString("Guid")); | 391 | uuid = UUID.Parse(xtr.ReadElementString("Guid")); |
@@ -397,7 +397,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
397 | case "CreatorID": | 397 | case "CreatorID": |
398 | xtr.ReadStartElement("CreatorID"); | 398 | xtr.ReadStartElement("CreatorID"); |
399 | creatorId = UUID.Parse(xtr.ReadElementString("Guid")); | 399 | creatorId = UUID.Parse(xtr.ReadElementString("Guid")); |
400 | xtr.ReadEndElement(); | 400 | xtr.ReadEndElement(); |
401 | break; | 401 | break; |
402 | } | 402 | } |
403 | } | 403 | } |
diff --git a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs index 6cc0ed9..37f1f2e 100644 --- a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs +++ b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs | |||
@@ -33,9 +33,9 @@ using OpenSim.Region.Framework.Interfaces; | |||
33 | using OpenSim.Region.Framework.Scenes; | 33 | using OpenSim.Region.Framework.Scenes; |
34 | 34 | ||
35 | namespace OpenSim.Region.CoreModules.World.Sound | 35 | namespace OpenSim.Region.CoreModules.World.Sound |
36 | { | 36 | { |
37 | public class SoundModule : IRegionModule, ISoundModule | 37 | public class SoundModule : IRegionModule, ISoundModule |
38 | { | 38 | { |
39 | //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 39 | //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
40 | 40 | ||
41 | protected Scene m_scene; | 41 | protected Scene m_scene; |
@@ -68,11 +68,11 @@ namespace OpenSim.Region.CoreModules.World.Sound | |||
68 | if (dis > 100.0) // Max audio distance | 68 | if (dis > 100.0) // Max audio distance |
69 | continue; | 69 | continue; |
70 | 70 | ||
71 | // Scale by distance | 71 | // Scale by distance |
72 | gain = (float)((double)gain*((100.0 - dis) / 100.0)); | 72 | gain = (float)((double)gain*((100.0 - dis) / 100.0)); |
73 | 73 | ||
74 | p.ControllingClient.SendPlayAttachedSound(soundID, objectID, ownerID, (float)gain, flags); | 74 | p.ControllingClient.SendPlayAttachedSound(soundID, objectID, ownerID, (float)gain, flags); |
75 | } | 75 | } |
76 | } | 76 | } |
77 | 77 | ||
78 | public virtual void TriggerSound( | 78 | public virtual void TriggerSound( |
@@ -84,12 +84,12 @@ namespace OpenSim.Region.CoreModules.World.Sound | |||
84 | if (dis > 100.0) // Max audio distance | 84 | if (dis > 100.0) // Max audio distance |
85 | continue; | 85 | continue; |
86 | 86 | ||
87 | // Scale by distance | 87 | // Scale by distance |
88 | gain = (float)((double)gain*((100.0 - dis) / 100.0)); | 88 | gain = (float)((double)gain*((100.0 - dis) / 100.0)); |
89 | 89 | ||
90 | p.ControllingClient.SendTriggeredSound( | 90 | p.ControllingClient.SendTriggeredSound( |
91 | soundId, ownerID, objectID, parentID, handle, position, (float)gain); | 91 | soundId, ownerID, objectID, parentID, handle, position, (float)gain); |
92 | } | 92 | } |
93 | } | 93 | } |
94 | } | 94 | } |
95 | } | 95 | } |
diff --git a/OpenSim/Region/CoreModules/World/Sun/SunModule.cs b/OpenSim/Region/CoreModules/World/Sun/SunModule.cs index aa38c09..0712a7f 100644 --- a/OpenSim/Region/CoreModules/World/Sun/SunModule.cs +++ b/OpenSim/Region/CoreModules/World/Sun/SunModule.cs | |||
@@ -322,7 +322,7 @@ namespace OpenSim.Region.CoreModules | |||
322 | m_DayLengthHours = config.Configs["Sun"].GetDouble("day_length", d_day_length); | 322 | m_DayLengthHours = config.Configs["Sun"].GetDouble("day_length", d_day_length); |
323 | 323 | ||
324 | // Horizon shift, this is used to shift the sun's orbit, this affects the day / night ratio | 324 | // Horizon shift, this is used to shift the sun's orbit, this affects the day / night ratio |
325 | // must hard code to ~.5 to match sun position in LL based viewers | 325 | // must hard code to ~.5 to match sun position in LL based viewers |
326 | m_HorizonShift = config.Configs["Sun"].GetDouble("day_night_offset", d_day_night); | 326 | m_HorizonShift = config.Configs["Sun"].GetDouble("day_night_offset", d_day_night); |
327 | 327 | ||
328 | 328 | ||
@@ -494,7 +494,7 @@ namespace OpenSim.Region.CoreModules | |||
494 | receivedEstateToolsSunUpdate = true; | 494 | receivedEstateToolsSunUpdate = true; |
495 | 495 | ||
496 | // Generate shared values | 496 | // Generate shared values |
497 | GenSunPos(); | 497 | GenSunPos(); |
498 | 498 | ||
499 | // When sun settings are updated, we should update all clients with new settings. | 499 | // When sun settings are updated, we should update all clients with new settings. |
500 | SunUpdateToAllClients(); | 500 | SunUpdateToAllClients(); |
diff --git a/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs b/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs index a09315a..c2ad7b8 100644 --- a/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs +++ b/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs | |||
@@ -43,7 +43,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Vegetation | |||
43 | protected Scene m_scene; | 43 | protected Scene m_scene; |
44 | 44 | ||
45 | protected static readonly PCode[] creationCapabilities = new PCode[] { PCode.Grass, PCode.NewTree, PCode.Tree }; | 45 | protected static readonly PCode[] creationCapabilities = new PCode[] { PCode.Grass, PCode.NewTree, PCode.Tree }; |
46 | public PCode[] CreationCapabilities { get { return creationCapabilities; } } | 46 | public PCode[] CreationCapabilities { get { return creationCapabilities; } } |
47 | 47 | ||
48 | public void Initialise(Scene scene, IConfigSource source) | 48 | public void Initialise(Scene scene, IConfigSource source) |
49 | { | 49 | { |
@@ -73,7 +73,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Vegetation | |||
73 | UUID ownerID, UUID groupID, Vector3 pos, Quaternion rot, PrimitiveBaseShape shape) | 73 | UUID ownerID, UUID groupID, Vector3 pos, Quaternion rot, PrimitiveBaseShape shape) |
74 | { | 74 | { |
75 | if (Array.IndexOf(creationCapabilities, (PCode)shape.PCode) < 0) | 75 | if (Array.IndexOf(creationCapabilities, (PCode)shape.PCode) < 0) |
76 | { | 76 | { |
77 | m_log.DebugFormat("[VEGETATION]: PCode {0} not handled by {1}", shape.PCode, Name); | 77 | m_log.DebugFormat("[VEGETATION]: PCode {0} not handled by {1}", shape.PCode, Name); |
78 | return null; | 78 | return null; |
79 | } | 79 | } |
@@ -111,6 +111,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Vegetation | |||
111 | tree.Scale = new Vector3(4, 4, 4); | 111 | tree.Scale = new Vector3(4, 4, 4); |
112 | break; | 112 | break; |
113 | } | 113 | } |
114 | } | 114 | } |
115 | } | 115 | } |
116 | } | 116 | } |
diff --git a/OpenSim/Region/CoreModules/World/Wind/Plugins/ConfigurableWind.cs b/OpenSim/Region/CoreModules/World/Wind/Plugins/ConfigurableWind.cs index 41d2071..9d47e19 100644 --- a/OpenSim/Region/CoreModules/World/Wind/Plugins/ConfigurableWind.cs +++ b/OpenSim/Region/CoreModules/World/Wind/Plugins/ConfigurableWind.cs | |||
@@ -46,7 +46,7 @@ namespace OpenSim.Region.CoreModules.World.Wind.Plugins | |||
46 | 46 | ||
47 | private float m_avgStrength = 5.0f; // Average magnitude of the wind vector | 47 | private float m_avgStrength = 5.0f; // Average magnitude of the wind vector |
48 | private float m_avgDirection = 0.0f; // Average direction of the wind in degrees | 48 | private float m_avgDirection = 0.0f; // Average direction of the wind in degrees |
49 | private float m_varStrength = 5.0f; // Max Strength Variance | 49 | private float m_varStrength = 5.0f; // Max Strength Variance |
50 | private float m_varDirection = 30.0f;// Max Direction Variance | 50 | private float m_varDirection = 30.0f;// Max Direction Variance |
51 | private float m_rateChange = 1.0f; // | 51 | private float m_rateChange = 1.0f; // |
52 | 52 | ||
@@ -141,7 +141,7 @@ namespace OpenSim.Region.CoreModules.World.Wind.Plugins | |||
141 | { | 141 | { |
142 | m_windSpeeds[y * 16 + x] = m_curPredominateWind; | 142 | m_windSpeeds[y * 16 + x] = m_curPredominateWind; |
143 | } | 143 | } |
144 | } | 144 | } |
145 | } | 145 | } |
146 | 146 | ||
147 | public Vector3 WindSpeed(float fX, float fY, float fZ) | 147 | public Vector3 WindSpeed(float fX, float fY, float fZ) |
diff --git a/OpenSim/Region/CoreModules/World/Wind/Plugins/SimpleRandomWind.cs b/OpenSim/Region/CoreModules/World/Wind/Plugins/SimpleRandomWind.cs index 2c371da..071e20b 100644 --- a/OpenSim/Region/CoreModules/World/Wind/Plugins/SimpleRandomWind.cs +++ b/OpenSim/Region/CoreModules/World/Wind/Plugins/SimpleRandomWind.cs | |||
@@ -95,7 +95,7 @@ namespace OpenSim.Region.CoreModules.World.Wind.Plugins | |||
95 | m_windSpeeds[y * 16 + x].Y *= m_strength; | 95 | m_windSpeeds[y * 16 + x].Y *= m_strength; |
96 | } | 96 | } |
97 | } | 97 | } |
98 | } | 98 | } |
99 | } | 99 | } |
100 | 100 | ||
101 | public Vector3 WindSpeed(float fX, float fY, float fZ) | 101 | public Vector3 WindSpeed(float fX, float fY, float fZ) |
diff --git a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs index b442f6f..3283c1f 100644 --- a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs +++ b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs | |||
@@ -418,7 +418,7 @@ namespace OpenSim.Region.CoreModules | |||
418 | } | 418 | } |
419 | 419 | ||
420 | avatar.ControllingClient.SendWindData(windSpeeds); | 420 | avatar.ControllingClient.SendWindData(windSpeeds); |
421 | } | 421 | } |
422 | } | 422 | } |
423 | 423 | ||
424 | private void SendWindAllClients() | 424 | private void SendWindAllClients() |
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs index 4783b35..436f332 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs | |||
@@ -33,6 +33,8 @@ using OpenSim.Framework; | |||
33 | using OpenSim.Region.Framework.Interfaces; | 33 | using OpenSim.Region.Framework.Interfaces; |
34 | using OpenSim.Region.Framework.Scenes; | 34 | using OpenSim.Region.Framework.Scenes; |
35 | using OpenSim.Region.Framework.Scenes.Hypergrid; | 35 | using OpenSim.Region.Framework.Scenes.Hypergrid; |
36 | using OpenSim.Services.Interfaces; | ||
37 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | ||
36 | 38 | ||
37 | namespace OpenSim.Region.CoreModules.World.WorldMap | 39 | namespace OpenSim.Region.CoreModules.World.WorldMap |
38 | { | 40 | { |
@@ -92,13 +94,13 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
92 | } | 94 | } |
93 | 95 | ||
94 | // try to fetch from GridServer | 96 | // try to fetch from GridServer |
95 | List<RegionInfo> regionInfos = m_scene.SceneGridService.RequestNamedRegions(mapName, 20); | 97 | List<GridRegion> regionInfos = m_scene.GridService.GetRegionsByName(UUID.Zero, mapName, 20); |
96 | if (regionInfos == null) | 98 | if (regionInfos == null) |
97 | { | 99 | { |
98 | m_log.Warn("[MAPSEARCHMODULE]: RequestNamedRegions returned null. Old gridserver?"); | 100 | m_log.Warn("[MAPSEARCHMODULE]: RequestNamedRegions returned null. Old gridserver?"); |
99 | // service wasn't available; maybe still an old GridServer. Try the old API, though it will return only one region | 101 | // service wasn't available; maybe still an old GridServer. Try the old API, though it will return only one region |
100 | regionInfos = new List<RegionInfo>(); | 102 | regionInfos = new List<GridRegion>(); |
101 | RegionInfo info = m_scene.SceneGridService.RequestClosestRegion(mapName); | 103 | GridRegion info = m_scene.GridService.GetRegionByName(UUID.Zero, mapName); |
102 | if (info != null) regionInfos.Add(info); | 104 | if (info != null) regionInfos.Add(info); |
103 | } | 105 | } |
104 | 106 | ||
@@ -109,11 +111,15 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
109 | if (mapName.Contains(".") && mapName.Contains(":")) | 111 | if (mapName.Contains(".") && mapName.Contains(":")) |
110 | { | 112 | { |
111 | // It probably is a domain name. Try to link to it. | 113 | // It probably is a domain name. Try to link to it. |
112 | RegionInfo regInfo; | 114 | GridRegion regInfo; |
113 | Scene cScene = GetClientScene(remoteClient); | 115 | Scene cScene = GetClientScene(remoteClient); |
114 | regInfo = HGHyperlink.TryLinkRegion(cScene, remoteClient, mapName); | 116 | IHyperlinkService hyperService = cScene.RequestModuleInterface<IHyperlinkService>(); |
115 | if (regInfo != null) | 117 | if (hyperService != null) |
116 | regionInfos.Add(regInfo); | 118 | { |
119 | regInfo = hyperService.TryLinkRegion(remoteClient, mapName); | ||
120 | if (regInfo != null) | ||
121 | regionInfos.Add(regInfo); | ||
122 | } | ||
117 | } | 123 | } |
118 | } | 124 | } |
119 | 125 | ||
@@ -122,17 +128,17 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
122 | MapBlockData data; | 128 | MapBlockData data; |
123 | if (regionInfos.Count > 0) | 129 | if (regionInfos.Count > 0) |
124 | { | 130 | { |
125 | foreach (RegionInfo info in regionInfos) | 131 | foreach (GridRegion info in regionInfos) |
126 | { | 132 | { |
127 | data = new MapBlockData(); | 133 | data = new MapBlockData(); |
128 | data.Agents = 0; | 134 | data.Agents = 0; |
129 | data.Access = info.AccessLevel; | 135 | data.Access = info.Access; |
130 | data.MapImageId = info.RegionSettings.TerrainImageID; | 136 | data.MapImageId = info.TerrainImage; |
131 | data.Name = info.RegionName; | 137 | data.Name = info.RegionName; |
132 | data.RegionFlags = 0; // TODO not used? | 138 | data.RegionFlags = 0; // TODO not used? |
133 | data.WaterHeight = 0; // not used | 139 | data.WaterHeight = 0; // not used |
134 | data.X = (ushort)info.RegionLocX; | 140 | data.X = (ushort)(info.RegionLocX / Constants.RegionSize); |
135 | data.Y = (ushort)info.RegionLocY; | 141 | data.Y = (ushort)(info.RegionLocY / Constants.RegionSize); |
136 | blocks.Add(data); | 142 | blocks.Add(data); |
137 | } | 143 | } |
138 | } | 144 | } |
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index 1f25f28..05ed70a 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | |||
@@ -48,6 +48,7 @@ using OpenSim.Region.Framework.Scenes; | |||
48 | using Caps=OpenSim.Framework.Capabilities.Caps; | 48 | using Caps=OpenSim.Framework.Capabilities.Caps; |
49 | using OSDArray=OpenMetaverse.StructuredData.OSDArray; | 49 | using OSDArray=OpenMetaverse.StructuredData.OSDArray; |
50 | using OSDMap=OpenMetaverse.StructuredData.OSDMap; | 50 | using OSDMap=OpenMetaverse.StructuredData.OSDMap; |
51 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | ||
51 | 52 | ||
52 | namespace OpenSim.Region.CoreModules.World.WorldMap | 53 | namespace OpenSim.Region.CoreModules.World.WorldMap |
53 | { | 54 | { |
@@ -232,10 +233,20 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
232 | } | 233 | } |
233 | if (lookup) | 234 | if (lookup) |
234 | { | 235 | { |
235 | List<MapBlockData> mapBlocks; | 236 | List<MapBlockData> mapBlocks = new List<MapBlockData>(); ; |
236 | 237 | ||
237 | mapBlocks = m_scene.SceneGridService.RequestNeighbourMapBlocks((int)m_scene.RegionInfo.RegionLocX - 8, (int)m_scene.RegionInfo.RegionLocY - 8, (int)m_scene.RegionInfo.RegionLocX + 8, (int)m_scene.RegionInfo.RegionLocY + 8); | 238 | List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID, |
238 | avatarPresence.ControllingClient.SendMapBlock(mapBlocks,0); | 239 | (int)(m_scene.RegionInfo.RegionLocX - 8) * (int)Constants.RegionSize, |
240 | (int)(m_scene.RegionInfo.RegionLocX + 8) * (int)Constants.RegionSize, | ||
241 | (int)(m_scene.RegionInfo.RegionLocY - 8) * (int)Constants.RegionSize, | ||
242 | (int)(m_scene.RegionInfo.RegionLocY + 8) * (int)Constants.RegionSize); | ||
243 | foreach (GridRegion r in regions) | ||
244 | { | ||
245 | MapBlockData block = new MapBlockData(); | ||
246 | MapBlockFromGridRegion(block, r); | ||
247 | mapBlocks.Add(block); | ||
248 | } | ||
249 | avatarPresence.ControllingClient.SendMapBlock(mapBlocks, 0); | ||
239 | 250 | ||
240 | lock (cachedMapBlocks) | 251 | lock (cachedMapBlocks) |
241 | cachedMapBlocks = mapBlocks; | 252 | cachedMapBlocks = mapBlocks; |
@@ -579,7 +590,9 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
579 | } | 590 | } |
580 | if (httpserver.Length == 0) | 591 | if (httpserver.Length == 0) |
581 | { | 592 | { |
582 | RegionInfo mreg = m_scene.SceneGridService.RequestNeighbouringRegionInfo(regionhandle); | 593 | uint x = 0, y = 0; |
594 | Utils.LongToUInts(regionhandle, out x, out y); | ||
595 | GridRegion mreg = m_scene.GridService.GetRegionByPosition(m_scene.RegionInfo.ScopeID, (int)x, (int)y); | ||
583 | 596 | ||
584 | if (mreg != null) | 597 | if (mreg != null) |
585 | { | 598 | { |
@@ -719,15 +732,25 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
719 | { | 732 | { |
720 | List<MapBlockData> response = new List<MapBlockData>(); | 733 | List<MapBlockData> response = new List<MapBlockData>(); |
721 | 734 | ||
722 | // this should return one mapblock at most. But make sure: Look whether the one we requested is in there | 735 | // this should return one mapblock at most. |
723 | List<MapBlockData> mapBlocks = m_scene.SceneGridService.RequestNeighbourMapBlocks(minX, minY, maxX, maxY); | 736 | // (diva note: why?? in that case we should GetRegionByPosition) |
724 | if (mapBlocks != null) | 737 | // But make sure: Look whether the one we requested is in there |
738 | List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID, | ||
739 | minX * (int)Constants.RegionSize, | ||
740 | maxX * (int)Constants.RegionSize, | ||
741 | minY * (int)Constants.RegionSize, | ||
742 | maxY * (int)Constants.RegionSize); | ||
743 | |||
744 | if (regions != null) | ||
725 | { | 745 | { |
726 | foreach (MapBlockData block in mapBlocks) | 746 | foreach (GridRegion r in regions) |
727 | { | 747 | { |
728 | if (block.X == minX && block.Y == minY) | 748 | if ((r.RegionLocX == minX * (int)Constants.RegionSize) && |
749 | (r.RegionLocY == minY * (int)Constants.RegionSize)) | ||
729 | { | 750 | { |
730 | // found it => add it to response | 751 | // found it => add it to response |
752 | MapBlockData block = new MapBlockData(); | ||
753 | MapBlockFromGridRegion(block, r); | ||
731 | response.Add(block); | 754 | response.Add(block); |
732 | break; | 755 | break; |
733 | } | 756 | } |
@@ -754,10 +777,30 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
754 | 777 | ||
755 | protected virtual void GetAndSendBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY, uint flag) | 778 | protected virtual void GetAndSendBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY, uint flag) |
756 | { | 779 | { |
757 | List<MapBlockData> mapBlocks = m_scene.SceneGridService.RequestNeighbourMapBlocks(minX - 4, minY - 4, maxX + 4, maxY + 4); | 780 | List<MapBlockData> mapBlocks = new List<MapBlockData>(); |
781 | List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID, | ||
782 | (minX - 4) * (int)Constants.RegionSize, | ||
783 | (maxX + 4) * (int)Constants.RegionSize, | ||
784 | (minY - 4) * (int)Constants.RegionSize, | ||
785 | (maxY + 4) * (int)Constants.RegionSize); | ||
786 | foreach (GridRegion r in regions) | ||
787 | { | ||
788 | MapBlockData block = new MapBlockData(); | ||
789 | MapBlockFromGridRegion(block, r); | ||
790 | mapBlocks.Add(block); | ||
791 | } | ||
758 | remoteClient.SendMapBlock(mapBlocks, flag); | 792 | remoteClient.SendMapBlock(mapBlocks, flag); |
759 | } | 793 | } |
760 | 794 | ||
795 | protected void MapBlockFromGridRegion(MapBlockData block, GridRegion r) | ||
796 | { | ||
797 | block.Access = r.Access; | ||
798 | block.MapImageId = r.TerrainImage; | ||
799 | block.Name = r.RegionName; | ||
800 | block.X = (ushort)(r.RegionLocX / Constants.RegionSize); | ||
801 | block.Y = (ushort)(r.RegionLocY / Constants.RegionSize); | ||
802 | } | ||
803 | |||
761 | public Hashtable OnHTTPGetMapImage(Hashtable keysvals) | 804 | public Hashtable OnHTTPGetMapImage(Hashtable keysvals) |
762 | { | 805 | { |
763 | m_log.Debug("[WORLD MAP]: Sending map image jpeg"); | 806 | m_log.Debug("[WORLD MAP]: Sending map image jpeg"); |
@@ -874,31 +917,34 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
874 | m_log.InfoFormat( | 917 | m_log.InfoFormat( |
875 | "[WORLD MAP]: Exporting world map for {0} to {1}", m_scene.RegionInfo.RegionName, exportPath); | 918 | "[WORLD MAP]: Exporting world map for {0} to {1}", m_scene.RegionInfo.RegionName, exportPath); |
876 | 919 | ||
877 | List<MapBlockData> mapBlocks = | 920 | List<MapBlockData> mapBlocks = new List<MapBlockData>(); |
878 | m_scene.CommsManager.GridService.RequestNeighbourMapBlocks( | 921 | List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID, |
879 | (int)(m_scene.RegionInfo.RegionLocX - 9), | 922 | (int)(m_scene.RegionInfo.RegionLocX - 9) * (int)Constants.RegionSize, |
880 | (int)(m_scene.RegionInfo.RegionLocY - 9), | 923 | (int)(m_scene.RegionInfo.RegionLocX + 9) * (int)Constants.RegionSize, |
881 | (int)(m_scene.RegionInfo.RegionLocX + 9), | 924 | (int)(m_scene.RegionInfo.RegionLocY - 9) * (int)Constants.RegionSize, |
882 | (int)(m_scene.RegionInfo.RegionLocY + 9)); | 925 | (int)(m_scene.RegionInfo.RegionLocY + 9) * (int)Constants.RegionSize); |
883 | List<AssetBase> textures = new List<AssetBase>(); | 926 | List<AssetBase> textures = new List<AssetBase>(); |
884 | List<Image> bitImages = new List<Image>(); | 927 | List<Image> bitImages = new List<Image>(); |
885 | 928 | ||
886 | foreach (MapBlockData mapBlock in mapBlocks) | 929 | foreach (GridRegion r in regions) |
887 | { | 930 | { |
931 | MapBlockData mapBlock = new MapBlockData(); | ||
932 | MapBlockFromGridRegion(mapBlock, r); | ||
888 | AssetBase texAsset = m_scene.AssetService.Get(mapBlock.MapImageId.ToString()); | 933 | AssetBase texAsset = m_scene.AssetService.Get(mapBlock.MapImageId.ToString()); |
889 | 934 | ||
890 | if (texAsset != null) | 935 | if (texAsset != null) |
891 | { | 936 | { |
892 | textures.Add(texAsset); | 937 | textures.Add(texAsset); |
893 | } | 938 | } |
894 | else | 939 | //else |
895 | { | 940 | //{ |
896 | texAsset = m_scene.AssetService.Get(mapBlock.MapImageId.ToString()); | 941 | // // WHAT?!? This doesn't seem right. Commenting (diva) |
897 | if (texAsset != null) | 942 | // texAsset = m_scene.AssetService.Get(mapBlock.MapImageId.ToString()); |
898 | { | 943 | // if (texAsset != null) |
899 | textures.Add(texAsset); | 944 | // { |
900 | } | 945 | // textures.Add(texAsset); |
901 | } | 946 | // } |
947 | //} | ||
902 | } | 948 | } |
903 | 949 | ||
904 | foreach (AssetBase asset in textures) | 950 | foreach (AssetBase asset in textures) |