コード例 #1
0
ファイル: Program.cs プロジェクト: yusufakdag/CrossoutMarket
        static void Main(string[] args)
        {
            WebSettings.Settings.Load();
            WebSettings.Settings.Save(); // Saving defaults
            var url = "http://+:" + WebSettings.Settings.WebserverPort;

            CrossoutDataService.Initialize();

            Logger log = LogManager.GetCurrentClassLogger();

            var rootPath = RootPathProvider.GetRootPathStatic();

            log.Error($"RootPath: {rootPath}");
            log.Error($"SettingsPath: {WebSettings.Settings.FilePath}");

            using (WebApp.Start <Startup>(url))
            {
                Console.WriteLine("Running on {0}", url);
                string command = "";
                do
                {
                    Console.WriteLine("Enter save to save the config file");
                    Console.WriteLine("Enter load to load the config file");
                    Console.WriteLine("Enter exit to shut down the server");
                    command = Console.ReadLine();

                    if (command == "save")
                    {
                        Console.WriteLine("Saving config");
                        WebSettings.Settings.Save();
                    }
                    if (command == "load")
                    {
                        Console.WriteLine("Saving config");
                        WebSettings.Settings.Load();
                    }
                } while (command != "exit" && command != "quit");
            }
        }
コード例 #2
0
 public static string AbsolutePath(string relativePath)
 {
     return(System.IO.Path.Combine(RootPathProvider.GetRootPathStatic(), relativePath));
 }
コード例 #3
0
 public static bool ImageExists(string path)
 {
     return(File.Exists(System.IO.Path.Combine(RootPathProvider.GetRootPathStatic(), "img", "items", path)));
 }