コード例 #1
0
ファイル: Session.cs プロジェクト: sergeystoyan/FhrCliverHost
        public static void Start()
        {
            Log.Main.Inform("Version compiled: " + Cliver.Bot.Program.GetCustomizationCompiledTime().ToString());
            Log.Main.Inform("Command line parameters: " + string.Join("|", Environment.GetCommandLineArgs()));

            if (This != null)
            {
                throw new Exception("Previous session was not closed.");
            }
            new Session();
            if (This == null)
            {
                return;
            }
            BotCycle.Start();
        }
コード例 #2
0
ファイル: Session.cs プロジェクト: gilby125/CliverBot
        public static void Start()
        {
            Log.Initialize(Log.Mode.SESSIONS, Cliver.Bot.Properties.Log.Default.PreWorkDir, Cliver.Bot.Properties.Log.Default.WriteLog, Cliver.Bot.Properties.Log.Default.DeleteLogsOlderDays);
            Log.Main.Inform("Version compiled: " + Cliver.Bot.Program.GetCustomizationCompiledTime().ToString());
            Log.Main.Inform("Command line parameters: " + string.Join("|", Environment.GetCommandLineArgs()));

            if (This != null)
            {
                throw new Exception("Previous session was not closed.");
            }
            new Session();
            if (This == null)
            {
                return;
            }
            BotCycle.Start();
        }
コード例 #3
0
        public static void Start()
        {
            try
            {
                if (!Settings.Log.WriteLog)
                {
                    Log.DefaultLevel = Log.Level.NONE;
                }
                Log.Initialize(Log.Mode.FOLDER_PER_SESSION, new List <string> {
                    Settings.Log.PreWorkDir
                }, Settings.Log.DeleteLogsOlderDays);

                Log.Main.Inform("Version compiled: " + Program.GetCustomizationCompiledTime().ToString());
                Log.Main.Inform("Command line parameters: " + string.Join("|", Environment.GetCommandLineArgs()));

                if (This != null)
                {
                    throw new Exception("Previous session was not closed.");
                }
                Activator.Create <Session>(true);
                if (This == null)
                {
                    return;
                }
                BotCycle.Start();
                Session.State = SessionState.RUNNING;
                This.Storage.WriteState(SessionState.RUNNING, new { });
            }
            catch (ThreadAbortException)
            {
                Close();
                throw;
            }
            catch (Exception e)
            {
                Session.__ErrorClose(e, true);
            }
        }