mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
/list command improvements
Coding style, Guid, interface, Fallback Command
This commit is contained in:
parent
5d1aee46c2
commit
f82041288d
4 changed files with 72 additions and 49 deletions
|
|
@ -12,8 +12,14 @@ namespace MinecraftClient.Commands
|
|||
|
||||
public override string Run(McTcpClient handler, string command)
|
||||
{
|
||||
handler.ListPlayers();
|
||||
string[] onlinePlayers = handler.getOnlinePlayers();
|
||||
if (onlinePlayers.Length == 0) //Not properly handled by Protocol handler?
|
||||
{
|
||||
//Fallback to server /list command
|
||||
handler.SendText("/list");
|
||||
return "";
|
||||
}
|
||||
else return "PlayerList: " + String.Join(", ", onlinePlayers);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue