Skip to content

Commit

Permalink
Debugging Silence Command
Browse files Browse the repository at this point in the history
- Adds debugging message for silence checks
- Minor code re-factoring for request chat event
  • Loading branch information
data-bomb committed Mar 3, 2024
1 parent 1197220 commit 6889281
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 6 additions & 8 deletions Si_AdminMod/Event_Netcode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,13 @@ static void Prefix(GameByteStreamReader __result, ref byte[] __0, int __1, bool

public static OnRequestPlayerChatArgs FireOnRequestPlayerChatEvent(Player player, string message)
{
OnRequestPlayerChatArgs onRequestPlayerChatArgs = new OnRequestPlayerChatArgs();
onRequestPlayerChatArgs.Player = player;
onRequestPlayerChatArgs.Text = message;
onRequestPlayerChatArgs.Block = false;
EventHandler<OnRequestPlayerChatArgs> requestPlayerChatEvent = OnRequestPlayerChat;
if (requestPlayerChatEvent != null)
OnRequestPlayerChatArgs onRequestPlayerChatArgs = new OnRequestPlayerChatArgs
{
requestPlayerChatEvent(null, onRequestPlayerChatArgs);
}
Player = player,
Text = message,
Block = false
};
OnRequestPlayerChat?.Invoke(null, onRequestPlayerChatArgs);

return onRequestPlayerChatArgs;
}
Expand Down
2 changes: 2 additions & 0 deletions Si_ChatSilence/Si_Silence.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ public void OnRequestPlayerChat(object? sender, OnRequestPlayerChatArgs args)
return;
}

MelonLogger.Msg("Checking if player is silenced.");

// check if player is allowed to chat
if (IsSteamSilenced(args.Player.PlayerID))
{
Expand Down

0 comments on commit 6889281

Please sign in to comment.