aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs149
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandChannel.cs10
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs50
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandObject.cs89
-rw-r--r--OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs31
-rw-r--r--OpenSim/Region/CoreModules/World/Sun/SunModule.cs6
6 files changed, 204 insertions, 131 deletions
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
index e8b5af0..6d9cb7f 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
@@ -202,12 +202,13 @@ namespace OpenSim.Region.CoreModules.World.Estate
202 } 202 }
203 Scene.RegionInfo.RegionSettings.Save(); 203 Scene.RegionInfo.RegionSettings.Save();
204 TriggerRegionInfoChange(); 204 TriggerRegionInfoChange();
205 sendRegionHandshakeToAll();
205 sendRegionInfoPacketToAll(); 206 sendRegionInfoPacketToAll();
206 } 207 }
207 208
208 private void handleCommitEstateTerrainTextureRequest(IClientAPI remoteClient) 209 private void handleCommitEstateTerrainTextureRequest(IClientAPI remoteClient)
209 { 210 {
210 sendRegionHandshakeToAll(); 211 // sendRegionHandshakeToAll();
211 } 212 }
212 213
213 public void setRegionTerrainSettings(float WaterHeight, 214 public void setRegionTerrainSettings(float WaterHeight,
@@ -276,8 +277,25 @@ namespace OpenSim.Region.CoreModules.World.Estate
276 { 277 {
277 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || Scene.Permissions.BypassPermissions()) 278 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || Scene.Permissions.BypassPermissions())
278 { 279 {
280 if ((estateAccessType & 1) != 0) // All estates
281 {
282 List<int> estateIDs = Scene.EstateDataService.GetEstatesByOwner(Scene.RegionInfo.EstateSettings.EstateOwner);
283 EstateSettings estateSettings;
284
285 foreach (int estateID in estateIDs)
286 {
287 if (estateID != Scene.RegionInfo.EstateSettings.EstateID)
288 {
289 estateSettings = Scene.EstateDataService.LoadEstateSettings(estateID);
290 estateSettings.AddEstateUser(user);
291 estateSettings.Save();
292 }
293 }
294 }
295
279 Scene.RegionInfo.EstateSettings.AddEstateUser(user); 296 Scene.RegionInfo.EstateSettings.AddEstateUser(user);
280 Scene.RegionInfo.EstateSettings.Save(); 297 Scene.RegionInfo.EstateSettings.Save();
298
281 TriggerEstateInfoChange(); 299 TriggerEstateInfoChange();
282 remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AccessOptions, Scene.RegionInfo.EstateSettings.EstateAccess, Scene.RegionInfo.EstateSettings.EstateID); 300 remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AccessOptions, Scene.RegionInfo.EstateSettings.EstateAccess, Scene.RegionInfo.EstateSettings.EstateID);
283 } 301 }
@@ -291,10 +309,26 @@ namespace OpenSim.Region.CoreModules.World.Estate
291 { 309 {
292 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || Scene.Permissions.BypassPermissions()) 310 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || Scene.Permissions.BypassPermissions())
293 { 311 {
312 if ((estateAccessType & 1) != 0) // All estates
313 {
314 List<int> estateIDs = Scene.EstateDataService.GetEstatesByOwner(Scene.RegionInfo.EstateSettings.EstateOwner);
315 EstateSettings estateSettings;
316
317 foreach (int estateID in estateIDs)
318 {
319 if (estateID != Scene.RegionInfo.EstateSettings.EstateID)
320 {
321 estateSettings = Scene.EstateDataService.LoadEstateSettings(estateID);
322 estateSettings.RemoveEstateUser(user);
323 estateSettings.Save();
324 }
325 }
326 }
327
294 Scene.RegionInfo.EstateSettings.RemoveEstateUser(user); 328 Scene.RegionInfo.EstateSettings.RemoveEstateUser(user);
295 Scene.RegionInfo.EstateSettings.Save(); 329 Scene.RegionInfo.EstateSettings.Save();
296 TriggerEstateInfoChange();
297 330
331 TriggerEstateInfoChange();
298 remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AccessOptions, Scene.RegionInfo.EstateSettings.EstateAccess, Scene.RegionInfo.EstateSettings.EstateID); 332 remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AccessOptions, Scene.RegionInfo.EstateSettings.EstateAccess, Scene.RegionInfo.EstateSettings.EstateID);
299 } 333 }
300 else 334 else
@@ -306,8 +340,25 @@ namespace OpenSim.Region.CoreModules.World.Estate
306 { 340 {
307 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || Scene.Permissions.BypassPermissions()) 341 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || Scene.Permissions.BypassPermissions())
308 { 342 {
343 if ((estateAccessType & 1) != 0) // All estates
344 {
345 List<int> estateIDs = Scene.EstateDataService.GetEstatesByOwner(Scene.RegionInfo.EstateSettings.EstateOwner);
346 EstateSettings estateSettings;
347
348 foreach (int estateID in estateIDs)
349 {
350 if (estateID != Scene.RegionInfo.EstateSettings.EstateID)
351 {
352 estateSettings = Scene.EstateDataService.LoadEstateSettings(estateID);
353 estateSettings.AddEstateGroup(user);
354 estateSettings.Save();
355 }
356 }
357 }
358
309 Scene.RegionInfo.EstateSettings.AddEstateGroup(user); 359 Scene.RegionInfo.EstateSettings.AddEstateGroup(user);
310 Scene.RegionInfo.EstateSettings.Save(); 360 Scene.RegionInfo.EstateSettings.Save();
361
311 TriggerEstateInfoChange(); 362 TriggerEstateInfoChange();
312 remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AllowedGroups, Scene.RegionInfo.EstateSettings.EstateGroups, Scene.RegionInfo.EstateSettings.EstateID); 363 remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AllowedGroups, Scene.RegionInfo.EstateSettings.EstateGroups, Scene.RegionInfo.EstateSettings.EstateID);
313 } 364 }
@@ -320,10 +371,26 @@ namespace OpenSim.Region.CoreModules.World.Estate
320 { 371 {
321 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || Scene.Permissions.BypassPermissions()) 372 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || Scene.Permissions.BypassPermissions())
322 { 373 {
374 if ((estateAccessType & 1) != 0) // All estates
375 {
376 List<int> estateIDs = Scene.EstateDataService.GetEstatesByOwner(Scene.RegionInfo.EstateSettings.EstateOwner);
377 EstateSettings estateSettings;
378
379 foreach (int estateID in estateIDs)
380 {
381 if (estateID != Scene.RegionInfo.EstateSettings.EstateID)
382 {
383 estateSettings = Scene.EstateDataService.LoadEstateSettings(estateID);
384 estateSettings.RemoveEstateGroup(user);
385 estateSettings.Save();
386 }
387 }
388 }
389
323 Scene.RegionInfo.EstateSettings.RemoveEstateGroup(user); 390 Scene.RegionInfo.EstateSettings.RemoveEstateGroup(user);
324 Scene.RegionInfo.EstateSettings.Save(); 391 Scene.RegionInfo.EstateSettings.Save();
325 TriggerEstateInfoChange();
326 392
393 TriggerEstateInfoChange();
327 remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AllowedGroups, Scene.RegionInfo.EstateSettings.EstateGroups, Scene.RegionInfo.EstateSettings.EstateID); 394 remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AllowedGroups, Scene.RegionInfo.EstateSettings.EstateGroups, Scene.RegionInfo.EstateSettings.EstateID);
328 } 395 }
329 else 396 else
@@ -351,6 +418,29 @@ namespace OpenSim.Region.CoreModules.World.Estate
351 if (!alreadyInList) 418 if (!alreadyInList)
352 { 419 {
353 420
421 if ((estateAccessType & 1) != 0) // All estates
422 {
423 List<int> estateIDs = Scene.EstateDataService.GetEstatesByOwner(Scene.RegionInfo.EstateSettings.EstateOwner);
424 EstateSettings estateSettings;
425
426 foreach (int estateID in estateIDs)
427 {
428 if (estateID != Scene.RegionInfo.EstateSettings.EstateID)
429 {
430 EstateBan bitem = new EstateBan();
431
432 bitem.BannedUserID = user;
433 bitem.EstateID = (uint)estateID;
434 bitem.BannedHostAddress = "0.0.0.0";
435 bitem.BannedHostIPMask = "0.0.0.0";
436
437 estateSettings = Scene.EstateDataService.LoadEstateSettings(estateID);
438 estateSettings.AddBan(bitem);
439 estateSettings.Save();
440 }
441 }
442 }
443
354 EstateBan item = new EstateBan(); 444 EstateBan item = new EstateBan();
355 445
356 item.BannedUserID = user; 446 item.BannedUserID = user;
@@ -360,6 +450,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
360 450
361 Scene.RegionInfo.EstateSettings.AddBan(item); 451 Scene.RegionInfo.EstateSettings.AddBan(item);
362 Scene.RegionInfo.EstateSettings.Save(); 452 Scene.RegionInfo.EstateSettings.Save();
453
363 TriggerEstateInfoChange(); 454 TriggerEstateInfoChange();
364 455
365 ScenePresence s = Scene.GetScenePresence(user); 456 ScenePresence s = Scene.GetScenePresence(user);
@@ -409,8 +500,25 @@ namespace OpenSim.Region.CoreModules.World.Estate
409 500
410 if (alreadyInList && listitem != null) 501 if (alreadyInList && listitem != null)
411 { 502 {
503 if ((estateAccessType & 1) != 0) // All estates
504 {
505 List<int> estateIDs = Scene.EstateDataService.GetEstatesByOwner(Scene.RegionInfo.EstateSettings.EstateOwner);
506 EstateSettings estateSettings;
507
508 foreach (int estateID in estateIDs)
509 {
510 if (estateID != Scene.RegionInfo.EstateSettings.EstateID)
511 {
512 estateSettings = Scene.EstateDataService.LoadEstateSettings(estateID);
513 estateSettings.RemoveBan(user);
514 estateSettings.Save();
515 }
516 }
517 }
518
412 Scene.RegionInfo.EstateSettings.RemoveBan(listitem.BannedUserID); 519 Scene.RegionInfo.EstateSettings.RemoveBan(listitem.BannedUserID);
413 Scene.RegionInfo.EstateSettings.Save(); 520 Scene.RegionInfo.EstateSettings.Save();
521
414 TriggerEstateInfoChange(); 522 TriggerEstateInfoChange();
415 } 523 }
416 else 524 else
@@ -430,8 +538,25 @@ namespace OpenSim.Region.CoreModules.World.Estate
430 { 538 {
431 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || Scene.Permissions.BypassPermissions()) 539 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || Scene.Permissions.BypassPermissions())
432 { 540 {
541 if ((estateAccessType & 1) != 0) // All estates
542 {
543 List<int> estateIDs = Scene.EstateDataService.GetEstatesByOwner(Scene.RegionInfo.EstateSettings.EstateOwner);
544 EstateSettings estateSettings;
545
546 foreach (int estateID in estateIDs)
547 {
548 if (estateID != Scene.RegionInfo.EstateSettings.EstateID)
549 {
550 estateSettings = Scene.EstateDataService.LoadEstateSettings(estateID);
551 estateSettings.AddEstateManager(user);
552 estateSettings.Save();
553 }
554 }
555 }
556
433 Scene.RegionInfo.EstateSettings.AddEstateManager(user); 557 Scene.RegionInfo.EstateSettings.AddEstateManager(user);
434 Scene.RegionInfo.EstateSettings.Save(); 558 Scene.RegionInfo.EstateSettings.Save();
559
435 TriggerEstateInfoChange(); 560 TriggerEstateInfoChange();
436 remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.EstateManagers, Scene.RegionInfo.EstateSettings.EstateManagers, Scene.RegionInfo.EstateSettings.EstateID); 561 remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.EstateManagers, Scene.RegionInfo.EstateSettings.EstateManagers, Scene.RegionInfo.EstateSettings.EstateID);
437 } 562 }
@@ -444,10 +569,26 @@ namespace OpenSim.Region.CoreModules.World.Estate
444 { 569 {
445 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || Scene.Permissions.BypassPermissions()) 570 if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || Scene.Permissions.BypassPermissions())
446 { 571 {
572 if ((estateAccessType & 1) != 0) // All estates
573 {
574 List<int> estateIDs = Scene.EstateDataService.GetEstatesByOwner(Scene.RegionInfo.EstateSettings.EstateOwner);
575 EstateSettings estateSettings;
576
577 foreach (int estateID in estateIDs)
578 {
579 if (estateID != Scene.RegionInfo.EstateSettings.EstateID)
580 {
581 estateSettings = Scene.EstateDataService.LoadEstateSettings(estateID);
582 estateSettings.RemoveEstateManager(user);
583 estateSettings.Save();
584 }
585 }
586 }
587
447 Scene.RegionInfo.EstateSettings.RemoveEstateManager(user); 588 Scene.RegionInfo.EstateSettings.RemoveEstateManager(user);
448 Scene.RegionInfo.EstateSettings.Save(); 589 Scene.RegionInfo.EstateSettings.Save();
449 TriggerEstateInfoChange();
450 590
591 TriggerEstateInfoChange();
451 remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.EstateManagers, Scene.RegionInfo.EstateSettings.EstateManagers, Scene.RegionInfo.EstateSettings.EstateID); 592 remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.EstateManagers, Scene.RegionInfo.EstateSettings.EstateManagers, Scene.RegionInfo.EstateSettings.EstateID);
452 } 593 }
453 else 594 else
diff --git a/OpenSim/Region/CoreModules/World/Land/LandChannel.cs b/OpenSim/Region/CoreModules/World/Land/LandChannel.cs
index 7d990c2..7fc358d 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandChannel.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandChannel.cs
@@ -133,16 +133,6 @@ namespace OpenSim.Region.CoreModules.World.Land
133 return new List<ILandObject>(); 133 return new List<ILandObject>();
134 } 134 }
135 135
136 public bool IsLandPrimCountTainted()
137 {
138 if (m_landManagementModule != null)
139 {
140 return m_landManagementModule.IsLandPrimCountTainted();
141 }
142
143 return false;
144 }
145
146 public bool IsForcefulBansAllowed() 136 public bool IsForcefulBansAllowed()
147 { 137 {
148 if (m_landManagementModule != null) 138 if (m_landManagementModule != null)
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
index b5517a1..fae4f90 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
@@ -62,8 +62,7 @@ namespace OpenSim.Region.CoreModules.World.Land
62 62
63 public class LandManagementModule : INonSharedRegionModule 63 public class LandManagementModule : INonSharedRegionModule
64 { 64 {
65 private static readonly ILog m_log = 65 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
66 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
67 66
68 private static readonly string remoteParcelRequestPath = "0009/"; 67 private static readonly string remoteParcelRequestPath = "0009/";
69 68
@@ -89,7 +88,6 @@ namespace OpenSim.Region.CoreModules.World.Land
89 /// </value> 88 /// </value>
90 private readonly Dictionary<int, ILandObject> m_landList = new Dictionary<int, ILandObject>(); 89 private readonly Dictionary<int, ILandObject> m_landList = new Dictionary<int, ILandObject>();
91 90
92 private bool m_landPrimCountTainted;
93 private int m_lastLandLocalID = LandChannel.START_LAND_LOCAL_ID - 1; 91 private int m_lastLandLocalID = LandChannel.START_LAND_LOCAL_ID - 1;
94 92
95 private bool m_allowedForcefulBans = true; 93 private bool m_allowedForcefulBans = true;
@@ -128,18 +126,18 @@ namespace OpenSim.Region.CoreModules.World.Land
128 126
129 m_scene.EventManager.OnParcelPrimCountAdd += EventManagerOnParcelPrimCountAdd; 127 m_scene.EventManager.OnParcelPrimCountAdd += EventManagerOnParcelPrimCountAdd;
130 m_scene.EventManager.OnParcelPrimCountUpdate += EventManagerOnParcelPrimCountUpdate; 128 m_scene.EventManager.OnParcelPrimCountUpdate += EventManagerOnParcelPrimCountUpdate;
129 m_scene.EventManager.OnObjectBeingRemovedFromScene += EventManagerOnObjectBeingRemovedFromScene;
130 m_scene.EventManager.OnRequestParcelPrimCountUpdate += EventManagerOnRequestParcelPrimCountUpdate;
131
131 m_scene.EventManager.OnAvatarEnteringNewParcel += EventManagerOnAvatarEnteringNewParcel; 132 m_scene.EventManager.OnAvatarEnteringNewParcel += EventManagerOnAvatarEnteringNewParcel;
132 m_scene.EventManager.OnClientMovement += EventManagerOnClientMovement; 133 m_scene.EventManager.OnClientMovement += EventManagerOnClientMovement;
133 m_scene.EventManager.OnValidateLandBuy += EventManagerOnValidateLandBuy; 134 m_scene.EventManager.OnValidateLandBuy += EventManagerOnValidateLandBuy;
134 m_scene.EventManager.OnLandBuy += EventManagerOnLandBuy; 135 m_scene.EventManager.OnLandBuy += EventManagerOnLandBuy;
135 m_scene.EventManager.OnNewClient += EventManagerOnNewClient; 136 m_scene.EventManager.OnNewClient += EventManagerOnNewClient;
136 m_scene.EventManager.OnSignificantClientMovement += EventManagerOnSignificantClientMovement; 137 m_scene.EventManager.OnSignificantClientMovement += EventManagerOnSignificantClientMovement;
137 m_scene.EventManager.OnObjectBeingRemovedFromScene += EventManagerOnObjectBeingRemovedFromScene;
138 m_scene.EventManager.OnNoticeNoLandDataFromStorage += EventManagerOnNoLandDataFromStorage; 138 m_scene.EventManager.OnNoticeNoLandDataFromStorage += EventManagerOnNoLandDataFromStorage;
139 m_scene.EventManager.OnIncomingLandDataFromStorage += EventManagerOnIncomingLandDataFromStorage; 139 m_scene.EventManager.OnIncomingLandDataFromStorage += EventManagerOnIncomingLandDataFromStorage;
140 m_scene.EventManager.OnSetAllowForcefulBan += EventManagerOnSetAllowedForcefulBan; 140 m_scene.EventManager.OnSetAllowForcefulBan += EventManagerOnSetAllowedForcefulBan;
141 m_scene.EventManager.OnRequestParcelPrimCountUpdate += EventManagerOnRequestParcelPrimCountUpdate;
142 m_scene.EventManager.OnParcelPrimCountTainted += EventManagerOnParcelPrimCountTainted;
143 m_scene.EventManager.OnRegisterCaps += EventManagerOnRegisterCaps; 141 m_scene.EventManager.OnRegisterCaps += EventManagerOnRegisterCaps;
144 m_scene.EventManager.OnPluginConsole += EventManagerOnPluginConsole; 142 m_scene.EventManager.OnPluginConsole += EventManagerOnPluginConsole;
145 143
@@ -277,8 +275,8 @@ namespace OpenSim.Region.CoreModules.World.Land
277 /// <returns>The parcel created.</returns> 275 /// <returns>The parcel created.</returns>
278 protected ILandObject CreateDefaultParcel() 276 protected ILandObject CreateDefaultParcel()
279 { 277 {
280// m_log.DebugFormat( 278 m_log.DebugFormat(
281// "[LAND MANAGEMENT MODULE]: Creating default parcel for region {0}", m_scene.RegionInfo.RegionName); 279 "[LAND MANAGEMENT MODULE]: Creating default parcel for region {0}", m_scene.RegionInfo.RegionName);
282 280
283 ILandObject fullSimParcel = new LandObject(UUID.Zero, false, m_scene); 281 ILandObject fullSimParcel = new LandObject(UUID.Zero, false, m_scene);
284 fullSimParcel.SetLandBitmap(fullSimParcel.GetSquareLandBitmap(0, 0, (int)Constants.RegionSize, (int)Constants.RegionSize)); 282 fullSimParcel.SetLandBitmap(fullSimParcel.GetSquareLandBitmap(0, 0, (int)Constants.RegionSize, (int)Constants.RegionSize));
@@ -695,34 +693,24 @@ namespace OpenSim.Region.CoreModules.World.Land
695 693
696 #region Parcel Modification 694 #region Parcel Modification
697 695
698 public void ResetAllLandPrimCounts() 696 public void ResetOverMeRecords()
699 { 697 {
700 lock (m_landList) 698 lock (m_landList)
701 { 699 {
702 foreach (LandObject p in m_landList.Values) 700 foreach (LandObject p in m_landList.Values)
703 { 701 {
704 p.ResetLandPrimCounts(); 702 p.ResetOverMeRecord();
705 } 703 }
706 } 704 }
707 } 705 }
708 706
709 public void EventManagerOnParcelPrimCountTainted()
710 {
711 m_landPrimCountTainted = true;
712 }
713
714 public bool IsLandPrimCountTainted()
715 {
716 return m_landPrimCountTainted;
717 }
718
719 public void EventManagerOnParcelPrimCountAdd(SceneObjectGroup obj) 707 public void EventManagerOnParcelPrimCountAdd(SceneObjectGroup obj)
720 { 708 {
721 Vector3 position = obj.AbsolutePosition; 709 Vector3 position = obj.AbsolutePosition;
722 ILandObject landUnderPrim = GetLandObject(position.X, position.Y); 710 ILandObject landUnderPrim = GetLandObject(position.X, position.Y);
723 if (landUnderPrim != null) 711 if (landUnderPrim != null)
724 { 712 {
725 ((LandObject)landUnderPrim).AddPrimToCount(obj); 713 ((LandObject)landUnderPrim).AddPrimOverMe(obj);
726 } 714 }
727 } 715 }
728 716
@@ -732,7 +720,7 @@ namespace OpenSim.Region.CoreModules.World.Land
732 { 720 {
733 foreach (LandObject p in m_landList.Values) 721 foreach (LandObject p in m_landList.Values)
734 { 722 {
735 p.RemovePrimFromCount(obj); 723 p.RemovePrimFromOverMe(obj);
736 } 724 }
737 } 725 }
738 } 726 }
@@ -765,8 +753,7 @@ namespace OpenSim.Region.CoreModules.World.Land
765 foreach (LandObject p in landOwnersAndParcels[owner]) 753 foreach (LandObject p in landOwnersAndParcels[owner])
766 { 754 {
767 simArea += p.LandData.Area; 755 simArea += p.LandData.Area;
768 simPrims += p.LandData.OwnerPrims + p.LandData.OtherPrims + p.LandData.GroupPrims + 756 simPrims += p.PrimCounts.Total;
769 p.LandData.SelectedPrims;
770 } 757 }
771 758
772 foreach (LandObject p in landOwnersAndParcels[owner]) 759 foreach (LandObject p in landOwnersAndParcels[owner])
@@ -783,7 +770,7 @@ namespace OpenSim.Region.CoreModules.World.Land
783// "[LAND MANAGEMENT MODULE]: Triggered EventManagerOnParcelPrimCountUpdate() for {0}", 770// "[LAND MANAGEMENT MODULE]: Triggered EventManagerOnParcelPrimCountUpdate() for {0}",
784// m_scene.RegionInfo.RegionName); 771// m_scene.RegionInfo.RegionName);
785 772
786 ResetAllLandPrimCounts(); 773 ResetOverMeRecords();
787 EntityBase[] entities = m_scene.Entities.GetEntities(); 774 EntityBase[] entities = m_scene.Entities.GetEntities();
788 foreach (EntityBase obj in entities) 775 foreach (EntityBase obj in entities)
789 { 776 {
@@ -796,15 +783,13 @@ namespace OpenSim.Region.CoreModules.World.Land
796 } 783 }
797 } 784 }
798 FinalizeLandPrimCountUpdate(); 785 FinalizeLandPrimCountUpdate();
799 m_landPrimCountTainted = false;
800 } 786 }
801 787
802 public void EventManagerOnRequestParcelPrimCountUpdate() 788 public void EventManagerOnRequestParcelPrimCountUpdate()
803 { 789 {
804 ResetAllLandPrimCounts(); 790 ResetOverMeRecords();
805 m_scene.EventManager.TriggerParcelPrimCountUpdate(); 791 m_scene.EventManager.TriggerParcelPrimCountUpdate();
806 FinalizeLandPrimCountUpdate(); 792 FinalizeLandPrimCountUpdate();
807 m_landPrimCountTainted = false;
808 } 793 }
809 794
810 /// <summary> 795 /// <summary>
@@ -868,8 +853,6 @@ namespace OpenSim.Region.CoreModules.World.Land
868 m_landList[startLandObjectIndex].ForceUpdateLandInfo(); 853 m_landList[startLandObjectIndex].ForceUpdateLandInfo();
869 } 854 }
870 855
871 EventManagerOnParcelPrimCountTainted();
872
873 //Now add the new land object 856 //Now add the new land object
874 ILandObject result = AddLandObject(newLand); 857 ILandObject result = AddLandObject(newLand);
875 UpdateLandObject(startLandObject.LandData.LocalID, startLandObject.LandData); 858 UpdateLandObject(startLandObject.LandData.LocalID, startLandObject.LandData);
@@ -936,7 +919,6 @@ namespace OpenSim.Region.CoreModules.World.Land
936 performFinalLandJoin(masterLandObject, slaveLandObject); 919 performFinalLandJoin(masterLandObject, slaveLandObject);
937 } 920 }
938 } 921 }
939 EventManagerOnParcelPrimCountTainted();
940 922
941 masterLandObject.SendLandUpdateToAvatarsOverMe(); 923 masterLandObject.SendLandUpdateToAvatarsOverMe();
942 } 924 }
@@ -1130,6 +1112,7 @@ namespace OpenSim.Region.CoreModules.World.Land
1130 1112
1131 if (land != null) 1113 if (land != null)
1132 { 1114 {
1115 m_scene.EventManager.TriggerParcelPrimCountUpdate();
1133 m_landList[local_id].SendLandObjectOwners(remote_client); 1116 m_landList[local_id].SendLandObjectOwners(remote_client);
1134 } 1117 }
1135 else 1118 else
@@ -1375,7 +1358,8 @@ namespace OpenSim.Region.CoreModules.World.Land
1375 private string ProcessPropertiesUpdate(string request, string path, string param, UUID agentID, Caps caps) 1358 private string ProcessPropertiesUpdate(string request, string path, string param, UUID agentID, Caps caps)
1376 { 1359 {
1377 IClientAPI client; 1360 IClientAPI client;
1378 if (! m_scene.TryGetClient(agentID, out client)) { 1361 if (!m_scene.TryGetClient(agentID, out client))
1362 {
1379 m_log.WarnFormat("[LAND MANAGEMENT MODULE]: Unable to retrieve IClientAPI for {0}", agentID); 1363 m_log.WarnFormat("[LAND MANAGEMENT MODULE]: Unable to retrieve IClientAPI for {0}", agentID);
1380 return LLSDHelpers.SerialiseLLSDReply(new LLSDEmpty()); 1364 return LLSDHelpers.SerialiseLLSDReply(new LLSDEmpty());
1381 } 1365 }
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
index e87153b..57c7fc6 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
@@ -64,8 +64,6 @@ namespace OpenSim.Region.CoreModules.World.Land
64 64
65 #endregion 65 #endregion
66 66
67 #region ILandObject Members
68
69 public int GetPrimsFree() 67 public int GetPrimsFree()
70 { 68 {
71 m_scene.EventManager.TriggerParcelPrimCountUpdate(); 69 m_scene.EventManager.TriggerParcelPrimCountUpdate();
@@ -213,6 +211,7 @@ namespace OpenSim.Region.CoreModules.World.Land
213 return simMax; 211 return simMax;
214 } 212 }
215 } 213 }
214
216 #endregion 215 #endregion
217 216
218 #region Packet Request Handling 217 #region Packet Request Handling
@@ -944,9 +943,12 @@ namespace OpenSim.Region.CoreModules.World.Land
944 943
945 lock (primsOverMe) 944 lock (primsOverMe)
946 { 945 {
946// m_log.DebugFormat(
947// "[LAND OBJECT]: Request for SendLandObjectOwners() from {0} with {1} known prims on region",
948// remote_client.Name, primsOverMe.Count);
949
947 try 950 try
948 { 951 {
949
950 foreach (SceneObjectGroup obj in primsOverMe) 952 foreach (SceneObjectGroup obj in primsOverMe)
951 { 953 {
952 try 954 try
@@ -958,7 +960,7 @@ namespace OpenSim.Region.CoreModules.World.Land
958 } 960 }
959 catch (NullReferenceException) 961 catch (NullReferenceException)
960 { 962 {
961 m_log.Info("[LAND]: " + "Got Null Reference when searching land owners from the parcel panel"); 963 m_log.Error("[LAND]: " + "Got Null Reference when searching land owners from the parcel panel");
962 } 964 }
963 try 965 try
964 { 966 {
@@ -985,6 +987,7 @@ namespace OpenSim.Region.CoreModules.World.Land
985 public Dictionary<UUID, int> GetLandObjectOwners() 987 public Dictionary<UUID, int> GetLandObjectOwners()
986 { 988 {
987 Dictionary<UUID, int> ownersAndCount = new Dictionary<UUID, int>(); 989 Dictionary<UUID, int> ownersAndCount = new Dictionary<UUID, int>();
990
988 lock (primsOverMe) 991 lock (primsOverMe)
989 { 992 {
990 try 993 try
@@ -1021,8 +1024,10 @@ namespace OpenSim.Region.CoreModules.World.Land
1021 1024
1022 public void ReturnLandObjects(uint type, UUID[] owners, UUID[] tasks, IClientAPI remote_client) 1025 public void ReturnLandObjects(uint type, UUID[] owners, UUID[] tasks, IClientAPI remote_client)
1023 { 1026 {
1024 Dictionary<UUID,List<SceneObjectGroup>> returns = 1027// m_log.DebugFormat(
1025 new Dictionary<UUID,List<SceneObjectGroup>>(); 1028// "[LAND OBJECT]: Request to return objects in {0} from {1}", LandData.Name, remote_client.Name);
1029
1030 Dictionary<UUID,List<SceneObjectGroup>> returns = new Dictionary<UUID,List<SceneObjectGroup>>();
1026 1031
1027 lock (primsOverMe) 1032 lock (primsOverMe)
1028 { 1033 {
@@ -1095,83 +1100,29 @@ namespace OpenSim.Region.CoreModules.World.Land
1095 1100
1096 #region Object Adding/Removing from Parcel 1101 #region Object Adding/Removing from Parcel
1097 1102
1098 public void ResetLandPrimCounts() 1103 public void ResetOverMeRecord()
1099 { 1104 {
1100 LandData.GroupPrims = 0;
1101 LandData.OwnerPrims = 0;
1102 LandData.OtherPrims = 0;
1103 LandData.SelectedPrims = 0;
1104
1105
1106 lock (primsOverMe) 1105 lock (primsOverMe)
1107 primsOverMe.Clear(); 1106 primsOverMe.Clear();
1108 } 1107 }
1109 1108
1110 public void AddPrimToCount(SceneObjectGroup obj) 1109 public void AddPrimOverMe(SceneObjectGroup obj)
1111 { 1110 {
1112 1111// m_log.DebugFormat("[LAND OBJECT]: Adding scene object {0} {1} over {2}", obj.Name, obj.LocalId, LandData.Name);
1113 UUID prim_owner = obj.OwnerID; 1112
1114 int prim_count = obj.PrimCount;
1115
1116 if (obj.IsSelected)
1117 {
1118 LandData.SelectedPrims += prim_count;
1119 }
1120 else
1121 {
1122 if (prim_owner == LandData.OwnerID)
1123 {
1124 LandData.OwnerPrims += prim_count;
1125 }
1126 else if ((obj.GroupID == LandData.GroupID ||
1127 prim_owner == LandData.GroupID) &&
1128 LandData.GroupID != UUID.Zero)
1129 {
1130 LandData.GroupPrims += prim_count;
1131 }
1132 else
1133 {
1134 LandData.OtherPrims += prim_count;
1135 }
1136 }
1137
1138 lock (primsOverMe) 1113 lock (primsOverMe)
1139 primsOverMe.Add(obj); 1114 primsOverMe.Add(obj);
1140 } 1115 }
1141 1116
1142 public void RemovePrimFromCount(SceneObjectGroup obj) 1117 public void RemovePrimFromOverMe(SceneObjectGroup obj)
1143 { 1118 {
1119// m_log.DebugFormat("[LAND OBJECT]: Removing scene object {0} {1} from over {2}", obj.Name, obj.LocalId, LandData.Name);
1120
1144 lock (primsOverMe) 1121 lock (primsOverMe)
1145 { 1122 primsOverMe.Remove(obj);
1146 if (primsOverMe.Contains(obj))
1147 {
1148 UUID prim_owner = obj.OwnerID;
1149 int prim_count = obj.PrimCount;
1150
1151 if (prim_owner == LandData.OwnerID)
1152 {
1153 LandData.OwnerPrims -= prim_count;
1154 }
1155 else if (obj.GroupID == LandData.GroupID ||
1156 prim_owner == LandData.GroupID)
1157 {
1158 LandData.GroupPrims -= prim_count;
1159 }
1160 else
1161 {
1162 LandData.OtherPrims -= prim_count;
1163 }
1164
1165 primsOverMe.Remove(obj);
1166 }
1167 }
1168 } 1123 }
1169 1124
1170 #endregion 1125 #endregion
1171
1172 #endregion
1173
1174 #endregion
1175 1126
1176 /// <summary> 1127 /// <summary>
1177 /// Set the media url for this land parcel 1128 /// Set the media url for this land parcel
@@ -1192,5 +1143,7 @@ namespace OpenSim.Region.CoreModules.World.Land
1192 LandData.MusicURL = url; 1143 LandData.MusicURL = url;
1193 SendLandUpdateToAvatarsOverMe(); 1144 SendLandUpdateToAvatarsOverMe();
1194 } 1145 }
1146
1147 #endregion
1195 } 1148 }
1196} 1149}
diff --git a/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs b/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs
index 2a9036d..9e931a6 100644
--- a/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs
@@ -201,25 +201,29 @@ namespace OpenSim.Region.CoreModules.World.Land
201 else 201 else
202 parcelCounts.Users[obj.OwnerID] = partCount; 202 parcelCounts.Users[obj.OwnerID] = partCount;
203 203
204 if (landData.IsGroupOwned) 204 if (obj.IsSelected)
205 { 205 {
206 if (obj.OwnerID == landData.GroupID) 206 parcelCounts.Selected += partCount;
207 parcelCounts.Owner += partCount;
208 else if (landData.GroupID != UUID.Zero && obj.GroupID == landData.GroupID)
209 parcelCounts.Group += partCount;
210 else
211 parcelCounts.Others += partCount;
212 } 207 }
213 else 208 else
214 { 209 {
215 if (obj.OwnerID == landData.OwnerID) 210 if (landData.IsGroupOwned)
216 parcelCounts.Owner += partCount; 211 {
212 if (obj.OwnerID == landData.GroupID)
213 parcelCounts.Owner += partCount;
214 else if (landData.GroupID != UUID.Zero && obj.GroupID == landData.GroupID)
215 parcelCounts.Group += partCount;
216 else
217 parcelCounts.Others += partCount;
218 }
217 else 219 else
218 parcelCounts.Others += partCount; 220 {
221 if (obj.OwnerID == landData.OwnerID)
222 parcelCounts.Owner += partCount;
223 else
224 parcelCounts.Others += partCount;
225 }
219 } 226 }
220
221 if (obj.IsSelected)
222 parcelCounts.Selected += partCount;
223 } 227 }
224 } 228 }
225 229
@@ -375,6 +379,7 @@ namespace OpenSim.Region.CoreModules.World.Land
375 count = counts.Owner; 379 count = counts.Owner;
376 count += counts.Group; 380 count += counts.Group;
377 count += counts.Others; 381 count += counts.Others;
382 count += counts.Selected;
378 } 383 }
379 } 384 }
380 385
diff --git a/OpenSim/Region/CoreModules/World/Sun/SunModule.cs b/OpenSim/Region/CoreModules/World/Sun/SunModule.cs
index cea7c78..4e14c73 100644
--- a/OpenSim/Region/CoreModules/World/Sun/SunModule.cs
+++ b/OpenSim/Region/CoreModules/World/Sun/SunModule.cs
@@ -469,8 +469,8 @@ namespace OpenSim.Region.CoreModules
469 m_SunFixedHour = FixedSunHour; 469 m_SunFixedHour = FixedSunHour;
470 m_SunFixed = FixedSun; 470 m_SunFixed = FixedSun;
471 471
472 m_log.DebugFormat("[SUN]: Sun Settings Update: Fixed Sun? : {0}", m_SunFixed.ToString()); 472 // m_log.DebugFormat("[SUN]: Sun Settings Update: Fixed Sun? : {0}", m_SunFixed.ToString());
473 m_log.DebugFormat("[SUN]: Sun Settings Update: Sun Hour : {0}", m_SunFixedHour.ToString()); 473 // m_log.DebugFormat("[SUN]: Sun Settings Update: Sun Hour : {0}", m_SunFixedHour.ToString());
474 474
475 receivedEstateToolsSunUpdate = true; 475 receivedEstateToolsSunUpdate = true;
476 476
@@ -480,7 +480,7 @@ namespace OpenSim.Region.CoreModules
480 // When sun settings are updated, we should update all clients with new settings. 480 // When sun settings are updated, we should update all clients with new settings.
481 SunUpdateToAllClients(); 481 SunUpdateToAllClients();
482 482
483 m_log.DebugFormat("[SUN]: PosTime : {0}", PosTime.ToString()); 483 // m_log.DebugFormat("[SUN]: PosTime : {0}", PosTime.ToString());
484 } 484 }
485 } 485 }
486 486