Interface MessageDispatcher
public interface MessageDispatcher
Dispatcher responsible for routing and sending messages to players.
Handles message formatting, filtering, and event dispatching through the messaging pipeline.
- Since:
- 1.8.2
-
Method Summary
Modifier and TypeMethodDescriptioncreateMessageEvent(FPlayer fReceiver, ModuleName moduleName, EventMetadata eventMetadata) Creates a complete message send event for a specific receiver.createReceivers(ModuleName moduleName, EventMetadata eventMetadata) Creates and populates the receiver list for the message event based on filtering criteria.dispatch(@NonNull ModuleName moduleName, @NonNull EventMetadata eventMetadata) Dispatches a message event to eligible receivers determined by the module name and event metadata.dispatch(@NonNull ModuleName moduleName, @NonNull EventMetadata eventMetadata, @NonNull Set<FPlayer> receivers) Dispatches a message event to the specified set of receivers asynchronously.dispatch(MessageSendEvent messageSendEvent) Directly dispatches a pre-built message send event through the event system.dispatch(@NonNull ModuleLocalization module, @NonNull EventMetadata eventMetadata) Builds the message, works out who receives it and sends it.
-
Method Details
-
dispatch
Builds the message, works out who receives it and sends it.- Parameters:
module- the module the message came fromeventMetadata- how it should be delivered- Returns:
- the players it reached
-
dispatch
Dispatches a message event to eligible receivers determined by the module name and event metadata. Automatically resolves the receiver list usingcreateReceivers(ModuleName, EventMetadata).- Parameters:
moduleName- The module name used for localization and receiver filteringeventMetadata- Metadata containing event information and filtering criteria- Returns:
- The set of players who received the message
-
dispatch
Set<FPlayer> dispatch(@NonNull ModuleName moduleName, @NonNull EventMetadata eventMetadata, @NonNull Set<FPlayer> receivers) Dispatches a message event to the specified set of receivers asynchronously. Each receiver receives an individually created message event for personalized message processing. Dispatching is skipped if the receiver set is empty.- Parameters:
moduleName- The module name used for message localizationeventMetadata- Metadata containing event information for message creationreceivers- The pre-filtered set of players to receive the message- Returns:
- The set of players who received the message (same as input receivers)
-
dispatch
Directly dispatches a pre-built message send event through the event system.- Parameters:
messageSendEvent- The message send event to dispatch- Returns:
- The dispatched message send event
-
createReceivers
Creates and populates the receiver list for the message event based on filtering criteria. Applies player filters, range filters, and module settings checks to determine eligible receivers.- Parameters:
moduleName- The module name containing localization and settings to check for each receivereventMetadata- Metadata containing event information and filtering criteria- Returns:
- A set of eligible players to receive the message, or an empty set if the event is for proxy and cancelled
-
createMessageEvent
MessageSendEvent createMessageEvent(FPlayer fReceiver, ModuleName moduleName, EventMetadata eventMetadata) Creates a complete message send event for a specific receiver. Builds formatted message components including main message, format wrapper, and destination subtext.- Parameters:
fReceiver- The player receiving the messagemoduleName- The name identifier for the moduleeventMetadata- Metadata containing event information and message content- Returns:
- A fully constructed MessageSendEvent ready for dispatch
-