Commit Graph

448 Commits

Author SHA1 Message Date
Teriuihi f3147b3256 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.
2024-05-04 23:41:27 +02:00
Teriuihi 65503a02f3 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.
2024-04-30 22:15:46 +02:00
Teriuihi 7140a0cd78 Merge branch 'main' into vote_mute 2024-04-28 21:38:26 +02:00
Teriuihi 99f66c3b4b Prevent empty stack exception in PlayerListener
An additional condition is added to prevent an exception from being thrown when attempting to peek an empty stack in the PlayerListener.java file. This should resolve issues where checking if the playerDeathsStack is before the cut off time caused an empty stack exception error.
2024-04-28 21:38:12 +02:00
Teriuihi 187f71d6c3 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.
2024-04-28 21:36:45 +02:00
Teriuihi 3b2aa84164 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.
2024-04-13 16:52:56 +02:00
Teriuihi 0fb497c2f1 Merge branch 'main' into vote_mute 2024-04-13 16:15:56 +02:00
Teriuihi de24ca4437 Refactor PlayerListener for mute handling and text prioritization
Improved the PlayerListener class by adjusting event handling priority and adding nullability constraints for PlayerDeathEvent for better program robustness. Also removed a now unused import of the TextComponent class for cleaner codebase management.
2024-04-13 16:15:35 +02:00
Teriuihi e351e86bea Add mute handling and text styling in PlayerListener
Enhanced PlayerListener feature by incorporating checks for server mute status before sending death messages. Additionally, styled the death messages by adding text color and italics when mute state is false to improve readability.
2024-04-10 22:02:01 +02:00
Teriuihi 192fca3a89 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.
2024-04-07 19:16:32 +02:00
Teriuihi d6135f2456 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.
2024-04-07 18:29:46 +02:00
Teriuihi c057c69653 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.
2024-04-07 18:11:19 +02:00
Teriuihi c25767e473 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.
2024-04-07 18:07:20 +02:00
Teriuihi 37aa9fdf4c 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
2024-04-07 16:32:33 +02:00
Teriuihi ed2ba74772 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.
2024-04-06 19:39:36 +02:00
Teriuihi 44d6e994cc 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.
2024-04-06 17:25:15 +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 034de90062 Implement evidence for automatic ban for 'punish' filter violations
When a user who violate the 'punish' filter rules is automatically banned, there will now be a post about it in the #evidence channel.
2024-03-02 20:41:59 +01: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
Len 8a5b407359 update gradle 2024-01-04 09:28:53 +01:00
Len f63c4c0836 Update velocity 2023-12-17 12:39:07 +01:00
Len eb7c1dd1e1 Update to 1.20.4 2023-12-17 12:37:21 +01:00
Teriuihi 278129e8d8 Changed pinging to prevent ping for not @'d user
Allowed \ to escape ping
2023-08-14 01:29:06 +02: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 4b930e62c3 Log party messages that are from a toggled user on the local server as well 2023-07-10 23:33:42 +02:00
Teriuihi c02e4dd884 Log all party messages 2023-07-10 23:15:08 +02:00
Teriuihi 8a463696ed Made chatusermanager use synchronized functions 2023-07-07 23:16:32 +02:00
Teriuihi ce5ea19961 Removed unused imports 2023-07-07 23:16:15 +02:00
Teriuihi 591ca93981 Fixed first join messages only working if chat user is not loaded yet 2023-07-07 23:15:45 +02:00
Teriuihi d7cfe97644 Added first join messages back 2023-06-26 21:40:15 +02:00
Teriuihi c86a344d49 Trying a different way to see if a player is a new player 2023-06-22 02:00:51 +02:00
Teriuihi 5583abbbca Fix party info not showing if party owner is null 2023-06-20 23:44:32 +02:00
Teriuihi 55918670bc Maybe fixed mentions 2023-06-20 00:40:44 +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 9b7868bea7 Fix mentions happening within words 2023-06-17 23:58:33 +02:00
Teriuihi 6c6b798677 Fix load order 2023-04-23 22:48:33 +02:00
Teriuihi 0c1b197054 Don't send players a ping sound if they have the player that's pinging them ignored 2022-11-25 19:49:37 +01:00
Len 57afbbe805 Update permissions for nicknames 2022-10-29 10:29:26 +02:00
Len 5398d97248 Merge branch 'main' of https://github.com/Altitude-Devs/Chat 2022-10-09 20:25:52 +02:00
Len d90f5ac376 Update nicknames for Player and CMI. 2022-10-09 20:25:40 +02:00
Teriuihi 0c7ad69e85 Only replace the first instance of a name/nickname 2022-10-09 19:33:06 +02:00
Teriuihi 7ef9b4a64a Make .replace require a TextReplacementConfig 2022-10-09 19:32:51 +02:00
Teriuihi 5b06049265 Fixed double @ if someone doesn't have a nickname (or has the same nickname as the username) 2022-10-09 18:04:41 +02:00
Teriuihi ea051fd905 Fixed spacing for target replacement 2022-10-09 01:21:10 +02:00