This commit is contained in:
39
Program.cs
39
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<AyConfig>(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");
|
||||
|
||||
@@ -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\\"
|
||||
}
|
||||
11
config.json
11
config.json
@@ -1 +1,10 @@
|
||||
{"AllowScheduleConflicts":true,"Test":"AyaNova server "}
|
||||
{
|
||||
"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\\"
|
||||
}
|
||||
@@ -6,11 +6,12 @@
|
||||
<RootNamespace>raven_launcher</RootNamespace>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<ApplicationIcon>ayanova.ico</ApplicationIcon>
|
||||
<AssemblyName>ayanova-launcher</AssemblyName>
|
||||
<ApplicationIcon>ayanova.ico</ApplicationIcon>
|
||||
<AssemblyName>ayanova-launcher</AssemblyName>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="appsettings.json">
|
||||
<Content Include="config.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user