Commit Graph

230 Commits

Author SHA1 Message Date
akastijn 7cc7cca129 Update cosmos-api to version 1.21.8 and adjust repository URL in settings.gradle.kts. 2025-07-29 22:54:06 +02:00
akastijn 3bfd358e78 Add support for custom channel aliases and improve string formatting consistency 2025-07-29 19:11:14 +02:00
akastijn eb30750134 Refactor switch statements to use enhanced -> syntax and update dependencies to include cosmos-api. 2025-07-29 19:10:20 +02:00
Teriuihi fc7860145f Updated to 1.21 by switching to cosmos 2025-06-21 00:53:55 +02:00
Teriuihi 1dd19f0543 Update dependencies and build configuration 2025-06-20 23:26:54 +02:00
Teriuihi b65fcdb1c7 Update URL detection and formatting logic in Utility
Enhanced `DEFAULT_URL_PATTERN` for improved URL detection and added `formatUrl` method to ensure URLs include a valid scheme. Adjusted `formatText` to use clickable and underlined URLs in the configured format. Removed unused imports and cleaned up comments.
2025-06-20 22:34:22 +02:00
Teriuihi e74361a7b7 Add "local" chat channels with proximity-based messaging
Introduced a "local" channel type to restrict chat visibility based on player proximity, configurable via `LOCAL_DISTANCE`. Added channel spy functionality to monitor "local" messages. Updated constructors and configuration to support this new feature.
2025-03-22 18:19:25 +01:00
Teriuihi 5212954946 Refactor config reload and server name handling.
Replaced inconsistent `ReloadConfig` usage with `reloadConfig` across the codebase for better naming consistency. Introduced `ServerName` utility to standardize server name retrieval and improve maintainability. Added logging enhancements for better debugging of muted users and blocked messages.
2025-03-21 22:55:57 +01:00
Teriuihi f1b8af6136 Merge branch 'ignore_fix' 2025-03-21 20:35:06 +01:00
Teriuihi 9e437079e4 Remove Galaxy dependency
Switched back to paper since we don't use any features from Galaxy that aren't already in paper
2025-03-21 20:34:45 +01:00
Len bfc9af69d0 Fix URL clicking in chat. 2025-02-09 18:04:55 +01:00
Len ea705c879f Allow nick request from nick preview message 2025-02-07 20:45:21 +01:00
Len f5c0a0676c Delay unread mail message and also send it as a title message 2025-02-07 20:44:59 +01:00
Stijn 73e67eed6c
Vote mute (#3)
* Implement chat log handler with database support

The code changes introduce the ability to log chat messages. A new ChatLogHandler class has been added that manages the queue of chat log messages, both storing them in memory and writing them to a database. New columns have been added to the database and the interactivity with the database is handled using prepared statements to improve security and performance. The chat messages are deleted from the database after a certain period, which can be configured.

* Add start of VoteToMute functionality in chat system

Implemented VoteToMute system enabling initiated voting for muting a player in chat. This includes creating new classes "ActiveVoteToMute", "VoteToMute", and "VoteToMuteStarter". The "VoteToMute" class handles the voting command logic, it allows players to vote on whether to mute other players. The code also adds a call to register this new command in the main VelocityChat class.

* Replace Object2ObjectOpenHashMap with HashMap

The usage of Object2ObjectOpenHashMap in storing chat logs and the chat log handler was switched to HashMap. This was done to ensure the plugin can be run on proxy as velocity does not include this library

* Add VoteToMuteHelper and enhance ActiveVoteToMute

Implemented a new module titled VoteToMuteHelper to enhance the voting system and augment the user experience. This module enhances the system by providing relevant player suggestions and setting up the mute player. Made updates to the ActiveVoteToMute module to handle potential voters and mute the player if the vote is passed. VoteToMute module is also updated to include the total eligible players. The code is made robust by adding appropriate error checks.

* Enable optional logging in ChatLogHandler

Modified the ChatLogHandler to support optional logging by introducing a new argument in the getInstance() method. This argument sets the logging state during instantiation. This facilitates better flexibility when using the ChatLogHandler across different sections of the code base as logging requirements may differ.

* Add mute vote results sent to Discord and staff presence check

Enhanced the vote-to-mute feature by adding a function that sends the mute vote results to a general channel on Discord. A 'staff presence' check has also been added which prevents the mute vote from being initiated if a staff member is online, instead, it prompts users to directly contact a staff member for help.

* Fix chat log message deletion query

Corrected the SQL query in the `deleteOldMessages` method within `ChatLogQueries.java`. Originally, it was incorrectly deleting newer messages rather than older ones due to an incorrect comparison symbol. It has now been adjusted to properly delete older messages based on the provided duration.

* Add player muted logging and abstract embed building

The update introduces a log entry indicating when a player has been muted due to voting. The embed creation for this process has been isolated and extracted into a separate function. This contributes to better code modularity and organization.

* Implement logging for ChatLogHandler

The ChatLogHandler now includes logging for better troubleshooting and understanding of the server state. Logging triggers when chat logging is disabled, when it starts, and also if there's a failure in saving chat messages to the database.

* Refactor death message display in PlayerListener

The commit refactors the method for displaying player death messages in the PlayerListener class. Specifically, it adds functionality to replace usernames with display names in death notifications. More descriptive death messages with themed colors and icons are now shown.

* Refine ChatPlugin and improve "vote to mute" logic

Modified ChatPlugin to include "thisPlugin" within the ShutdownListener initialization. Additionally, adjusted the mute vote failure message color from green to red in ActiveVoteToMute file and added a condition to return false if there are no votes. Also, made improvements to the pagination logic in the VoteToMuteStarter file. Lastly, improved the chat logging mechanics in ChatLogHandler by adding and refining various log information for capturing action details.

* Update vote validation and argument naming

Updated the method "votePassed" in "ActiveVoteToMute" to consider a scenario where no votes have been made for muting. Also, corrected the argument name from "yesno" to "yesNo" in "VoteToMuteHelper" to match with its name in the command constructor

* Update vote to mute functionality in chat system

Several changes were made to update the vote to mute functionality in the chat system. The threshold for eligible players online for vote has been changed from 10 to 6. In addition, improvements have been made to prevent the vote from ending prematurely. Lastly, feedback messages to users when they cast their vote and an update to the vote start message format have been implemented.

* Update vote-to-mute feature

The vote-to-mute feature is updated to include information about the vote initiating player. Also, the duration to retrieve chat logs increased from 5 minutes to 10 minutes. Lastly, eligible players are now notified live about the voting progress.

* Fix message validation and chat log order

Corrected conditional logic in VoteToMuteHelper to validate messages properly and adjusted sorting of chat logs in VoteToMuteStarter to display in reverse chronological order. The update now accurately verifies the existence of selected messages and presents recent logs first for more user-friendly navigation.
2024-07-27 23:16:18 +02:00
Len c9e819645a Update build.gradle.kts 2024-07-27 22:33:39 +02:00
Teriuihi 0877d05296 Merge remote-tracking branch 'origin/main' 2024-07-19 22:03:03 +02:00
Len 13e4966a12 Revert "Update to 1.21?"
This reverts commit 3ea078237d.
2024-07-19 21:09:26 +02:00
Teriuihi 340975e99e Change default config file path
The path to the configuration file that was initially set to the user's home directory has been modified. It has been shifted to "/mnt/configs/ChatPlugin".
2024-07-19 20:46:39 +02:00
Len 3ea078237d Update to 1.21? 2024-07-06 11:00:58 +02:00
Teriuihi 4e92285261 Add throwable to warn and error methods in ALogger
This update introduces modifications to the 'ALogger.java' file to handle possible exceptions more efficiently. It extends the warn and error functions to include a Throwable parameter, making error logs more informative for easier debugging.
2024-04-06 15:35:08 +02:00
Teriuihi a377bdfe48 Implement player death message limits
The code now includes player death message limits, with a configured maximum number of messages per defined period. This was added in the PlayerListener class and configuration options were placed in Config.java. This change will restrict spamming of death messages.
2024-04-06 13:11:05 +02:00
Teriuihi 4af85d0e79 Add option to disable chat filters in private channels
A constructor parameter and corresponding field 'disableInPrivate' have been added to the ChatFilter class. This handles disabling specific chat filters in private channels. The necessary checks have been implemented in RegexManager. The configuration for each filter is also updated in RegexConfig to incorporate this new functionality.
2024-03-31 13:37:05 +02:00
Teriuihi bd8fa02f1e Add 'punish' filter and automatic banning functionality
Extended the RegexManager filterText method to include a 'punish' case that triggers an automatic ban for users who violate the filter. This commit also updates the PluginMessageListener to handle 'punish' commands, thus completing the execution of an auto-ban function.
2024-03-02 19:18:13 +01:00
Teriuihi f1deebf49e Merge remote-tracking branch 'origin/main' 2023-08-11 22:30:34 +02:00
Teriuihi 3e29fc7d17 Added minimum hex value for nick colors 2023-08-11 22:30:23 +02:00
Len ffa90b5c94 add MENTIONPLAYERTAG to Config.java 2023-07-15 17:45:03 +02:00
Len 9d7f944c88 Fix Tagging players and triggering a replacematcher not resetting chatcolor 2023-07-15 17:42:12 +02:00
Teriuihi 8a463696ed Made chatusermanager use synchronized functions 2023-07-07 23:16:32 +02:00
Teriuihi f3c7a312c0 Added first join messages 2023-06-20 00:35:46 +02:00
Teriuihi d8f064e7ca Fix spy needing mute-server permission 2023-06-20 00:09:48 +02:00
Teriuihi 7ef9b4a64a Make .replace require a TextReplacementConfig 2022-10-09 19:32:51 +02:00
Teriuihi 6beb398e10 Added a way to replace text with components and patterns with strings/components 2022-10-09 00:36:07 +02:00
Len 3aa0b09133 Fix ChatFilter.java not applying to message. 2022-10-08 11:05:56 +02:00
Len 3bdaa798c3 Continue the loop do not break it. 2022-10-03 19:39:41 +02:00
Len 7fcfb2321f Update config style 2022-10-03 19:29:25 +02:00
Len 3d14cca551 Update minimessage tags to be lowercase 2022-10-03 11:29:06 +02:00
Len d1df551f35 Update minimessage tags to be lowercase 2022-10-03 10:30:27 +02:00
Teriuihi d7bd3aa222 Switched to using minimessage (mostly) 2022-10-02 04:52:33 +02:00
Len a4e4982dc3 Update nicknames to use Chat's plugin message channels. 2022-10-01 20:42:35 +02:00
Len 271500bae3 Add permission for newline 2022-09-29 16:51:03 +02:00
Len 6329eacd07 Fix some deprecated issues 2022-09-29 16:26:55 +02:00
Len a405862fe1 Update Config.java references for Nicknames 2022-09-27 00:45:23 +02:00
Len 11ecf1ad16 Merge Nicknames 2022-09-27 00:02:27 +02:00
Len 1ea2c03fcd Add nicknameString getting in ChatUser.java 2022-09-27 00:02:27 +02:00
Len 4d01ccb065 Update Config.java 2022-09-27 00:02:27 +02:00
Len a15b13e8ac Add Nick.java 2022-09-27 00:02:27 +02:00
Len 00f4e00011 Add Pair.java 2022-09-27 00:02:27 +02:00
Len 3888298827 Add Emote to FilterType.java
Add EmoteList command.
2022-09-27 00:02:27 +02:00
Len ee2a2c2225 Use 1.19.2 API 2022-09-26 19:08:51 +02:00
Teriuihi 341a330e3d Removed sout for adding party users 2022-09-22 23:53:09 +02:00