FastLogin Documentation

repository·main·Indexed 18 days ago

https://github.com/tuxcoding/fastlogin

A Minecraft plugin that automatically detects premium players to allow them to bypass offline-mode authentication (auto-login). It supports Spigot, Paper, BungeeCord, Waterfall, and Velocity. The plugin integrates with authentication plugins like AuthMe and LoginSecurity, requires ProtocolLib 5.3+ or ProtocolSupport, and provides commands such as /premium and /cracked to manage player account status.

Tokens
2K
Snippets
5
Records
11
Agent score
68%

What's inside FastLogin

  1. Install FastLogin on Spigot/Paper

    main

    To install FastLogin on a standalone Spigot or Paper server, follow these steps:

    1. Install a Protocol Plugin: You must have either ProtocolLib 5.3+ (development build above 720) or ProtocolSupport installed.
    2. Install FastLogin: Download and add FastLoginBukkit to your plugins folder.
    3. Enable Offline Mode: Set onlinemode=false in your server.properties file.
    4. Authentication Plugin: Ensure you have a supported authentication plugin (e.g., AuthMe, LoginSecurity) installed.
  2. Install FastLogin on BungeeCord/Waterfall or Velocity

    main

    For proxy environments, FastLogin must be installed on both the proxy (BungeeCord/Velocity) and the backend Spigot server.

    1. Backend Setup:

      • Install ProtocolLib or ProtocolSupport on the Spigot server.
      • Install FastLoginBukkit on the Spigot server.
      • Enable proxy support in your server configuration (usually spigot.yml or paper.yml).
      • Restart the backend server to generate the allowed-proxies.txt file in the FastLogin folder.
      • Add your proxy ID to allowed-proxies.txt:
        • BungeeCord: Add your stats-id from the BungeeCord config.
        • Velocity: Use the proxyId.txt generated in the proxy's plugins folder.
      • Set onlinemode=false in server.properties.
    2. Proxy Setup:

      • Install FastLogin on the proxy.
      • Enable IP forwarding in your proxy configuration.
      • Configure the database in the FastLogin proxy config. Note that proxies have limited drivers:
        • BungeeCord: Supports mysql (MySQL/MariaDB).
        • Velocity: Supports mariadb (MySQL/MariaDB).
        • Note: SQLite is not available on proxies.
      • Set onlinemode=false in the proxy's config.yml.
    3. Security: Always configure your firewall so the Spigot server is only accessible through the proxy.

  3. Use ToggleCommand to manage plugin features

    main

    The ToggleCommand class is an abstract base for commands used to enable or disable specific FastLogin features. While the specific sub-commands (like toggling premium status) are implemented in subclasses, the base logic handles permission checks, console restrictions, and BungeeCord synchronization.

    Key Behaviors

    • BungeeCord Synchronization: If the BungeeCord manager is enabled, commands are forwarded to the proxy to ensure settings are synchronized across the network. Users will see a wait-on-proxy message during this process.
    • Permission Requirements: Commands typically require a primary permission. An additional .other permission suffix can be used to grant extended access.
    • Console Restriction: Most toggle commands cannot be executed from the server console; they require a Player sender to facilitate plugin messaging to the proxy.
  4. Use FastLogin PlaceholderAPI variable

    main

    If using PlaceholderAPI on Spigot, you can retrieve a player's authentication status using the %fastlogin_status% placeholder.

    Possible values:

    • Premium
    • Cracked
    • Unknown (Note: In BungeeCord environments, this value may appear briefly as Unknown due to a millisecond delay after joining).
    %fastlogin_status%
  5. Requirements for FastLogin

    main

    Before installing, ensure your environment meets these requirements:

    Java Version:

    • Java 21+ is recommended for optimal multi-threading performance.

    Server Software:

    • Spigot (or forks like Paper): 1.8.8+ (must be in offline mode).
      • Requires ProtocolLib 5.3+ (dev build > 720) or ProtocolSupport.
    • Proxies: Latest BungeeCord (or Waterfall) or Velocity (version 17+).

    Authentication:

    • An authentication plugin must be installed.
  6. FastLogin Permissions

    main

    Use these permissions to control access to FastLogin commands:

    • fastlogin.bukkit.command.premium: Permission to use the /premium command.
    • fastlogin.bukkit.command.cracked: Permission to use the /cracked command.
    • fastlogin.command.premium.other: Permission to use /premium on other players.
    • fastlogin.command.cracked.other: Permission to use /cracked on other players.
  7. Use FastLogin commands

    main

    Manually label players as premium or cracked accounts using the following commands:

    • /premium [player]: Labels the target player as a paid (premium) account.
    • /cracked [player]: Labels the target player as a cracked account.
    /premium [player]
    /cracked [player]
  8. Manage premium status with the /premium command

    main

    The /premium command allows players to toggle their premium (Online Mode) status. This command can be used by a player for themselves or by an administrator for another player.

    Usage

    • /premium: Toggles premium status for the player executing the command. If premium-warning is enabled in the configuration, the player will be prompted to confirm the action before it is applied.
    • /premium <player>: Toggles premium status for a specific player. This requires administrative permissions.

    Behavior

    • Self-toggle: If the player is already set to prefer Online Mode, the command will notify them that the status already exists. If successful, the player may be kicked from the server depending on the kick-toggle configuration setting.
    • Admin-toggle: If the target player is unknown, an error is returned. If the target is already premium, an error is returned. If successful, the player's profile is updated in storage.
    • BungeeCord Support: If the server is part of a BungeeCord network, the command is forwarded to the proxy to ensure consistency across the network.

    Permissions

    • Using the command on oneself typically requires no special permission beyond being a player.
    • Using the command on another player requires administrative permissions (defined by the plugin's permission system).
    /premium
    /premium <player>
  9. Use the /cracked command to manage premium status

    main

    The /cracked command allows players or administrators to toggle the premium (Online Mode) status for a player. This is used to switch a player between a premium account and a cracked (offline mode) account within FastLogin.

    Usage

    Toggle status for yourself: Run the command without arguments. If you are currently a premium player, it will attempt to switch you to cracked mode. Depending on your server configuration, you may be kicked to apply the changes.

    /cracked

    Toggle status for another player: Administrators can use this command to change the status of a specific player. This requires appropriate permissions.

    /cracked <player>

    Behavior

    • Switching to Cracked: If a player is currently set to onlinemodePreferred: true, running this command sets it to false and clears their UUID (id set to null).
    • Kicking: If the server configuration kick-toggle is set to true, the player will be kicked from the server when their premium status is removed to ensure the change takes effect.
    • BungeeCord Support: If FastLogin is running in a BungeeCord/Velocity network, the command is forwarded to the proxy to ensure consistency across the network.
    # No direct CLI code snippet provided in source, but usage is:
    /cracked
    /cracked <player>
  10. Delete player profiles with the delete command

    main

    Use the delete command to remove profile entries from the FastLogin storage. This command requires a username as an argument.

    Important Constraints:

    • BungeeCord Compatibility: You cannot delete profile entries while using BungeeCord. If the BungeeCord manager is enabled, the command will fail with an error.
    • Permissions: The sender must have the permission associated with the command.
    • Execution: The deletion process is performed asynchronously to prevent server lag.
    # Usage pattern (conceptual)
    /delete <username>