send parcels onwership change updates to all avatars that may want it

master
UbitUmarov 2020-04-08 00:01:05 +01:00
parent 29f59fe407
commit b4eb5d6cca
2 changed files with 64 additions and 16 deletions

View File

@ -1529,18 +1529,17 @@ namespace OpenSim.Region.CoreModules.World.Land
if (avatar.IsChildAgent) if (avatar.IsChildAgent)
{ {
if(client == remote_client) land.SendLandProperties(-10000, false, LandChannel.LAND_RESULT_SINGLE, client);
land.SendLandProperties(-10000, false, LandChannel.LAND_RESULT_SINGLE, client);
return; return;
} }
ILandObject aland = GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); ILandObject aland = GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y);
if (aland != null) if (aland != null)
{ {
if(client == remote_client && land != aland) if(land != aland)
land.SendLandProperties(-10000, false, LandChannel.LAND_RESULT_SINGLE, client); land.SendLandProperties(-10000, false, LandChannel.LAND_RESULT_SINGLE, client);
else if (land == aland) else if (land == aland)
aland.SendLandProperties(0, false, LandChannel.LAND_RESULT_SINGLE, client); aland.SendLandProperties(0, true, LandChannel.LAND_RESULT_SINGLE, client);
} }
if (avatar.currentParcelUUID == parcelID) if (avatar.currentParcelUUID == parcelID)
avatar.currentParcelUUID = parcelID; // force parcel flags review avatar.currentParcelUUID = parcelID; // force parcel flags review
@ -1614,9 +1613,9 @@ namespace OpenSim.Region.CoreModules.World.Land
land.LandData.GroupID = UUID.Zero; land.LandData.GroupID = UUID.Zero;
land.LandData.IsGroupOwned = false; land.LandData.IsGroupOwned = false;
land.LandData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects | ParcelFlags.ShowDirectory); land.LandData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects | ParcelFlags.ShowDirectory);
UpdateLandObject(land.LandData.LocalID, land.LandData);
m_scene.ForEachClient(SendParcelOverlay); m_scene.ForEachClient(SendParcelOverlay);
land.SendLandUpdateToClient(true, remote_client); land.SendLandUpdateToClient(true, remote_client);
UpdateLandObject(land.LandData.LocalID, land.LandData);
} }
} }
} }
@ -1638,9 +1637,9 @@ namespace OpenSim.Region.CoreModules.World.Land
land.LandData.IsGroupOwned = false; land.LandData.IsGroupOwned = false;
land.LandData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects | ParcelFlags.ShowDirectory); land.LandData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects | ParcelFlags.ShowDirectory);
m_scene.ForEachClient(SendParcelOverlay);
land.SendLandUpdateToClient(true, remote_client);
UpdateLandObject(land.LandData.LocalID, land.LandData); UpdateLandObject(land.LandData.LocalID, land.LandData);
m_scene.ForEachClient(SendParcelOverlay);
land.SendLandUpdateToAvatars();
} }
} }
} }
@ -1667,9 +1666,9 @@ namespace OpenSim.Region.CoreModules.World.Land
land.LandData.AnyAVSounds = true; land.LandData.AnyAVSounds = true;
land.LandData.GroupAVSounds = true; land.LandData.GroupAVSounds = true;
land.LandData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects | ParcelFlags.ShowDirectory); land.LandData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects | ParcelFlags.ShowDirectory);
m_scene.ForEachClient(SendParcelOverlay);
land.SendLandUpdateToClient(true, remote_client);
UpdateLandObject(land.LandData.LocalID, land.LandData); UpdateLandObject(land.LandData.LocalID, land.LandData);
m_scene.ForEachClient(SendParcelOverlay);
land.SendLandUpdateToAvatars();
} }
} }
} }
@ -1692,6 +1691,8 @@ namespace OpenSim.Region.CoreModules.World.Land
if (land != null) if (land != null)
{ {
land.UpdateLandSold(e.agentId, e.groupId, e.groupOwned, (uint)e.transactionID, e.parcelPrice, e.parcelArea); land.UpdateLandSold(e.agentId, e.groupId, e.groupOwned, (uint)e.transactionID, e.parcelPrice, e.parcelArea);
m_scene.ForEachClient(SendParcelOverlay);
land.SendLandUpdateToAvatars();
} }
} }
} }
@ -1744,6 +1745,8 @@ namespace OpenSim.Region.CoreModules.World.Land
if (!m_scene.Permissions.CanDeedParcel(remote_client.AgentId, land)) if (!m_scene.Permissions.CanDeedParcel(remote_client.AgentId, land))
return; return;
land.DeedToGroup(groupID); land.DeedToGroup(groupID);
m_scene.ForEachClient(SendParcelOverlay);
land.SendLandUpdateToAvatars();
} }
} }
@ -2297,10 +2300,11 @@ namespace OpenSim.Region.CoreModules.World.Land
land.LandData.GroupID = UUID.Zero; land.LandData.GroupID = UUID.Zero;
land.LandData.Name = DefaultGodParcelName; land.LandData.Name = DefaultGodParcelName;
UpdateLandObject(land.LandData.LocalID, land.LandData);
//m_scene.EventManager.TriggerParcelPrimCountUpdate();
m_scene.ForEachClient(SendParcelOverlay); m_scene.ForEachClient(SendParcelOverlay);
land.SendLandUpdateToClient(true, client); land.SendLandUpdateToClient(true, client);
UpdateLandObject(land.LandData.LocalID, land.LandData);
m_scene.EventManager.TriggerParcelPrimCountUpdate();
} }
private void ClientOnSimWideDeletes(IClientAPI client, UUID agentID, int flags, UUID targetID) private void ClientOnSimWideDeletes(IClientAPI client, UUID agentID, int flags, UUID targetID)

