public static void PrintNoFormat(object message) { lock (_messages) { _messages.Add(message.ToString()); } TaskQueue.QueueMain(() => LogToFile(message.ToString())); }
public void StartCommandLoop() { //Logger.Log ("Command Executer initialized."); LoadCommands(); while (_server.Running) { try { ConsoleKeyInfo key = Console.ReadKey(true); if (key.Key == ConsoleKey.Backspace) { if (_input.Length > 0) { _input = _input.Remove(_input.Length - 1); } } else if (key.Key == ConsoleKey.Enter) { string tmpStr = _input; _input = string.Empty; TaskQueue.QueueMain(() => ExecuteCommand("_server_", tmpStr)); } else { _input += key.KeyChar; } Logger.InputStr = _input; } catch (Exception e) { Logger.LogError("Error in command loop."); } } }
public static void Print(object message, params object[] args) { //TaskQueue.QueueMain(()=>LogToFile (message.ToString())); lock (_messages) { _messages.Add(string.Format(message.ToString(), args)); } TaskQueue.QueueMain(() => LogToFile(string.Format(message.ToString(), args))); }