Exemplo n.º 1
0
 private unsafe static IntPtr CGameUI__DisplayChatMessageHook(CGameUI *_this, int sender, string message, ChatRecipients recipients, float duration)
 {
     try
     {
         PlayerChatEventArgs playerChatEventArgs = new PlayerChatEventArgs(sender, message, recipients, duration);
         PlayerChat?.Invoke(null, playerChatEventArgs);
         if (BlockChat || playerChatEventArgs.IsBlocked)
         {
             return(IntPtr.Zero);
         }
         return(CGameUI__DisplayChatMessage(_this, playerChatEventArgs.Sender, playerChatEventArgs.Message, playerChatEventArgs.Recipients, playerChatEventArgs.Duration));
     }
     catch (Exception ex)
     {
         Trace.WriteLine("Unhandled Exception in InternalCGameUI__DisplayChatMessageHook!");
         Trace.WriteLine(ex.ToString());
     }
     return(BlockChat ? IntPtr.Zero : CGameUI__DisplayChatMessage(_this, sender, message, recipients, duration));
 }
 public static void OnPlayerChat(PlayerChatEventArgs args)
 {
     PlayerChat?.Invoke(args);
 }
 public void OnPlayerChat(IPlayerChatEvent evt) => PlayerChat?.Invoke(evt);