From 38eb620214a51f863074dc6f03503bd4ae8e83ad Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Wed, 24 Aug 2016 12:42:00 +1000 Subject: [PATCH] Latest backup in /mi uses relative time now. --- Commands/Information/CmdMapInfo.cs | 7 ++++--- Levels/LevelAccess.cs | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Commands/Information/CmdMapInfo.cs b/Commands/Information/CmdMapInfo.cs index 22c165497..79dd06602 100644 --- a/Commands/Information/CmdMapInfo.cs +++ b/Commands/Information/CmdMapInfo.cs @@ -65,9 +65,10 @@ namespace MCGalaxy.Commands { } if (Directory.Exists(Server.backupLocation + "/" + data.Name)) { - int latestBackup = Directory.GetDirectories(Server.backupLocation + "/" + data.Name).Length; - DateTime time = Directory.GetCreationTime(LevelInfo.BackupPath(data.Name, latestBackup.ToString())); - Player.Message(p, " Latest backup: &a{0} %Sat &a" + time.ToString("yyyy-MM-dd HH:mm:ss"), latestBackup); + int latest = Directory.GetDirectories(Server.backupLocation + "/" + data.Name).Length; + DateTime time = File.GetCreationTimeUtc(LevelInfo.BackupPath(data.Name, latest.ToString())); + TimeSpan delta = DateTime.UtcNow - time; + Player.Message(p, " Latest backup: &a{0} %S({1} ago)", latest, delta.Shorten()); } else { Player.Message(p, " No backups for this map exist yet."); } diff --git a/Levels/LevelAccess.cs b/Levels/LevelAccess.cs index 2af60a6d5..70fe33e92 100644 --- a/Levels/LevelAccess.cs +++ b/Levels/LevelAccess.cs @@ -86,8 +86,9 @@ namespace MCGalaxy { if (p.Rank > Max && !p.group.CanExecute(maxCmd)) { Group grp = Group.findPerm(Max); string grpName = grp == null ? "&f" + Max : grp.ColoredName; - Player.Message(p, "Only {2} and below may {1} in {0}.", name, action, grpName) return false; + Player.Message(p, "Only {2} and below may {1} in {0}.", name, action, grpName); return false; } + return true; } } }