Fix /server backup lite also saving level backups, fix going auto afk resetting idle time.

This commit is contained in:
UnknownShadow200 2016-09-05 14:53:00 +10:00
parent 35230bac70
commit 8844fa5166
3 changed files with 15 additions and 9 deletions

View File

@ -156,9 +156,9 @@ namespace MCGalaxy {
if (!Server.irc ||!IsConnected()) return;
string msg = null;
if (action == PlayerAction.AFK)
if (action == PlayerAction.AFK && !p.hidden)
msg = p.ColoredName + " %Sis AFK " + message;
else if (action == PlayerAction.UnAFK)
else if (action == PlayerAction.UnAFK && !p.hidden)
msg = p.ColoredName + " %Sis no longer AFK";
else if (action == PlayerAction.Joker)
msg = p.ColoredName + " %Sis now a &aJ&bo&ck&5e&9r%S";

View File

@ -60,8 +60,8 @@ namespace MCGalaxy {
if (group.commands.Contains("inbox") && Database.TableExists("Inbox" + name) ) {
//safe against SQL injections because no user input is given here
using (DataTable table = Database.Backend.GetAllRows("Inbox" + name, "*")) {
if (table.Rows.Count > 0)
SendMessage("You have &a" + table.Rows.Count + " %Smessages in /inbox");
if (table.Rows.Count > 0)
SendMessage("You have &a" + table.Rows.Count + " %Smessages in /inbox");
}
}
} catch {
@ -107,11 +107,12 @@ namespace MCGalaxy {
} else {
if (Moved()) LastAction = DateTime.UtcNow;
if (LastAction.AddMinutes(Server.afkminutes) < DateTime.UtcNow) {
if (name != null && !String.IsNullOrEmpty(name.Trim()) && !hidden) {
CmdAfk.ToggleAfk(this, "auto: Not moved for " + Server.afkminutes + " minutes");
AutoAfk = true;
}
DateTime lastAction = LastAction;
if (LastAction.AddMinutes(Server.afkminutes) < DateTime.UtcNow
&& !String.IsNullOrEmpty(name)) {
CmdAfk.ToggleAfk(this, "auto: Not moved for " + Server.afkminutes + " minutes");
AutoAfk = true;
LastAction = lastAction;
}
}
}

View File

@ -70,6 +70,9 @@ namespace MCGalaxy {
const string undo1 = "extra/undo/", undo2 = @"extra\undo\";
const string prev1 = "extra/undoPrevious/", prev2 = @"extra\undoPrevious\";
const string levelBackup1 = "levels/backups/", levelBackup2 = @"levels\backups\";
const string levelPrev1 = "levels/prev/", levelPrev2 = @"levels\prev\";
static List<Uri> GetAllFiles(DirectoryInfo dir, Uri baseUri, bool lite) {
List<Uri> list = new List<Uri>();
foreach (FileSystemInfo entry in dir.GetFileSystemInfos()) {
@ -77,6 +80,8 @@ namespace MCGalaxy {
string path = ((FileInfo)entry).FullName;
if (lite && (path.Contains(undo1) || path.Contains(undo2))) continue;
if (lite && (path.Contains(prev1) || path.Contains(prev2))) continue;
if (lite && (path.Contains(levelBackup1) || path.Contains(levelBackup2))) continue;
if (lite && (path.Contains(levelPrev1) || path.Contains(levelPrev2))) continue;
// Make a relative URI
Uri uri = baseUri.MakeRelativeUri(new Uri(path));