Core: Use better format for 'Banned for', also use banner's actual name in it.

This commit is contained in:
UnknownShadow200 2016-10-29 15:00:08 +11:00
parent bcd18c6923
commit 1c394224c4
4 changed files with 13 additions and 13 deletions

View File

@ -27,7 +27,7 @@ namespace MCGalaxy.Commands {
string[] args = message.Split(' ');
if (message == "" || args.Length < 2) { Help(p); return; }
Player who = PlayerInfo.FindMatches(p, args[0]);
Group grp = Group.FindMatches(p, args[1]);
Group grp = Group.FindMatches(p, args[1]);
if (who == null || grp == null) return;
if (p != null && who.Rank > p.Rank) {

View File

@ -20,7 +20,6 @@ using System.Collections.Generic;
using System.Data;
using System.Globalization;
using System.IO;
using System.Text;
using MCGalaxy.Eco;
using MCGalaxy.SQL;
@ -103,12 +102,13 @@ namespace MCGalaxy {
Item item = GetItem(args[0]);
if (item == null) return;
if (args[1].CaselessEq("enabled"))
if (args[1].CaselessEq("enabled")) {
item.Enabled = args[2].CaselessEq("true");
else if (args[1].CaselessEq("purchaserank"))
} else if (args[1].CaselessEq("purchaserank")) {
item.PurchaseRank = (LevelPermission)int.Parse(args[2]);
else
} else {
item.Parse(line, args);
}
}
}

View File

@ -34,22 +34,22 @@ namespace MCGalaxy {
}
public static string FormatBan(string banner, string reason) {
return "Banned for \"" + reason + "\" by " + banner;
return "Banned by " + banner + ": " + reason;
}
/// <summary> Adds a ban entry for the given user, and who banned them and why they were banned. </summary>
public static void BanPlayer(Player p, string who, string reason, bool stealth, string oldrank) {
public static void BanPlayer(Player banner, string target, string reason, bool stealth, string oldrank) {
reason = reason.Replace(" ", "%20");
string player = p == null ? "(console)" : p.name.ToLower();
AddBanEntry(player, who.ToLower(), reason, stealth.ToString(), FormatDate(), oldrank);
string player = banner == null ? "(console)" : banner.truename;
AddBanEntry(player, target.ToLower(), reason, stealth.ToString(), FormatDate(), oldrank);
}
/// <summary> Adds a ban entry for the given user, and who banned them and why they were banned. </summary>
public static void UnbanPlayer(Player p, string who, string reason) {
public static void UnbanPlayer(Player unbanner, string target, string reason) {
reason = reason.Replace(" ", "%20");
string player = p == null ? "(console)" : p.name.ToLower();
AddUnbanEntry(player, who.ToLower(), reason, FormatDate());
string player = unbanner == null ? "(console)" : unbanner.truename;
AddUnbanEntry(player, target.ToLower(), reason, FormatDate());
}
static string FormatDate() {

View File

@ -40,7 +40,7 @@ namespace MCGalaxy {
/// <summary> Gets the name and the group name for the given player. </summary>
public static void GetEntry(Player p, Player dst, out string name, out string group) {
string col = Entities.GetSupportedCol(dst, p.color);
group = Server.TablistGlobal ? "On " + p.level.name : "&fPlayers";
group = Server.TablistGlobal ? "On " + p.level.name : "&fPlayers";
name = col + p.truename;
IGame game = p.level.CurrentGame();
if (game != null) game.GetTabName(p, dst, ref name, ref group);