Fix save world issue
This commit is contained in:
parent
b0a678710c
commit
c090d9a9f6
2 changed files with 11 additions and 3 deletions
|
|
@ -94,6 +94,7 @@ namespace TShockAPI
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
|
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
Log.Initialize(Path.Combine(SavePath, "log.txt"), LogLevel.All, false);
|
Log.Initialize(Path.Combine(SavePath, "log.txt"), LogLevel.All, false);
|
||||||
#else
|
#else
|
||||||
|
|
@ -131,10 +132,10 @@ namespace TShockAPI
|
||||||
"';Pwd='" + Config.MySqlPassword + "';";
|
"';Pwd='" + Config.MySqlPassword + "';";
|
||||||
DB.Open();
|
DB.Open();
|
||||||
}
|
}
|
||||||
catch(MySqlException ex)
|
catch (MySqlException ex)
|
||||||
{
|
{
|
||||||
Log.Error(ex.ToString());
|
Log.Error(ex.ToString());
|
||||||
throw new Exception("MySql not setup correctly");
|
throw new Exception("MySql not setup correctly");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,14 @@ namespace TShockAPI
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void SaveWorld()
|
public static void SaveWorld()
|
||||||
{
|
{
|
||||||
WorldGen.RealsaveWorld();
|
try
|
||||||
|
{
|
||||||
|
WorldGen.RealsaveWorld();
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
WorldGen.saveWorld();
|
||||||
|
}
|
||||||
|
|
||||||
Broadcast("World saved.", Color.Yellow);
|
Broadcast("World saved.", Color.Yellow);
|
||||||
Log.Info(string.Format("World saved at ({0})", Main.worldPathName));
|
Log.Info(string.Format("World saved at ({0})", Main.worldPathName));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue