Latest backup in /mi uses relative time now.

This commit is contained in:
UnknownShadow200 2016-08-24 12:42:00 +10:00
parent 060e48487d
commit 38eb620214
2 changed files with 6 additions and 4 deletions

View File

@ -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.");
}

View File

@ -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;
}
}
}