Skip to content

Class endstone::BroadcastMessageEvent

ClassList > endstone > BroadcastMessageEvent

Event triggered for server broadcast messages such as fromServer::broadcast() .More...

  • #include <endstone/event/server/broadcast_message_event.h>

Inherits the following classes: endstone::Cancellable

Public Functions

Type Name
BroadcastMessageEvent (bool async, Message message, std::unordered_set< const CommandSender * > recipients)
ENDSTONE_EVENT (BroadcastMessageEvent)
const Message & getMessage () const
Get the message to broadcast.
const std::unordered_set< const CommandSender * > & getRecipients () const
Gets a set of recipients that this broadcast message will be displayed to.
void setMessage (Message message)
Set the message to broadcast.

Public Functions inherited from endstone::Cancellable

See endstone::Cancellable

Type Name
virtual void cancel ()
Cancel this event.
virtual bool isCancelled () override const
Gets the cancellation state of this event.
virtual void setCancelled (bool cancel) override
Sets the cancellation state of this event.

Public Functions inherited from endstone::ICancellable

See endstone::ICancellable

Type Name
virtual void cancel () = 0
Cancels this event.
virtual bool isCancelled () const = 0
Gets the cancellation state of this event.
virtual void setCancelled (bool cancel) = 0
Sets the cancellation state of this event.
virtual ~ICancellable () = default

Detailed Description

This event should be async if fired from an async thread.

Public Functions Documentation

function BroadcastMessageEvent

inline endstone::BroadcastMessageEvent::BroadcastMessageEvent (
    bool async,
    Message message,
    std::unordered_set< const  CommandSender * > recipients
) 

function ENDSTONE_EVENT

endstone::BroadcastMessageEvent::ENDSTONE_EVENT (
    BroadcastMessageEvent
) 

function getMessage

Get the message to broadcast.

inline const  Message & endstone::BroadcastMessageEvent::getMessage () const

Returns:

Message to broadcast


function getRecipients

Gets a set of recipients that this broadcast message will be displayed to.

inline const std::unordered_set< const  CommandSender * > & endstone::BroadcastMessageEvent::getRecipients () const

Returns:

All CommandSenders who will see this broadcast message


function setMessage

Set the message to broadcast.

inline void endstone::BroadcastMessageEvent::setMessage (
    Message message
) 

Parameters:

  • message New message to broadcast


The documentation for this class was generated from the following file include/endstone/event/server/broadcast_message_event.h