diff --git a/Galactic Colors Control Server/Client.cs b/Galactic Colors Control Server/Client.cs new file mode 100644 index 0000000..12a0522 --- /dev/null +++ b/Galactic Colors Control Server/Client.cs @@ -0,0 +1,16 @@ +using System.Net.Sockets; + +namespace Galactic_Colors_Control_Server +{ + public class Client + { + public int status = -1; + public string pseudo = ""; + public int partyID = -1; + + public Party party + { + get { if (partyID != -1) { return Program.parties[partyID]; } else { return null; } } + } + } +} \ No newline at end of file diff --git a/Galactic Colors Control Server/Commands/ClearCommand.cs b/Galactic Colors Control Server/Commands/ClearCommand.cs index 98e9dba..9d204d1 100644 --- a/Galactic Colors Control Server/Commands/ClearCommand.cs +++ b/Galactic Colors Control Server/Commands/ClearCommand.cs @@ -8,6 +8,7 @@ namespace Galactic_Colors_Control_Server.Commands public string Name { get { return "clear"; } } public string DescText { get { return "Clears the console screen."; } } public string HelpText { get { return "Use /clear to execute Console.Clear()."; } } + public Manager.CommandGroup Group { get { return Manager.CommandGroup.root; } } public bool IsServer { get { return true; } } public bool IsClient { get { return true; } } public bool IsClientSide { get { return true; } } diff --git a/Galactic Colors Control Server/Commands/CountCommand.cs b/Galactic Colors Control Server/Commands/Client/CountCommand.cs similarity index 60% rename from Galactic Colors Control Server/Commands/CountCommand.cs rename to Galactic Colors Control Server/Commands/Client/CountCommand.cs index e650b93..54e5d3e 100644 --- a/Galactic Colors Control Server/Commands/CountCommand.cs +++ b/Galactic Colors Control Server/Commands/Client/CountCommand.cs @@ -3,13 +3,14 @@ using System.Net.Sockets; namespace Galactic_Colors_Control_Server.Commands { - public class CountCommand : ICommand + public class ClientCountCommand : ICommand { public string Name { get { return "count"; } } public string DescText { get { return "Counts connected clients."; } } - public string HelpText { get { return "Use /count to show connected clients count and size"; } } + public string HelpText { get { return "Use /client count to show connected clients count and size"; } } + public Manager.CommandGroup Group { get { return Manager.CommandGroup.client; } } public bool IsServer { get { return true; } } - public bool IsClient { get { return false; } } + public bool IsClient { get { return true; } } public bool IsClientSide { get { return false; } } public bool IsNoConnect { get { return false; } } public int minArgs { get { return 0; } } @@ -17,7 +18,7 @@ namespace Galactic_Colors_Control_Server.Commands public void Execute(string[] args, Socket soc, bool server = false) { - Utilities.ConsoleWrite(Program.clients.Count + "/" + Program.config.size); + Utilities.Return(Program.clients.Count + "/" + Program.config.size, soc, server); } } } diff --git a/Galactic Colors Control Server/Commands/KickCommand.cs b/Galactic Colors Control Server/Commands/Client/KickCommand.cs similarity index 68% rename from Galactic Colors Control Server/Commands/KickCommand.cs rename to Galactic Colors Control Server/Commands/Client/KickCommand.cs index 2c3e0f7..58d1256 100644 --- a/Galactic Colors Control Server/Commands/KickCommand.cs +++ b/Galactic Colors Control Server/Commands/Client/KickCommand.cs @@ -6,11 +6,12 @@ using System.Net.Sockets; namespace Galactic_Colors_Control_Server.Commands { - public class KickCommand : ICommand + public class ClientKickCommand : ICommand { public string Name { get { return "kick"; } } public string DescText { get { return "Kicks selected client."; } } - public string HelpText { get { return "Use /kick [username] to kick client from server."; } } + public string HelpText { get { return "Use /client kick [username] to kick client from server."; } } + public Manager.CommandGroup Group { get { return Manager.CommandGroup.client; } } public bool IsServer { get { return true; } } public bool IsClient { get { return false; } } public bool IsClientSide { get { return false; } } @@ -23,15 +24,15 @@ namespace Galactic_Colors_Control_Server.Commands Socket target = null; foreach(Socket client in Program.clients.Keys) { - if(Utilities.GetName(client) == args[1]) { target = client; } + if(Utilities.GetName(client) == args[2]) { target = client; } } if (target != null) { - Logger.Write(args[1] + " was kick by server.", Logger.logType.info); + Logger.Write(args[2] + " was kick by server.", Logger.logType.info); if (args.Length > 2) { - Utilities.Send(target, "/kick " + args[2], Common.dataType.message); - Logger.Write("because" + args[1], Logger.logType.debug); + Utilities.Send(target, "/kick " + args[3], Common.dataType.message); + Logger.Write("because" + args[2], Logger.logType.debug); } else { Utilities.Send(target, "/kick", Common.dataType.message); @@ -39,7 +40,7 @@ namespace Galactic_Colors_Control_Server.Commands } else { - Utilities.Return("Can't find " + args[1], soc, server); + Utilities.Return("Can't find " + args[2], soc, server); } } } diff --git a/Galactic Colors Control Server/Commands/ListCommand.cs b/Galactic Colors Control Server/Commands/Client/ListCommand.cs similarity index 70% rename from Galactic Colors Control Server/Commands/ListCommand.cs rename to Galactic Colors Control Server/Commands/Client/ListCommand.cs index 244fa6a..2b97c76 100644 --- a/Galactic Colors Control Server/Commands/ListCommand.cs +++ b/Galactic Colors Control Server/Commands/Client/ListCommand.cs @@ -3,13 +3,14 @@ using System.Net.Sockets; namespace Galactic_Colors_Control_Server.Commands { - public class ListCommand : ICommand + public class ClientListCommand : 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 string HelpText { get { return "Use /client list to display all connected client username or IP."; } } + public Manager.CommandGroup Group { get { return Manager.CommandGroup.client; } } public bool IsServer { get { return true; } } - public bool IsClient { get { return false; } } + public bool IsClient { get { return true; } } public bool IsClientSide { get { return false; } } public bool IsNoConnect { get { return false; } } public int minArgs { get { return 0; } } @@ -23,7 +24,7 @@ namespace Galactic_Colors_Control_Server.Commands text += (Utilities.GetName(socket) + ", "); } text = text.Remove(text.Length - 2, 2); - Utilities.ConsoleWrite(text); + Utilities.Return(text, soc, server); } } } diff --git a/Galactic Colors Control Server/Commands/Client/StatusCommand.cs b/Galactic Colors Control Server/Commands/Client/StatusCommand.cs new file mode 100644 index 0000000..e6a3271 --- /dev/null +++ b/Galactic Colors Control Server/Commands/Client/StatusCommand.cs @@ -0,0 +1,45 @@ +using Galactic_Colors_Control_Common; +using System; +using System.Net; +using System.Net.Sockets; + +namespace Galactic_Colors_Control_Server.Commands +{ + public class ClientStatusCommand : ICommand + { + public string Name { get { return "status"; } } + public string DescText { get { return "Get client status."; } } + public string HelpText { get { return "Use /client status [username] to show client status."; } } + public Manager.CommandGroup Group { get { return Manager.CommandGroup.client; } } + public bool IsServer { get { return true; } } + public bool IsClient { get { return false; } } + public bool IsClientSide { get { return false; } } + public bool IsNoConnect { get { return true; } } + public int minArgs { get { return 1; } } + public int maxArgs { get { return 1; } } + + public void Execute(string[] args, Socket soc, bool server = false) + { + Socket target = null; + foreach (Socket client in Program.clients.Keys) + { + if (Utilities.GetName(client) == args[2]) { target = client; } + } + if (target != null) + { + string text = ""; + text += ("Name : " + Utilities.GetName(target) + Environment.NewLine); + text += ("IP : " + ((IPEndPoint)target.LocalEndPoint).Address.ToString() + Environment.NewLine); + if(Program.clients[target].party != null) + { + text += ("Party : " + Program.clients[target].party + Environment.NewLine); + } + Utilities.ConsoleWrite(text); + } + else + { + Utilities.Return("Can't find " + args[2], soc, server); + } + } + } +} diff --git a/Galactic Colors Control Server/Commands/ConnectCommand.cs b/Galactic Colors Control Server/Commands/ConnectCommand.cs index a23009c..8de0284 100644 --- a/Galactic Colors Control Server/Commands/ConnectCommand.cs +++ b/Galactic Colors Control Server/Commands/ConnectCommand.cs @@ -10,6 +10,7 @@ namespace Galactic_Colors_Control_Server.Commands public string Name { get { return "connect"; } } public string DescText { get { return "Gets an username."; } } public string HelpText { get { return "Use /connect [username] to start identification"; } } + public Manager.CommandGroup Group { get { return Manager.CommandGroup.root; } } public bool IsServer { get { return false; } } public bool IsClient { get { return true; } } public bool IsClientSide { get { return false; } } @@ -23,7 +24,7 @@ namespace Galactic_Colors_Control_Server.Commands { Logger.Write("Identifiaction request from " + Utilities.GetName(soc), Logger.logType.debug); bool allreadyconnected = false; - foreach(Data client in Program.clients.Values) + foreach(Client client in Program.clients.Values) { if(client.pseudo == args[1]) { allreadyconnected = true; break; } } diff --git a/Galactic Colors Control Server/Commands/ExitCommand.cs b/Galactic Colors Control Server/Commands/ExitCommand.cs index 7c9e617..cea265e 100644 --- a/Galactic Colors Control Server/Commands/ExitCommand.cs +++ b/Galactic Colors Control Server/Commands/ExitCommand.cs @@ -7,9 +7,10 @@ namespace Galactic_Colors_Control_Server.Commands public class ExitCommand : ICommand { public string Name { get { return "exit"; } } - public string DescText { get { return "Leave the program."; } } + public string DescText { get { return "Leave the server."; } } public string HelpText { get { return "Use /exit to stop actual program."; } } - public bool IsServer { get { return true; } } + public Manager.CommandGroup Group { get { return Manager.CommandGroup.root; } } + public bool IsServer { get { return false; } } public bool IsClient { get { return true; } } public bool IsClientSide { get { return false; } } public bool IsNoConnect { get { return true; } } @@ -18,22 +19,14 @@ namespace Galactic_Colors_Control_Server.Commands public void Execute(string[] args, Socket soc, bool server = false) { - if (server) - { - Program._run = false; - Utilities.ConsoleWrite("Exit server"); - } - else - { - soc.Shutdown(SocketShutdown.Both); - Logger.Write("Client disconnected from " + Utilities.GetName(soc), Logger.logType.info); - string username = Utilities.GetName(soc); - bool connected = Program.clients[soc].status != -1; - soc.Close(); - Program.clients.Remove(soc); - if (connected) { Utilities.Broadcast(username + " leave the server", Common.dataType.message); } - Logger.Write("Size: " + Program.clients.Count + "/" + Program.config.size, Logger.logType.debug); - } + soc.Shutdown(SocketShutdown.Both); + Logger.Write("Client disconnected from " + Utilities.GetName(soc), Logger.logType.info); + string username = Utilities.GetName(soc); + bool connected = Program.clients[soc].status != -1; + soc.Close(); + Program.clients.Remove(soc); + if (connected) { Utilities.Broadcast(username + " leave the server", Common.dataType.message); } + Logger.Write("Size: " + Program.clients.Count + "/" + Program.config.size, Logger.logType.debug); } } } diff --git a/Galactic Colors Control Server/Commands/HelpCommand.cs b/Galactic Colors Control Server/Commands/HelpCommand.cs index 0e8a419..1d5ffbe 100644 --- a/Galactic Colors Control Server/Commands/HelpCommand.cs +++ b/Galactic Colors Control Server/Commands/HelpCommand.cs @@ -10,51 +10,60 @@ namespace Galactic_Colors_Control_Server.Commands public string Name { get { return "help"; } } public string DescText { get { return "Shows the help."; } } public string HelpText { get { return "Use /help [command] to display command help."; } } + public Manager.CommandGroup Group { get { return Manager.CommandGroup.root; } } public bool IsServer { get { return true; } } public bool IsClient { get { return true; } } public bool IsClientSide { get { return false; } } public bool IsNoConnect { get { return false; } } public int minArgs { get { return 0; } } - public int maxArgs { get { return 1; } } + public int maxArgs { get { return 2; } } public void Execute(string[] args, Socket soc, bool server = false) { if(args.Length == 1) { - List list = new List(); int maxLen = 0; - foreach (string com in Manager.commands.Keys) + List list = new List(); + foreach (ICommand com in Manager.commands) { - if(Manager.CanAccess(Manager.commands[com], soc, server)) + if(Manager.CanAccess(com, soc, server)) { list.Add(com); - if(com.Length > maxLen) { maxLen = com.Length; } + if(com.Name.Length + (com.Group == 0 ? 0 : 4) > maxLen) { maxLen = com.Name.Length + (com.Group == 0 ? 0 : 4); } } } - list.Sort(); + list.Sort((x,y) => x.Group.CompareTo(y.Group)); string text = "Use /help [command] for more informations." + Environment.NewLine + "Available commands:" + Environment.NewLine; - foreach (var key in list) + Manager.CommandGroup actualGroup = 0; + foreach (ICommand com in list) { - text += (" " + key + new string(' ', maxLen - key.Length) + " : " + Manager.commands[key].DescText + Environment.NewLine); + if(com.Group != actualGroup) + { + text += (Environment.NewLine + " " + com.Group.ToString() + Environment.NewLine); + actualGroup = com.Group; + } + text += (" " + (com.Group != 0 ? new string(' ',4) : "") + com.Name + new string(' ', maxLen - com.Name.Length - (com.Group == 0 ? 0 : 4)) + " : " + com.DescText + Environment.NewLine); } Utilities.Return(text, soc, server); } else { - if (Manager.commands.ContainsKey(args[1])) + ICommand command = null; + args = args.Skip(1).ToArray(); + if (Manager.TryGetCommand(args, ref command)) { - if (Manager.CanAccess(Manager.commands[args[1]], soc, server)) + if (Manager.CanAccess(command, soc, server)) { - Utilities.Return(Manager.commands[args[1]].HelpText, soc, server); + Utilities.Return(command.HelpText, soc, server); } else { - Utilities.Return("Any help for " + args[1], soc, server); + Utilities.Return("Any help for " + Manager.CommandToString(args), soc, server); } } else { - Utilities.Return("Any help for " + args[1], soc, server); + Utilities.Return("Any help for " + Manager.CommandToString(args), soc, server); } } } diff --git a/Galactic Colors Control Server/Commands/ICommand.cs b/Galactic Colors Control Server/Commands/ICommand.cs index 63cb3c8..d7fbffb 100644 --- a/Galactic Colors Control Server/Commands/ICommand.cs +++ b/Galactic Colors Control Server/Commands/ICommand.cs @@ -7,6 +7,7 @@ namespace Galactic_Colors_Control_Server.Commands string Name { get; } string DescText { get; } string HelpText { get; } + Manager.CommandGroup Group { get; } bool IsServer { get; } bool IsClient { get; } bool IsClientSide { get; } diff --git a/Galactic Colors Control Server/Commands/LogLevelCommand.cs b/Galactic Colors Control Server/Commands/LogLevelCommand.cs index 87b3055..9244ba4 100644 --- a/Galactic Colors Control Server/Commands/LogLevelCommand.cs +++ b/Galactic Colors Control Server/Commands/LogLevelCommand.cs @@ -8,6 +8,7 @@ namespace Galactic_Colors_Control_Server.Commands public string Name { get { return "loglevel"; } } public string DescText { get { return "Change console loglevel."; } } public string HelpText { get { return "Use /loglevel [loglevel] to change Loglevel."; } } + public Manager.CommandGroup Group { get { return Manager.CommandGroup.root; } } public bool IsServer { get { return true; } } public bool IsClient { get { return false; } } public bool IsClientSide { get { return true; } } diff --git a/Galactic Colors Control Server/Commands/Manager.cs b/Galactic Colors Control Server/Commands/Manager.cs index aaa773f..f914e69 100644 --- a/Galactic Colors Control Server/Commands/Manager.cs +++ b/Galactic Colors Control Server/Commands/Manager.cs @@ -6,9 +6,10 @@ using System.Reflection; namespace Galactic_Colors_Control_Server.Commands { - class Manager + public class Manager { - public static Dictionary commands { get; private set; } = new Dictionary(); + public static List commands { get; private set; } = new List(); + public enum CommandGroup { root, server, party, client} /// /// Find all ICommand and add them to commands @@ -19,8 +20,8 @@ namespace Galactic_Colors_Control_Server.Commands IEnumerable coms = Assembly.GetExecutingAssembly().GetTypes().Where(x => x.GetInterfaces().Contains(typeof(ICommand)) && x.GetConstructor(Type.EmptyTypes) != null).Select(x => Activator.CreateInstance(x) as ICommand); foreach (ICommand com in coms) { - commands.Add(com.Name, com); - Logger.Write("Added command " + com.GetType().Name, Logger.logType.debug); + commands.Add(com); + Logger.Write("Added command " + com.Group.ToString() + " " + com.Name, Logger.logType.debug); } } @@ -32,12 +33,12 @@ namespace Galactic_Colors_Control_Server.Commands /// Is server? public static void Execute(string[] args, Socket soc = null, bool server = false) { - if (commands.ContainsKey(args[0])) + ICommand command = null; + if (TryGetCommand(args, ref command)) { - ICommand command = commands[args[0]]; if (CanAccess(command, soc, server)) { - if (command.IsClientSide) + if (!server && command.IsClientSide) { Utilities.Return("It's a client side command", soc, server); } @@ -45,30 +46,85 @@ namespace Galactic_Colors_Control_Server.Commands { if (args.Length > command.minArgs) { - if (args.Length - 1 <= command.maxArgs) + if (args.Length - (command.Group == 0 ? 1 : 2) <= command.maxArgs) { command.Execute(args, soc, server); } else { - Utilities.Return("Command " + command.Name + " require at most " + command.minArgs + " argument(s).", soc, server); + Utilities.Return("Command " + CommandToString(command) + " require at most " + command.minArgs + " argument(s).", soc, server); } } else { - Utilities.Return("Command " + command.Name + " require at least " + command.minArgs + " argument(s).", soc, server); + Utilities.Return("Command " + CommandToString(command) + " require at least " + command.minArgs + " argument(s).", soc, server); } } } else { - Utilities.Return("Unknown command : " + args[0], soc, server); + Utilities.Return("Unknown command : " + CommandToString(args), soc, server); } } else { - Utilities.Return("Unknown command : " + args[0], soc, server); + Utilities.Return("Unknown command : " + CommandToString(args), soc, server); + } + } + + public static string CommandToString(ICommand command) + { + string text = ""; + if(command.Group != 0) { text += (command.Group.ToString() + " "); } + text += command.Name; + return text; + } + + public static string CommandToString(string[] args) + { + if (args.Length > 0) + { + string text = ""; + foreach(string arg in args) + { + text += (arg + " "); + } + return text; + } + else + { + return null; + } + } + + public static bool TryGetCommand(string[] args, ref ICommand command) + { + if (args.Length > 0) + { + List groups = Enum.GetNames(typeof(CommandGroup)).ToList(); + CommandGroup group = 0; + if (groups.Contains(args[0])) + { + if (args.Length > 1) + { + group = (CommandGroup)Enum.Parse(typeof(CommandGroup), args[0]); + } + } + IEnumerable coms = commands.Where(p => (p.Name == args[group == 0 ? 0 : 1] && p.Group == group)); + if (coms.Count() == 1) + { + command = coms.First(); + return true; + } + else + { + return false; + } + } + else + { + return false; } } diff --git a/Galactic Colors Control Server/Commands/PingCommand.cs b/Galactic Colors Control Server/Commands/PingCommand.cs index 3938c37..6f1ed09 100644 --- a/Galactic Colors Control Server/Commands/PingCommand.cs +++ b/Galactic Colors Control Server/Commands/PingCommand.cs @@ -7,6 +7,7 @@ namespace Galactic_Colors_Control_Server.Commands public string Name { get { return "ping"; } } public string DescText { get { return "Clears the console screen."; } } public string HelpText { get { return "Use /ping to display our ping."; } } + public Manager.CommandGroup Group { get { return Manager.CommandGroup.root; } } public bool IsServer { get { return false; } } public bool IsClient { get { return true; } } public bool IsClientSide { get { return true; } } diff --git a/Galactic Colors Control Server/Commands/CloseCommand.cs b/Galactic Colors Control Server/Commands/Server/ServerCloseCommand.cs similarity index 69% rename from Galactic Colors Control Server/Commands/CloseCommand.cs rename to Galactic Colors Control Server/Commands/Server/ServerCloseCommand.cs index 9129e77..f861576 100644 --- a/Galactic Colors Control Server/Commands/CloseCommand.cs +++ b/Galactic Colors Control Server/Commands/Server/ServerCloseCommand.cs @@ -3,17 +3,18 @@ using System.Net.Sockets; namespace Galactic_Colors_Control_Server.Commands { - public class CloseCommand : ICommand + public class ServerCloseCommand : ICommand { public string Name { get { return "close"; } } - public string DescText { get { return "Closes server from connections."; } } - public string HelpText { get { return "Use /close to stop connection process"; } } + public string DescText { get { return "Close server."; } } + public string HelpText { get { return "Use /server close to close server for connections"; } } + public Manager.CommandGroup Group { get { return Manager.CommandGroup.server; } } public bool IsServer { get { return true; } } public bool IsClient { get { return false; } } public bool IsClientSide { get { return false; } } public bool IsNoConnect { get { return false; } } public int minArgs { get { return 0; } } - public int maxArgs { get { return 0; } } + public int maxArgs { get { return 1; } } public void Execute(string[] args, Socket soc, bool server = false) { diff --git a/Galactic Colors Control Server/Commands/OpenCommand.cs b/Galactic Colors Control Server/Commands/Server/ServerOpenCommand.cs similarity index 69% rename from Galactic Colors Control Server/Commands/OpenCommand.cs rename to Galactic Colors Control Server/Commands/Server/ServerOpenCommand.cs index 3eee375..fad8f5c 100644 --- a/Galactic Colors Control Server/Commands/OpenCommand.cs +++ b/Galactic Colors Control Server/Commands/Server/ServerOpenCommand.cs @@ -3,17 +3,18 @@ using System.Net.Sockets; namespace Galactic_Colors_Control_Server.Commands { - public class OpenCommand : ICommand + public class ServerOpenCommand : ICommand { public string Name { get { return "open"; } } - public string DescText { get { return "Opens server for connections."; } } - public string HelpText { get { return "Use /open to restart connection process"; } } + public string DescText { get { return "Open server."; } } + public string HelpText { get { return "Use /server open to open server for connections"; } } + public Manager.CommandGroup Group { get { return Manager.CommandGroup.server; } } public bool IsServer { get { return true; } } public bool IsClient { get { return false; } } public bool IsClientSide { get { return false; } } public bool IsNoConnect { get { return false; } } public int minArgs { get { return 0; } } - public int maxArgs { get { return 0; } } + public int maxArgs { get { return 1; } } public void Execute(string[] args, Socket soc, bool server = false) { diff --git a/Galactic Colors Control Server/Commands/StatusCommand.cs b/Galactic Colors Control Server/Commands/Server/ServerStatusCommand.cs similarity index 54% rename from Galactic Colors Control Server/Commands/StatusCommand.cs rename to Galactic Colors Control Server/Commands/Server/ServerStatusCommand.cs index 57fcd7a..a7ecc9e 100644 --- a/Galactic Colors Control Server/Commands/StatusCommand.cs +++ b/Galactic Colors Control Server/Commands/Server/ServerStatusCommand.cs @@ -3,11 +3,12 @@ using System.Net.Sockets; namespace Galactic_Colors_Control_Server.Commands { - public class StatusCommand : ICommand + public class ServerStatusCommand : ICommand { public string Name { get { return "status"; } } public string DescText { get { return "Shows server status."; } } - public string HelpText { get { return "Use /status to display server actual status."; } } + public string HelpText { get { return "Use /server status to display server actual status."; } } + public Manager.CommandGroup Group { get { return Manager.CommandGroup.server; } } public bool IsServer { get { return true; } } public bool IsClient { get { return false; } } public bool IsClientSide { get { return false; } } @@ -19,11 +20,14 @@ namespace Galactic_Colors_Control_Server.Commands { if (Program._open) { - Utilities.ConsoleWrite("Server open"); + Utilities.ConsoleWrite("Server : open", ConsoleColor.Green); } - else { - Utilities.ConsoleWrite("Server close"); + else + { + Utilities.ConsoleWrite("Server : close", ConsoleColor.Red); } + Utilities.ConsoleWrite("Clients : " + Program.clients.Count + "/" + Program.config.size); + Utilities.ConsoleWrite("Parties : " + Program.parties.Count); } } } diff --git a/Galactic Colors Control Server/Commands/TimeCommand.cs b/Galactic Colors Control Server/Commands/TimeCommand.cs index 98d3a00..fd307f7 100644 --- a/Galactic Colors Control Server/Commands/TimeCommand.cs +++ b/Galactic Colors Control Server/Commands/TimeCommand.cs @@ -8,6 +8,7 @@ namespace Galactic_Colors_Control_Server.Commands public string Name { get { return "time"; } } public string DescText { get { return "Gives server time."; } } public string HelpText { get { return "Use /time to display server time. (format is server dependent)"; } } + public Manager.CommandGroup Group { get { return Manager.CommandGroup.root; } } public bool IsServer { get { return true; } } public bool IsClient { get { return true; } } public bool IsClientSide { get { return false; } } diff --git a/Galactic Colors Control Server/Data.cs b/Galactic Colors Control Server/Data.cs deleted file mode 100644 index 587c7a5..0000000 --- a/Galactic Colors Control Server/Data.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Net.Sockets; - -namespace Galactic_Colors_Control_Server -{ - public class Data - { - public int id; - public int status = -1; - public string pseudo = ""; - } -} diff --git a/Galactic Colors Control Server/Galactic Colors Control Server.csproj b/Galactic Colors Control Server/Galactic Colors Control Server.csproj index 5fab29b..d1fdaba 100644 --- a/Galactic Colors Control Server/Galactic Colors Control Server.csproj +++ b/Galactic Colors Control Server/Galactic Colors Control Server.csproj @@ -56,24 +56,27 @@ Properties\AssemblyInfoCommon.cs + + - + - + - - + + - - + + + - + @@ -103,6 +106,9 @@ Galactic Colors Control Common + + +