- Timestamp:
- Sep 4, 2018, 1:00:48 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/AllocsCommands/Commands/ListKnownPlayers.cs
r284 r325 1 using AllocsFixes.PersistentData;2 1 using System; 3 2 using System.Collections.Generic; 3 using AllocsFixes.PersistentData; 4 4 5 namespace AllocsFixes.CustomCommands 6 { 7 public class ListKnownPlayers : ConsoleCmdAbstract 8 { 9 public override string GetDescription () 10 { 5 namespace AllocsFixes.CustomCommands { 6 public class ListKnownPlayers : ConsoleCmdAbstract { 7 public override string GetDescription () { 11 8 return "lists all players that were ever online"; 12 9 } … … 14 11 public override string GetHelp () { 15 12 return "Usage:\n" + 16 17 18 19 20 21 22 23 13 " 1. listknownplayers\n" + 14 " 2. listknownplayers -online\n" + 15 " 3. listknownplayers -notbanned\n" + 16 " 4. listknownplayers <player name / steamid>\n" + 17 "1. Lists all players that have ever been online\n" + 18 "2. Lists only the players that are currently online\n" + 19 "3. Lists only the players that are not banned\n" + 20 "4. Lists all players whose name contains the given string or matches the given SteamID"; 24 21 } 25 22 26 public override string[] GetCommands () 27 { 28 return new string[] { "listknownplayers", "lkp" }; 23 public override string[] GetCommands () { 24 return new[] {"listknownplayers", "lkp"}; 29 25 } 30 26 31 public override void Execute (List<string> _params, CommandSenderInfo _senderInfo) 32 { 27 public override void Execute (List<string> _params, CommandSenderInfo _senderInfo) { 33 28 try { 34 29 AdminTools admTools = GameManager.Instance.adminTools; … … 56 51 57 52 if (p != null) { 58 SdtdConsole.Instance.Output (String.Format ("{0}. {1}, id={2}, steamid={3}, online={4}, ip={5}, playtime={6} m, seen={7}", 53 SdtdConsole.Instance.Output (string.Format ( 54 "{0}. {1}, id={2}, steamid={3}, online={4}, ip={5}, playtime={6} m, seen={7}", 59 55 0, p.Name, p.EntityID, nameFilter, p.IsOnline, p.IP, 60 56 p.TotalPlayTime / 60, … … 62 58 ); 63 59 } else { 64 SdtdConsole.Instance.Output ( String.Format ("SteamID {0} unknown!", nameFilter));60 SdtdConsole.Instance.Output (string.Format ("SteamID {0} unknown!", nameFilter)); 65 61 } 66 62 } else { … … 74 70 && (nameFilter.Length == 0 || p.Name.ToLower ().Contains (nameFilter)) 75 71 ) { 76 SdtdConsole.Instance.Output (String.Format ("{0}. {1}, id={2}, steamid={3}, online={4}, ip={5}, playtime={6} m, seen={7}", 77 ++num, p.Name, p.EntityID, sid, p.IsOnline, p.IP, 78 p.TotalPlayTime / 60, 79 p.LastOnline.ToString ("yyyy-MM-dd HH:mm")) 72 SdtdConsole.Instance.Output (string.Format ( 73 "{0}. {1}, id={2}, steamid={3}, online={4}, ip={5}, playtime={6} m, seen={7}", 74 ++num, p.Name, p.EntityID, sid, p.IsOnline, p.IP, 75 p.TotalPlayTime / 60, 76 p.LastOnline.ToString ("yyyy-MM-dd HH:mm")) 80 77 ); 81 78 } 82 79 } 80 83 81 SdtdConsole.Instance.Output ("Total of " + PersistentContainer.Instance.Players.Count + " known"); 84 82 }
Note:
See TracChangeset
for help on using the changeset viewer.