mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-18 03:39:04 -04:00
Change backedup to ChangedSinceBackup and invert logic for simplicity
This commit is contained in:
parent
80de760878
commit
abbfb2c01b
@ -91,7 +91,6 @@ 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.IsMuseum = true;
|
||||
|
||||
Level.LoadMetadata(lvl);
|
||||
|
@ -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) {
|
||||
|
@ -61,6 +61,7 @@ namespace MCGalaxy {
|
||||
internal AABB[] blockAABBs = new AABB[Block.ExtendedCount];
|
||||
|
||||
public ushort Width, Height, Length;
|
||||
/// <summary> Whether this level should be treated as a readonly museum </summary>
|
||||
public bool IsMuseum;
|
||||
|
||||
public int ReloadThreshold {
|
||||
@ -77,6 +78,7 @@ namespace MCGalaxy {
|
||||
public bool Changed;
|
||||
/// <summary> Whether block changes made on this level should be saved to the BlockDB and .lvl files. </summary>
|
||||
public bool SaveChanges = true;
|
||||
public bool ChangedSinceBackup;
|
||||
|
||||
/// <summary> Whether players on this level sees server-wide chat. </summary>
|
||||
public bool SeesServerWideChat { get { return Config.ServerWideChat && Server.Config.ServerWideChat; } }
|
||||
@ -87,7 +89,6 @@ namespace MCGalaxy {
|
||||
|
||||
public List<UndoPos> UndoBuffer = new List<UndoPos>();
|
||||
public VolatileArray<Zone> Zones = new VolatileArray<Zone>();
|
||||
public bool backedup;
|
||||
public BlockDB BlockDB;
|
||||
public LevelAccessController VisitAccess, BuildAccess;
|
||||
|
||||
|
@ -253,7 +253,7 @@ namespace MCGalaxy {
|
||||
/// <param name="backup"> Specific name of the backup, or "" to automatically pick a name. </param>
|
||||
/// <returns> The name of the backup, or null if no backup was saved. </returns>
|
||||
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);
|
||||
|
||||
|
@ -417,7 +417,7 @@ namespace MCGalaxy {
|
||||
lvl.SaveChanges = false;
|
||||
}
|
||||
|
||||
res.backedup = true;
|
||||
res.ChangedSinceBackup = false;
|
||||
Level.LoadMetadata(res);
|
||||
BotsFile.Load(res);
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user