2014-11-11 00:32:32 +11:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace MinecraftClient.Commands
|
|
|
|
|
{
|
2014-11-11 00:55:42 +11:00
|
|
|
public class List : Command
|
|
|
|
|
{
|
|
|
|
|
public override string CMDName { get { return "list"; } }
|
2016-08-22 19:09:43 +02:00
|
|
|
public override string CMDDesc { get { return "list [raw]: get the player list."; } }
|
2014-11-11 00:32:32 +11:00
|
|
|
|
2014-11-11 00:55:42 +11:00
|
|
|
public override string Run(McTcpClient handler, string command)
|
|
|
|
|
{
|
2016-08-22 19:09:43 +02:00
|
|
|
bool rawNames = getArg(command).ToLower() == "raw";
|
|
|
|
|
return "PlayerList: "
|
|
|
|
|
+ String.Join(", ",
|
|
|
|
|
handler.GetOnlinePlayers()
|
|
|
|
|
.OrderBy(player => player.Name)
|
|
|
|
|
.Select(player => rawNames
|
|
|
|
|
? player.Name
|
|
|
|
|
: player.DisplayName));
|
2014-11-11 00:55:42 +11:00
|
|
|
}
|
|
|
|
|
}
|
2014-11-11 00:32:32 +11:00
|
|
|
}
|
|
|
|
|
|