diff options
author | Melanie | 2013-01-04 22:39:07 +0000 |
---|---|---|
committer | Melanie | 2013-01-04 22:39:07 +0000 |
commit | e62b14024f35121f1fd83bd6d3cd572ed9ba5897 (patch) | |
tree | 987892e6227b79eb45d48c5df0f8b9acfdf30755 /OpenSim/Region/CoreModules | |
parent | Merge branch 'master' into careminster (diff) | |
parent | Set default particle burst count to 1 instead of 0 in any set particle system... (diff) | |
download | opensim-SC_OLD-e62b14024f35121f1fd83bd6d3cd572ed9ba5897.zip opensim-SC_OLD-e62b14024f35121f1fd83bd6d3cd572ed9ba5897.tar.gz opensim-SC_OLD-e62b14024f35121f1fd83bd6d3cd572ed9ba5897.tar.bz2 opensim-SC_OLD-e62b14024f35121f1fd83bd6d3cd572ed9ba5897.tar.xz |
Merge branch 'master' into careminster
Conflicts:
OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
Diffstat (limited to 'OpenSim/Region/CoreModules')
11 files changed, 179 insertions, 97 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index acd156e..6323160 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -722,15 +722,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
722 | 722 | ||
723 | if (!silent) | 723 | if (!silent) |
724 | { | 724 | { |
725 | // Killing it here will cause the client to deselect it | 725 | if (so.HasPrivateAttachmentPoint) |
726 | // It then reappears on the avatar, deselected | ||
727 | // through the full update below | ||
728 | // | ||
729 | if (so.IsSelected) | ||
730 | { | ||
731 | m_scene.SendKillObject(new List<uint> { so.RootPart.LocalId }); | ||
732 | } | ||
733 | else if (so.HasPrivateAttachmentPoint) | ||
734 | { | 726 | { |
735 | // m_log.DebugFormat( | 727 | // m_log.DebugFormat( |
736 | // "[ATTACHMENTS MODULE]: Killing private HUD {0} for avatars other than {1} at attachment point {2}", | 728 | // "[ATTACHMENTS MODULE]: Killing private HUD {0} for avatars other than {1} at attachment point {2}", |
@@ -745,7 +737,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
745 | }); | 737 | }); |
746 | } | 738 | } |
747 | 739 | ||
748 | so.IsSelected = false; // fudge.... | 740 | // Fudge below is an extremely unhelpful comment. It's probably here so that the scheduled full update |
741 | // will succeed, as that will not update if an attachment is selected. | ||
742 | so.IsSelected = false; // fudge.... | ||
743 | |||
749 | so.ScheduleGroupForFullUpdate(); | 744 | so.ScheduleGroupForFullUpdate(); |
750 | } | 745 | } |
751 | 746 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs index d0e88f6..4c85637 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs | |||
@@ -124,7 +124,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
124 | SaveAssets = true; | 124 | SaveAssets = true; |
125 | } | 125 | } |
126 | 126 | ||
127 | protected void ReceivedAllAssets(ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids) | 127 | protected void ReceivedAllAssets(ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids, bool timedOut) |
128 | { | 128 | { |
129 | Exception reportedException = null; | 129 | Exception reportedException = null; |
130 | bool succeeded = true; | 130 | bool succeeded = true; |
@@ -143,6 +143,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
143 | m_saveStream.Close(); | 143 | m_saveStream.Close(); |
144 | } | 144 | } |
145 | 145 | ||
146 | if (timedOut) | ||
147 | { | ||
148 | succeeded = false; | ||
149 | reportedException = new Exception("Loading assets timed out"); | ||
150 | } | ||
151 | |||
146 | m_module.TriggerInventoryArchiveSaved( | 152 | m_module.TriggerInventoryArchiveSaved( |
147 | m_id, succeeded, m_userInfo, m_invPath, m_saveStream, reportedException); | 153 | m_id, succeeded, m_userInfo, m_invPath, m_saveStream, reportedException); |
148 | } | 154 | } |
@@ -350,7 +356,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
350 | { | 356 | { |
351 | m_log.DebugFormat("[INVENTORY ARCHIVER]: Not saving assets since --noassets was specified"); | 357 | m_log.DebugFormat("[INVENTORY ARCHIVER]: Not saving assets since --noassets was specified"); |
352 | 358 | ||
353 | ReceivedAllAssets(new List<UUID>(), new List<UUID>()); | 359 | ReceivedAllAssets(new List<UUID>(), new List<UUID>(), false); |
354 | } | 360 | } |
355 | } | 361 | } |
356 | catch (Exception) | 362 | catch (Exception) |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 01f1c63..fcfdf7c 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -622,13 +622,18 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
622 | /// <returns></returns> | 622 | /// <returns></returns> |
623 | private bool ResolveUserUuid(Scene scene, UUID uuid) | 623 | private bool ResolveUserUuid(Scene scene, UUID uuid) |
624 | { | 624 | { |
625 | if (!m_validUserUuids.ContainsKey(uuid)) | 625 | lock (m_validUserUuids) |
626 | { | 626 | { |
627 | UserAccount account = scene.UserAccountService.GetUserAccount(scene.RegionInfo.ScopeID, uuid); | 627 | if (!m_validUserUuids.ContainsKey(uuid)) |
628 | m_validUserUuids.Add(uuid, account != null); | 628 | { |
629 | } | 629 | // Note: we call GetUserAccount() inside the lock because this UserID is likely |
630 | // to occur many times, and we only want to query the users service once. | ||
631 | UserAccount account = scene.UserAccountService.GetUserAccount(scene.RegionInfo.ScopeID, uuid); | ||
632 | m_validUserUuids.Add(uuid, account != null); | ||
633 | } | ||
630 | 634 | ||
631 | return m_validUserUuids[uuid]; | 635 | return m_validUserUuids[uuid]; |
636 | } | ||
632 | } | 637 | } |
633 | 638 | ||
634 | /// <summary> | 639 | /// <summary> |
@@ -641,19 +646,26 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
641 | if (uuid == UUID.Zero) | 646 | if (uuid == UUID.Zero) |
642 | return true; // this means the object has no group | 647 | return true; // this means the object has no group |
643 | 648 | ||
644 | if (!m_validGroupUuids.ContainsKey(uuid)) | 649 | lock (m_validGroupUuids) |
645 | { | 650 | { |
646 | bool exists; | 651 | if (!m_validGroupUuids.ContainsKey(uuid)) |
647 | 652 | { | |
648 | if (m_groupsModule == null) | 653 | bool exists; |
649 | exists = false; | 654 | if (m_groupsModule == null) |
650 | else | 655 | { |
651 | exists = (m_groupsModule.GetGroupRecord(uuid) != null); | 656 | exists = false; |
657 | } | ||
658 | else | ||
659 | { | ||
660 | // Note: we call GetGroupRecord() inside the lock because this GroupID is likely | ||
661 | // to occur many times, and we only want to query the groups service once. | ||
662 | exists = (m_groupsModule.GetGroupRecord(uuid) != null); | ||
663 | } | ||
664 | m_validGroupUuids.Add(uuid, exists); | ||
665 | } | ||
652 | 666 | ||
653 | m_validGroupUuids.Add(uuid, exists); | 667 | return m_validGroupUuids[uuid]; |
654 | } | 668 | } |
655 | |||
656 | return m_validGroupUuids[uuid]; | ||
657 | } | 669 | } |
658 | 670 | ||
659 | /// Load an asset | 671 | /// Load an asset |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs index 7bdd65c..367693d 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs | |||
@@ -587,19 +587,29 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
587 | } | 587 | } |
588 | } | 588 | } |
589 | 589 | ||
590 | protected void ReceivedAllAssets( | 590 | protected void ReceivedAllAssets(ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids, bool timedOut) |
591 | ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids) | ||
592 | { | 591 | { |
593 | foreach (UUID uuid in assetsNotFoundUuids) | 592 | string errorMessage; |
593 | |||
594 | if (timedOut) | ||
594 | { | 595 | { |
595 | m_log.DebugFormat("[ARCHIVER]: Could not find asset {0}", uuid); | 596 | errorMessage = "Loading assets timed out"; |
596 | } | 597 | } |
598 | else | ||
599 | { | ||
600 | foreach (UUID uuid in assetsNotFoundUuids) | ||
601 | { | ||
602 | m_log.DebugFormat("[ARCHIVER]: Could not find asset {0}", uuid); | ||
603 | } | ||
597 | 604 | ||
598 | // m_log.InfoFormat( | 605 | // m_log.InfoFormat( |
599 | // "[ARCHIVER]: Received {0} of {1} assets requested", | 606 | // "[ARCHIVER]: Received {0} of {1} assets requested", |
600 | // assetsFoundUuids.Count, assetsFoundUuids.Count + assetsNotFoundUuids.Count); | 607 | // assetsFoundUuids.Count, assetsFoundUuids.Count + assetsNotFoundUuids.Count); |
601 | 608 | ||
602 | CloseArchive(String.Empty); | 609 | errorMessage = String.Empty; |
610 | } | ||
611 | |||
612 | CloseArchive(errorMessage); | ||
603 | } | 613 | } |
604 | 614 | ||
605 | /// <summary> | 615 | /// <summary> |
@@ -626,4 +636,4 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
626 | m_rootScene.EventManager.TriggerOarFileSaved(m_requestId, errorMessage); | 636 | m_rootScene.EventManager.TriggerOarFileSaved(m_requestId, errorMessage); |
627 | } | 637 | } |
628 | } | 638 | } |
629 | } \ No newline at end of file | 639 | } |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs index 95d109c..c1ff94d 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs | |||
@@ -150,12 +150,5 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
150 | m_log.InfoFormat("[ARCHIVER]: Added {0} assets to archive", m_assetsWritten); | 150 | m_log.InfoFormat("[ARCHIVER]: Added {0} assets to archive", m_assetsWritten); |
151 | } | 151 | } |
152 | 152 | ||
153 | /// <summary> | ||
154 | /// Only call this if you need to force a close on the underlying writer. | ||
155 | /// </summary> | ||
156 | public void ForceClose() | ||
157 | { | ||
158 | m_archiveWriter.Close(); | ||
159 | } | ||
160 | } | 153 | } |
161 | } | 154 | } |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs index e2f8833..715bf51 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs | |||
@@ -50,7 +50,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
50 | /// Method called when all the necessary assets for an archive request have been received. | 50 | /// Method called when all the necessary assets for an archive request have been received. |
51 | /// </summary> | 51 | /// </summary> |
52 | public delegate void AssetsRequestCallback( | 52 | public delegate void AssetsRequestCallback( |
53 | ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids); | 53 | ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids, bool timedOut); |
54 | 54 | ||
55 | enum RequestState | 55 | enum RequestState |
56 | { | 56 | { |
@@ -148,7 +148,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
148 | if (m_repliesRequired == 0) | 148 | if (m_repliesRequired == 0) |
149 | { | 149 | { |
150 | m_requestState = RequestState.Completed; | 150 | m_requestState = RequestState.Completed; |
151 | PerformAssetsRequestCallback(null); | 151 | PerformAssetsRequestCallback(false); |
152 | return; | 152 | return; |
153 | } | 153 | } |
154 | 154 | ||
@@ -164,7 +164,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
164 | 164 | ||
165 | protected void OnRequestCallbackTimeout(object source, ElapsedEventArgs args) | 165 | protected void OnRequestCallbackTimeout(object source, ElapsedEventArgs args) |
166 | { | 166 | { |
167 | bool close = true; | 167 | bool timedOut = true; |
168 | 168 | ||
169 | try | 169 | try |
170 | { | 170 | { |
@@ -174,7 +174,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
174 | // the final request came in (assuming that such a thing is possible) | 174 | // the final request came in (assuming that such a thing is possible) |
175 | if (m_requestState == RequestState.Completed) | 175 | if (m_requestState == RequestState.Completed) |
176 | { | 176 | { |
177 | close = false; | 177 | timedOut = false; |
178 | return; | 178 | return; |
179 | } | 179 | } |
180 | 180 | ||
@@ -223,8 +223,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
223 | } | 223 | } |
224 | finally | 224 | finally |
225 | { | 225 | { |
226 | if (close) | 226 | if (timedOut) |
227 | m_assetsArchiver.ForceClose(); | 227 | Util.FireAndForget(PerformAssetsRequestCallback, true); |
228 | } | 228 | } |
229 | } | 229 | } |
230 | 230 | ||
@@ -290,7 +290,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
290 | 290 | ||
291 | // We want to stop using the asset cache thread asap | 291 | // We want to stop using the asset cache thread asap |
292 | // as we now need to do the work of producing the rest of the archive | 292 | // as we now need to do the work of producing the rest of the archive |
293 | Util.FireAndForget(PerformAssetsRequestCallback); | 293 | Util.FireAndForget(PerformAssetsRequestCallback, false); |
294 | } | 294 | } |
295 | else | 295 | else |
296 | { | 296 | { |
@@ -311,9 +311,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
311 | { | 311 | { |
312 | Culture.SetCurrentCulture(); | 312 | Culture.SetCurrentCulture(); |
313 | 313 | ||
314 | Boolean timedOut = (Boolean)o; | ||
315 | |||
314 | try | 316 | try |
315 | { | 317 | { |
316 | m_assetsRequestCallback(m_foundAssetUuids, m_notFoundAssetUuids); | 318 | m_assetsRequestCallback(m_foundAssetUuids, m_notFoundAssetUuids, timedOut); |
317 | } | 319 | } |
318 | catch (Exception e) | 320 | catch (Exception e) |
319 | { | 321 | { |
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 267332d..9aee491 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | |||
@@ -128,7 +128,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
128 | { | 128 | { |
129 | uint sun = 0; | 129 | uint sun = 0; |
130 | 130 | ||
131 | if (!Scene.RegionInfo.EstateSettings.UseGlobalTime) | 131 | if (Scene.RegionInfo.EstateSettings.FixedSun) |
132 | sun = (uint)(Scene.RegionInfo.EstateSettings.SunPosition * 1024.0) + 0x1800; | 132 | sun = (uint)(Scene.RegionInfo.EstateSettings.SunPosition * 1024.0) + 0x1800; |
133 | UUID estateOwner; | 133 | UUID estateOwner; |
134 | estateOwner = Scene.RegionInfo.EstateSettings.EstateOwner; | 134 | estateOwner = Scene.RegionInfo.EstateSettings.EstateOwner; |
@@ -1128,6 +1128,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
1128 | { | 1128 | { |
1129 | Scene.RegionInfo.EstateSettings.UseGlobalTime = false; | 1129 | Scene.RegionInfo.EstateSettings.UseGlobalTime = false; |
1130 | Scene.RegionInfo.EstateSettings.SunPosition = (parms2 - 0x1800)/1024.0; | 1130 | Scene.RegionInfo.EstateSettings.SunPosition = (parms2 - 0x1800)/1024.0; |
1131 | // Warning: FixedSun should be set to True, otherwise this sun position won't be used. | ||
1131 | } | 1132 | } |
1132 | 1133 | ||
1133 | if ((parms1 & 0x00000010) != 0) | 1134 | if ((parms1 & 0x00000010) != 0) |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 281c143..b4f7d51 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -141,6 +141,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
141 | m_scene.EventManager.OnValidateLandBuy += EventManagerOnValidateLandBuy; | 141 | m_scene.EventManager.OnValidateLandBuy += EventManagerOnValidateLandBuy; |
142 | m_scene.EventManager.OnLandBuy += EventManagerOnLandBuy; | 142 | m_scene.EventManager.OnLandBuy += EventManagerOnLandBuy; |
143 | m_scene.EventManager.OnNewClient += EventManagerOnNewClient; | 143 | m_scene.EventManager.OnNewClient += EventManagerOnNewClient; |
144 | m_scene.EventManager.OnMakeChildAgent += EventMakeChildAgent; | ||
144 | m_scene.EventManager.OnSignificantClientMovement += EventManagerOnSignificantClientMovement; | 145 | m_scene.EventManager.OnSignificantClientMovement += EventManagerOnSignificantClientMovement; |
145 | m_scene.EventManager.OnNoticeNoLandDataFromStorage += EventManagerOnNoLandDataFromStorage; | 146 | m_scene.EventManager.OnNoticeNoLandDataFromStorage += EventManagerOnNoLandDataFromStorage; |
146 | m_scene.EventManager.OnIncomingLandDataFromStorage += EventManagerOnIncomingLandDataFromStorage; | 147 | m_scene.EventManager.OnIncomingLandDataFromStorage += EventManagerOnIncomingLandDataFromStorage; |
@@ -221,6 +222,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
221 | } | 222 | } |
222 | } | 223 | } |
223 | 224 | ||
225 | public void EventMakeChildAgent(ScenePresence avatar) | ||
226 | { | ||
227 | avatar.currentParcelUUID = UUID.Zero; | ||
228 | } | ||
229 | |||
224 | void ClientOnPreAgentUpdate(IClientAPI remoteClient, AgentUpdateArgs agentData) | 230 | void ClientOnPreAgentUpdate(IClientAPI remoteClient, AgentUpdateArgs agentData) |
225 | { | 231 | { |
226 | } | 232 | } |
@@ -249,17 +255,15 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
249 | newData.LocalID = local_id; | 255 | newData.LocalID = local_id; |
250 | ILandObject landobj = null; | 256 | ILandObject landobj = null; |
251 | 257 | ||
258 | ILandObject land; | ||
252 | lock (m_landList) | 259 | lock (m_landList) |
253 | { | 260 | { |
254 | if (m_landList.ContainsKey(local_id)) | 261 | if (m_landList.TryGetValue(local_id, out land)) |
255 | { | 262 | land.LandData = newData; |
256 | m_landList[local_id].LandData = newData; | ||
257 | landobj = m_landList[local_id]; | ||
258 | // m_scene.EventManager.TriggerLandObjectUpdated((uint)local_id, m_landList[local_id]); | ||
259 | } | ||
260 | } | 263 | } |
261 | if(landobj != null) | 264 | |
262 | m_scene.EventManager.TriggerLandObjectUpdated((uint)local_id, landobj); | 265 | if (land != null) |
266 | m_scene.EventManager.TriggerLandObjectUpdated((uint)local_id, land); | ||
263 | } | 267 | } |
264 | 268 | ||
265 | public bool AllowedForcefulBans | 269 | public bool AllowedForcefulBans |
@@ -584,7 +588,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
584 | // Only now can we add the prim counts to the land object - we rely on the global ID which is generated | 588 | // Only now can we add the prim counts to the land object - we rely on the global ID which is generated |
585 | // as a random UUID inside LandData initialization | 589 | // as a random UUID inside LandData initialization |
586 | if (m_primCountModule != null) | 590 | if (m_primCountModule != null) |
587 | new_land.PrimCounts = m_primCountModule.GetPrimCounts(new_land.LandData.GlobalID); | 591 | new_land.PrimCounts = m_primCountModule.GetPrimCounts(new_land.LandData.GlobalID); |
588 | 592 | ||
589 | lock (m_landList) | 593 | lock (m_landList) |
590 | { | 594 | { |
@@ -621,6 +625,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
621 | /// <param name="local_id">Land.localID of the peice of land to remove.</param> | 625 | /// <param name="local_id">Land.localID of the peice of land to remove.</param> |
622 | public void removeLandObject(int local_id) | 626 | public void removeLandObject(int local_id) |
623 | { | 627 | { |
628 | ILandObject land; | ||
624 | lock (m_landList) | 629 | lock (m_landList) |
625 | { | 630 | { |
626 | for (int x = 0; x < 64; x++) | 631 | for (int x = 0; x < 64; x++) |
@@ -637,9 +642,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
637 | } | 642 | } |
638 | } | 643 | } |
639 | 644 | ||
640 | m_scene.EventManager.TriggerLandObjectRemoved(m_landList[local_id].LandData.GlobalID); | 645 | land = m_landList[local_id]; |
641 | m_landList.Remove(local_id); | 646 | m_landList.Remove(local_id); |
642 | } | 647 | } |
648 | |||
649 | m_scene.EventManager.TriggerLandObjectRemoved(land.LandData.GlobalID); | ||
643 | } | 650 | } |
644 | 651 | ||
645 | /// <summary> | 652 | /// <summary> |
@@ -1399,25 +1406,72 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1399 | 1406 | ||
1400 | public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient) | 1407 | public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient) |
1401 | { | 1408 | { |
1402 | ILandObject selectedParcel = null; | 1409 | if (localID != -1) |
1403 | lock (m_landList) | ||
1404 | { | 1410 | { |
1405 | m_landList.TryGetValue(localID, out selectedParcel); | 1411 | ILandObject selectedParcel = null; |
1412 | lock (m_landList) | ||
1413 | { | ||
1414 | m_landList.TryGetValue(localID, out selectedParcel); | ||
1415 | } | ||
1416 | |||
1417 | if (selectedParcel == null) | ||
1418 | return; | ||
1419 | |||
1420 | selectedParcel.ReturnLandObjects(returnType, agentIDs, taskIDs, remoteClient); | ||
1406 | } | 1421 | } |
1422 | else | ||
1423 | { | ||
1424 | if (returnType != 1) | ||
1425 | { | ||
1426 | m_log.WarnFormat("[LAND MANAGEMENT MODULE]: ReturnObjectsInParcel: unknown return type {0}", returnType); | ||
1427 | return; | ||
1428 | } | ||
1407 | 1429 | ||
1408 | if (selectedParcel == null) return; | 1430 | // We get here when the user returns objects from the list of Top Colliders or Top Scripts. |
1431 | // In that case we receive specific object UUID's, but no parcel ID. | ||
1409 | 1432 | ||
1410 | selectedParcel.ReturnLandObjects(returnType, agentIDs, taskIDs, remoteClient); | 1433 | Dictionary<UUID, HashSet<SceneObjectGroup>> returns = new Dictionary<UUID, HashSet<SceneObjectGroup>>(); |
1434 | |||
1435 | foreach (UUID groupID in taskIDs) | ||
1436 | { | ||
1437 | SceneObjectGroup obj = m_scene.GetSceneObjectGroup(groupID); | ||
1438 | if (obj != null) | ||
1439 | { | ||
1440 | if (!returns.ContainsKey(obj.OwnerID)) | ||
1441 | returns[obj.OwnerID] = new HashSet<SceneObjectGroup>(); | ||
1442 | returns[obj.OwnerID].Add(obj); | ||
1443 | } | ||
1444 | else | ||
1445 | { | ||
1446 | m_log.WarnFormat("[LAND MANAGEMENT MODULE]: ReturnObjectsInParcel: unknown object {0}", groupID); | ||
1447 | } | ||
1448 | } | ||
1449 | |||
1450 | int num = 0; | ||
1451 | foreach (HashSet<SceneObjectGroup> objs in returns.Values) | ||
1452 | num += objs.Count; | ||
1453 | m_log.DebugFormat("[LAND MANAGEMENT MODULE]: Returning {0} specific object(s)", num); | ||
1454 | |||
1455 | foreach (HashSet<SceneObjectGroup> objs in returns.Values) | ||
1456 | { | ||
1457 | List<SceneObjectGroup> objs2 = new List<SceneObjectGroup>(objs); | ||
1458 | if (m_scene.Permissions.CanReturnObjects(null, remoteClient.AgentId, objs2)) | ||
1459 | { | ||
1460 | m_scene.returnObjects(objs2.ToArray(), remoteClient.AgentId); | ||
1461 | } | ||
1462 | else | ||
1463 | { | ||
1464 | m_log.WarnFormat("[LAND MANAGEMENT MODULE]: ReturnObjectsInParcel: not permitted to return {0} object(s) belonging to user {1}", | ||
1465 | objs2.Count, objs2[0].OwnerID); | ||
1466 | } | ||
1467 | } | ||
1468 | } | ||
1411 | } | 1469 | } |
1412 | 1470 | ||
1413 | public void EventManagerOnNoLandDataFromStorage() | 1471 | public void EventManagerOnNoLandDataFromStorage() |
1414 | { | 1472 | { |
1415 | // called methods already have locks | 1473 | ResetSimLandObjects(); |
1416 | // lock (m_landList) | 1474 | CreateDefaultParcel(); |
1417 | { | ||
1418 | ResetSimLandObjects(); | ||
1419 | CreateDefaultParcel(); | ||
1420 | } | ||
1421 | } | 1475 | } |
1422 | 1476 | ||
1423 | #endregion | 1477 | #endregion |
diff --git a/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs b/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs index 55b8227..771fdd2 100644 --- a/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs | |||
@@ -490,11 +490,14 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
490 | 490 | ||
491 | m_Scene.ForEachSOG(AddObject); | 491 | m_Scene.ForEachSOG(AddObject); |
492 | 492 | ||
493 | List<UUID> primcountKeys = new List<UUID>(m_PrimCounts.Keys); | 493 | lock (m_PrimCounts) |
494 | foreach (UUID k in primcountKeys) | ||
495 | { | 494 | { |
496 | if (!m_OwnerMap.ContainsKey(k)) | 495 | List<UUID> primcountKeys = new List<UUID>(m_PrimCounts.Keys); |
497 | m_PrimCounts.Remove(k); | 496 | foreach (UUID k in primcountKeys) |
497 | { | ||
498 | if (!m_OwnerMap.ContainsKey(k)) | ||
499 | m_PrimCounts.Remove(k); | ||
500 | } | ||
498 | } | 501 | } |
499 | 502 | ||
500 | m_Tainted = false; | 503 | m_Tainted = false; |
diff --git a/OpenSim/Region/CoreModules/World/Sun/SunModule.cs b/OpenSim/Region/CoreModules/World/Sun/SunModule.cs index a321c09..6f344c8 100644 --- a/OpenSim/Region/CoreModules/World/Sun/SunModule.cs +++ b/OpenSim/Region/CoreModules/World/Sun/SunModule.cs | |||
@@ -252,12 +252,11 @@ namespace OpenSim.Region.CoreModules | |||
252 | } | 252 | } |
253 | 253 | ||
254 | // TODO: Decouple this, so we can get rid of Linden Hour info | 254 | // TODO: Decouple this, so we can get rid of Linden Hour info |
255 | // Update Region infor with new Sun Position and Hour | 255 | // Update Region with new Sun Vector |
256 | // set estate settings for region access to sun position | 256 | // set estate settings for region access to sun position |
257 | if (receivedEstateToolsSunUpdate) | 257 | if (receivedEstateToolsSunUpdate) |
258 | { | 258 | { |
259 | m_scene.RegionInfo.RegionSettings.SunVector = Position; | 259 | m_scene.RegionInfo.RegionSettings.SunVector = Position; |
260 | m_scene.RegionInfo.RegionSettings.SunPosition = GetCurrentTimeAsLindenSunHour(); | ||
261 | } | 260 | } |
262 | } | 261 | } |
263 | 262 | ||
@@ -395,7 +394,7 @@ namespace OpenSim.Region.CoreModules | |||
395 | ready = false; | 394 | ready = false; |
396 | 395 | ||
397 | // Remove our hooks | 396 | // Remove our hooks |
398 | m_scene.EventManager.OnFrame -= SunUpdate; | 397 | m_scene.EventManager.OnFrame -= SunUpdate; |
399 | m_scene.EventManager.OnAvatarEnteringNewParcel -= AvatarEnteringParcel; | 398 | m_scene.EventManager.OnAvatarEnteringNewParcel -= AvatarEnteringParcel; |
400 | m_scene.EventManager.OnEstateToolsSunUpdate -= EstateToolsSunUpdate; | 399 | m_scene.EventManager.OnEstateToolsSunUpdate -= EstateToolsSunUpdate; |
401 | m_scene.EventManager.OnGetCurrentTimeAsLindenSunHour -= GetCurrentTimeAsLindenSunHour; | 400 | m_scene.EventManager.OnGetCurrentTimeAsLindenSunHour -= GetCurrentTimeAsLindenSunHour; |
@@ -459,26 +458,33 @@ namespace OpenSim.Region.CoreModules | |||
459 | SunToClient(avatar.ControllingClient); | 458 | SunToClient(avatar.ControllingClient); |
460 | } | 459 | } |
461 | 460 | ||
462 | /// <summary> | 461 | public void EstateToolsSunUpdate(ulong regionHandle) |
463 | /// | ||
464 | /// </summary> | ||
465 | /// <param name="regionHandle"></param> | ||
466 | /// <param name="FixedTime">Is the sun's position fixed?</param> | ||
467 | /// <param name="useEstateTime">Use the Region or Estate Sun hour?</param> | ||
468 | /// <param name="FixedSunHour">What hour of the day is the Sun Fixed at?</param> | ||
469 | public void EstateToolsSunUpdate(ulong regionHandle, bool FixedSun, bool useEstateTime, float FixedSunHour) | ||
470 | { | 462 | { |
471 | if (m_scene.RegionInfo.RegionHandle == regionHandle) | 463 | if (m_scene.RegionInfo.RegionHandle == regionHandle) |
472 | { | 464 | { |
473 | // Must limit the Sun Hour to 0 ... 24 | 465 | float sunFixedHour; |
474 | while (FixedSunHour > 24.0f) | 466 | bool fixedSun; |
475 | FixedSunHour -= 24; | ||
476 | 467 | ||
477 | while (FixedSunHour < 0) | 468 | if (m_scene.RegionInfo.RegionSettings.UseEstateSun) |
478 | FixedSunHour += 24; | 469 | { |
470 | sunFixedHour = (float)m_scene.RegionInfo.EstateSettings.SunPosition; | ||
471 | fixedSun = m_scene.RegionInfo.EstateSettings.FixedSun; | ||
472 | } | ||
473 | else | ||
474 | { | ||
475 | sunFixedHour = (float)m_scene.RegionInfo.RegionSettings.SunPosition - 6.0f; | ||
476 | fixedSun = m_scene.RegionInfo.RegionSettings.FixedSun; | ||
477 | } | ||
478 | |||
479 | // Must limit the Sun Hour to 0 ... 24 | ||
480 | while (sunFixedHour > 24.0f) | ||
481 | sunFixedHour -= 24; | ||
479 | 482 | ||
480 | m_SunFixedHour = FixedSunHour; | 483 | while (sunFixedHour < 0) |
481 | m_SunFixed = FixedSun; | 484 | sunFixedHour += 24; |
485 | |||
486 | m_SunFixedHour = sunFixedHour; | ||
487 | m_SunFixed = fixedSun; | ||
482 | 488 | ||
483 | // m_log.DebugFormat("[SUN]: Sun Settings Update: Fixed Sun? : {0}", m_SunFixed.ToString()); | 489 | // m_log.DebugFormat("[SUN]: Sun Settings Update: Fixed Sun? : {0}", m_SunFixed.ToString()); |
484 | // m_log.DebugFormat("[SUN]: Sun Settings Update: Sun Hour : {0}", m_SunFixedHour.ToString()); | 490 | // m_log.DebugFormat("[SUN]: Sun Settings Update: Sun Hour : {0}", m_SunFixedHour.ToString()); |
@@ -501,7 +507,7 @@ namespace OpenSim.Region.CoreModules | |||
501 | { | 507 | { |
502 | m_scene.ForEachRootClient(delegate(IClientAPI client) | 508 | m_scene.ForEachRootClient(delegate(IClientAPI client) |
503 | { | 509 | { |
504 | SunToClient(client); | 510 | SunToClient(client); |
505 | }); | 511 | }); |
506 | } | 512 | } |
507 | 513 | ||
diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs index 33aabe4..4d738a5 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | |||
@@ -480,7 +480,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
480 | else | 480 | else |
481 | { | 481 | { |
482 | m_plugineffects[pluginName] = effect; | 482 | m_plugineffects[pluginName] = effect; |
483 | m_log.Warn("E ... " + pluginName + " (Replaced)"); | 483 | m_log.Info("E ... " + pluginName + " (Replaced)"); |
484 | } | 484 | } |
485 | } | 485 | } |
486 | } | 486 | } |