# ============================================================
#  MCConsent – Paper Plugin Configuration
#  Author: SimolZimol
#  Website: https://log.devanturas.net
# ============================================================

# ── Global switch ────────────────────────────────────────────
# Set to false to completely disable all enforcement (plugin stays
# loaded but won't block any player).
enabled: true

# ── Database ─────────────────────────────────────────────────
# Connection details for the MariaDB/MySQL database where consent
# records are stored.  You can point this at the same database as
# the MCLogger plugin so consent events appear in the web panel.
database:
  host: "localhost"
  port: 3306
  database: "mclogger"
  username: "mclogger"
  password: "change_me_please"
  ssl: false
  # Maximum number of concurrent DB connections
  pool-size: 5

# ── Consent settings ─────────────────────────────────────────
consent:
  # ── Policy version ──────────────────────────────────────────
  # Change this value every time you update your Privacy Policy.
  # Players who accepted an older version will be prompted again.
  # Tip: use the Document ID shown on your MCLogger web panel
  #      policy page (e.g. "ABC123") for automatic synchronisation.
  policy-version: "1.0"

  # ── Policy URL ──────────────────────────────────────────────
  # Full URL players can visit to read the Privacy Policy.
  # If you host it via the MCLogger web panel, the URL looks like:
  #   https://your-panel.example.com/policy/<group-id>
  policy-url: "https://example.com/privacy-policy"

  # ── Enforcement mode ────────────────────────────────────────
  # KICK   – Kick the player immediately at login if no consent.
  #          Players see a disconnect screen with the policy URL.
  # HOLD   – Allow the player to join but freeze them in place.
  #          They cannot move, chat, or run commands until they
  #          accept (or the grace period expires and they get kicked).
  # REMIND – Let the player join freely; send periodic reminders
  #          but never kick.  Useful for soft opt-in scenarios.
  enforcement-mode: HOLD

  # ── Command name ────────────────────────────────────────────
  # The command players type to interact with the consent system.
  # NOTE: This only changes display text in prompts.
  #       The actual Bukkit command is always "/consent" (registered
  #       in plugin.yml with aliases /privacy and /pp).
  command: "consent"

  # ── Velocity / BungeeCord network kick ──────────────────────
  # Set to true if this server runs behind a Velocity or BungeeCord
  # proxy.  When enabled, kick messages are forwarded via the
  # BungeeCord plugin-messaging channel so the player is removed
  # from the entire network instead of just this server.
  # Requires the proxy to have the plugin-messaging channel enabled.
  velocity-kick: false

  # ── Grace period (HOLD mode only) ───────────────────────────
  # How many seconds a player has to accept before being kicked.
  # Set to 0 to wait forever (player can take as long as they like).
  grace-period-seconds: 120

  # ── Reminder interval (REMIND mode only) ────────────────────
  # How often (seconds) to resend the consent prompt to players
  # who haven't responded.  0 = send once on join only.
  reminder-interval-seconds: 300

  # ── Move-message cooldown ────────────────────────────────────
  # Minimum seconds between "please accept first" messages when a
  # player tries to move in HOLD mode.  Prevents chat spam.
  move-message-cooldown-seconds: 5

  # ── Exempt worlds ────────────────────────────────────────────
  # Players in these worlds are not subject to consent enforcement.
  # Useful if you have a lobby/hub world where players arrive before
  # being redirected to a game world.
  # Example: ["world_lobby", "world_hub"]
  exempt-worlds: []

  # ── Bypass permission ────────────────────────────────────────
  # Players with this permission bypass all consent checks.
  # Default: consent.bypass  (assigned to ops by default)
  bypass-permission: "consent.bypass"
  # ── GDPR – Aufbewahrungsfristen (Art. 5(1)(e)) ─────────────────
  # Number of days to keep accepted consent records.
  # After this period data is automatically deleted by the plugin.
  # Set to 0 to keep records indefinitely (not recommended for GDPR).
  retention-days-consent: 1095   # 3 years

  # Number of days to keep decline records.
  retention-days-declines: 1095  # 3 years
# ── Admin settings ───────────────────────────────────────────
admin:
  # Log consent accept/decline events to the server_events table in
  # the MCLogger database.  Requires database.database to point to
  # the same DB as MCLogger.
  log-to-mclogger-db: true

  # Broadcast a message to online admins when a player
  # accepts or declines the policy.
  notify-admins: false

  # Permission node required to use admin sub-commands:
  #   /consent admin reload
  #   /consent admin list
  #   /consent admin revoke <player>
  #   /consent admin forceaccept <player>
  admin-permission: "consent.admin"

