mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-24 05:03:34 -04:00
Now /baninfo shows banner/unbanner name in colour
This commit is contained in:
parent
d1fdfdd4e4
commit
26f52349dc
@ -53,7 +53,8 @@ namespace MCGalaxy.Commands.Moderation {
|
|||||||
|
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
TimeSpan delta = GetDelta(data[2]);
|
TimeSpan delta = GetDelta(data[2]);
|
||||||
Player.Message(p, "{0} {1} ago by {2}", banned ? "Banned" : "Last banned", delta.Shorten(), data[0]);
|
Player.Message(p, "{0} {1} ago by {2}", banned ? "Banned" : "Last banned",
|
||||||
|
delta.Shorten(), GetName(p, data[0]));
|
||||||
Player.Message(p, "Reason: {0}", data[1]);
|
Player.Message(p, "Reason: {0}", data[1]);
|
||||||
} else {
|
} else {
|
||||||
Player.Message(p, "No ban data found for {0}%S.", colName);
|
Player.Message(p, "No ban data found for {0}%S.", colName);
|
||||||
@ -62,11 +63,18 @@ namespace MCGalaxy.Commands.Moderation {
|
|||||||
data = Ban.GetUnbanData(plName);
|
data = Ban.GetUnbanData(plName);
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
TimeSpan delta = GetDelta(data[2]);
|
TimeSpan delta = GetDelta(data[2]);
|
||||||
Player.Message(p, "{0} {1} ago by {2}", banned ? "Last unbanned" : "Unbanned", delta.Shorten(), data[0]);
|
Player.Message(p, "{0} {1} ago by {2}", banned ? "Last unbanned" : "Unbanned",
|
||||||
|
delta.Shorten(), GetName(p, data[0]));
|
||||||
Player.Message(p, "Reason: {0}", data[1]);
|
Player.Message(p, "Reason: {0}", data[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static string GetName(Player p, string user) {
|
||||||
|
// ban/unban uses truename
|
||||||
|
if (Server.ClassicubeAccountPlus && !user.EndsWith("+")) user += "+";
|
||||||
|
return PlayerInfo.GetColoredName(p, user);
|
||||||
|
}
|
||||||
|
|
||||||
static TimeSpan GetDelta(string data) {
|
static TimeSpan GetDelta(string data) {
|
||||||
data = data.Replace(",", "");
|
data = data.Replace(",", "");
|
||||||
string[] date = data.Split(' ');
|
string[] date = data.Split(' ');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user