1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 15:20:48 -05:00

Fix Threading Duplicate for Mute Penalty & Added !MuteInfo & Fix PM (#269)

* Resolve duplicate migration
Resolve unmuting state double penalties

* Change order of operation

* Added MuteInfoCommand.cs

* Resolve !pm and @broadcast permanently being disabled
This commit is contained in:
Amos
2022-10-14 14:47:01 +01:00
committed by GitHub
parent 9cc3733db7
commit 8b498363d6
3 changed files with 102 additions and 34 deletions

View File

@ -38,9 +38,6 @@ public class Plugin : IPlugin
switch (gameEvent.Type)
{
case GameEvent.EventType.Command:
break;
case GameEvent.EventType.Join:
// Check if user has any meta set, else ignore (unmuted)
var muteMetaJoin = await MuteManager.GetCurrentMuteState(gameEvent.Origin);
@ -122,7 +119,16 @@ public class Plugin : IPlugin
manager.CommandInterceptors.Add(gameEvent =>
{
if (gameEvent.Extra is not Command command)
{
return true;
}
var muteMeta = MuteManager.GetCurrentMuteState(gameEvent.Origin).GetAwaiter().GetResult();
if (muteMeta.MuteState is not MuteState.Muted)
{
return true;
}
return !DisabledCommands.Contains(command.GetType().Name) && !command.IsBroadcast;
});