diff --git a/A1Emu/A1Emu.csproj b/A1Emu/A1Emu.csproj index b0fc61e..8b7cc77 100644 --- a/A1Emu/A1Emu.csproj +++ b/A1Emu/A1Emu.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net9.0 diff --git a/A1Emu/Program.cs b/A1Emu/Program.cs index 47f637b..0dec86f 100644 --- a/A1Emu/Program.cs +++ b/A1Emu/Program.cs @@ -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.