feat: pass kick message through PlayerBannedEvent for plugin modification#1056
Merged
feat: pass kick message through PlayerBannedEvent for plugin modification#1056
Conversation
…tion Add a nullable Message kickMessage field to PlayerBannedEvent on all 6 platforms so external plugins (e.g. WebEnhancer) can modify the kick message before it is sent to the player. BanCommand and TempBanCommand now build the kick message before calling ban(), pass it through PlayerBanStorage.ban() where [id] is set after create(), and fire PlayerBannedEvent with the message attached. After the event completes, the resolved message is used for the kick. This enables the [pin] placeholder to be replaced on the initial kick when banning an online player, not just on reconnect denial.
…n e2e test Async RCON commands (bmban/bmunban) return immediately while processing on a background thread. Fixed sleeps were insufficient on slower CI servers, causing the "unbanned player can join server" test to time out.
Replace notification-based polling (unreliable across platforms) with createBotWithRetry for the "unbanned player can join server" test and increase sleep durations. Kicked connections resolve in ~1-2s so retries are cheap, and the approach doesn't depend on staffBot message delivery.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a nullable Message kickMessage field to PlayerBannedEvent on all 6 platforms so external plugins (e.g. WebEnhancer) can modify the kick message before it is sent to the player.
BanCommand and TempBanCommand now build the kick message before calling ban(), pass it through PlayerBanStorage.ban() where [id] is set after create(), and fire PlayerBannedEvent with the message attached. After the event completes, the resolved message is used for the kick.
This enables the [pin] placeholder to be replaced on the initial kick when banning an online player, not just on reconnect denial.