diff --git a/MCGalaxy/Chat/Chat.cs b/MCGalaxy/Chat/Chat.cs index 1c14701d8..501f8f50a 100644 --- a/MCGalaxy/Chat/Chat.cs +++ b/MCGalaxy/Chat/Chat.cs @@ -174,7 +174,7 @@ namespace MCGalaxy { public static bool NotIgnoring(Player source, Player target) { if (target.ignoreAll) return source == target; // don't ignore messages from self - return source == null || !target.listignored.Contains(source.name); + return source == null || !target.listignored.CaselessContains(source.name); } diff --git a/MCGalaxy/Chat/ChatModes.cs b/MCGalaxy/Chat/ChatModes.cs index 5b987b7d2..5a49755d2 100644 --- a/MCGalaxy/Chat/ChatModes.cs +++ b/MCGalaxy/Chat/ChatModes.cs @@ -97,7 +97,7 @@ namespace MCGalaxy { if (who.ignoreAll) { DoFakePM(p, who, message); return; } - if (p != null && who.listignored.Contains(p.name)) { + if (p != null && who.listignored.CaselessContains(p.name)) { DoFakePM(p, who, message); return; } DoPM(p, who, message); diff --git a/MCGalaxy/Commands/Chat/CmdIgnore.cs b/MCGalaxy/Commands/Chat/CmdIgnore.cs index ec0dbf79b..c6cd8ff39 100644 --- a/MCGalaxy/Commands/Chat/CmdIgnore.cs +++ b/MCGalaxy/Commands/Chat/CmdIgnore.cs @@ -81,10 +81,9 @@ namespace MCGalaxy.Commands.Chatting { Player.Message(p, "You must use the full name when unignoring offline players."); return; } - if (p.name == who.name) { Player.Message(p, "You cannot ignore yourself."); return; } + if (p == who) { Player.Message(p, "You cannot ignore yourself."); return; } - if (p.listignored.Contains(who.name)) { - p.listignored.Remove(who.name); + if (p.listignored.CaselessRemove(who.name)) { Player.Message(p, "&aNo longer ignoring {0}", who.ColoredName); } else { p.listignored.Add(who.name); diff --git a/MCGalaxy/Commands/Chat/MessageCmd.cs b/MCGalaxy/Commands/Chat/MessageCmd.cs index 8efb0cd31..72a76bc5d 100644 --- a/MCGalaxy/Commands/Chat/MessageCmd.cs +++ b/MCGalaxy/Commands/Chat/MessageCmd.cs @@ -30,7 +30,7 @@ namespace MCGalaxy.Commands.Chatting { if (!TryMessage(p, string.Format(message, giver, who.ColoredName))) return false; string giverRaw = (p == null) ? "(console)" : p.name; - if (messageWho && !who.listignored.Contains(giverRaw) && !who.ignoreAll) + if (messageWho && !who.listignored.CaselessContains(giverRaw) && !who.ignoreAll) Player.Message(who, string.Format(message, giver, "you")); return true; } diff --git a/MCGalaxy/Commands/Moderation/CmdSetRank.cs b/MCGalaxy/Commands/Moderation/CmdSetRank.cs index 9137cdf52..fbb4840f2 100644 --- a/MCGalaxy/Commands/Moderation/CmdSetRank.cs +++ b/MCGalaxy/Commands/Moderation/CmdSetRank.cs @@ -103,8 +103,8 @@ namespace MCGalaxy.Commands.Moderation { } static Group TargetRank(Player p, string name, Group curRank) { - if (name == "+up") return NextRankUp(p, curRank); - if (name == "-down") return NextRankDown(p, curRank); + if (name.CaselessEq("+up")) return NextRankUp(p, curRank); + if (name.CaselessEq("-down")) return NextRankDown(p, curRank); return Matcher.FindRanks(p, name); } diff --git a/MCGalaxy/Commands/World/CmdMain.cs b/MCGalaxy/Commands/World/CmdMain.cs index 3d744b0f2..440b2fd0d 100644 --- a/MCGalaxy/Commands/World/CmdMain.cs +++ b/MCGalaxy/Commands/World/CmdMain.cs @@ -34,7 +34,7 @@ namespace MCGalaxy.Commands.World { if (message.Length == 0) { if (Player.IsSuper(p)) { Player.Message(p, "Main level is {0}", Server.mainLevel.ColoredName); - } else if (p.level.name == Server.mainLevel.name) { + } else if (p.level == Server.mainLevel) { Command.all.FindByName("Spawn").Use(p, ""); } else { PlayerActions.ChangeMap(p, Server.mainLevel); diff --git a/MCGalaxy/Commands/World/CmdOverseer.SubCommands.cs b/MCGalaxy/Commands/World/CmdOverseer.SubCommands.cs index 20430bebb..d2cce7577 100644 --- a/MCGalaxy/Commands/World/CmdOverseer.SubCommands.cs +++ b/MCGalaxy/Commands/World/CmdOverseer.SubCommands.cs @@ -58,7 +58,7 @@ namespace MCGalaxy.Commands.World { Player pl = PlayerInfo.FindMatches(p, name); if (pl == null) return; - if (pl.level.name == p.level.name) { + if (pl.level == p.level) { PlayerActions.ChangeMap(pl, Server.mainLevel); } else { Player.Message(p, "Player is not on your level!"); diff --git a/MCGalaxy/Commands/other/CmdTpA.cs b/MCGalaxy/Commands/other/CmdTpA.cs index 3807abe18..9ff63a0f6 100644 --- a/MCGalaxy/Commands/other/CmdTpA.cs +++ b/MCGalaxy/Commands/other/CmdTpA.cs @@ -44,9 +44,9 @@ namespace MCGalaxy.Commands.Misc { Player target = PlayerInfo.FindMatches(p, message); if (target == null) return; if (target == p) { Player.Message(p, "You cannot /tpa to yourself."); return; } - if (target.listignored.Contains(p.name)) { ShowSentMessage(p, target); return; } + if (target.listignored.CaselessContains(p.name)) { ShowSentMessage(p, target); return; } - if (target.name == p.currentTpa) { + if (target.name.CaselessEq(p.currentTpa)) { Player.Message(p, "You still have a pending teleport request with this player."); return; } if (p.level != target.level && target.level.IsMuseum) {