diff --git a/compose.yml b/compose.yml index 45a6c63..9f473ba 100755 --- a/compose.yml +++ b/compose.yml @@ -58,6 +58,7 @@ services: carbon:yGY2bbis luckperms:tamnmXad miniplaceholders:Kpbing8i + networkjoinmessages:1MJzJZCs signedvelocity:OxMy0xf6 velocitab:aWnzUwbr labels: diff --git a/velocity/config/plugins/networkjoinmessages/config.yml b/velocity/config/plugins/networkjoinmessages/config.yml new file mode 100644 index 0000000..dfac4b6 --- /dev/null +++ b/velocity/config/plugins/networkjoinmessages/config.yml @@ -0,0 +1,268 @@ +# This configuration supports both legacy color codes and MiniMessage! +# For documentation on MiniMessage visit https://docs.advntr.dev/minimessage/format.html + +# Set server aliases +Servers: + lobby: Lobby + survival: Survival Server + mining: Mining Server + staff: Click to TP!'>Staff Server + ???: Unknown Server +Messages: + # These player placeholders work in any of the following three message types + # %player% - Player username + # %displayname% - Custom name the player has according to the proxy + # %player_prefix% - Player prefix (requires LuckPerms on the proxy) + # %player_suffix% - Player suffix (requires LuckPerms on the proxy) + + # These placeholders are available for the swap server message + # %to% - Server they are heading to + # %to_clean% - Server they are heading to without formatting + # %from% - Server they are coming from + # %from_clean% - Server they are coming from without formatting + # %playercount_from% - Amount of players where they are coming from + # %playercount_to% - Amount of players where they are heading to + # %playercount_network% - Amount of players on the network + + # Message sent when a player swaps servers - leave blank to use the list of messages defined below + SwapServerMessage: + + # A list of swap messages to be selected at random each time a player swaps servers + # IMPORTANT - SwapServerMessage (directly above) must be empty to enable this option + SwapServerMessages: [] + + # These placeholders are available for the join and leave network messages + # %server_name% - Name of the server they connected to + # %server_name_clean% - Name of the server they connected to without formatting + # %playercount_server% - Amount of players on the sever they joined or left + # %playercount_network% - Amount of players on the network + + # Message sent when a player joins the network for the first time - leave blank to use the list of messages defined below + FirstJoinNetworkMessage: "%carbon_displayname% has connected to the network." + + # A list of first join messages to be selected at random each time a player joins for the first time + # IMPORTANT - FirstJoinNetworkMessage (directly above) must be empty to enable this option + FirstJoinNetworkMessages: [] + + # Message sent when a player joins the network - leave blank to use the list of messages defined below + JoinNetworkMessage: "%carbon_displayname% has connected to the network." + + # A list of join messages to be selected at random each time a player joins + # IMPORTANT - JoinNetworkMessage (directly above) must be empty to enable this option + JoinNetworkMessages: [] + + # Message sent when a player leaves the network - leave blank to use the list of messages defined below + LeaveNetworkMessage: "%carbon_displayname% has disconnected to the network." + + # A list of leave messages to be selected at random each time a player leaves + # IMPORTANT - LeaveNetworkMessage (directly above) must be empty to enable this option + LeaveNetworkMessages: [] + + # Configurable Command Messages! + Commands: + NoMoreArgumentsNeeded: No more arguments needed. + NoPermission: You do not have the permission to use this command. + Spoof: + NoArgument: | + Arguments: + - join + - leave + - swap + SwapNoArgument: | + Arguments: + - join + - leave + - swap + Please specify TO and FROM + ToggleSilentNoPerm: You do not have the permission to join the server silently. + ToggleSilent: Your silent mode has now been set to %state% + JoinNotification: |- + [NetworkJoin] You joined the server while silenced or vanished. + If vanished, unvanish, or if silenced use /njoinspoof toggle + to re-enable join, leave, and swap messages. + ToggleJoin: + MissingFirstArgument: |- + Please specify which messages you would like to disable/enable. + Valid arguments are: join, leave, swap, all + MissingState: |- + Please specify which state you would like to enter. + Valid arguments are: on / off or true / false. + Confirmation: Receive messages for %mode% has been set to %state% + TargetNotFound: Could not find a player with name %player% + MustSpecifyPlayer: You must specify the target player when running from console + ConfirmationOther: Set receive messages for %mode% on %player% to %state% + Reload: + ConfigReloaded: Config Reloaded! + Misc: + SilentPrefix: [Silent] + ConsoleSilentSwap: Swap message was silenced. %player% %from% -> %to% + ConsoleSilentJoin: Join message was silenced. %player% joined the network + ConsoleSilentLeave: Leave message was silenced. %player% left the network +Settings: + # As PAPIProxyBridge is unable to parse placeholders for offline players, a cache for the leave network message must + # be implemented. For placeholders that frequently change such as experience level, armor rating, etc. you may wish + # for this cache to update more often. + # Designate how long in seconds the leave network message will be cached or use 0 to only update cache on join and + # server swap. + LeaveNetworkMessageCacheDuration: 45 + + # Designate how long, in milliseconds, the plugin will wait before sending the leave network message for a player. + # This allows them to rejoin with no join message and cancel the sending of the leave network message altogether. + # Helps prevent spam from players with a weak internet connection. 1500 is recommended. + LeaveJoinBufferDuration: 0 + + # Should players with the networkjoinmessages.silent permission be silenced by default? + # It will be set to this for all players after a reboot. They can toggle it for themselves with the /njoinspoof toggle command + SilentJoinDefaultState: true + + # Storage backend + # SQL - External SQL server (MySQL, MariaDB, or PostgreSQL). Requires filling in the SQL section below. + # H2 - Embedded SQL database (default). Best for most servers; no setup required. + # TEXT - Plain text file (joined.txt). Easiest to inspect and edit by hand. (Player data will still use H2) + # Changing this option requires a restart. Data is migrated automatically except when migrating from SQL. + FirstJoinStorageType: H2 + + # Storage backend for player data + # Same as above, except valid options are H2 and SQL only. TEXT is not available for this interface. + PlayerDataStorageType: H2 + + # External SQL server settings — only used when StorageType is SQL. + # Changes here require a restart. + SQL: + # Hostname or IP address of the SQL server. + Host: localhost + # Port — MySQL/MariaDB default is 3306, PostgreSQL default is 5432. + Port: 3306 + # Name of the database to use. Must already exist. + Database: database + TablePrefix: njm_ + Username: njm_user + Password: '' + # SQL driver to use. Accepted values: mysql, mariadb, postgresql + Driver: mysql + # Whether to require SSL/TLS for the connection (MySQL/MariaDB only). + UseSSL: false + # Seconds to wait when checking if the connection is still alive. + ConnectionTimeout: 5 + + # Should players ignore messages by default? Re-enable with /njointoggle. + # Changes require a restart to affect players who joined the proxy + IgnoreJoinByDefault: false + IgnoreSwapByDefault: false + IgnoreLeaveByDefault: false + + # Should the following messages be enabled? + SwapServerMessageEnabled: false + FirstJoinNetworkMessageEnabled: false + JoinNetworkMessageEnabled: true + LeaveNetworkMessageEnabled: true + # Should other players with the networkjoinmessages.silent permission be notified of players moving silently? + NotifyAdminsOnSilentMove: true + + # NOTE: These do not affect silenced players. Silenced move messages will be seen by all players with the permission. + SwapServerMessageViewableBy: + # Should the swap server message be seen by the server they swapped to? + ServerJoined: true + + # Should the swap server message be seen by the server they swapped from? + ServerLeft: true + + # Should the swap server message be seen by the other servers? + OtherServer: true + FirstJoinNetworkMessageViewableBy: + # Should the Join Network message be seen by the server they Joined? + ServerJoined: true + + # Should theJoin Network message be seen by the other servers? + OtherServer: true + JoinNetworkMessageViewableBy: + # Should the Join Network message be seen by the server they Joined? + ServerJoined: true + + # Should theJoin Network message be seen by the other servers? + OtherServer: true + LeaveNetworkMessageViewableBy: + # Should the Leave Network message be seen by the server they left? + ServerLeft: true + + # Should the Leave Network message be seen by the other servers? + OtherServer: true + + # Servers in this list will not trigger messages. + # Servers listed here are case-sensitive. Check your bungee config to see how you have them listed! + ServerBlacklist: + - SomeServerName + - SomeOtherServerName + # Should the blacklist list be the only servers allowed to trigger messages? (Reverse the check) + UseBlacklistAsWhitelist: false + # When a player swaps from A to B, which one should we check? JOINED, LEFT, BOTH, ANY + # Behaviour will change depending on the blacklist being in blacklist or whitelist mode. + # example: If you set this to JOINED: BlacklistMode will prevent the message from going through if the joined server is going through. + # WhitelistMode will only allow it if the joined server is in the list. + # IF set to ANY or both, ANY of them must be blacklisted/whitelisted, or BOTH of them must ble blacklisted/whitelisted. + SwapServerMessageRequires: ANY + # IgnoreFirstJoinMessagesList - Players on these servers will not see a message when someone joins the network for the first time. + # The global message will still be triggered if someone joins these servers directly. + # Case-sensitive! + IgnoreFirstJoinMessagesList: + - SomeServerNameThatShouldNotSeeFirstJoinNetworkMessages + - SomeOtherServerName + # IgnoreJoinMessagesList - Players on these servers will not see a message when someone joins the network. + # The global message will still be triggered if someone joins these servers directly. + # Case-sensitive! + IgnoreJoinMessagesList: + - SomeServerNameThatShouldNotSeeJoinNetworkMessages + - SomeOtherServerName + # IgnoreLeaveMessagesList - Players on these servers will not see a message when someone leaves the network. + # The global message will still be triggered if someone leaves these servers directly. + # Case-sensitive! + IgnoreLeaveMessagesList: + - SomeServerNameThatShouldNotSeeLeaveNetworkMessages + - SomeOtherServerName + +OtherPlugins: + PAPIProxyBridge: + # The maximum amount of time in milliseconds to wait for PlaceholderAPI placeholders before timing out + RequestTimeout: 1500 + SayanVanish: + # Vanished players will not trigger messages aside from + # silent messages sent to players with networkjoinmessages.silent permission + TreatVanishedPlayersAsSilent: true + # Vanished players will not be counted in the player count placeholders + RemoveVanishedPlayersFromPlayerCount: true + # Send silent messages to players with the permission sayanvanish.vanish.use (permission must be set on the proxy) + NotifyVanishEnabledPlayersOnSilentMove: false + PremiumVanish: + # Vanished players will not trigger messages aside from + # silent messages sent to players with networkjoinmessages.silent permission + TreatVanishedPlayersAsSilent: true + # Vanished players will not be counted in the player count placeholders + RemoveVanishedPlayersFromPlayerCount: true + # Spoof a join message automatically when a player stops being vanished (shows) + SpoofJoinMessageOnShow: true + # Spoof a leave message automatically when a player vanishes (hides) + SpoofLeaveMessageOnHide: true + # Treats a player with the permission pv.joinvanished as vanished on join (permission must be set on the proxy) + # This is to be used in conjunction with the PremiumVanish 'AutoVanishOnJoin' option + TreatVanishedOnJoin: false + # Send silent messages to players with the permission pv.use or pv.see (permission must be set on the proxy) + NotifyVanishEnabledPlayersOnSilentMove: false + # Instead of sending silent messages to all players with pv.use or pv.see, only send silent messages to players with + # a greater than or equal to see level than the player who triggered the message's use level. + # Simply put, this setting respects the layered use/see permissions set with PremiumVanish. + # Requires players to rejoin upon changes to their level or setting this setting to true + NotifyRespectVanishLevels: false + # What should be the highest level for both PremiumVanish permissions? + # Lower amounts might improve performance with more players since they reduce the amount of permission checks + MaxLevel: 100 + LimboAPI: + # No swap messages for players swapping to or from limbo servers + SuppressSwapMessages: true + # No join messages for players joining limbo servers + SuppressJoinMessages: false + # No leave messages for players leaving from limbo servers + SuppressLeaveMessages: false + +debug: false +# Do not touch this +config-version: 14 diff --git a/velocity/config/plugins/networkjoinmessages/discord.yml b/velocity/config/plugins/networkjoinmessages/discord.yml new file mode 100644 index 0000000..6647906 --- /dev/null +++ b/velocity/config/plugins/networkjoinmessages/discord.yml @@ -0,0 +1,161 @@ +# This is the configuration for an optional discord webhook integration +# Here you can provide a discord webhook url for notifications :) + +# Whether to enable the integration +Enabled: false + +# The webhook url - if you need help check out these resources +# https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks +# https://youtu.be/fKksxz2Gdnc?si=jxY0gr1tiPXiPsgf +WebhookUrl: https://discord.com/api/webhooks/00000000000000000000/example-replace-this + +# The picture that will replace %embedavatarurl% throughout this config +# Available placeholders are %uuid% & %player% +EmbedAvatarUrl: https://mc-heads.net/avatar/%uuid% + +# All rules/settings in config.yml are honored here as well +# Configuration for swap-server, first-join, join, and leave messages is below +# Anything that is supposed to be a url MUST be either blank or a valid url!!! + +# Available placeholders for swap are: +# %embedavatarurl% - Defined above +# %player% - The player's username +# %displayname% - The custom name the player has according to bungee +# %to% - The server they are heading to +# %to_clean% - The server they are heading to without color codes +# %from% - The server they are coming from +# %from_clean% - The server they are coming from without color codes +# %playercount_from% - The amount of players where they are coming from +# %playercount_to% - The amount of players where they are heading to +# %playercount_network% - The amount of players on the network + +# Available placeholders for join/leave are: +# %embedavatarurl% - Defined above +# %player% - The player's username +# %displayname% - The custom name the player has according to bungee +# %server_name% - The name of the server they connected to +# %server_name_clean% - The name of the server they connected to without color codes +# %playercount_server% - The playercount of the server they are on +# %playercount_network% - The amount of players on the network +Messages: + SwapServer: + # Whether to enable the message + Enabled: true + # Lets you define a custom name and/or pfp url just for this message type + CustomWebhook: + Enabled: false + Name: '' + AvatarUrl: '' + # The message content + Content: '' + Embed: + Enabled: true + Color: '#444444' + Author: + ImageUrl: '%embedavatarurl%' + Name: '%player% swapped servers' + Url: '' + ThumbnailUrl: '' + Title: + Text: '' + Url: '' + Description: '' + # Format is "title;value;inline" (eg. "Who joined?;%displayname%;true") or "blank" to add a blank field + Fields: + - From;%from_clean%;true + - To;%to_clean%;true + ImageUrl: '' + Footer: + Text: '' + IconUrl: '' + Timestamp: false + FirstJoinNetwork: + # Whether to enable the message + Enabled: true + # Lets you define a custom name and/or pfp url just for this message type + CustomWebhook: + Enabled: false + Name: '' + AvatarUrl: '' + # The message content + Content: '' + Embed: + Enabled: true + Color: '#553a8c' + Author: + ImageUrl: '%embedavatarurl%' + Name: '%player% joined the network for the first time!' + Url: '' + ThumbnailUrl: '' + Title: + Text: '' + Url: '' + Description: '' + # Format is "title;value;inline" (eg. "Who joined?;%displayname%;true") or "blank" to add a blank field + Fields: [] + ImageUrl: '' + Footer: + Text: '' + IconUrl: '' + Timestamp: false + JoinNetwork: + # Whether to enable the message + Enabled: true + # Lets you define a custom name and/or pfp url just for this message type + CustomWebhook: + Enabled: false + Name: '' + AvatarUrl: '' + # The message content + Content: '' + Embed: + Enabled: true + Color: '#3d8c40' + Author: + ImageUrl: '%embedavatarurl%' + Name: '%player% joined the network' + Url: '' + ThumbnailUrl: '' + Title: + Text: '' + Url: '' + Description: '' + # Format is "title;value;inline" (eg. "Who joined?;%displayname%;true") or "blank" to add a blank field + Fields: [] + ImageUrl: '' + Footer: + Text: '' + IconUrl: '' + Timestamp: false + LeaveNetwork: + # Whether to enable the message + Enabled: true + # Lets you define a custom name and/or pfp url just for this message type + CustomWebhook: + Enabled: false + Name: '' + AvatarUrl: '' + # The message content + Content: '' + Embed: + Enabled: true + Color: '#ff0000' + Author: + ImageUrl: '%embedavatarurl%' + Name: '%player% left the network' + Url: '' + ThumbnailUrl: '' + Title: + Text: '' + Url: '' + Description: '' + # Format is "title;value;inline" (eg. "Who joined?;%displayname%;true") or "blank" to add a blank field + Fields: [] + ImageUrl: '' + Footer: + Text: '' + IconUrl: '' + Timestamp: false + +# Do not touch this +config-version: 2 diff --git a/velocity/config/plugins/networkjoinmessages/joined.mv.db b/velocity/config/plugins/networkjoinmessages/joined.mv.db new file mode 100644 index 0000000..11b90a0 Binary files /dev/null and b/velocity/config/plugins/networkjoinmessages/joined.mv.db differ diff --git a/velocity/config/plugins/networkjoinmessages/player_data.mv.db b/velocity/config/plugins/networkjoinmessages/player_data.mv.db new file mode 100644 index 0000000..d4e9c5e Binary files /dev/null and b/velocity/config/plugins/networkjoinmessages/player_data.mv.db differ