Page MenuHomeFeedback Tracker

Mission event handler request: ChatMessageReceived
Feedback, NormalPublic

Description

Mission Event: ChatMessageReceived
Description: Fires when a message is received, before adding it to the chat feed. Return true to block a message from being added to the chat feed.
Parameters:

  • index: Number - The channel index the message was sent in (indexes as per currentChannel, -1 for system)
  • sender id: Number - Owner ID of the sender
  • sender name: String - Name of the sender
  • message: String - The message contents

Example:

addMissionEventhandler ["ChatMessageReceived",{
	params ["_index","_senderID","_senderName","_message"];
}];

Parameter Examples:
https://i.imgur.com/kHXr0D6.png

[0,3,"Connor","""my globalChat message"""]
[0,3,"Connor","my global message"]
[1,3,"Connor","my side message"]
[5,3,"Connor","my direct message"]

https://i.imgur.com/ejdqYw0.png

[-1,2,"","BattlEye Client: (Global) Admin: my rcon message"]
[-1,2,"","Player Connor (2) connecting"]
[-1,2,"","Player Connor (2) connected"]
[-1,2,"Connor","Player Connor (2) kicked off: "]
[-1,2,"","Player Connor (2) disconnected"]

Details

Severity
Feature
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10
Category
Feature Request
Additional Information

Context:
The available methods of detecting messages added to the chat feed don't allow detecting every type of message. I am able to detect player-sent messages without any trouble, command messages such as systemChat and groupChat have to go through a function, system connection and kill logs are artificially recreated with other event handlers and I am simply unable to detect battleye/rcon messages and client kick/ban logs.

This event handler would remove the need for such hacky and inconvenient solutions as it would provide a single point where all messages can be detected.

Other:

  • Being able to return true to filter out certain messages isn't entirely necessary, however it would be nice to have.
  • It may also be useful to provide a parameter that specifies the method used to send a message. eg: player chat, command, battleye/rcon, system messages.

Event Timeline

_connor created this task.May 11 2020, 4:19 AM
heyoxe added a subscriber: heyoxe.Jun 6 2020, 7:00 PM
dedmen added a project: Restricted Project.Jun 7 2020, 2:59 PM
dedmen set Ref Ticket to AIII-53004.
dedmen moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.
dedmen added a subscriber: dedmen.EditedJul 7 2020, 6:38 PM

sender id: Number - Owner ID of the sender

Not sure if I can do that, alternative would be netID.

dedmen moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Jul 7 2020, 6:46 PM
dedmen claimed this task.
dedmen changed the task status from New to Assigned.

That should be fine.

Mission Event: HandleChatMessage
Description: Fires when a message is received, before adding it to the chat feed. Return true to block a message from being added to the chat feed. Fires clientside
Parameters:

index: Number - The channel index the message was sent in (indexes as per currentChannel, 0 for system)
sender id: Number - Owner ID of the sender
sender name: String - Name of the sender
message: String - The message contents

Needs to return true or false. true == skip/don't print the message, if you return false or anything non-boolean it will print it as normal.

dev-branch next week

dedmen changed the task status from Assigned to Feedback.Thu, Jul 30, 2:28 PM
dedmen moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.