Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The same bridge connects selected moderation and roleplay events to the wider co
- **Discord account linking** — players can request a linking code or unlink their Minecraft account.
- **Website feature codes** — issues scoped codes for skins, drinks, and player profiles, subject to access rules and cooldowns.
- **Account status updates** — processes website notices about linking and eligibility, including RPCharacters survival access checks.
- **Moderation connections** — sends player warnings and supported Essentials ban or unban events to the linked services.
- **Moderation connections** — sends player warnings, and bans, unbans and expired timed bans from the server ban list, to the linked services so the Discord Banned role follows the in-game ban.
- **Player benefit synchronization** — shares resolved player metadata and entitlements with ProvinceSystem.
- **Bird-mail notifications** — provides the connection for BirdMessenger arrival notifications to linked Discord accounts.

Expand Down
4 changes: 4 additions & 0 deletions src/main/java/net/tfminecraft/tfmcweb/Cache.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ public final class Cache {
/** Tier key → LuckPerms group. Only these groups are ever added or removed. */
public static Map<String, String> patreonGroups = Map.copyOf(patreonGroupDefaults());

/** Mirror this server's ban list (bans, unbans, expiries) to the Discord bot. */
public static boolean banMirrorEnabled = true;
public static int banMirrorPollSeconds = 30;

private Cache() {}

/** Mutable noble/gilded/ascended → same-name group map. */
Expand Down
9 changes: 7 additions & 2 deletions src/main/java/net/tfminecraft/tfmcweb/TFMCWeb.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

import net.tfminecraft.tfmcweb.cache.LinkCache;
import net.tfminecraft.tfmcweb.gate.DiscordGateService;
import net.tfminecraft.tfmcweb.listeners.EssentialsBanListener;
import net.tfminecraft.tfmcweb.listeners.PlayerJoinListener;
import net.tfminecraft.tfmcweb.loaders.ConfigLoader;
import net.tfminecraft.tfmcweb.entitlements.PlayerMetaSyncService;
import net.tfminecraft.tfmcweb.managers.BanMirrorPoller;
import net.tfminecraft.tfmcweb.managers.LinkDiscordCommand;
import net.tfminecraft.tfmcweb.managers.PatreonCommand;
import net.tfminecraft.tfmcweb.managers.PluginNoticePoller;
Expand All @@ -30,6 +30,7 @@ public class TFMCWeb extends JavaPlugin {
private DiscordGateService gateService;
private PluginNoticePoller noticePoller;
private PatreonRankWriter rankWriter;
private BanMirrorPoller banMirror;

@Override
public void onEnable() {
Expand Down Expand Up @@ -95,7 +96,8 @@ public void onEnable() {
new PlayerJoinListener(this, gateService),
this
);
new EssentialsBanListener(this, linkCache).register();
banMirror = new BanMirrorPoller(this, linkCache);
banMirror.start();

getLogger().info(
"TFMCWeb enabled (api="
Expand All @@ -114,6 +116,9 @@ public void onDisable() {
if (rankWriter != null) {
rankWriter.stop();
}
if (banMirror != null) {
banMirror.stop();
}
}

public LinkCache getLinkCache() {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ public void load(File configFile) {
loadTokenCooldowns(config);
PlayerMetaConfigLoader.load(config);
loadPatreon(config);
Cache.banMirrorEnabled = config.getBoolean("ban-mirror.enabled", true);
Cache.banMirrorPollSeconds = positiveOrDefault(
config.getInt("ban-mirror.poll-seconds", 30),
30
);
}

private void loadPatreon(FileConfiguration config) {
Expand Down
Loading