remove a dev only conditional on lludp handlers; change parcel lists updates a bit;

0.9.1.0-post-fixes
UbitUmarov 2018-11-25 18:56:38 +00:00
parent d179b2dda1
commit cded996265
7 changed files with 442 additions and 969 deletions

View File

@ -182,10 +182,8 @@ namespace OpenSim.Framework
public delegate void ParcelAccessListRequest(
UUID agentID, UUID sessionID, uint flags, int sequenceID, int landLocalID, IClientAPI remote_client);
public delegate void ParcelAccessListUpdateRequest(UUID agentID, uint flags,
int landLocalID, UUID transactionID, int sequenceID,
int sections, List<LandAccessEntry> entries,
IClientAPI remote_client);
public delegate void ParcelAccessListUpdateRequest(UUID agentID, uint flags, UUID transactionID,
int landLocalID, List<LandAccessEntry> entries, IClientAPI remote_client);
public delegate void ParcelPropertiesRequest(
int start_x, int start_y, int end_x, int end_y, int sequence_id, bool snap_selection, IClientAPI remote_client);

View File

@ -85,7 +85,7 @@ namespace OpenSim.Framework
void SendLandUpdateToClient(bool snap_selection, IClientAPI remote_client);
List<LandAccessEntry> CreateAccessListArrayByFlag(AccessList flag);
void SendAccessList(UUID agentID, UUID sessionID, uint flags, int sequenceID, IClientAPI remote_client);
void UpdateAccessList(uint flags, UUID transactionID, int sequenceID, int sections, List<LandAccessEntry> entries, IClientAPI remote_client);
void UpdateAccessList(uint flags, UUID transationID, List<LandAccessEntry> entries);
void UpdateLandBitmapByteArray();
void SetLandBitmapFromByteArray();
bool[,] GetLandBitmap();

File diff suppressed because it is too large Load Diff

View File

