Commit Graph
78 Commits
Author SHA1 Message Date
stijn 8546bda28a Replace hardcoded web server URL with configurable value from Config. 2026-07-18 20:51:32 +02:00
stijn 5a508fdf28 Add web-api module with OpenAPI integration, enable chat logs forwarding to web backend, and update dependencies across modules. 2026-07-18 20:21:25 +02:00
stijn dc513ac2f0 Add support for miniMessage serialization in chat logs 2026-07-18 19:11:53 +02:00
stijn 3bfd358e78 Add support for custom channel aliases and improve string formatting consistency 2025-07-29 19:11:14 +02:00
auto fc7860145f Updated to 1.21 by switching to cosmos 2025-06-21 00:53:55 +02:00
auto 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
auto 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
StijnandGitHub 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
auto 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
auto 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
Len 9d7f944c88 Fix Tagging players and triggering a replacematcher not resetting chatcolor 2023-07-15 17:42:12 +02:00
auto 7ef9b4a64a Make .replace require a TextReplacementConfig 2022-10-09 19:32:51 +02:00
auto 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 1ea2c03fcd Add nicknameString getting in ChatUser.java 2022-09-27 00:02:27 +02:00
Len a15b13e8ac Add Nick.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
auto 35ad214901 Fixed regex injection 2022-06-02 05:09:43 +02:00
auto 7ab95e437a Fixed bypass spam limits by spamming more than one character 2022-05-30 19:58:00 +02:00
Len c836452d19 Update minimessage references 2022-05-27 00:31:36 +02:00
auto 0997c2bab6 Disable toggles on join 2022-05-24 04:20:21 +02:00
auto 41897f4b16 Added toggle to party as well and made it so it can be added to other channels if needed 2022-05-24 04:17:55 +02:00
auto c645201ef3 Removed variable, moved call inline 2022-05-24 02:50:18 +02:00
auto fdd9d81400 Fix party users not being removed correctly (they left the party but still had their party id set) 2022-05-24 02:49:36 +02:00
auto 3e313cb00b Fixed being able to bypass replacement filters by having multiple of the same match in one string 2022-05-24 02:41:11 +02:00
destro174 29dd5d2d55 Commit reply/continue rework 2022-04-21 15:45:50 +02:00
auto 23e7c57333 Use exceptions for filters, highlight words that were filtered 2022-02-27 18:29:41 +01:00
autoanddestro174 fcb2adb009 Maybe made nicknames auto sync 2022-02-19 16:58:22 +01:00
autoanddestro174 91b261cdb0 Maybe fixed party 2022-02-19 16:58:22 +01:00
autoanddestro174 4571d191fd Added party disband command and a way to remove all users from a party 2022-02-19 16:58:22 +01:00
auto 4f4f48e847 Added all the commands and added configurable messages for everything 2022-01-30 17:50:18 +01:00
destro174 57a43e9c1c finish mails? 2022-01-29 23:21:35 +01:00
destro174 26b044b2e7 merge basic mailing 2022-01-29 14:53:47 +01:00
destro174 eb31a141d0 sync mutes from proxy to server 2022-01-05 15:25:17 +01:00
destro174 3fd7bbfece dirty fix for /spy not working 2021-08-22 10:47:39 +02:00
destro174 1d5dd7c764 Don't use replacematcher for parsing text on signs 2021-08-20 23:03:58 +02:00
destro174 0ace870550 Add PartyUser implement it into Party 2021-08-08 22:07:47 +02:00
auto 9551785f83 Added a terrible way to sync parties cus I don't have time to implement a proper solution atm 2021-08-08 13:30:57 +02:00
auto 67eccd389d Switched to Username only (no nicknames) till colors can be fixed (for party users) 2021-08-08 12:19:32 +02:00
auto 2cb843b68c Finished party command, and sub commands 2021-08-08 11:36:06 +02:00
auto b9fae1cb35 Created configurable chat channels 2021-08-05 11:40:42 +02:00
auto dfcf8de34e Removed Bukkit stuff I missed from the general use API 2021-08-01 03:20:49 +02:00
auto 59a6edd4f6 Removed code that uses Bukkit API from the API 2021-07-31 23:16:51 +02:00
destro174 9d8d4b3853 fixes 2021-07-30 03:16:41 +02:00
auto ead360ee1c Chance stored party users to a HashMap for easier access 2021-07-29 03:21:29 +02:00
auto fc76d07b4c Return if matcher.find() OR matcher.matches() is true since one seems to work when it's the only thing in the text, and the other only works when there is other text around it?? 2021-07-28 22:51:45 +02:00
auto 70b5f980f0 Make Regex case insensitive 2021-07-28 21:26:21 +02:00
destro174 9674503170 some tweaks 2021-07-28 20:42:09 +02:00
destro174 0891e252f9 auto commit 2021-07-27 18:46:58 +02:00
destro174 96dbdc6dd0 Fix nicknames and prefixes 2021-07-18 00:48:55 +02:00