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( public delegate void ParcelAccessListRequest(
UUID agentID, UUID sessionID, uint flags, int sequenceID, int landLocalID, IClientAPI remote_client); UUID agentID, UUID sessionID, uint flags, int sequenceID, int landLocalID, IClientAPI remote_client);
public delegate void ParcelAccessListUpdateRequest(UUID agentID, uint flags, public delegate void ParcelAccessListUpdateRequest(UUID agentID, uint flags, UUID transactionID,
int landLocalID, UUID transactionID, int sequenceID, int landLocalID, List<LandAccessEntry> entries, IClientAPI remote_client);
int sections, List<LandAccessEntry> entries,
IClientAPI remote_client);
public delegate void ParcelPropertiesRequest( 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); 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); void SendLandUpdateToClient(bool snap_selection, IClientAPI remote_client);
List<LandAccessEntry> CreateAccessListArrayByFlag(AccessList flag); List<LandAccessEntry> CreateAccessListArrayByFlag(AccessList flag);
void SendAccessList(UUID agentID, UUID sessionID, uint flags, int sequenceID, IClientAPI remote_client); 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 UpdateLandBitmapByteArray();
void SetLandBitmapFromByteArray(); void SetLandBitmapFromByteArray();
bool[,] GetLandBitmap(); 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, public void ClientOnParcelAccessListUpdateRequest(UUID agentID,
uint flags, int landLocalID, UUID transactionID, int sequenceID, uint flags, UUID transactionID, int landLocalID, List<LandAccessEntry> entries,
int sections, List<LandAccessEntry> entries,
IClientAPI remote_client) IClientAPI remote_client)
{ {
// Flags is the list to update, it can mean either the ban or if ((flags & 0x03) == 0)
// the access list (WTH is a pass list? Mentioned in ParcelFlags) return; // we only have access and ban
//
// 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
ILandObject land; ILandObject land;
lock (m_landList) lock (m_landList)
{ {
@ -703,15 +698,19 @@ namespace OpenSim.Region.CoreModules.World.Land
if (land != null) if (land != null)
{ {
GroupPowers requiredPowers = GroupPowers.LandManageAllowed; GroupPowers requiredPowers = GroupPowers.None;
if (flags == (uint)AccessList.Ban) if ((flags & (uint)AccessList.Access) != 0)
requiredPowers = GroupPowers.LandManageBanned; requiredPowers |= GroupPowers.LandManageAllowed;
if ((flags & (uint)AccessList.Ban) != 0)
requiredPowers |= GroupPowers.LandManageBanned;
if(requiredPowers == GroupPowers.None)
return;
if (m_scene.Permissions.CanEditParcelProperties(agentID, if (m_scene.Permissions.CanEditParcelProperties(agentID,
land, requiredPowers, false)) land, requiredPowers, false))
{ {
land.UpdateAccessList(flags, transactionID, sequenceID, land.UpdateAccessList(flags, transactionID, entries);
sections, entries, remote_client);
} }
} }
else else

View File

@ -54,7 +54,8 @@ namespace OpenSim.Region.CoreModules.World.Land
protected Scene m_scene; protected Scene m_scene;
protected List<SceneObjectGroup> primsOverMe = new List<SceneObjectGroup>(); 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 ExpiringCache<UUID, bool> m_groupMemberCache = new ExpiringCache<UUID, bool>();
protected TimeSpan m_groupMemberCacheTimeout = TimeSpan.FromSeconds(30); // cache invalidation after 30 seconds 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, public void UpdateAccessList(uint flags, UUID transactionID, List<LandAccessEntry> entries)
int sequenceID, int sections,
List<LandAccessEntry> entries,
IClientAPI remote_client)
{ {
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)) || if ((!m_listTransactions.ContainsKey(flags)) ||
m_listTransactions[flags] != transactionID) m_listTransactions[flags] != transactionID)
{ {
m_listTransactions[flags] = transactionID; m_listTransactions[flags] = transactionID;
List<LandAccessEntry> toRemove = new List<LandAccessEntry>();
List<LandAccessEntry> toRemove = foreach (LandAccessEntry entry in parcelAccessList)
new List<LandAccessEntry>();
foreach (LandAccessEntry entry in newData.ParcelAccessList)
{ {
if (entry.Flags == (AccessList)flags) if (((uint)entry.Flags & flags) != 0)
toRemove.Add(entry); toRemove.Add(entry);
} }
foreach (LandAccessEntry entry in toRemove) foreach (LandAccessEntry entry in toRemove)
{ parcelAccessList.Remove(entry);
newData.ParcelAccessList.Remove(entry);
}
// Checked here because this will always be the first // a delete all command ?
// and only packet in a transaction
if (entries.Count == 1 && entries[0].AgentID == UUID.Zero) 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; return;
} }
} }
}
foreach (LandAccessEntry entry in entries) foreach (LandAccessEntry entry in entries)
{ {
LandAccessEntry temp = LandAccessEntry temp = new LandAccessEntry();
new LandAccessEntry();
temp.AgentID = entry.AgentID; temp.AgentID = entry.AgentID;
temp.Expires = entry.Expires; temp.Expires = entry.Expires;
temp.Flags = (AccessList)flags; temp.Flags = (AccessList)flags;
newData.ParcelAccessList.Add(temp); parcelAccessList.Add(temp);
} }
// update use lists flags LandData.ParcelAccessList = parcelAccessList;
// rights already checked or we wont be here
uint parcelflags = newData.Flags;
if ((flags & (uint)AccessList.Access) != 0) if ((flags & (uint)AccessList.Access) != 0)
parcelflags |= (uint)ParcelFlags.UseAccessList; LandData.Flags |= (uint)ParcelFlags.UseAccessList;
if ((flags & (uint)AccessList.Ban) != 0) if ((flags & (uint)AccessList.Ban) != 0)
parcelflags |= (uint)ParcelFlags.UseBanList; LandData.Flags |= (uint)ParcelFlags.UseBanList;
newData.Flags = parcelflags;
m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData);
} }
#endregion #endregion

View File

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

View File

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