mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-10-02 10:01:34 -04:00
Add a CanSpeak method to player class that returns whether player can currently speak
This commit is contained in:
parent
659c25eee0
commit
3b78863c79
@ -33,7 +33,7 @@ namespace MCGalaxy.Commands.Chatting {
|
|||||||
TabList.Update(p, true);
|
TabList.Update(p, true);
|
||||||
p.LastAction = DateTime.UtcNow;
|
p.LastAction = DateTime.UtcNow;
|
||||||
|
|
||||||
bool cantSend = p.muted || (Server.chatmod && !p.voice);
|
bool cantSend = !p.CanSpeak();
|
||||||
if (p.IsAfk) {
|
if (p.IsAfk) {
|
||||||
if (cantSend) {
|
if (cantSend) {
|
||||||
p.Message("You are now marked as being AFK.");
|
p.Message("You are now marked as being AFK.");
|
||||||
|
@ -312,11 +312,16 @@ namespace MCGalaxy {
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
/// <summary> Returns whether the player is currently allowed to talk. </summary>
|
||||||
|
public bool CanSpeak() { return !muted && (voice || !Server.chatmod); }
|
||||||
|
|
||||||
|
/// <summary> Blocks calling thread until all 'new map loaded' packets have been sent. </summary>
|
||||||
public void BlockUntilLoad(int sleep) {
|
public void BlockUntilLoad(int sleep) {
|
||||||
while (Loading)
|
while (Loading)
|
||||||
Thread.Sleep(sleep);
|
Thread.Sleep(sleep);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary> Checks if player is currently unverified, and if so, sends a message informing them </summary>
|
||||||
public void CheckIsUnverified() {
|
public void CheckIsUnverified() {
|
||||||
if (verifiedPass) return;
|
if (verifiedPass) return;
|
||||||
Unverified = Server.Config.verifyadmins && Rank >= Server.Config.VerifyAdminsRank;
|
Unverified = Server.Config.verifyadmins && Rank >= Server.Config.VerifyAdminsRank;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user