diff options
author | UbitUmarov | 2018-11-25 18:56:38 +0000 |
---|---|---|
committer | UbitUmarov | 2018-11-25 18:56:38 +0000 |
commit | cded99626595dba9f15ad5485cf2fe1260c3266f (patch) | |
tree | f009cf3b84a56be880a919c30fe4ed13a5004bf3 /OpenSim/Region/CoreModules | |
parent | avoid data references stuck in packet pools (diff) | |
download | opensim-SC-cded99626595dba9f15ad5485cf2fe1260c3266f.zip opensim-SC-cded99626595dba9f15ad5485cf2fe1260c3266f.tar.gz opensim-SC-cded99626595dba9f15ad5485cf2fe1260c3266f.tar.bz2 opensim-SC-cded99626595dba9f15ad5485cf2fe1260c3266f.tar.xz |
remove a dev only conditional on lludp handlers; change parcel lists updates a bit;
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | 27 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandObject.cs | 86 |
2 files changed, 54 insertions, 59 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index ebfc58c..ae7885b 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -684,17 +684,12 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
684 | } | 684 | } |
685 | 685 | ||
686 | public void ClientOnParcelAccessListUpdateRequest(UUID agentID, | 686 | public void ClientOnParcelAccessListUpdateRequest(UUID agentID, |
687 | uint flags, int landLocalID, UUID transactionID, int sequenceID, | 687 | uint flags, UUID transactionID, int landLocalID, List<LandAccessEntry> entries, |
688 | int sections, List<LandAccessEntry> entries, | ||
689 | IClientAPI remote_client) | 688 | IClientAPI remote_client) |
690 | { | 689 | { |
691 | // Flags is the list to update, it can mean either the ban or | 690 | if ((flags & 0x03) == 0) |
692 | // the access list (WTH is a pass list? Mentioned in ParcelFlags) | 691 | return; // we only have access and ban |
693 | // | 692 | |
694 | // There may be multiple packets, because these can get LONG. | ||
695 | // Use transactionID to determine a new chain of packets since | ||
696 | // packets may have come in out of sequence and that would be | ||
697 | // a big mess if using the sequenceID | ||
698 | ILandObject land; | 693 | ILandObject land; |
699 | lock (m_landList) | 694 | lock (m_landList) |
700 | { | 695 | { |
@@ -703,15 +698,19 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
703 | 698 | ||
704 | if (land != null) | 699 | if (land != null) |
705 | { | 700 | { |
706 | GroupPowers requiredPowers = GroupPowers.LandManageAllowed; | 701 | GroupPowers requiredPowers = GroupPowers.None; |
707 | if (flags == (uint)AccessList.Ban) | 702 | if ((flags & (uint)AccessList.Access) != 0) |
708 | requiredPowers = GroupPowers.LandManageBanned; | 703 | requiredPowers |= GroupPowers.LandManageAllowed; |
704 | if ((flags & (uint)AccessList.Ban) != 0) | ||
705 | requiredPowers |= GroupPowers.LandManageBanned; | ||
706 | |||
707 | if(requiredPowers == GroupPowers.None) | ||
708 | return; | ||
709 | 709 | ||
710 | if (m_scene.Permissions.CanEditParcelProperties(agentID, | 710 | if (m_scene.Permissions.CanEditParcelProperties(agentID, |
711 | land, requiredPowers, false)) | 711 | land, requiredPowers, false)) |
712 | { | 712 | { |
713 | land.UpdateAccessList(flags, transactionID, sequenceID, | 713 | land.UpdateAccessList(flags, transactionID, entries); |
714 | sections, entries, remote_client); | ||
715 | } | 714 | } |
716 | } | 715 | } |
717 | else | 716 | else |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 2c9ff00..88ca0c6 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs | |||
@@ -54,7 +54,8 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
54 | 54 | ||
55 | protected Scene m_scene; | 55 | protected Scene m_scene; |
56 | protected List<SceneObjectGroup> primsOverMe = new List<SceneObjectGroup>(); | 56 | protected List<SceneObjectGroup> primsOverMe = new List<SceneObjectGroup>(); |
57 | protected Dictionary<uint, UUID> m_listTransactions = new Dictionary<uint, UUID>(); | 57 | private Dictionary<uint, UUID> m_listTransactions = new Dictionary<uint, UUID>(); |
58 | private object m_listTransactionsLock = new object(); | ||
58 | 59 | ||
59 | protected ExpiringCache<UUID, bool> m_groupMemberCache = new ExpiringCache<UUID, bool>(); | 60 | protected ExpiringCache<UUID, bool> m_groupMemberCache = new ExpiringCache<UUID, bool>(); |
60 | protected TimeSpan m_groupMemberCacheTimeout = TimeSpan.FromSeconds(30); // cache invalidation after 30 seconds | 61 | protected TimeSpan m_groupMemberCacheTimeout = TimeSpan.FromSeconds(30); // cache invalidation after 30 seconds |
@@ -869,66 +870,61 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
869 | } | 870 | } |
870 | } | 871 | } |
871 | 872 | ||
872 | public void UpdateAccessList(uint flags, UUID transactionID, | 873 | public void UpdateAccessList(uint flags, UUID transactionID, List<LandAccessEntry> entries) |
873 | int sequenceID, int sections, | ||
874 | List<LandAccessEntry> entries, | ||
875 | IClientAPI remote_client) | ||
876 | { | 874 | { |
877 | LandData newData = LandData.Copy(); | 875 | if((flags & 0x03) == 0) |
878 | 876 | return; // we only have access and ban | |
879 | if ((!m_listTransactions.ContainsKey(flags)) || | ||
880 | m_listTransactions[flags] != transactionID) | ||
881 | { | ||
882 | m_listTransactions[flags] = transactionID; | ||
883 | |||
884 | List<LandAccessEntry> toRemove = | ||
885 | new List<LandAccessEntry>(); | ||
886 | |||
887 | foreach (LandAccessEntry entry in newData.ParcelAccessList) | ||
888 | { | ||
889 | if (entry.Flags == (AccessList)flags) | ||
890 | toRemove.Add(entry); | ||
891 | } | ||
892 | 877 | ||
893 | foreach (LandAccessEntry entry in toRemove) | 878 | flags &=0x03 ; |
894 | { | 879 | // get a work copy of lists |
895 | newData.ParcelAccessList.Remove(entry); | 880 | List<LandAccessEntry> parcelAccessList = new List<LandAccessEntry>(LandData.ParcelAccessList); |
896 | } | ||
897 | 881 | ||
898 | // Checked here because this will always be the first | 882 | // first packet on a transaction clears before adding |
899 | // and only packet in a transaction | 883 | // we need to this way because viewer protocol does not seem reliable |
900 | if (entries.Count == 1 && entries[0].AgentID == UUID.Zero) | 884 | lock (m_listTransactionsLock) |
885 | { | ||
886 | if ((!m_listTransactions.ContainsKey(flags)) || | ||
887 | m_listTransactions[flags] != transactionID) | ||
901 | { | 888 | { |
902 | m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); | 889 | m_listTransactions[flags] = transactionID; |
890 | List<LandAccessEntry> toRemove = new List<LandAccessEntry>(); | ||
891 | foreach (LandAccessEntry entry in parcelAccessList) | ||
892 | { | ||
893 | if (((uint)entry.Flags & flags) != 0) | ||
894 | toRemove.Add(entry); | ||
895 | } | ||
896 | foreach (LandAccessEntry entry in toRemove) | ||
897 | parcelAccessList.Remove(entry); | ||
903 | 898 | ||
904 | return; | 899 | // a delete all command ? |
900 | if (entries.Count == 1 && entries[0].AgentID == UUID.Zero) | ||
901 | { | ||
902 | LandData.ParcelAccessList = parcelAccessList; | ||
903 | if ((flags & (uint)AccessList.Access) != 0) | ||
904 | LandData.Flags &= ~(uint)ParcelFlags.UseAccessList; | ||
905 | if ((flags & (uint)AccessList.Ban) != 0) | ||
906 | LandData.Flags &= ~(uint)ParcelFlags.UseBanList; | ||
907 | m_listTransactions.Remove(flags); | ||
908 | return; | ||
909 | } | ||
905 | } | 910 | } |
906 | } | 911 | } |
907 | 912 | ||
908 | foreach (LandAccessEntry entry in entries) | 913 | foreach (LandAccessEntry entry in entries) |
909 | { | 914 | { |
910 | LandAccessEntry temp = | 915 | LandAccessEntry temp = new LandAccessEntry(); |
911 | new LandAccessEntry(); | ||
912 | |||
913 | temp.AgentID = entry.AgentID; | 916 | temp.AgentID = entry.AgentID; |
914 | temp.Expires = entry.Expires; | 917 | temp.Expires = entry.Expires; |
915 | temp.Flags = (AccessList)flags; | 918 | temp.Flags = (AccessList)flags; |
916 | 919 | ||
917 | newData.ParcelAccessList.Add(temp); | 920 | parcelAccessList.Add(temp); |
918 | } | 921 | } |
919 | 922 | ||
920 | // update use lists flags | 923 | LandData.ParcelAccessList = parcelAccessList; |
921 | // rights already checked or we wont be here | 924 | if ((flags & (uint)AccessList.Access) != 0) |
922 | uint parcelflags = newData.Flags; | 925 | LandData.Flags |= (uint)ParcelFlags.UseAccessList; |
923 | 926 | if ((flags & (uint)AccessList.Ban) != 0) | |
924 | if((flags & (uint)AccessList.Access) != 0) | 927 | LandData.Flags |= (uint)ParcelFlags.UseBanList; |
925 | parcelflags |= (uint)ParcelFlags.UseAccessList; | ||
926 | if((flags & (uint)AccessList.Ban) != 0) | ||
927 | parcelflags |= (uint)ParcelFlags.UseBanList; | ||
928 | |||
929 | newData.Flags = parcelflags; | ||
930 | |||
931 | m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); | ||
932 | } | 928 | } |
933 | 929 | ||
934 | #endregion | 930 | #endregion |