# ── Messages ─────────────────────────────────────────────────
# All messages support MiniMessage formatting tags:
#   <red>, <green>, <gold>, <bold>, <italic>, <underlined>
#   <click:open_url:'URL'>, <hover:show_text:'text'>, etc.
# Available placeholders:
#   {url}      – The policy URL (consent.policy-url)
#   {command}  – The consent command (consent.command)
#   {player}   – The player's name
#   {version}  – The current policy version
#   {seconds}  – Remaining grace period seconds (where applicable)
messages:
  # ── Prefix ──────────────────────────────────────────────────
  # Prepended to every plugin message.
  prefix: "<gold>[Privacy]</gold> "

  # ── Join prompt ─────────────────────────────────────────────
  # Sent to a player when they join and consent is required.
  # This text must inform the player what data is being collected
  # and for what purpose (Art. 13 GDPR).
  join-prompt: |
    <yellow><bold>Privacy Policy Consent Required</bold></yellow>
    <gray>Before you can play you must read and accept our Privacy Policy.</gray>
    <dark_gray>We collect: chat messages, commands, login/logout times, IP address
    (pseudonymized), and player position – for server moderation purposes.</dark_gray>
    <aqua><click:open_url:'{url}'><hover:show_text:'<gray>Click to open in browser</gray>'>📄 {url}</hover></click></aqua>
    <green>➜ Type <bold>/{command} accept</bold> to agree and start playing.</green>
    <red>➜ Type <bold>/{command} decline</bold> to disconnect.</red>

  # ── Accepted ────────────────────────────────────────────────
  accepted: "<green>✔ Thank you! You have accepted the Privacy Policy (v{version}). Enjoy your stay!</green>"

  # ── Declined (shown just before the player is kicked) ───────
  declined: "<red>You declined the Privacy Policy. You cannot play on this server without accepting it.</red>"

  # ── Kick message – KICK mode, no prior consent ───────────────
  # This is the disconnect screen message (plain text only –
  # some Minecraft versions strip MiniMessage in kick screens).
  kick-message: |
    Privacy Policy Consent Required

    You must accept our Privacy Policy to play on this server.
    Visit: {url}

    Reconnect and type /{command} accept to accept.

  # ── Kick message – player declined ──────────────────────────
  decline-kick-message: |
    Privacy Policy Declined

    You have declined our Privacy Policy.
    You cannot play on this server without accepting it.
    Contact an admin if you have questions.

  # ── Grace period kick (HOLD mode) ───────────────────────────
  grace-kick-message: |
    Consent Timeout

    You did not accept the Privacy Policy within the allowed time.
    Visit: {url}
    Reconnect and type /{command} accept to accept.

  # ── Movement blocked (HOLD mode) ────────────────────────────
  hold-move-blocked: "<red>⛔ Please accept the Privacy Policy first! Type /<bold>{command} accept</bold>.</red>"

  # ── Chat blocked (HOLD mode) ────────────────────────────────
  hold-chat-blocked: "<red>⛔ You cannot chat until you accept the Privacy Policy. Type /<bold>{command} accept</bold>.</red>"

  # ── Command blocked (HOLD mode) ─────────────────────────────
  hold-command-blocked: "<red>⛔ Commands are disabled until you accept the Privacy Policy. Type /<bold>{command} accept</bold>.</red>"

  # ── Already accepted ────────────────────────────────────────
  already-accepted: "<green>✔ You have already accepted the current Privacy Policy (v{version}).</green>"

  # ── No consent currently required ───────────────────────────
  no-consent-required: "<gray>No consent is currently required on this server.</gray>"

  # ── Grace period warning ─────────────────────────────────────
  grace-warning: "<yellow>⚠ You have <bold>{seconds}s</bold> left to accept the Privacy Policy or you will be disconnected.</yellow>"

  # ── Admin broadcast: player accepted ────────────────────────
  admin-notify-accept: "<dark_gray>[Consent] <white>{player}</white> accepted the Privacy Policy (v{version}).</dark_gray>"

  # ── Admin broadcast: player declined ────────────────────────
  admin-notify-decline: "<dark_gray>[Consent] <white>{player}</white> <red>declined</red> the Privacy Policy (v{version}).</dark_gray>"

  # ── Help header ─────────────────────────────────────────────
  help-header: "<gold><bold>===== MCConsent Help =====</bold></gold>"

  # ── Remind mode reminder ─────────────────────────────────────
  remind-message: |
    <yellow>⚠ Reminder: Please accept our Privacy Policy.</yellow>
    <aqua><click:open_url:'{url}'>{url}</click></aqua>
    <green>Type /<bold>{command} accept</bold> to accept.</green>
  # ── Consent withdrawn (Art. 7(3) GDPR) ───────────────────────
  # Shown in chat just before the player is kicked after /consent withdraw.
  withdrawn: "<yellow>Your consent has been withdrawn. You will be disconnected. You may rejoin and re-accept the Privacy Policy at any time.</yellow>"

  # Disconnect screen message shown after /consent withdraw.
  withdraw-kick-message: |
    Consent Withdrawn

    You have successfully withdrawn your consent.
    Your data will be handled according to the Privacy Policy.
    You may reconnect at any time and accept the Privacy Policy.
    Visit: {url}