Commit Graph

448 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 bbd421c423 switched to ' instead of " 2025-06-20 22:53:03 +02:00
Teriuihi 5fe5a305a5 Corrected insecure usage of environment variables 2025-06-20 22:50:59 +02:00
Teriuihi bbfc9c407c Corrected credentials id 2025-06-20 22:47:48 +02:00
Teriuihi 880108d344 Fix formatting 2025-06-20 22:46:59 +02:00
Teriuihi 61e705b088 Fix formatting 2025-06-20 22:45:53 +02:00
Teriuihi 38228ea585 Add credentials to Jenkinsfile 2025-06-20 22:34:40 +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 769859a617 Fix bypass permission logic for ignored players in chat
Updated the filtering logic to correctly handle the "chat.ignorebypass" permission, ensuring players with bypass permission are not excluded due to ignore settings. Adjusted related conditionals in ChatHandler and ChatListener, and refactored patterns without altering functionality.
2025-03-22 02:44:42 +01:00
Teriuihi cb0bda8d5b Prevent sending mail to ignored players.
Added a check to block users from sending mail to players who have ignored them. A message is displayed to inform the sender, ensuring clearer communication and respecting player preferences.
2025-03-21 22:56:10 +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 9bd9e21321 Merge pull request 'vote_mute' (#2) from vote_mute into main
Reviewed-on: #2
2025-01-22 20:45:21 +00:00
stijn 1c570fd524 Merge branch 'main' into vote_mute 2025-01-22 20:43:24 +00:00
stijn 131ea6da9d Merge pull request 'ignore_fix' (#1) from ignore_fix into main
Reviewed-on: #1
2025-01-22 20:43:13 +00:00
Teriuihi 45eceaf4a6 Merge branch 'main' into ignore_fix 2025-01-02 00:37:11 +01:00
Teriuihi 3275db13d0 Merge branch 'main' into vote_mute 2025-01-02 00:36:36 +01:00
Teriuihi c5eebb7e88 Merge remote-tracking branch 'origin/main' 2025-01-02 00:36:11 +01:00
Teriuihi 5e34e6e7fa Don't ignore users with bypass permission
Refactored chat logic to respect 'chat.ignorebypass' permission for both senders and receivers. This only applies to cases where a user is sending text to another user, checks for login/out messages were not fixed
2025-01-02 00:30:55 +01:00
Teriuihi c5c60d25b1 Cleanup 2025-01-02 00:22:03 +01:00
Len 804e619e8a Add workaround to display nickname when tagging a player in chat. 2024-10-06 19:29:31 +02:00
Teriuihi b3e545a0c8 Log custom messages sent in custom channels
Added a log statement to capture and log information whenever a message is sent in a custom channel. This includes the player's name, the channel name, and the message content for better monitoring and debugging.
2024-09-25 20:03:12 +02:00
Len 773638c222 Add Jenkinsfile 2024-08-04 22:28:28 +02: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
Len 33dc113b36 Revert "Remove chat decorators"
This reverts commit bd48c3f0ca.
2024-07-27 16:05:15 +02:00
Len ba8ba373fd Remove CMI 2024-07-27 16:05:11 +02:00
Len c3e27edb7e Move down receivers in ChatListener.java 2024-07-27 11:17:34 +02:00
Len bd48c3f0ca Remove chat decorators 2024-07-27 11:03:55 +02:00
Len 71a8c652dc Update to 1.21 2024-07-21 18:57:58 +02:00
Teriuihi 0877d05296 Merge remote-tracking branch 'origin/main' 2024-07-19 22:03:03 +02:00
Len e1d6da56d0 Revert "Update gradle-wrapper.properties to 8.8"
This reverts commit 2c3feac367.
2024-07-19 21:09:26 +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
Len 2c3feac367 Update gradle-wrapper.properties to 8.8 2024-07-06 11:00:58 +02:00
Len c97f5a54d7 invert boolean check 2024-07-06 11:00:58 +02:00
Teriuihi a908e32d0b 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-06-04 21:18:57 +02:00
Teriuihi 8393d12c6d 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.
2024-05-05 16:14:48 +02:00
Teriuihi 782c7df4ef 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.
2024-05-05 15:42:59 +02:00
Teriuihi a876a9f77b 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
2024-05-05 00:11:56 +02:00