- Timestamp:
- Sep 4, 2018, 2:33:52 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/LandClaimList.cs
r325 r326 14 14 Dictionary<Player, List<Vector3i>> result = new Dictionary<Player, List<Vector3i>> (); 15 15 16 if (d != null) { 17 Dictionary<PersistentPlayerData, List<Vector3i>> owners = 18 new Dictionary<PersistentPlayerData, List<Vector3i>> (); 19 foreach (KeyValuePair<Vector3i, PersistentPlayerData> kvp in d) { 20 bool allowed = true; 21 if (_positionFilters != null) { 22 foreach (PositionFilter pf in _positionFilters) { 23 if (!pf (kvp.Key)) { 24 allowed = false; 25 break; 26 } 16 if (d == null) { 17 return result; 18 } 19 20 Dictionary<PersistentPlayerData, List<Vector3i>> owners = 21 new Dictionary<PersistentPlayerData, List<Vector3i>> (); 22 foreach (KeyValuePair<Vector3i, PersistentPlayerData> kvp in d) { 23 bool allowed = true; 24 if (_positionFilters != null) { 25 foreach (PositionFilter pf in _positionFilters) { 26 if (!pf (kvp.Key)) { 27 allowed = false; 28 break; 27 29 } 28 }29 30 if (allowed) {31 if (!owners.ContainsKey (kvp.Value)) {32 owners.Add (kvp.Value, new List<Vector3i> ());33 }34 35 owners [kvp.Value].Add (kvp.Key);36 30 } 37 31 } 38 32 39 foreach (KeyValuePair<PersistentPlayerData, List<Vector3i>> kvp in owners) { 40 Player p = PersistentContainer.Instance.Players [kvp.Key.PlayerId, false]; 41 if (p == null) { 42 p = new Player (kvp.Key.PlayerId); 33 if (allowed) { 34 if (!owners.ContainsKey (kvp.Value)) { 35 owners.Add (kvp.Value, new List<Vector3i> ()); 43 36 } 44 37 45 bool allowed = true; 46 if (_ownerFilters != null) { 47 foreach (OwnerFilter of in _ownerFilters) { 48 if (!of (p)) { 49 allowed = false; 50 break; 51 } 38 owners [kvp.Value].Add (kvp.Key); 39 } 40 } 41 42 foreach (KeyValuePair<PersistentPlayerData, List<Vector3i>> kvp in owners) { 43 Player p = PersistentContainer.Instance.Players [kvp.Key.PlayerId, false]; 44 if (p == null) { 45 p = new Player (kvp.Key.PlayerId); 46 } 47 48 bool allowed = true; 49 if (_ownerFilters != null) { 50 foreach (OwnerFilter of in _ownerFilters) { 51 if (!of (p)) { 52 allowed = false; 53 break; 52 54 } 53 55 } 56 } 54 57 55 if (allowed) { 56 result.Add (p, new List<Vector3i> ()); 57 foreach (Vector3i v in kvp.Value) { 58 result [p].Add (v); 59 } 58 if (allowed) { 59 result.Add (p, new List<Vector3i> ()); 60 foreach (Vector3i v in kvp.Value) { 61 result [p].Add (v); 60 62 } 61 63 }
Note:
See TracChangeset
for help on using the changeset viewer.