mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-10-01 09:36:03 -04:00
You shouldn't be able to speak while pending /pass verification, fixes #535 (Thanks MasterlazorX)
This commit is contained in:
parent
3abe564c1c
commit
5c18fe940d
@ -43,15 +43,7 @@ namespace MCGalaxy.Commands.Chatting {
|
||||
}
|
||||
|
||||
public static bool CanSpeak(Player p, string cmd) {
|
||||
if (p.IsConsole) return true;
|
||||
|
||||
if (p.muted) {
|
||||
p.Message("Cannot use %T/{0} %Swhile muted.", cmd); return false;
|
||||
}
|
||||
if (Server.chatmod && !p.voice) {
|
||||
p.Message("Cannot use %T/{0} %Swhile chat moderation is on without %T/Voice%S.", cmd); return false;
|
||||
}
|
||||
return true;
|
||||
return p.CheckCanSpeak("use %T/" + cmd);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -442,7 +442,7 @@ namespace MCGalaxy {
|
||||
if (ZSGame.Instance.HandlesChatMessage(this, text)) return;
|
||||
|
||||
// Put this after vote collection so that people can vote even when chat is moderated
|
||||
if (Server.chatmod && !voice) { Message("Chat moderation is on, you cannot speak without %T/voice"); return; }
|
||||
if (!CheckCanSpeak("speak")) return;
|
||||
|
||||
// Filter out bad words
|
||||
if (Server.Config.ProfanityFiltering) text = ProfanityFilter.Parse(text);
|
||||
|
@ -314,7 +314,22 @@ namespace MCGalaxy {
|
||||
|
||||
/// <summary> Returns whether the player is currently allowed to talk. </summary>
|
||||
public bool CanSpeak() {
|
||||
return IsConsole || (!muted && (voice || !Server.chatmod));
|
||||
return IsConsole || (!muted && !Unverified && (voice || !Server.chatmod));
|
||||
}
|
||||
|
||||
public bool CheckCanSpeak(string action) {
|
||||
if (IsConsole) return true;
|
||||
|
||||
if (muted) {
|
||||
Message("Cannot {0} %Swhile muted", action); return false;
|
||||
}
|
||||
if (Server.chatmod && !voice) {
|
||||
Message("Cannot {0} %Swhile chat moderation is on without %T/Voice%S", action); return false;
|
||||
}
|
||||
if (Unverified) {
|
||||
Message("%WYou must first verify with %T/Pass [Password]"); return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary> Blocks calling thread until all 'new map loaded' packets have been sent. </summary>
|
||||
|
Loading…
x
Reference in New Issue
Block a user