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) {
Player.Message(p, "%T/botset <bot> <AI script>");
Player.Message(p, "%HMakes <bot> do <AI script>");
Player.Message(p, "%T/botset [bot] [AI script]");
Player.Message(p, "%HMakes [bot] do the instructions in [AI script]");
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;
GetBlacklistedPlayers(data.Name, vBlacklist);
if (vWhitelist.Count > 0)
Player.Message(p, " Visit whitelist: &a" + vWhitelist.Join("%S, &a"));
if (vBlacklist.Count > 0)
Player.Message(p, " Visit blacklist: &c" + vBlacklist.Join("%S, &c"));
if (bWhitelist.Count > 0)
Player.Message(p, " Build whitelist: &a" + bWhitelist.Join("%S, &a"));
if (bBlacklist.Count > 0)
Player.Message(p, " Build blacklist: &c" + bBlacklist.Join("%S, &c"));
if (vWhitelist.Count > 0) {
Player.Message(p, " &aVisit whitelist: " + JoinNames(vWhitelist, p));
}
if (vBlacklist.Count > 0) {
Player.Message(p, " &cVisit blacklist: " + JoinNames(vBlacklist, p));
}
if (bWhitelist.Count > 0) {
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))
data.RealmOwner = GetRealmMapOwner(data.Name);
@ -114,6 +118,10 @@ namespace MCGalaxy.Commands {
Player.Message(p, " This map is a personal realm of {0}",
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) {
bool plus = Server.ClassicubeAccountPlus;