Now /mi shows name colour for blacklist/whitelist entries

This commit is contained in:
UnknownShadow200 2016-09-12 08:51:14 +10:00
parent 2338b0f7c7
commit 8939de0698
2 changed files with 18 additions and 10 deletions

View File

@ -73,8 +73,8 @@ namespace MCGalaxy.Commands {
} }
public override void Help(Player p) { public override void Help(Player p) {
Player.Message(p, "%T/botset <bot> <AI script>"); Player.Message(p, "%T/botset [bot] [AI script]");
Player.Message(p, "%HMakes <bot> do <AI script>"); Player.Message(p, "%HMakes [bot] do the instructions in [AI script]");
Player.Message(p, "%HSpecial AI scripts: Kill and Hunt"); Player.Message(p, "%HSpecial AI scripts: Kill and Hunt");
} }
} }

View File

@ -97,14 +97,18 @@ namespace MCGalaxy.Commands {
List<string> bWhitelist = data.BuildWhitelist, bBlacklist = data.BuildBlacklist; List<string> bWhitelist = data.BuildWhitelist, bBlacklist = data.BuildBlacklist;
GetBlacklistedPlayers(data.Name, vBlacklist); GetBlacklistedPlayers(data.Name, vBlacklist);
if (vWhitelist.Count > 0) if (vWhitelist.Count > 0) {
Player.Message(p, " Visit whitelist: &a" + vWhitelist.Join("%S, &a")); Player.Message(p, " &aVisit whitelist: " + JoinNames(vWhitelist, p));
if (vBlacklist.Count > 0) }
Player.Message(p, " Visit blacklist: &c" + vBlacklist.Join("%S, &c")); if (vBlacklist.Count > 0) {
if (bWhitelist.Count > 0) Player.Message(p, " &cVisit blacklist: " + JoinNames(vBlacklist, p));
Player.Message(p, " Build whitelist: &a" + bWhitelist.Join("%S, &a")); }
if (bBlacklist.Count > 0) if (bWhitelist.Count > 0) {
Player.Message(p, " Build blacklist: &c" + bBlacklist.Join("%S, &c")); Player.Message(p, " &aBuild whitelist: " + JoinNames(bWhitelist, p));
}
if (bBlacklist.Count > 0) {
Player.Message(p, " &Build blacklist: " + JoinNames(bBlacklist, p));
}
if (String.IsNullOrEmpty(data.RealmOwner)) if (String.IsNullOrEmpty(data.RealmOwner))
data.RealmOwner = GetRealmMapOwner(data.Name); data.RealmOwner = GetRealmMapOwner(data.Name);
@ -115,6 +119,10 @@ namespace MCGalaxy.Commands {
owners.Join(n => PlayerInfo.GetColoredName(p, n))); owners.Join(n => PlayerInfo.GetColoredName(p, n)));
} }
static string JoinNames(List<string> items, Player p) {
return items.Join(name => PlayerInfo.GetColoredName(p, name));
}
static string GetRealmMapOwner(string lvlName) { static string GetRealmMapOwner(string lvlName) {
bool plus = Server.ClassicubeAccountPlus; bool plus = Server.ClassicubeAccountPlus;
// Early out when accounts have + and map doesn't. // Early out when accounts have + and map doesn't.