Welcome to the Hangar Open Beta. Please report any issue you encounter on GitHub!
Avatar for NikSne

Authorization system for servers

Report PacketAuth?

How it works

Client

  • Client is connecting to the server

    • Mod sends protocol version and token(if exists)
  • Packet received

    • Mod puts it into it's config

Server

  • Player is logging in

    • Adding player nick to outdated list
    • Server schedules next operations
      • If player still online
        • If player nick still in outdated list
          • Kick player with kick.outdated message
        • Else if tokengen.enabled is "true" and there's no db and player nick not in tokens.yml file
          • Generate random token
          • Send token to player
          • Save player's token in tokens.yml file
        • Else if tokengen.enabled is "true" and there's db and player nick not in storage.mysql.tableName table
          • Generate random token
          • Send token to player
          • Save player's token in storage.mysql.tableName table
        • Else if player nick not in verified list
          • Kick player with kick.message message
        • Else if tokenDisabling.enabled is "true" and there's no db and player nick in disabled_tokens.yml file
          • Kick player with message from disabled_tokens.yml file (if specified)
        • Else if tokenDisabling.enabled is "true" and there's db and player nick in tokenDisabling.tableName table
          • Kick player with message from tokenDisabling.tableName table (if specified)
        • Else pass player
        • Parse all placeholders
      • Remove player nick from outdated and verified lists
  • Packet received

    • Parse client protocol version and player's token from packet
    • If protocol version is compatible
      • Remove player nick from outdated list
    • If there's no db
      • If name in tokens.yml file and token is valid
        • Add player nick to verified list
    • Else
      • If name in storage.mysql.tableName table and token is valid
        • Add player nick to verified list