aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs5
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs335
3 files changed, 301 insertions, 46 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index 7f06e82..692e0c9 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -1366,7 +1366,9 @@ namespace OpenSim.Region.Framework.Scenes
1366 { 1366 {
1367 try 1367 try
1368 { 1368 {
1369// m_log.ErrorFormat("[EVENT MANAGER]: OnRemovePresenceDelegate: {0}",d.Target.ToString());
1369 d(agentId); 1370 d(agentId);
1371// m_log.ErrorFormat("[EVENT MANAGER]: OnRemovePresenceDelegate done ");
1370 } 1372 }
1371 catch (Exception e) 1373 catch (Exception e)
1372 { 1374 {
@@ -2037,7 +2039,10 @@ namespace OpenSim.Region.Framework.Scenes
2037 { 2039 {
2038 try 2040 try
2039 { 2041 {
2042// m_log.ErrorFormat("[EVENT MANAGER]: TriggerClientClosed: {0}", d.Target.ToString());
2040 d(ClientID, scene); 2043 d(ClientID, scene);
2044// m_log.ErrorFormat("[EVENT MANAGER]: TriggerClientClosed done ");
2045
2041 } 2046 }
2042 catch (Exception e) 2047 catch (Exception e)
2043 { 2048 {
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 0765b3f..0266faf 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3640,13 +3640,17 @@ namespace OpenSim.Region.Framework.Scenes
3640 } 3640 }
3641 3641
3642 m_eventManager.TriggerClientClosed(agentID, this); 3642 m_eventManager.TriggerClientClosed(agentID, this);
3643// m_log.Debug("[Scene]TriggerClientClosed done");
3643 m_eventManager.TriggerOnRemovePresence(agentID); 3644 m_eventManager.TriggerOnRemovePresence(agentID);
3645// m_log.Debug("[Scene]TriggerOnRemovePresence done");
3644 3646
3645 if (!isChildAgent) 3647 if (!isChildAgent)
3646 { 3648 {
3647 if (AttachmentsModule != null) 3649 if (AttachmentsModule != null)
3648 { 3650 {
3651// m_log.Debug("[Scene]DeRezAttachments");
3649 AttachmentsModule.DeRezAttachments(avatar); 3652 AttachmentsModule.DeRezAttachments(avatar);
3653// m_log.Debug("[Scene]DeRezAttachments done");
3650 } 3654 }
3651 3655
3652 ForEachClient( 3656 ForEachClient(
@@ -3660,7 +3664,10 @@ namespace OpenSim.Region.Framework.Scenes
3660 3664
3661 // It's possible for child agents to have transactions if changes are being made cross-border. 3665 // It's possible for child agents to have transactions if changes are being made cross-border.
3662 if (AgentTransactionsModule != null) 3666 if (AgentTransactionsModule != null)
3667 {
3668// m_log.Debug("[Scene]RemoveAgentAssetTransactions");
3663 AgentTransactionsModule.RemoveAgentAssetTransactions(agentID); 3669 AgentTransactionsModule.RemoveAgentAssetTransactions(agentID);
3670 }
3664 m_log.Debug("[Scene] The avatar has left the building"); 3671 m_log.Debug("[Scene] The avatar has left the building");
3665 } 3672 }
3666 catch (Exception e) 3673 catch (Exception e)
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index a9a6ba4..24a92eb 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -164,12 +164,12 @@ namespace OpenSim.Region.Framework.Scenes
164 lock (parcelLock) 164 lock (parcelLock)
165 { 165 {
166 bool oldhide = m_currentParcelHide; 166 bool oldhide = m_currentParcelHide;
167 bool check = true; 167 bool checksame = true;
168 if (value != m_currentParcelUUID) 168 if (value != m_currentParcelUUID)
169 { 169 {
170 m_previusParcelHide = m_currentParcelHide; 170 m_previusParcelHide = m_currentParcelHide;
171 m_previusParcelUUID = m_currentParcelUUID; 171 m_previusParcelUUID = m_currentParcelUUID;
172 check = false; 172 checksame = false;
173 } 173 }
174 m_currentParcelUUID = value; 174 m_currentParcelUUID = value;
175 m_currentParcelHide = false; 175 m_currentParcelHide = false;
@@ -177,8 +177,9 @@ namespace OpenSim.Region.Framework.Scenes
177 ILandObject land = m_scene.LandChannel.GetLandObject(AbsolutePosition.X, AbsolutePosition.Y); 177 ILandObject land = m_scene.LandChannel.GetLandObject(AbsolutePosition.X, AbsolutePosition.Y);
178 if (land != null && !land.LandData.SeeAVs) 178 if (land != null && !land.LandData.SeeAVs)
179 m_currentParcelHide = true; 179 m_currentParcelHide = true;
180 if (m_previusParcelUUID != UUID.Zero) 180
181 ParcelCrossCheck(m_currentParcelUUID,m_previusParcelUUID,m_currentParcelHide, m_previusParcelHide, oldhide,check); 181 if (m_previusParcelUUID != UUID.Zero || checksame)
182 ParcelCrossCheck(m_currentParcelUUID,m_previusParcelUUID,m_currentParcelHide, m_previusParcelHide, oldhide,checksame);
182 } 183 }
183 } 184 }
184 } 185 }
@@ -1835,42 +1836,32 @@ namespace OpenSim.Region.Framework.Scenes
1835 m_currentParcelUUID = UUID.Zero; 1836 m_currentParcelUUID = UUID.Zero;
1836 1837
1837 // send initial land overlay and parcel 1838 // send initial land overlay and parcel
1838 if (!IsChildAgent) 1839 ILandChannel landch = m_scene.LandChannel;
1840 if (landch != null)
1839 { 1841 {
1840 ILandChannel landch = m_scene.LandChannel; 1842 landch.sendClientInitialLandInfo(client);
1841 if (landch != null) 1843 if (!IsChildAgent)
1842 { 1844 {
1843 landch.sendClientInitialLandInfo(client);
1844 newhide = m_currentParcelHide; 1845 newhide = m_currentParcelHide;
1845 m_currentParcelHide = false; 1846 m_currentParcelHide = false;
1846 } 1847 }
1847 } 1848 }
1848 1849
1849
1850 // send agentData to all clients including us (?) 1850 // send agentData to all clients including us (?)
1851 // get appearance 1851 // get appearance
1852 // if in cache sent it to all clients 1852 // if in cache sent it to all clients
1853 // send what we have to us, even if not in cache ( bad? ) 1853 // send what we have to us, even if not in cache ( bad? )
1854 ValidateAndSendAppearanceAndAgentData(); 1854 ValidateAndSendAppearanceAndAgentData();
1855 1855
1856 // Create child agents in neighbouring regions
1857 if (openChildAgents && !IsChildAgent)
1858 {
1859 IEntityTransferModule m_agentTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>();
1860 if (m_agentTransfer != null)
1861 m_agentTransfer.EnableChildAgents(this);
1862 }
1863
1864
1865 // attachments 1856 // attachments
1866 if (isNPC || (TeleportFlags & TeleportFlags.ViaLogin) != 0) 1857 if (isNPC || (TeleportFlags & TeleportFlags.ViaLogin) != 0)
1867 { 1858 {
1868 if (Scene.AttachmentsModule != null) 1859 if (Scene.AttachmentsModule != null)
1869 Util.FireAndForget( 1860// Util.FireAndForget(
1870 o => 1861// o =>
1871 { 1862// {
1872 Scene.AttachmentsModule.RezAttachments(this); 1863 Scene.AttachmentsModule.RezAttachments(this);
1873 }); 1864// });
1874 } 1865 }
1875 else 1866 else
1876 { 1867 {
@@ -1894,6 +1885,14 @@ namespace OpenSim.Region.Framework.Scenes
1894 // "[SCENE PRESENCE]: Completing movement of {0} into region {1} took {2}ms", 1885 // "[SCENE PRESENCE]: Completing movement of {0} into region {1} took {2}ms",
1895 // client.Name, Scene.RegionInfo.RegionName, (DateTime.Now - startTime).Milliseconds); 1886 // client.Name, Scene.RegionInfo.RegionName, (DateTime.Now - startTime).Milliseconds);
1896 1887
1888 // Create child agents in neighbouring regions
1889 if (openChildAgents && !IsChildAgent)
1890 {
1891 IEntityTransferModule m_agentTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>();
1892 if (m_agentTransfer != null)
1893 m_agentTransfer.EnableChildAgents(this);
1894 }
1895
1897 // send the rest of the world 1896 // send the rest of the world
1898 if (m_teleportFlags > 0 && !isNPC) 1897 if (m_teleportFlags > 0 && !isNPC)
1899 SendInitialDataToMe(); 1898 SendInitialDataToMe();
@@ -1923,8 +1922,10 @@ namespace OpenSim.Region.Framework.Scenes
1923 } 1922 }
1924 // if hide force a check 1923 // if hide force a check
1925 if (!IsChildAgent && newhide) 1924 if (!IsChildAgent && newhide)
1926 ParcelCrossCheck(m_currentParcelUUID, m_previusParcelUUID, 1925 {
1927 true, m_previusParcelHide, false, true); 1926 ParcelLoginCheck(m_currentParcelUUID);
1927 m_currentParcelHide = newhide;
1928 }
1928 } 1929 }
1929 1930
1930 /// <summary> 1931 /// <summary>
@@ -3377,7 +3378,7 @@ namespace OpenSim.Region.Framework.Scenes
3377 if (!remoteClient.IsActive) 3378 if (!remoteClient.IsActive)
3378 return; 3379 return;
3379 3380
3380 if (ParcelHideThisAvatar && p.currentParcelUUID != currentParcelUUID) 3381 if (ParcelHideThisAvatar && p.currentParcelUUID != currentParcelUUID && p.GodLevel < 200)
3381 return; 3382 return;
3382 3383
3383 3384
@@ -3464,6 +3465,14 @@ namespace OpenSim.Region.Framework.Scenes
3464 // we created a new ScenePresence (a new child agent) in a fresh region. 3465 // we created a new ScenePresence (a new child agent) in a fresh region.
3465 // Request info about all the (root) agents in this region 3466 // Request info about all the (root) agents in this region
3466 // Note: This won't send data *to* other clients in that region (children don't send) 3467 // Note: This won't send data *to* other clients in that region (children don't send)
3468 if (m_teleportFlags <= 0)
3469 {
3470 ILandChannel landch = m_scene.LandChannel;
3471 if (landch != null)
3472 {
3473 landch.sendClientInitialLandInfo(ControllingClient);
3474 }
3475 }
3467 SendOtherAgentsAvatarDataToMe(); 3476 SendOtherAgentsAvatarDataToMe();
3468 SendOtherAgentsAppearanceToMe(); 3477 SendOtherAgentsAppearanceToMe();
3469 3478
@@ -3586,7 +3595,7 @@ namespace OpenSim.Region.Framework.Scenes
3586 public void SendAvatarDataToAgent(ScenePresence avatar) 3595 public void SendAvatarDataToAgent(ScenePresence avatar)
3587 { 3596 {
3588 //m_log.DebugFormat("[SCENE PRESENCE] SendAvatarDataToAgent from {0} ({1}) to {2} ({3})", Name, UUID, avatar.Name, avatar.UUID); 3597 //m_log.DebugFormat("[SCENE PRESENCE] SendAvatarDataToAgent from {0} ({1}) to {2} ({3})", Name, UUID, avatar.Name, avatar.UUID);
3589 if (ParcelHideThisAvatar && currentParcelUUID != avatar.currentParcelUUID) 3598 if (ParcelHideThisAvatar && currentParcelUUID != avatar.currentParcelUUID && avatar.GodLevel < 200)
3590 return; 3599 return;
3591 avatar.ControllingClient.SendAvatarDataImmediate(this); 3600 avatar.ControllingClient.SendAvatarDataImmediate(this);
3592 Animator.SendAnimPackToClient(avatar.ControllingClient); 3601 Animator.SendAnimPackToClient(avatar.ControllingClient);
@@ -3653,7 +3662,7 @@ namespace OpenSim.Region.Framework.Scenes
3653 { 3662 {
3654// m_log.DebugFormat( 3663// m_log.DebugFormat(
3655// "[SCENE PRESENCE]: Sending appearance data from {0} {1} to {2} {3}", Name, m_uuid, avatar.Name, avatar.UUID); 3664// "[SCENE PRESENCE]: Sending appearance data from {0} {1} to {2} {3}", Name, m_uuid, avatar.Name, avatar.UUID);
3656 if (ParcelHideThisAvatar && currentParcelUUID != avatar.currentParcelUUID) 3665 if (ParcelHideThisAvatar && currentParcelUUID != avatar.currentParcelUUID && avatar.GodLevel < 200)
3657 return; 3666 return;
3658 avatar.ControllingClient.SendAppearance( 3667 avatar.ControllingClient.SendAppearance(
3659 UUID, Appearance.VisualParams, Appearance.Texture.GetBytes()); 3668 UUID, Appearance.VisualParams, Appearance.Texture.GetBytes());
@@ -3866,14 +3875,21 @@ namespace OpenSim.Region.Framework.Scenes
3866 /// </summary> 3875 /// </summary>
3867 protected bool CrossToNewRegion() 3876 protected bool CrossToNewRegion()
3868 { 3877 {
3878 bool result = false;
3879 parcelRegionCross(false);
3869 try 3880 try
3870 { 3881 {
3871 return m_scene.CrossAgentToNewRegion(this, Flying); 3882 result = m_scene.CrossAgentToNewRegion(this, Flying);
3872 } 3883 }
3873 catch 3884 catch
3874 { 3885 {
3875 return m_scene.CrossAgentToNewRegion(this, false); 3886 result = m_scene.CrossAgentToNewRegion(this, false);
3876 } 3887 }
3888 if(!result)
3889 parcelRegionCross(true);
3890
3891 return result;
3892
3877 } 3893 }
3878 3894
3879 public void Reset() 3895 public void Reset()
@@ -3947,6 +3963,8 @@ namespace OpenSim.Region.Framework.Scenes
3947 /// </summary> 3963 /// </summary>
3948 public void GrantGodlikePowers(UUID agentID, UUID sessionID, UUID token, bool godStatus) 3964 public void GrantGodlikePowers(UUID agentID, UUID sessionID, UUID token, bool godStatus)
3949 { 3965 {
3966 int oldgodlevel = GodLevel;
3967
3950 if (godStatus) 3968 if (godStatus)
3951 { 3969 {
3952 // For now, assign god level 200 to anyone 3970 // For now, assign god level 200 to anyone
@@ -3967,6 +3985,9 @@ namespace OpenSim.Region.Framework.Scenes
3967 } 3985 }
3968 3986
3969 ControllingClient.SendAdminResponse(token, (uint)GodLevel); 3987 ControllingClient.SendAdminResponse(token, (uint)GodLevel);
3988
3989 if(oldgodlevel != GodLevel)
3990 parcelGodCheck(m_currentParcelUUID, GodLevel >= 200);
3970 } 3991 }
3971 3992
3972 #region Child Agent Updates 3993 #region Child Agent Updates
@@ -5377,7 +5398,221 @@ namespace OpenSim.Region.Framework.Scenes
5377 5398
5378 } 5399 }
5379 5400
5380 private void ParcelCrossCheck(UUID currentParcelUUID,UUID previusParcelUUID, 5401 private void parcelGodCheck(UUID currentParcelID, bool isGod)
5402 {
5403 List<ScenePresence> allpresences = null;
5404
5405
5406 allpresences = m_scene.GetScenePresences();
5407
5408 if (isGod)
5409 {
5410 List<ScenePresence> viewsToSendme = new List<ScenePresence>();
5411
5412 foreach (ScenePresence p in allpresences)
5413 {
5414 if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive)
5415 continue;
5416
5417 if (p.ParcelHideThisAvatar && p.currentParcelUUID != currentParcelID)
5418 {
5419 viewsToSendme.Add(p); // i see them
5420 }
5421 }
5422
5423 if (viewsToSendme.Count > 0)
5424 {
5425 foreach (ScenePresence p in viewsToSendme)
5426 {
5427 if (p.IsChildAgent)
5428 continue;
5429 m_log.Debug("[AVATAR]: viewMe: " + Lastname + " " + p.Lastname);
5430 ControllingClient.SendAvatarDataImmediate(p);
5431 p.SendAppearanceToAgent(this);
5432 p.SendAttachmentsToClient(ControllingClient);
5433 if (p.Animator != null)
5434 p.Animator.SendAnimPackToClient(ControllingClient);
5435 }
5436 }
5437 }
5438 else
5439 {
5440 List<ScenePresence> killsToSendme = new List<ScenePresence>();
5441
5442 foreach (ScenePresence p in allpresences)
5443 {
5444 if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive)
5445 continue;
5446
5447 if (p.ParcelHideThisAvatar && p.currentParcelUUID != currentParcelID)
5448 {
5449 killsToSendme.Add(p);
5450 }
5451 }
5452
5453 if (killsToSendme.Count > 0)
5454 {
5455 foreach (ScenePresence p in killsToSendme)
5456 {
5457 m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + p.Lastname);
5458 try { ControllingClient.SendKillObject(new List<uint> { p.LocalId }); }
5459 catch (NullReferenceException) { }
5460 }
5461 }
5462 }
5463
5464 }
5465
5466 private void ParcelLoginCheck(UUID currentParcelID)
5467 {
5468 List<ScenePresence> killsToSendto = new List<ScenePresence>();
5469 List<ScenePresence> killsToSendme = new List<ScenePresence>();
5470 List<ScenePresence> viewsToSendto = new List<ScenePresence>();
5471 List<ScenePresence> viewsToSendme = new List<ScenePresence>();
5472 List<ScenePresence> allpresences = null;
5473
5474 allpresences = m_scene.GetScenePresences();
5475
5476 foreach (ScenePresence p in allpresences)
5477 {
5478 if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive)
5479 continue;
5480
5481 if (currentParcelID != p.currentParcelUUID)
5482 {
5483 if (p.GodLevel < 200)
5484 killsToSendto.Add(p);
5485 if (GodLevel < 200 && p.ParcelHideThisAvatar)
5486 killsToSendme.Add(p);
5487 }
5488 else
5489 {
5490 viewsToSendto.Add(p);
5491 viewsToSendme.Add(p);
5492 }
5493 }
5494 allpresences.Clear();
5495
5496 // send the things
5497 // kill main avatar object
5498 if (killsToSendto.Count > 0 && PresenceType != PresenceType.Npc)
5499 {
5500 foreach (ScenePresence p in killsToSendto)
5501 {
5502 m_log.Debug("[AVATAR]: killTo: " + Lastname + " " + p.Lastname);
5503 try { p.ControllingClient.SendKillObject(new List<uint> { LocalId }); }
5504 catch (NullReferenceException) { }
5505 }
5506 }
5507
5508 if (killsToSendme.Count > 0)
5509 {
5510 foreach (ScenePresence p in killsToSendme)
5511 {
5512 m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + p.Lastname);
5513 try { ControllingClient.SendKillObject(new List<uint> { p.LocalId }); }
5514 catch (NullReferenceException) { }
5515 }
5516 }
5517
5518 if (viewsToSendto.Count > 0 && PresenceType != PresenceType.Npc)
5519 {
5520 foreach (ScenePresence p in viewsToSendto)
5521 {
5522 m_log.Debug("[AVATAR]: viewTo: " + Lastname + " " + p.Lastname);
5523 p.ControllingClient.SendAvatarDataImmediate(this);
5524 SendAppearanceToAgent(p);
5525 SendAttachmentsToClient(p.ControllingClient);
5526 if (Animator != null)
5527 Animator.SendAnimPackToClient(p.ControllingClient);
5528 }
5529 }
5530
5531 if (viewsToSendme.Count > 0)
5532 {
5533 foreach (ScenePresence p in viewsToSendme)
5534 {
5535 m_log.Debug("[AVATAR]: viewMe: " + Lastname + "<-" + p.Lastname);
5536 if (p.IsChildAgent)
5537 continue;
5538 ControllingClient.SendAvatarDataImmediate(p);
5539 p.SendAppearanceToAgent(this);
5540 p.SendAttachmentsToClient(ControllingClient);
5541 if (p.Animator != null)
5542 p.Animator.SendAnimPackToClient(ControllingClient);
5543 }
5544 }
5545 }
5546
5547 private void parcelRegionCross(bool abort)
5548 {
5549 if (!ParcelHideThisAvatar)
5550 return;
5551
5552 List<ScenePresence> allpresences = null;
5553 allpresences = m_scene.GetScenePresences();
5554
5555 if (abort)
5556 {
5557 List<ScenePresence> viewsToSendme = new List<ScenePresence>();
5558
5559 foreach (ScenePresence p in allpresences)
5560 {
5561 if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive)
5562 continue;
5563
5564 if (p.currentParcelUUID == m_currentParcelUUID)
5565 {
5566 viewsToSendme.Add(p);
5567 }
5568 }
5569
5570 if (viewsToSendme.Count > 0)
5571 {
5572 foreach (ScenePresence p in viewsToSendme)
5573 {
5574 if (p.IsChildAgent)
5575 continue;
5576// m_log.Debug("[AVATAR]: viewMe: " + Lastname + " " + p.Lastname);
5577 ControllingClient.SendAvatarDataImmediate(p);
5578 p.SendAppearanceToAgent(this);
5579 p.SendAttachmentsToClient(ControllingClient);
5580 if (p.Animator != null)
5581 p.Animator.SendAnimPackToClient(ControllingClient);
5582 }
5583 }
5584 }
5585 else
5586 {
5587 if (GodLevel >= 200)
5588 return;
5589
5590 List<ScenePresence> killsToSendme = new List<ScenePresence>();
5591 foreach (ScenePresence p in allpresences)
5592 {
5593 if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive)
5594 continue;
5595
5596 if (p.currentParcelUUID == m_currentParcelUUID)
5597 {
5598 killsToSendme.Add(p);
5599 }
5600 }
5601
5602 if (killsToSendme.Count > 0)
5603 {
5604 foreach (ScenePresence p in killsToSendme)
5605 {
5606 m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + p.Lastname);
5607 try { ControllingClient.SendKillObject(new List<uint> { p.LocalId }); }
5608 catch (NullReferenceException) { }
5609 }
5610 }
5611 }
5612 }
5613
5614
5615 private void ParcelCrossCheck(UUID currentParcelID,UUID previusParcelID,
5381 bool currentParcelHide, bool previusParcelHide, bool oldhide,bool check) 5616 bool currentParcelHide, bool previusParcelHide, bool oldhide,bool check)
5382 { 5617 {
5383 List<ScenePresence> killsToSendto = new List<ScenePresence>(); 5618 List<ScenePresence> killsToSendto = new List<ScenePresence>();
@@ -5391,6 +5626,7 @@ namespace OpenSim.Region.Framework.Scenes
5391 5626
5392 if (check) 5627 if (check)
5393 { 5628 {
5629 // check is relative to current parcel only
5394 if (currentParcelUUID == null || oldhide == currentParcelHide) 5630 if (currentParcelUUID == null || oldhide == currentParcelHide)
5395 return; 5631 return;
5396 5632
@@ -5404,8 +5640,8 @@ namespace OpenSim.Region.Framework.Scenes
5404 continue; 5640 continue;
5405 5641
5406 // those on not on parcel see me 5642 // those on not on parcel see me
5407 if (currentParcelUUID != p.currentParcelUUID) 5643 if (currentParcelID != p.currentParcelUUID)
5408 { 5644 {
5409 viewsToSendto.Add(p); // they see me 5645 viewsToSendto.Add(p); // they see me
5410 } 5646 }
5411 } 5647 }
@@ -5419,14 +5655,13 @@ namespace OpenSim.Region.Framework.Scenes
5419 continue; 5655 continue;
5420 5656
5421 // those not on parcel dont see me 5657 // those not on parcel dont see me
5422 if (currentParcelUUID != p.currentParcelUUID) 5658 if (currentParcelID != p.currentParcelUUID && p.GodLevel < 200)
5423 { 5659 {
5424 killsToSendto.Add(p); // they dont see me 5660 killsToSendto.Add(p); // they dont see me
5425 } 5661 }
5426 } 5662 }
5427 } // where public end 5663 } // where public end
5428 5664
5429
5430 allpresences.Clear(); 5665 allpresences.Clear();
5431 } 5666 }
5432 else 5667 else
@@ -5436,7 +5671,7 @@ namespace OpenSim.Region.Framework.Scenes
5436 // now on a private parcel 5671 // now on a private parcel
5437 allpresences = m_scene.GetScenePresences(); 5672 allpresences = m_scene.GetScenePresences();
5438 5673
5439 if (previusParcelHide && previusParcelUUID != UUID.Zero) 5674 if (previusParcelHide && previusParcelID != UUID.Zero)
5440 { 5675 {
5441 foreach (ScenePresence p in allpresences) 5676 foreach (ScenePresence p in allpresences)
5442 { 5677 {
@@ -5444,13 +5679,15 @@ namespace OpenSim.Region.Framework.Scenes
5444 continue; 5679 continue;
5445 5680
5446 // only those on previus parcel need receive kills 5681 // only those on previus parcel need receive kills
5447 if (previusParcelUUID == p.currentParcelUUID) 5682 if (previusParcelID == p.currentParcelUUID)
5448 { 5683 {
5449 killsToSendto.Add(p); // they dont see me 5684 if(p.GodLevel < 200)
5450 killsToSendme.Add(p); // i dont see them 5685 killsToSendto.Add(p); // they dont see me
5686 if(GodLevel < 200)
5687 killsToSendme.Add(p); // i dont see them
5451 } 5688 }
5452 // only those on new parcel need see 5689 // only those on new parcel need see
5453 if (currentParcelUUID == p.currentParcelUUID) 5690 if (currentParcelID == p.currentParcelUUID)
5454 { 5691 {
5455 viewsToSendto.Add(p); // they see me 5692 viewsToSendto.Add(p); // they see me
5456 viewsToSendme.Add(p); // i see them 5693 viewsToSendme.Add(p); // i see them
@@ -5468,7 +5705,7 @@ namespace OpenSim.Region.Framework.Scenes
5468 continue; 5705 continue;
5469 5706
5470 // those not on new parcel dont see me 5707 // those not on new parcel dont see me
5471 if (currentParcelUUID != p.currentParcelUUID) 5708 if (currentParcelID != p.currentParcelUUID && p.GodLevel < 200)
5472 { 5709 {
5473 killsToSendto.Add(p); // they dont see me 5710 killsToSendto.Add(p); // they dont see me
5474 } 5711 }
@@ -5484,7 +5721,7 @@ namespace OpenSim.Region.Framework.Scenes
5484 else 5721 else
5485 { 5722 {
5486 // now on public parcel 5723 // now on public parcel
5487 if (previusParcelHide && previusParcelUUID != UUID.Zero) 5724 if (previusParcelHide && previusParcelID != UUID.Zero)
5488 { 5725 {
5489 // was on private area 5726 // was on private area
5490 allpresences = m_scene.GetScenePresences(); 5727 allpresences = m_scene.GetScenePresences();
@@ -5494,7 +5731,7 @@ namespace OpenSim.Region.Framework.Scenes
5494 if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive) 5731 if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive)
5495 continue; 5732 continue;
5496 // only those old parcel need receive kills 5733 // only those old parcel need receive kills
5497 if (previusParcelUUID == p.currentParcelUUID) 5734 if (previusParcelID == p.currentParcelUUID && GodLevel < 200)
5498 { 5735 {
5499 killsToSendme.Add(p); // i dont see them 5736 killsToSendme.Add(p); // i dont see them
5500 } 5737 }
@@ -5511,29 +5748,32 @@ namespace OpenSim.Region.Framework.Scenes
5511 5748
5512 // send the things 5749 // send the things
5513 // kill main avatar object 5750 // kill main avatar object
5514 if (killsToSendto.Count > 0) 5751 if (killsToSendto.Count > 0 && PresenceType != PresenceType.Npc)
5515 { 5752 {
5516 foreach (ScenePresence p in killsToSendto) 5753 foreach (ScenePresence p in killsToSendto)
5517 { 5754 {
5755 m_log.Debug("[AVATAR]: killTo: " + Lastname + " " + p.Lastname);
5518 try { p.ControllingClient.SendKillObject(new List<uint> { LocalId }); } 5756 try { p.ControllingClient.SendKillObject(new List<uint> { LocalId }); }
5519 catch (NullReferenceException) { } 5757 catch (NullReferenceException) { }
5520 } 5758 }
5521 } 5759 }
5522 5760
5523 if (killsToSendme.Count > 0 && PresenceType != PresenceType.Npc) 5761 if (killsToSendme.Count > 0 )
5524 { 5762 {
5525 foreach (ScenePresence p in killsToSendme) 5763 foreach (ScenePresence p in killsToSendme)
5526 { 5764 {
5765 m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + p.Lastname);
5527 try {ControllingClient.SendKillObject(new List<uint> { p.LocalId }); } 5766 try {ControllingClient.SendKillObject(new List<uint> { p.LocalId }); }
5528 catch (NullReferenceException) { } 5767 catch (NullReferenceException) { }
5529 } 5768 }
5530 } 5769 }
5531 5770
5532 if (viewsToSendto.Count > 0) 5771 if (viewsToSendto.Count > 0 && PresenceType != PresenceType.Npc)
5533 { 5772 {
5534 foreach (ScenePresence p in viewsToSendto) 5773 foreach (ScenePresence p in viewsToSendto)
5535 { 5774 {
5536 p.ControllingClient.SendAvatarDataImmediate(this); 5775 p.ControllingClient.SendAvatarDataImmediate(this);
5776// m_log.Debug("[AVATAR]: viewTo: " + Lastname + " " + p.Lastname);
5537 SendAppearanceToAgent(p); 5777 SendAppearanceToAgent(p);
5538 SendAttachmentsToClient(p.ControllingClient); 5778 SendAttachmentsToClient(p.ControllingClient);
5539 if (Animator != null) 5779 if (Animator != null)
@@ -5541,10 +5781,13 @@ namespace OpenSim.Region.Framework.Scenes
5541 } 5781 }
5542 } 5782 }
5543 5783
5544 if (viewsToSendme.Count > 0 && PresenceType != PresenceType.Npc) 5784 if (viewsToSendme.Count > 0 )
5545 { 5785 {
5546 foreach (ScenePresence p in viewsToSendme) 5786 foreach (ScenePresence p in viewsToSendme)
5547 { 5787 {
5788 if (p.IsChildAgent)
5789 continue;
5790// m_log.Debug("[AVATAR]: viewMe: " + Lastname + "<-" + p.Lastname);
5548 ControllingClient.SendAvatarDataImmediate(p); 5791 ControllingClient.SendAvatarDataImmediate(p);
5549 p.SendAppearanceToAgent(this); 5792 p.SendAppearanceToAgent(this);
5550 p.SendAttachmentsToClient(ControllingClient); 5793 p.SendAttachmentsToClient(ControllingClient);