public App(string[] args) { try { Arguments CommandLine = new Arguments(args); Assembly a = Assembly.GetExecutingAssembly(); AssemblyName name = a.GetName(); xConsole.Title = "RemindMe Server Version " + name.Version; //Log = new Output(CommandLine["b"]); Log.Instance.WriteString(xConsole.Title + "\r\n", xCon.ConsoleColor.SkyBlueForte, true); if (!File.Exists(CommandLine["xmlFile"])) { Log.Instance.WriteError("xmlFile:(" + CommandLine["xmlFile"] + ") file not found."); return; } else if (!File.Exists(CommandLine["mpserver"])) { Log.Instance.WriteError("mpserver:(" + CommandLine["mpserver"] + ") file not found."); return; } else if (!File.Exists(CommandLine["config"])) { Log.Instance.WriteError("config:(" + CommandLine["config"] + ") file not found."); return; } ConfigFactory configFactory = new XMLConfigFactory(CommandLine["config"], true); Log.Instance.BotName = configFactory.GetBotName(); Log.Instance.WriteLine("CommandLine: {0}", string.Join(" ", args)); Log.Instance.WriteLine("Config File: {0}", CommandLine[@"config"]); RemBot = new BotDaemon(configFactory); _commands = new RMConsoleCommands(RemBot); AppInit = RemBot.InitializeBot(CommandLine["xmlFile"], CommandLine["mpserver"], CommandLine["autostart"]); } catch (Exception ex) { Log.Instance.WriteConsoleError("Startup Error", ex); } }
public RMConsoleCommands(BotDaemon bot) { _bot = bot; }