Interface FPlayerSQL

All Superinterfaces:
SQL
All Known Subinterfaces:
FPlayerH2, FPlayerMariaDB, FPlayerMySQL, FPlayerPostgreSQL, FPlayerSQLite

public interface FPlayerSQL extends SQL
SQL interface for player data operations in FlectonePulse. Defines database queries for player management and retrieval.
Since:
0.9.0
  • Method Details

    • findByName

      Finds a player by name (case-insensitive).
      Parameters:
      name - the player name
      Returns:
      optional containing player info if found
    • findByUUID

      Finds a player by UUID.
      Parameters:
      uuid - the player UUID
      Returns:
      optional containing player info if found
    • findByIp

      Finds a player by IP address and load settings.
      Parameters:
      ip - the IP address
      Returns:
      optional containing player info if found
    • findById

      Optional<FPlayerDAO.PlayerInfo> findById(int id)
      Finds a player by database ID and load settings.
      Parameters:
      id - the player database ID
      Returns:
      optional containing player info if found
    • insert

      int insert(boolean online, String uuid, String name, String ip)
      Inserts a new player.
      Parameters:
      uuid - the player UUID
      name - the player name
      Returns:
      the player database ID
    • update

      void update(int id, boolean online, String uuid, String name, String ip)
      Updates player information.
      Parameters:
      id - the player database ID
      online - whether the player is online
      uuid - the player UUID
      name - the player name
      ip - the player IP address
    • setOfflineByServer

      void setOfflineByServer(String server)
      Sets all players associated with the specified server to offline status. Players without a server assignment or matching the given server will be set offline.
      Parameters:
      server - the server identifier to match against player server settings
    • getOnlinePlayers

      List<FPlayerDAO.PlayerInfo> getOnlinePlayers()
      Gets all online players.
      Returns:
      list of online player info
    • getTotalPlayersCountByIp

      int getTotalPlayersCountByIp(String ip)
      Gets the total count of players with the specified IP address.
      Parameters:
      ip - the IP address to count players for
      Returns:
      the total number of players with the given IP
    • getPlayersByIp

      List<FPlayerDAO.PlayerInfo> getPlayersByIp(String ip, int limit, int offset)
      Gets a paginated list of players with the specified IP address.
      Parameters:
      ip - the IP address to filter players by
      limit - the maximum number of players to return
      offset - the number of players to skip
      Returns:
      list of player info matching the IP, ordered by ID descending
    • getAllPlayers

      List<FPlayerDAO.PlayerInfo> getAllPlayers()
      Gets all players.
      Returns:
      list of all player info
    • insertOrIgnore

      default void insertOrIgnore(int id, String uuid, String name)
      Inserts a player with the given ID, or does nothing if a conflict occurs.
      Parameters:
      id - the player database ID
      uuid - the player UUID
      name - the player name
      Throws:
      UnsupportedDatabaseOperationException - if not overridden