View File

@ -614,10 +614,9 @@ namespace OpenSim.Region.CoreModules.World.Land
UUID previousOwner = LandData.OwnerID; UUID previousOwner = LandData.OwnerID;
m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData);
// m_scene.EventManager.TriggerParcelPrimCountUpdate(); if (sellObjects)
SendLandUpdateToAvatarsOverMe(true); SellLandObjects(previousOwner);
m_scene.EventManager.TriggerParcelPrimCountUpdate();
if (sellObjects) SellLandObjects(previousOwner);
} }
public void DeedToGroup(UUID groupID) public void DeedToGroup(UUID groupID)
@ -632,7 +631,6 @@ namespace OpenSim.Region.CoreModules.World.Land
m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData);
m_scene.EventManager.TriggerParcelPrimCountUpdate(); m_scene.EventManager.TriggerParcelPrimCountUpdate();
SendLandUpdateToAvatarsOverMe(true);
} }
public bool IsEitherBannedOrRestricted(UUID avatar) public bool IsEitherBannedOrRestricted(UUID avatar)
@ -842,6 +840,9 @@ namespace OpenSim.Region.CoreModules.World.Land
m_scene.EventManager.TriggerParcelPrimCountUpdate(); m_scene.EventManager.TriggerParcelPrimCountUpdate();
m_scene.ForEachRootScenePresence(delegate(ScenePresence avatar) m_scene.ForEachRootScenePresence(delegate(ScenePresence avatar)
{ {
if (avatar.IsNPC)
return;
ILandObject over = null; ILandObject over = null;
try try
{ {
@ -871,6 +872,49 @@ namespace OpenSim.Region.CoreModules.World.Land
}); });
} }
public void SendLandUpdateToAvatars()
{
m_scene.ForEachScenePresence(delegate (ScenePresence avatar)
{
if (avatar.IsNPC)
return;
if(avatar.IsChildAgent)
{
SendLandProperties(-10000, false, LandChannel.LAND_RESULT_SINGLE, avatar.ControllingClient);
return;
}
ILandObject over = null;
try
{
over =
m_scene.LandChannel.GetLandObject(Util.Clamp<int>((int)Math.Round(avatar.AbsolutePosition.X), 0, ((int)m_scene.RegionInfo.RegionSizeX - 1)),
Util.Clamp<int>((int)Math.Round(avatar.AbsolutePosition.Y), 0, ((int)m_scene.RegionInfo.RegionSizeY - 1)));
}
catch (Exception)
{
m_log.Warn("[LAND]: " + "unable to get land at x: " + Math.Round(avatar.AbsolutePosition.X) + " y: " +
Math.Round(avatar.AbsolutePosition.Y));
}
if (over != null)
{
if (over.LandData.LocalID == LandData.LocalID)
{
if (m_scene.RegionInfo.RegionSettings.AllowDamage)
avatar.Invulnerable = false;
else
avatar.Invulnerable = (over.LandData.Flags & (uint)ParcelFlags.AllowDamage) == 0;
avatar.currentParcelUUID = LandData.GlobalID;
SendLandProperties(0, true, LandChannel.LAND_RESULT_SINGLE, avatar.ControllingClient);
return;
}
}
SendLandProperties(-10000, false, LandChannel.LAND_RESULT_SINGLE, avatar.ControllingClient);
});
}
#endregion #endregion
#region AccessList Functions #region AccessList Functions