- Timestamp:
- Jul 24, 2014, 3:25:58 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/TelnetCommands/ListPlayersExtended.cs
r91 r103 4 4 public class ListPlayersExtended : ConsoleCommand 5 5 { 6 public ListPlayersExtended(ConsoleSdtd cons) : base(cons) { 6 public ListPlayersExtended (ConsoleSdtd cons) : base(cons) 7 { 7 8 } 8 9 … … 12 13 } 13 14 14 public override string[] Names () { 15 public override string[] Names () 16 { 15 17 return new string[] { "listplayersextended", "lpe" }; 16 18 } … … 18 20 public override void Run (string[] _params) 19 21 { 20 World w = this.m_Console.gameManager.World; 21 int num = 0; 22 foreach (KeyValuePair<int, EntityPlayer> current in w.playerEntities.dict) 23 { 24 int clientId = -1; 25 Dictionary<int,int> d = this.m_Console.gameManager.connectionManager.mapClientToEntity; 26 foreach (KeyValuePair<int, int> mapping in d) { 27 if (mapping.Value == current.Value.fd0087) { 28 clientId = mapping.Key; 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; 29 30 } 30 } 31 string ip = string.Empty; 32 if (clientId >= 0) { 33 ip = this.m_Console.gameManager.connectionManager.connectedClients [clientId].networkPlayer.ipAddress; 34 } 35 m_Console.md000a (string.Concat (new object[] 31 m_Console.md000a (string.Concat (new object[] 36 32 { 37 33 string.Empty, … … 58 54 current.Value.Score, 59 55 ", steamid=", 60 SingletonMonoBehaviour<Authenticator>.Instance.GetPlayerId (current.Value.EntityName),56 CommonMappingFunctions.GetSteamID (ci), 61 57 ", ip=", 62 58 ip, 63 59 ", ping=", 64 60 current.Value.pingToServer 65 })); 61 } 62 ) 63 ); 64 } 65 m_Console.md000a ("Total of " + w.playerEntities.list.Count + " in the game"); 66 } catch (Exception e) { 67 Log.Out ("Error in ListPlayersExtended.Run: " + e); 66 68 } 67 m_Console.md000a ("Total of " + w.playerEntities.list.Count + " in the game");68 69 } 69 70 }
Note:
See TracChangeset
for help on using the changeset viewer.