source: binary-improvements/7dtd-server-fixes/src/TelnetCommands/ListPlayersExtended.cs@ 117

Last change on this file since 117 was 117, checked in by alloc, 10 years ago

Fixes: Updated for A9

File size: 1.6 KB
RevLine 
[75]1using System;
2using System.Collections.Generic;
3
4public class ListPlayersExtended : ConsoleCommand
5{
[103]6 public ListPlayersExtended (ConsoleSdtd cons) : base(cons)
7 {
[75]8 }
9
10 public override string Description ()
11 {
12 return "lists all players with extended attributes";
13 }
14
[103]15 public override string[] Names ()
16 {
[75]17 return new string[] { "listplayersextended", "lpe" };
18 }
19
20 public override void Run (string[] _params)
21 {
[103]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;
[76]30 }
[107]31 m_Console.SendResult (string.Concat (new object[]
[75]32 {
33 string.Empty,
34 ++num,
35 ". id=",
[117]36 current.Value.fd008f,
[75]37 ", ",
38 current.Value.EntityName,
39 ", pos=",
40 current.Value.GetPosition (),
41 ", rot=",
42 current.Value.rotation,
43 ", remote=",
[117]44 current.Value.fd00b2,
[75]45 ", health=",
46 current.Value.Health,
47 ", deaths=",
48 current.Value.Died,
49 ", zombies=",
50 current.Value.KilledZombies,
51 ", players=",
52 current.Value.KilledPlayers,
53 ", score=",
54 current.Value.Score,
[76]55 ", steamid=",
[103]56 CommonMappingFunctions.GetSteamID (ci),
[76]57 ", ip=",
[91]58 ip,
59 ", ping=",
60 current.Value.pingToServer
[103]61 }
62 )
63 );
64 }
[107]65 m_Console.SendResult ("Total of " + w.playerEntities.list.Count + " in the game");
[103]66 } catch (Exception e) {
67 Log.Out ("Error in ListPlayersExtended.Run: " + e);
[75]68 }
69 }
70}
71
Note: See TracBrowser for help on using the repository browser.