- Timestamp:
- Dec 12, 2015, 4:08:53 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/AllocsCommands/Commands/ListLandProtection.cs
r238 r253 86 86 } 87 87 88 Dictionary<Vector3i, PersistentPlayerData> d = ppl.m_lpBlockMap;89 if (d != null) {90 Dictionary<PersistentPlayerData, List<Vector3i>> owners = new Dictionary<PersistentPlayerData, List<Vector3i>> ();91 foreach (KeyValuePair<Vector3i, PersistentPlayerData> kvp in d) {92 if (!onlyCloseToPlayer || (Math.Abs (kvp.Key.x - closeTo.x) <= closeToDistance && Math.Abs (kvp.Key.z - closeTo.z) <= closeToDistance)) {93 if (!owners.ContainsKey (kvp.Value)) {94 owners.Add (kvp.Value, new List<Vector3i> ());95 }96 owners [kvp.Value].Add (kvp.Key);97 }98 }99 88 100 foreach (KeyValuePair<PersistentPlayerData, List<Vector3i>> kvp in owners) {101 if (steamIdFilter.Length == 0 || kvp.Key.PlayerId.Equals(steamIdFilter)) {102 PersistentData.Player p = PersistentData.PersistentContainer.Instance.Players [kvp.Key.PlayerId, false];103 string name = string.Empty;104 if (p != null) {105 name = p.Name;106 }107 name += " (" + kvp.Key.PlayerId + ")";89 LandClaimList.OwnerFilter[] ownerFilters = null; 90 if (!string.IsNullOrEmpty (steamIdFilter)) { 91 ownerFilters = new LandClaimList.OwnerFilter[] { LandClaimList.SteamIdFilter (steamIdFilter) }; 92 } 93 LandClaimList.PositionFilter[] posFilters = null; 94 if (onlyCloseToPlayer) { 95 posFilters = new LandClaimList.PositionFilter[] { LandClaimList.CloseToFilter2dRect (closeTo, closeToDistance) }; 96 } 108 97 109 SdtdConsole.Instance.Output (String.Format ("Player \"{0}\" owns {3} keystones (protected: {1}, current hardness multiplier: {2})", name, w.IsLandProtectionValidForPlayer (kvp.Key), w.GetLandProtectionHardnessModifierForPlayer (kvp.Key), kvp.Value.Count)); 110 if (!summaryOnly) { 111 foreach (Vector3i v in kvp.Value) { 112 SdtdConsole.Instance.Output (" (" + v.ToString () + ")"); 113 } 114 } 98 Dictionary<PersistentData.Player, List<Vector3i>> claims = LandClaimList.GetLandClaims (ownerFilters, posFilters); 99 100 foreach (KeyValuePair<PersistentData.Player, List<Vector3i>> kvp in claims) { 101 SdtdConsole.Instance.Output (String.Format ( 102 "Player \"{0} ({1})\" owns {4} keystones (protected: {2}, current hardness multiplier: {3})", 103 kvp.Key.Name, 104 kvp.Key.SteamID, 105 kvp.Key.LandProtectionActive, 106 kvp.Key.LandProtectionMultiplier, 107 kvp.Value.Count)); 108 if (!summaryOnly) { 109 foreach (Vector3i v in kvp.Value) { 110 SdtdConsole.Instance.Output (" (" + v.ToString () + ")"); 115 111 } 116 112 } … … 118 114 119 115 if (steamIdFilter.Length == 0) 120 SdtdConsole.Instance.Output ("Total of " + d.Count + " keystones in the game");116 SdtdConsole.Instance.Output ("Total of " + ppl.m_lpBlockMap.Count + " keystones in the game"); 121 117 } catch (Exception e) { 122 118 Log.Out ("Error in ListLandProtection.Run: " + e);
Note:
See TracChangeset
for help on using the changeset viewer.