@ -684,17 +684,12 @@ namespace OpenSim.Region.CoreModules.World.Land
}
public void ClientOnParcelAccessListUpdateRequest(UUID agentID,
uint flags, int landLocalID, UUID transactionID, int sequenceID,
int sections, List<LandAccessEntry> entries,
uint flags, UUID transactionID, int landLocalID, List<LandAccessEntry> entries,
IClientAPI remote_client)
{
// Flags is the list to update, it can mean either the ban or
// the access list (WTH is a pass list? Mentioned in ParcelFlags)
//
// There may be multiple packets, because these can get LONG.
// Use transactionID to determine a new chain of packets since
// packets may have come in out of sequence and that would be
// a big mess if using the sequenceID
if ((flags & 0x03) == 0)
return; // we only have access and ban
ILandObject land;
lock (m_landList)
{
@ -703,15 +698,19 @@ namespace OpenSim.Region.CoreModules.World.Land
if (land != null)
{
GroupPowers requiredPowers = GroupPowers.LandManageAllowed;
if (flags == (uint)AccessList.Ban)
requiredPowers = GroupPowers.LandManageBanned;
GroupPowers requiredPowers = GroupPowers.None;
if ((flags & (uint)AccessList.Access) != 0)
requiredPowers |= GroupPowers.LandManageAllowed;
if ((flags & (uint)AccessList.Ban) != 0)
requiredPowers |= GroupPowers.LandManageBanned;
if(requiredPowers == GroupPowers.None)
return;
if (m_scene.Permissions.CanEditParcelProperties(agentID,
land, requiredPowers, false))
{
land.UpdateAccessList(flags, transactionID, sequenceID,
sections, entries, remote_client);
land.UpdateAccessList(flags, transactionID, entries);
}
}
else

View File

@ -54,7 +54,8 @@ namespace OpenSim.Region.CoreModules.World.Land
protected Scene m_scene;
protected List<SceneObjectGroup> primsOverMe = new List<SceneObjectGroup>();
protected Dictionary<uint, UUID> m_listTransactions = new Dictionary<uint, UUID>();
private Dictionary<uint, UUID> m_listTransactions = new Dictionary<uint, UUID>();
private object m_listTransactionsLock = new object();
protected ExpiringCache<UUID, bool> m_groupMemberCache = new ExpiringCache<UUID, bool>();
protected TimeSpan m_groupMemberCacheTimeout = TimeSpan.FromSeconds(30); // cache invalidation after 30 seconds
@ -869,66 +870,61 @@ namespace OpenSim.Region.CoreModules.World.Land
}
}
public void UpdateAccessList(uint flags, UUID transactionID,
int sequenceID, int sections,
List<LandAccessEntry> entries,
IClientAPI remote_client)
public void UpdateAccessList(uint flags, UUID transactionID, List<LandAccessEntry> entries)
{
LandData newData = LandData.Copy();
if((flags & 0x03) == 0)
return; // we only have access and ban
flags &=0x03 ;
// get a work copy of lists
List<LandAccessEntry> parcelAccessList = new List<LandAccessEntry>(LandData.ParcelAccessList);
// first packet on a transaction clears before adding
// we need to this way because viewer protocol does not seem reliable
lock (m_listTransactionsLock)
{
if ((!m_listTransactions.ContainsKey(flags)) ||
m_listTransactions[flags] != transactionID)
{
m_listTransactions[flags] = transactionID;
List<LandAccessEntry> toRemove =
new List<LandAccessEntry>();
foreach (LandAccessEntry entry in newData.ParcelAccessList)
List<LandAccessEntry> toRemove = new List<LandAccessEntry>();
foreach (LandAccessEntry entry in parcelAccessList)
{
if (entry.Flags == (AccessList)flags)
if (((uint)entry.Flags & flags) != 0)
toRemove.Add(entry);
}
foreach (LandAccessEntry entry in toRemove)
{
newData.ParcelAccessList.Remove(entry);
}
parcelAccessList.Remove(entry);
// Checked here because this will always be the first
// and only packet in a transaction
// a delete all command ?
if (entries.Count == 1 && entries[0].AgentID == UUID.Zero)
{
m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData);
LandData.ParcelAccessList = parcelAccessList;
if ((flags & (uint)AccessList.Access) != 0)
LandData.Flags &= ~(uint)ParcelFlags.UseAccessList;
if ((flags & (uint)AccessList.Ban) != 0)
LandData.Flags &= ~(uint)ParcelFlags.UseBanList;
m_listTransactions.Remove(flags);
return;
}
}
}
foreach (LandAccessEntry entry in entries)
{
LandAccessEntry temp =
new LandAccessEntry();
LandAccessEntry temp = new LandAccessEntry();
temp.AgentID = entry.AgentID;
temp.Expires = entry.Expires;
temp.Flags = (AccessList)flags;
newData.ParcelAccessList.Add(temp);
parcelAccessList.Add(temp);
}
// update use lists flags
// rights already checked or we wont be here
uint parcelflags = newData.Flags;
LandData.ParcelAccessList = parcelAccessList;
if ((flags & (uint)AccessList.Access) != 0)
parcelflags |= (uint)ParcelFlags.UseAccessList;
LandData.Flags |= (uint)ParcelFlags.UseAccessList;
if ((flags & (uint)AccessList.Ban) != 0)
parcelflags |= (uint)ParcelFlags.UseBanList;
newData.Flags = parcelflags;
m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData);
LandData.Flags |= (uint)ParcelFlags.UseBanList;
}
#endregion

View File

@ -541,6 +541,8 @@ namespace OpenSim.Region.OptionalModules.World.NPC
public event GodlikeMessage onGodlikeMessage;
public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate;
public event GenericCall2 OnUpdateThrottles;
public event AgentFOV OnAgentFOV;
#pragma warning restore 67
#endregion

View File

@ -343,6 +343,8 @@ namespace OpenSim.Tests.Common
public event GodlikeMessage onGodlikeMessage;
public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate;
public event GenericCall2 OnUpdateThrottles;
public event AgentFOV OnAgentFOV;
#pragma warning restore 67
/// <value>