From a3b686e2fc4569658e1cef75c9a489218306832e Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Fri, 26 Nov 2021 19:46:32 +0000 Subject: [PATCH] --- Program.cs | 39 +++------------------------------------ appsettings.json | 9 --------- config.json | 11 ++++++++++- raven-launcher.csproj | 7 ++++--- 4 files changed, 17 insertions(+), 49 deletions(-) delete mode 100644 appsettings.json diff --git a/Program.cs b/Program.cs index 23c325a..decf626 100644 --- a/Program.cs +++ b/Program.cs @@ -1,43 +1,10 @@ -global using System.Text.Json; -global using System.Text.Json.Serialization; - + // Prevent from ending if CTL+C is pressed. Console.TreatControlCAsInput = true; Console.WriteLine($"AyaNova server launcher {AyaNovaVersion.VersionString}"); +//================== LAUNCH AYANOVA SERVER ================== -AyConfig cfg = null; - -var ConfigFileName = @"config.json"; -var json = string.Empty; -bool FirstTime=false; -//Read configuration or create if not exist -if (File.Exists(ConfigFileName)) -{ - json = File.ReadAllText(ConfigFileName); - cfg = JsonSerializer.Deserialize(json); -} -else -{ - cfg = new AyConfig(); - FirstTime=true; -} - -if(FirstTime){ - Console.WriteLine("Configuration file not found; using default values"); -} -Console.WriteLine("Current configuration:"); - -//iterate / prompt for each value - - -//write configuration -cfg = new AyConfig(); -json = JsonSerializer.Serialize(cfg); -File.WriteAllText(ConfigFileName, json); - - - - +var AyaNovaProcess = System.Diagnostics.Process.Start(@"../AyaNova.exe"); Console.WriteLine("Press CTL-C keys to shut down AyaNova Server"); diff --git a/appsettings.json b/appsettings.json deleted file mode 100644 index bec7bbb..0000000 --- a/appsettings.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "AYANOVA_USE_URLS": "http://*:7575", - "AYANOVA_DB_CONNECTION":"Server=localhost;Username=postgres;Password=mypasswordforpostgres;Database=AyaNova;", - "AYANOVA_DEFAULT_TRANSLATION":"en", - "AYANOVA_BACKUP_PG_DUMP_PATH":"postgres\\bin\\", - "AYANOVA_FOLDER_USER_FILES":"%programdata\\ayanova\\userfiles", - "AYANOVA_FOLDER_BACKUP_FILES":"%programdata\\ayanova\\backupfiles", - "AYANOVA_LOG_PATH":"%programdata\\ayanova\\" -} \ No newline at end of file diff --git a/config.json b/config.json index e782ef7..f51a706 100644 --- a/config.json +++ b/config.json @@ -1 +1,10 @@ -{"AllowScheduleConflicts":true,"Test":"AyaNova server "} \ No newline at end of file +{ + "AYANOVA_USE_URLS": "http://*:7575", + "AYANOVA_DB_CONNECTION":"Server=localhost;Username=postgres;Password=mypasswordforpostgres;Database=AyaNova;", + "AYANOVA_DEFAULT_TRANSLATION":"en", + "AYANOVA_BACKUP_PG_DUMP_PATH":"postgres\\bin\\", + "AYANOVA_FOLDER_USER_FILES":"%programdata\\ayanova\\userfiles", + "AYANOVA_FOLDER_BACKUP_FILES":"%programdata\\ayanova\\backupfiles", + "AYANOVA_LOG_LEVEL": "Info", + "AYANOVA_LOG_PATH":"%programdata\\ayanova\\" +} \ No newline at end of file diff --git a/raven-launcher.csproj b/raven-launcher.csproj index 3b1b256..eefdbe2 100644 --- a/raven-launcher.csproj +++ b/raven-launcher.csproj @@ -6,11 +6,12 @@ raven_launcher enable enable - ayanova.ico - ayanova-launcher + ayanova.ico + ayanova-launcher + true - + Always