mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-10-03 10:33:29 -04:00
Also log and show duration of action in /notes
This commit is contained in:
parent
d2619bdfb1
commit
659c25eee0
@ -48,12 +48,14 @@ namespace MCGalaxy.Commands.Moderation {
|
|||||||
string[] args = line.SplitSpaces();
|
string[] args = line.SplitSpaces();
|
||||||
if (args.Length <= 3) continue;
|
if (args.Length <= 3) continue;
|
||||||
|
|
||||||
if (args.Length == 4) {
|
string reason = args.Length > 4 ? args[4] : "";
|
||||||
p.Message(Action(args[1]) + " by " + args[2] + " on " + args[3]);
|
long duration = 0;
|
||||||
} else {
|
if (args.Length > 5) long.TryParse(args[5], out duration);
|
||||||
p.Message(Action(args[1]) + " by " + args[2] + " on " + args[3]
|
|
||||||
+ " - " + args[4].Replace("%20", " "));
|
p.Message("{0} by {1} %Son {2}{3}{4}",
|
||||||
}
|
Action(args[1]), PlayerInfo.GetColoredName(p, args[2]), args[3],
|
||||||
|
duration == 0 ? "" : " for " + TimeSpan.FromTicks(duration).Shorten(true),
|
||||||
|
reason.Length == 0 ? "" : " - " + reason.Replace("%20", " "));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,10 +54,8 @@ namespace MCGalaxy.Core {
|
|||||||
string src = e.Actor.name;
|
string src = e.Actor.name;
|
||||||
|
|
||||||
string time = DateTime.UtcNow.ToString("dd/MM/yyyy");
|
string time = DateTime.UtcNow.ToString("dd/MM/yyyy");
|
||||||
string data = e.Target + " " + type + " " + src + " " + time;
|
string data = e.Target + " " + type + " " + src + " " + time + " " +
|
||||||
if (e.Reason.Length > 0) {
|
e.Reason.Replace(" ", "%20") + " " + e.Duration.Ticks;
|
||||||
data += " " + e.Reason.Replace(" ", "%20");
|
|
||||||
}
|
|
||||||
Server.Notes.Append(data);
|
Server.Notes.Append(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user