コード例 #1
0
 public PlayerChatEventArgs(int sender, string message, ChatRecipients recipients, float duration)
 {
     Sender     = sender;
     Message    = message;
     Recipients = recipients;
     Duration   = duration;
 }
コード例 #2
0
 private static void OnPlayerChat(Int32 sender, String message, ChatRecipients recipients)
 {
     try
     {
         if (InternalInput.PlayerChat != null)
         {
             InternalInput.PlayerChat(sender, message, recipients);
         }
     }
     catch (Exception e)
     {
         Trace.WriteLine("Unhandled Exception in InternalInput.OnPlayerChat!");
         Trace.WriteLine(e.ToString());
     }
 }
コード例 #3
0
 /// <summary>
 /// Displays a chat message as sent by a player.
 /// </summary>
 /// <param name="this">The CGameUI instance.</param>
 /// <param name="sender">The player that send the message.</param>
 /// <param name="message">The message sent.</param>
 /// <param name="recipients">The team to receive the message.</param>
 /// <param name="duration">The duration the message should be shown.</param>
 /// <returns>Unknown</returns>
 public static IntPtr CGameUI__DisplayChatMessage(CGameUI @this, Int32 sender, String message, ChatRecipients recipients, Single duration)
 {
     return(ThisCall.Invoke <IntPtr>(GameAddresses.CGameUI__DisplayChatMessage, @this, sender, message, recipients, duration));
 }
コード例 #4
0
 public virtual void OnPlayerChat(Int32 sender, String message, ChatRecipients recipients)
 {
 }
コード例 #5
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));
 }
コード例 #6
0
 public static unsafe IntPtr CGameUI__DisplayChatMessage(CGameUI * @this, int sender, string message, ChatRecipients recipients, float duration)
 {
     return(ThisCall.Invoke <IntPtr>(GameAddresses.CGameUI__DisplayChatMessage, (IntPtr)(void *)@this, sender, message, recipients, duration));
 }
コード例 #7
0
        private static IntPtr CGameUI__DisplayChatMessageHook(CGameUI _this, Int32 sender, String message, ChatRecipients recipients, Single duration)
        {
            try
            {
                InternalInput.OnPlayerChat(sender, message, recipients);

                if (InternalInput.BlockChat)
                {
                    return(IntPtr.Zero);
                }
            }
            catch (Exception e)
            {
                Trace.WriteLine("Unhandled Exception in InternalInput.CGameUI__DisplayChatMessageHook!");
                Trace.WriteLine(e.ToString());
            }

            return(CGameUI__DisplayChatMessage(_this, sender, message, recipients, duration));
        }
コード例 #8
0
ファイル: CGameUI.cs プロジェクト: MastaChimp/SharpCraft
 public void WriteChatMessage(Int32 sender, String message, ChatRecipients recipients, Single duration)
 {
     GameFunctions.CGameUI__DisplayChatMessage(this, sender, message, recipients, duration);
 }