public NewCore(int port) { localhost = "http://+:" + port; logger = new NewMarketLogger("NewCore"); httpListener = new HttpListener(); containerStorage = new Dictionary <string, Tuple <object, System.Reflection.MethodInfo> >(); }
public void Init() { if (Log == null) { Log = new NewMarketLogger(this); } Log.Info("Initializing TMBot " + bot.DisplayName); logic = new Logic(this); protocol = new Protocol(this); logic.Log = Log; protocol.Log = Log; logic.Protocol = protocol; protocol.Logic = logic; WaitingForRestart = false; Tasking.Run(Delayer, botName); }
public bool ParseConfiguration() { useSeparateProcesses = ConfigObject.UseSeparateProcesses; mainLog = new Log(ConfigObject.MainLog, null, Log.LogLevel.Debug, Log.LogLevel.Debug); mongoLog = new NewMarketLogger(); for (int i = 0; i < ConfigObject.Bots.Length; i++) { Configuration.BotInfo info = ConfigObject.Bots[i]; if (ConfigObject.AutoStartAllBots || info.AutoStart) { mainLog.Info("Launching Bot " + info.DisplayName + "..."); } var v = new RunningBot(useSeparateProcesses, i, ConfigObject); botProcs.Add(v); } return(true); }
public Core(int port = 4345) { try { server = new HttpListener(); logger = new NewMarketLogger("Core"); server.Prefixes.Add($"http://+:{port}/"); Init(); VK.Init(); unstickeredCache = new EmptyStickeredDatabase(); unstickeredCache.LoadFromArray(File.ReadAllLines(Path.Combine("assets", "emptystickered.txt"))); logger.Nothing("Starting!"); ReloadConfig(); server.Start(); logger.Nothing("Started!"); Task.Run((Action)Listen); Task.Run((Action)BackgroundCheck); Task.Run((Action)UnstickeredDumper); //Task.Run((Action)DBHitProvider); } catch (Exception ex) { logger.Crash($"Message: {ex.Message}. Trace: {ex.StackTrace}"); } }