fix: Updated .NET and added some startup error handling

trying to get back in the groove
This commit is contained in:
Lako 2025-08-05 21:13:41 -04:00
parent 705802f49d
commit 1a3c64ae58
2 changed files with 14 additions and 2 deletions

View File

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>
<ItemGroup>

View File

@ -91,7 +91,8 @@ class Program
if (!File.Exists(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "/config"))
{
Console.WriteLine("[ERROR] A1Emu did not find a config file in the application's directory.");
Console.WriteLine("[ERROR] A1Emu did not find a config file in the application's directory. Please add one and relaunch.");
System.Environment.Exit(1);
}
try
@ -123,6 +124,17 @@ class Program
var con = new MySqlConnection(sqServer);
try
{
con.Open();
con.Close();
}
catch (MySqlException ex)
{
Console.WriteLine("[ERROR] A1Emu could not connect to the SQL server. Exception: " + ex.Message);
System.Environment.Exit(1);
}
//TODO - Generate a SQL DB. (Will probably be an external script or a manual README instruction)
//TODO - Truncate all the multiplayer tables whenever they get added.