public void Start() { BigTextPrinter bigText = new BigTextPrinter(); Message[] messages = client.GetMessageBoardMessages(boardname); bigText.PrintBigText(boardname, ConsoleColor.Yellow); foreach (Message message in messages) { message.Print(); } newmessages.Start(); while (true) { string inp = Console.ReadLine(); if (inp == "quit") { newmessages.Abort(); break; } else { if (!client.SendMessage("msgboard::" + boardname, inp)) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("[Server]: Message send failiure!"); Console.ForegroundColor = ConsoleColor.White; } } } }
static void Main(string[] args) { Console.Title = "Quantum Link"; Console.ForegroundColor = ConsoleColor.White; Console.WriteLine("[Client]: Initializing"); help = new Help(); bigText = new BigTextPrinter(); client = new Client(); bool run_client = true; if (!client.Connect() && YesNoPrompt("The server is offline and will be online shortly. Would you like to quit quantum link?")) { Process.GetCurrentProcess().Kill(); } Console.Clear(); Console.WriteLine(); bigText.PrintRainbow("Quantum Link"); Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine(); Console.WriteLine("Client Version: " + version); Console.WriteLine("Server Version: " + client.runCommand("serverinfo\tversion")); Console.WriteLine("Connections: " + client.runCommand("serverinfo\tconnections")); Console.ForegroundColor = ConsoleColor.White; Console.WriteLine(); RunCommand("announcements week"); Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine("[Info]: Enter \"help\" for help."); Console.ForegroundColor = ConsoleColor.White; while (run_client) { Console.ForegroundColor = ConsoleColor.Cyan; if (client.LoggedIn) { Console.Write(client.runCommand("myinfo\tusername") + ">"); } else { Console.Write("Guest>"); } Console.ForegroundColor = ConsoleColor.White; string command = Console.ReadLine(); RunCommand(command); } }