Exemple #1
0
        /// <summary>
        ///     Performs initialization of the application, such as loading the HTTP server and modules
        /// </summary>
        public virtual void Startup()
        {
            bool isWhiteCoreExe = AppDomain.CurrentDomain.FriendlyName == "WhiteCore.exe" ||
                                  AppDomain.CurrentDomain.FriendlyName == "WhiteCore.vshost.exe";
            string configrun = BaseApplication.CheckConfigStamp(isWhiteCoreExe);

            if (configrun != "")
            {
                MainConsole.Instance.Info("Using the configuration of " + configrun);
            }

            PrintStartupLogo();

            MainConsole.Instance.Info("====================================================================");
            MainConsole.Instance.Info(
                string.Format("==================== Starting WhiteCore-Sim ({0}) ======================",
                              (IntPtr.Size == 4 ? "x86" : "x64")));
            MainConsole.Instance.Info("====================================================================");
            MainConsole.Instance.Info("[WhiteCore-Sim Startup]: Version : " + Version + "\n");
            MainConsole.Instance.Info("[WhiteCore-Sim Startup]: Git Base: " + VersionInfo.GitVersion + "\n");
            if (Environment.Is64BitOperatingSystem)
            {
                MainConsole.Instance.Info("[WhiteCore-Sim Startup]: Running on 64 bit architecture");
            }
            // get memory allocation
            Process proc = Process.GetCurrentProcess();

            MainConsole.Instance.Info("[WhiteCore-Sim Startup]: Allocated RAM " + proc.WorkingSet64);
            if (Utilities.IsLinuxOs)
            {
                using (PerformanceCounter pc = new PerformanceCounter("Mono Memory", "Total Physical Memory")) {
                    var bytes = pc.RawValue;
                    MainConsole.Instance.InfoFormat("[WhiteCore-Sim Startup]: Physical RAM (Mbytes): {0}", bytes / 1024000);
                }
            }

            SetUpHTTPServer();

            StartModules();

            //Has to be after Scene Manager startup
            AddPluginCommands();
        }
        /// <summary>
        ///     Performs initialization of the application, such as loading the HTTP server and modules
        /// </summary>
        public virtual void Startup()
        {
            bool isWhiteCoreExe = AppDomain.CurrentDomain.FriendlyName == "WhiteCore.exe" ||
                                  AppDomain.CurrentDomain.FriendlyName == "WhiteCore.vshost.exe";
            string configrun = BaseApplication.CheckConfigStamp(isWhiteCoreExe);

            if (configrun != "")
            {
                MainConsole.Instance.Info("Using the configuration of " + configrun);
            }

            PrintStartupLogo();

            MainConsole.Instance.InfoFormat("[Mini WhiteCore-Sim]: Starting Mini WhiteCore-Sim ({0})...",
                                            (IntPtr.Size == 4 ? "x86" : "x64"));
            MainConsole.Instance.Info("[Mini WhiteCore-Sim]: Version : " + Version + "\n");
            MainConsole.Instance.Info("[Mini WhiteCore-Sim]: Git Base: " + VersionInfo.GitVersion + "\n");
            MainConsole.Instance.Info("[Mini WhiteCore-Sim]: Startup completed in " +
                                      (DateTime.Now - StartupTime).TotalSeconds);
        }