diff --git a/MCGalaxy/Commands/World/CmdMuseum.cs b/MCGalaxy/Commands/World/CmdMuseum.cs index 89ca32e80..be29e82aa 100644 --- a/MCGalaxy/Commands/World/CmdMuseum.cs +++ b/MCGalaxy/Commands/World/CmdMuseum.cs @@ -90,8 +90,7 @@ namespace MCGalaxy.Commands.World { static void JoinMuseum(Player p, string formattedMuseumName, string mapName, string path) { Level lvl = IMapImporter.GetFor(path).Read(path, formattedMuseumName, false); - lvl.MapName = mapName; - lvl.backedup = true; + lvl.MapName = mapName; lvl.IsMuseum = true; Level.LoadMetadata(lvl); diff --git a/MCGalaxy/Levels/Level.Blocks.cs b/MCGalaxy/Levels/Level.Blocks.cs index 537d61eba..0e49ec6b8 100644 --- a/MCGalaxy/Levels/Level.Blocks.cs +++ b/MCGalaxy/Levels/Level.Blocks.cs @@ -342,8 +342,8 @@ namespace MCGalaxy { errorLocation = "Adding physics"; if (physics > 0 && ActivatesPhysics(block)) AddCheck(PosToInt(x, y, z)); - Changed = true; - backedup = false; + Changed = true; + ChangedSinceBackup = true; return Block.VisuallyEquals(old, block) ? ChangeResult.VisuallySame : ChangeResult.Modified; } catch (Exception e) { diff --git a/MCGalaxy/Levels/Level.Fields.cs b/MCGalaxy/Levels/Level.Fields.cs index 815d47c91..2bacc98a4 100644 --- a/MCGalaxy/Levels/Level.Fields.cs +++ b/MCGalaxy/Levels/Level.Fields.cs @@ -61,6 +61,7 @@ namespace MCGalaxy { internal AABB[] blockAABBs = new AABB[Block.ExtendedCount]; public ushort Width, Height, Length; + /// Whether this level should be treated as a readonly museum public bool IsMuseum; public int ReloadThreshold { @@ -77,6 +78,7 @@ namespace MCGalaxy { public bool Changed; /// Whether block changes made on this level should be saved to the BlockDB and .lvl files. public bool SaveChanges = true; + public bool ChangedSinceBackup; /// Whether players on this level sees server-wide chat. public bool SeesServerWideChat { get { return Config.ServerWideChat && Server.Config.ServerWideChat; } } @@ -87,7 +89,6 @@ namespace MCGalaxy { public List UndoBuffer = new List(); public VolatileArray Zones = new VolatileArray(); - public bool backedup; public BlockDB BlockDB; public LevelAccessController VisitAccess, BuildAccess; diff --git a/MCGalaxy/Levels/Level.cs b/MCGalaxy/Levels/Level.cs index 451108c11..5a04870ca 100644 --- a/MCGalaxy/Levels/Level.cs +++ b/MCGalaxy/Levels/Level.cs @@ -253,7 +253,7 @@ namespace MCGalaxy { /// Specific name of the backup, or "" to automatically pick a name. /// The name of the backup, or null if no backup was saved. public string Backup(bool force = false, string backup = "") { - if (!backedup || force) { + if (ChangedSinceBackup || force) { string backupPath = LevelInfo.BackupBasePath(name); if (!Directory.Exists(backupPath)) Directory.CreateDirectory(backupPath); int next = LevelInfo.LatestBackup(name) + 1; @@ -283,7 +283,6 @@ namespace MCGalaxy { try { Level lvl = IMapImporter.GetFor(path).Read(path, name, true); - lvl.backedup = true; LoadMetadata(lvl); BotsFile.Load(lvl); diff --git a/MCGalaxy/Levels/LevelActions.cs b/MCGalaxy/Levels/LevelActions.cs index cef2ef504..670347607 100644 --- a/MCGalaxy/Levels/LevelActions.cs +++ b/MCGalaxy/Levels/LevelActions.cs @@ -417,7 +417,7 @@ namespace MCGalaxy { lvl.SaveChanges = false; } - res.backedup = true; + res.ChangedSinceBackup = false; Level.LoadMetadata(res); BotsFile.Load(res); diff --git a/MCGalaxy/Modules/Relay/Discord/DiscordApiClient.cs b/MCGalaxy/Modules/Relay/Discord/DiscordApiClient.cs index f0efcdcdd..2b08ca2d0 100644 --- a/MCGalaxy/Modules/Relay/Discord/DiscordApiClient.cs +++ b/MCGalaxy/Modules/Relay/Discord/DiscordApiClient.cs @@ -173,7 +173,7 @@ namespace MCGalaxy.Modules.Relay.Discord // 429 errors simply require retrying after sleeping for a bit if (Handle429(ex)) continue; - // If unable to reach Discord, don't spam error logs + // If unable to reach Discord at all, don't spam error logs if (ex.Status == WebExceptionStatus.NameResolutionFailure) { Logger.Log(LogType.Warning, "Error sending request to Discord API - " + ex.Message); return;