mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-17 11:18:55 -04:00
Fix rare case in which level blockdb is not saved after level is auto-saved.
This commit is contained in:
parent
1293736b4a
commit
30d99ccbd1
@ -104,7 +104,6 @@ namespace MCGalaxy.Games {
|
||||
} else {
|
||||
SendFreezeMessages();
|
||||
MessageAll("&bPlayers Frozen");
|
||||
mapon.countdowninprogress = true;
|
||||
gamestatus = CountdownGameStatus.InProgress;
|
||||
foreach (Player pl in players)
|
||||
pl.countdownsettemps = true;
|
||||
@ -239,7 +238,6 @@ namespace MCGalaxy.Games {
|
||||
Cuboid(maxX - 4, 4, 4, maxX - 4, 4, maxZ - 4, Block.air, mapon);
|
||||
|
||||
if (!freezemode) {
|
||||
mapon.countdowninprogress = true;
|
||||
gamestatus = CountdownGameStatus.InProgress;
|
||||
}
|
||||
}
|
||||
|
@ -91,11 +91,8 @@ namespace MCGalaxy
|
||||
public bool cancelsave1;
|
||||
public bool cancelunload;
|
||||
public bool changed;
|
||||
public bool physicschanged
|
||||
{
|
||||
get { return ListCheck.Count > 0; }
|
||||
}
|
||||
public bool countdowninprogress;
|
||||
public bool physicschanged { get { return ListCheck.Count > 0; } }
|
||||
|
||||
public bool ctfmode;
|
||||
public int currentUndo;
|
||||
public ushort Width, Height, Length;
|
||||
@ -401,10 +398,9 @@ namespace MCGalaxy
|
||||
}
|
||||
MovePlayersToMain();
|
||||
|
||||
if (changed && ShouldSaveChanges()) {
|
||||
Save(false, true);
|
||||
saveChanges();
|
||||
}
|
||||
if (changed && ShouldSaveChanges()) Save(false, true);
|
||||
if (ShouldSaveChanges()) saveChanges();
|
||||
|
||||
if (TntWarsGame.Find(this) != null)
|
||||
{
|
||||
foreach (TntWarsGame.player pl in TntWarsGame.Find(this).Players)
|
||||
@ -683,7 +679,11 @@ namespace MCGalaxy
|
||||
return false;
|
||||
}
|
||||
|
||||
public void saveChanges() { LevelDB.SaveBlockDB(this); }
|
||||
readonly object dbLock = new object();
|
||||
public void saveChanges() {
|
||||
lock (dbLock)
|
||||
LevelDB.SaveBlockDB(this);
|
||||
}
|
||||
|
||||
public List<Player> getPlayers() {
|
||||
Player[] players = PlayerInfo.Online.Items;
|
||||
|
Loading…
x
Reference in New Issue
Block a user