1
0
Fork 0
This repository has been archived on 2019-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
Galactic_Colors_Control/Galactic Colors Control Server/Commands/ListCommand.cs

29 lines
1.0 KiB
C#

using System;
using System.Net.Sockets;
namespace Galactic_Colors_Control_Server.Commands
{
public class ListCommand : ICommand
{
public string Name { get { return "list"; } }
public string DescText { get { return "Lists connected clients."; } }
public string HelpText { get { return "Use /list to display all connected client username or IP."; } }
public bool IsServer { get { return true; } }
public bool IsClient { get { return false; } }
public bool IsNoConnect { get { return false; } }
public int minArgs { get { return 0; } }
public int maxArgs { get { return 0; } }
public void Execute(string[] args, Socket soc, bool server = false)
{
string text = " ";
foreach (Socket socket in Program.clients.Keys)
{
text += (Utilities.GetName(socket) + ", ");
}
text = text.Remove(text.Length - 2, 2);
Utilities.ConsoleWrite(text);
}
}
}