Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for broadcasting messages with source information #6512

Open
dktapps opened this issue Nov 17, 2024 · 0 comments
Open

Add support for broadcasting messages with source information #6512

dktapps opened this issue Nov 17, 2024 · 0 comments
Labels
BC break Breaks API compatibility Category: API Related to the plugin API Category: Core Related to internal functionality Easy task Probably really easy to do, good task for first-time contributors Type: Enhancement Contributes features or other improvements to PocketMine-MP
Milestone

Comments

@dktapps
Copy link
Member

dktapps commented Nov 17, 2024

Description

Currently, recipients of chat messages don't have a programmatic way to tell who caused the message to be sent, or why it was sent.

This issue proposes the following:

  • Server->broadcastMessageFrom(CommandSender $source, Translatable|string $message, ?array $recipients = null, string $channelId = <default>)
  • CommandSender->onMessageBroadcast(source, message, channelId) - probably best this is separate from sendMessage()
  • Add string $channelId with a default to broadcastMessage()

Adding a source allows recipients to react differently depending on who sent the message, and adding a channel allows recipients to understand what type of message it is (e.g. a command audit admin message should probably be treated differently than a chat message).

Implementing these features would enable passing source information to the client on chat messages, which would allow it to filter chat messages based on Xbox Live account blocks. This is a feature that is technically required by all featured servers, but has never been implemented.

Alternative methods

@dktapps dktapps added Category: API Related to the plugin API Category: Core Related to internal functionality BC break Breaks API compatibility Type: Enhancement Contributes features or other improvements to PocketMine-MP labels Nov 17, 2024
@dktapps dktapps added this to the 6.0 milestone Nov 17, 2024
@dktapps dktapps added the Easy task Probably really easy to do, good task for first-time contributors label Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BC break Breaks API compatibility Category: API Related to the plugin API Category: Core Related to internal functionality Easy task Probably really easy to do, good task for first-time contributors Type: Enhancement Contributes features or other improvements to PocketMine-MP
Projects
None yet
Development

No branches or pull requests

1 participant