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

@ -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,14 +102,15 @@ 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);
}
}
}
public static void Save() {
using (StreamWriter w = new StreamWriter(propertiesFile, false)) {

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() {