Changeset 139 for binary-improvements
- Timestamp:
- Aug 27, 2014, 7:25:13 PM (10 years ago)
- Location:
- binary-improvements
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/CustomCommands/ListLandProtection.cs
r130 r139 26 26 PersistentPlayerList ppl = CommonMappingFunctions.GetGameManager ().GetPersistentPlayerList (); 27 27 28 bool summaryOnly = false; 29 string steamIdFilter = string.Empty; 30 31 if (_params.Length == 1) { 32 long tempLong; 33 34 if (_params [0].ToLower ().Equals ("summary")) { 35 summaryOnly = true; 36 } else if (_params [0].Length == 17 && long.TryParse (_params [0], out tempLong)) { 37 steamIdFilter = _params [0]; 38 } else { 39 ClientInfo ci = CommonMappingFunctions.GetClientInfoFromNameOrID (_params [0], true); 40 if (ci != null) { 41 steamIdFilter = CommonMappingFunctions.GetSteamID (ci); 42 } else { 43 m_Console.SendResult ("Player name or entity id \"" + _params [0] + "\" not found."); 44 return; 45 } 46 } 47 } 48 28 49 Dictionary<Vector3i, PersistentPlayerData> d = ppl.positionToLPBlockOwner; 29 50 if (d != null) { … … 37 58 38 59 foreach (KeyValuePair<PersistentPlayerData, List<Vector3i>> kvp in owners) { 39 ClientInfo ci = CommonMappingFunctions.GetClientInfoFromEntityID (kvp.Key.EntityId); 40 string name = string.Empty; 41 if (ci != null) { 42 name = CommonMappingFunctions.GetPlayerName (ci); 43 } 44 name += " (" + kvp.Key.PlayerId + ")"; 60 if (steamIdFilter.Length == 0 || kvp.Key.PlayerId.Equals (steamIdFilter)) { 61 ClientInfo ci = CommonMappingFunctions.GetClientInfoFromEntityID (kvp.Key.EntityId); 62 string name = string.Empty; 63 if (ci != null) { 64 name = CommonMappingFunctions.GetPlayerName (ci); 65 } 66 name += " (" + kvp.Key.PlayerId + ")"; 45 67 46 m_Console.SendResult (String.Format ("Player \"{0}\" (protected: {1}, current hardness multiplier: {2}):", name, w.LandClaimIsActive (kvp.Key), w.LandClaimPower (kvp.Key))); 47 foreach (Vector3i v in kvp.Value) { 48 m_Console.SendResult (" (" + v.ToString () + ")"); 68 m_Console.SendResult (String.Format ("Player \"{0}\" owns {3} keystones (protected: {1}, current hardness multiplier: {2})", name, w.LandClaimIsActive (kvp.Key), w.LandClaimPower (kvp.Key), kvp.Value.Count)); 69 if (!summaryOnly) { 70 foreach (Vector3i v in kvp.Value) { 71 m_Console.SendResult (" (" + v.ToString () + ")"); 72 } 73 } 49 74 } 50 75 } 51 76 } 52 77 53 m_Console.SendResult ("Total of " + d.Count + " keystones in the game"); 78 if (steamIdFilter.Length == 0) 79 m_Console.SendResult ("Total of " + d.Count + " keystones in the game"); 54 80 } catch (Exception e) { 55 81 Log.Out ("Error in ListLandProtection.Run: " + e);
Note:
See TracChangeset
for help on using the changeset viewer.