mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-24 05:03:34 -04:00
Fix /server backup lite also saving level backups, fix going auto afk resetting idle time.
This commit is contained in:
parent
35230bac70
commit
8844fa5166
@ -156,9 +156,9 @@ namespace MCGalaxy {
|
|||||||
if (!Server.irc ||!IsConnected()) return;
|
if (!Server.irc ||!IsConnected()) return;
|
||||||
string msg = null;
|
string msg = null;
|
||||||
|
|
||||||
if (action == PlayerAction.AFK)
|
if (action == PlayerAction.AFK && !p.hidden)
|
||||||
msg = p.ColoredName + " %Sis AFK " + message;
|
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";
|
msg = p.ColoredName + " %Sis no longer AFK";
|
||||||
else if (action == PlayerAction.Joker)
|
else if (action == PlayerAction.Joker)
|
||||||
msg = p.ColoredName + " %Sis now a &aJ&bo&ck&5e&9r%S";
|
msg = p.ColoredName + " %Sis now a &aJ&bo&ck&5e&9r%S";
|
||||||
|
@ -60,8 +60,8 @@ namespace MCGalaxy {
|
|||||||
if (group.commands.Contains("inbox") && Database.TableExists("Inbox" + name) ) {
|
if (group.commands.Contains("inbox") && Database.TableExists("Inbox" + name) ) {
|
||||||
//safe against SQL injections because no user input is given here
|
//safe against SQL injections because no user input is given here
|
||||||
using (DataTable table = Database.Backend.GetAllRows("Inbox" + name, "*")) {
|
using (DataTable table = Database.Backend.GetAllRows("Inbox" + name, "*")) {
|
||||||
if (table.Rows.Count > 0)
|
if (table.Rows.Count > 0)
|
||||||
SendMessage("You have &a" + table.Rows.Count + " %Smessages in /inbox");
|
SendMessage("You have &a" + table.Rows.Count + " %Smessages in /inbox");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
@ -107,11 +107,12 @@ namespace MCGalaxy {
|
|||||||
} else {
|
} else {
|
||||||
if (Moved()) LastAction = DateTime.UtcNow;
|
if (Moved()) LastAction = DateTime.UtcNow;
|
||||||
|
|
||||||
if (LastAction.AddMinutes(Server.afkminutes) < DateTime.UtcNow) {
|
DateTime lastAction = LastAction;
|
||||||
if (name != null && !String.IsNullOrEmpty(name.Trim()) && !hidden) {
|
if (LastAction.AddMinutes(Server.afkminutes) < DateTime.UtcNow
|
||||||
CmdAfk.ToggleAfk(this, "auto: Not moved for " + Server.afkminutes + " minutes");
|
&& !String.IsNullOrEmpty(name)) {
|
||||||
AutoAfk = true;
|
CmdAfk.ToggleAfk(this, "auto: Not moved for " + Server.afkminutes + " minutes");
|
||||||
}
|
AutoAfk = true;
|
||||||
|
LastAction = lastAction;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -70,6 +70,9 @@ namespace MCGalaxy {
|
|||||||
|
|
||||||
const string undo1 = "extra/undo/", undo2 = @"extra\undo\";
|
const string undo1 = "extra/undo/", undo2 = @"extra\undo\";
|
||||||
const string prev1 = "extra/undoPrevious/", prev2 = @"extra\undoPrevious\";
|
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) {
|
static List<Uri> GetAllFiles(DirectoryInfo dir, Uri baseUri, bool lite) {
|
||||||
List<Uri> list = new List<Uri>();
|
List<Uri> list = new List<Uri>();
|
||||||
foreach (FileSystemInfo entry in dir.GetFileSystemInfos()) {
|
foreach (FileSystemInfo entry in dir.GetFileSystemInfos()) {
|
||||||
@ -77,6 +80,8 @@ namespace MCGalaxy {
|
|||||||
string path = ((FileInfo)entry).FullName;
|
string path = ((FileInfo)entry).FullName;
|
||||||
if (lite && (path.Contains(undo1) || path.Contains(undo2))) continue;
|
if (lite && (path.Contains(undo1) || path.Contains(undo2))) continue;
|
||||||
if (lite && (path.Contains(prev1) || path.Contains(prev2))) 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
|
// Make a relative URI
|
||||||
Uri uri = baseUri.MakeRelativeUri(new Uri(path));
|
Uri uri = baseUri.MakeRelativeUri(new Uri(path));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user