mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-22 12:05:51 -04:00
More case insensitive
This commit is contained in:
parent
baa7425a3d
commit
b0fde8f95b
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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!");
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user