- Timestamp:
- Aug 26, 2014, 4:41:47 PM (10 years ago)
- Location:
- binary-improvements/7dtd-server-fixes/src/CustomCommands
- Files:
-
- 1 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/CustomCommands/ListPlayersExtended.cs
r117 r130 2 2 using System.Collections.Generic; 3 3 4 public class ListPlayersExtended : ConsoleCommand 4 namespace AllocsFixes.CustomCommands 5 5 { 6 public ListPlayersExtended (ConsoleSdtd cons) : base(cons)6 public class ListPlayersExtended : ConsoleCommand 7 7 { 8 } 8 public ListPlayersExtended (ConsoleSdtd cons) : base(cons) 9 { 10 } 9 11 10 public override string Description ()11 {12 return "lists all players with extended attributes";13 }12 public override string Description () 13 { 14 return "lists all players with extended attributes"; 15 } 14 16 15 public override string[] Names ()16 {17 return new string[] { "listplayersextended", "lpe" };18 }17 public override string[] Names () 18 { 19 return new string[] { "listplayersextended", "lpe" }; 20 } 19 21 20 public override void Run (string[] _params)21 {22 try {23 World w = CommonMappingFunctions.GetGameManager ().World;24 int num = 0;25 foreach (KeyValuePair<int, EntityPlayer> current in w.playerEntities.dict) {26 ClientInfo ci = CommonMappingFunctions.GetClientInfoFromEntityID (current.Key);27 string ip = string.Empty;28 if (ci != null) {29 ip = ci.networkPlayer.ipAddress;30 }31 m_Console.SendResult (string.Concat (new object[]22 public override void Run (string[] _params) 23 { 24 try { 25 World w = CommonMappingFunctions.GetGameManager ().World; 26 int num = 0; 27 foreach (KeyValuePair<int, EntityPlayer> current in w.playerEntities.dict) { 28 ClientInfo ci = CommonMappingFunctions.GetClientInfoFromEntityID (current.Key); 29 string ip = string.Empty; 30 if (ci != null) { 31 ip = ci.networkPlayer.ipAddress; 32 } 33 m_Console.SendResult (string.Concat (new object[] 32 34 { 33 35 string.Empty, … … 60 62 current.Value.pingToServer 61 63 } 62 ) 63 ); 64 ) 65 ); 66 } 67 m_Console.SendResult ("Total of " + w.playerEntities.list.Count + " in the game"); 68 } catch (Exception e) { 69 Log.Out ("Error in ListPlayersExtended.Run: " + e); 64 70 } 65 m_Console.SendResult ("Total of " + w.playerEntities.list.Count + " in the game");66 } catch (Exception e) {67 Log.Out ("Error in ListPlayersExtended.Run: " + e);68 71 } 69 72 } 70 73 } 71
Note:
See TracChangeset
for help on using the changeset viewer.