Interface FPlayerSQL
- All Superinterfaces:
SQL
- All Known Subinterfaces:
FPlayerH2, FPlayerMariaDB, FPlayerMySQL, FPlayerPostgreSQL, FPlayerSQLite
SQL interface for player data operations in FlectonePulse.
Defines database queries for player management and retrieval.
- Since:
- 0.9.0
-
Method Summary
Modifier and TypeMethodDescriptionfindById(int id) Finds a player by database ID and load settings.Finds a player by IP address and load settings.findByName(String name) Finds a player by name (case-insensitive).findByUUID(String uuid) Finds a player by UUID.Gets all players.Gets all online players.getPlayersByIp(String ip, int limit, int offset) Gets a paginated list of players with the specified IP address.intGets the total count of players with the specified IP address.intInserts a new player.default voidinsertOrIgnore(int id, String uuid, String name) Inserts a player with the given ID, or does nothing if a conflict occurs.voidsetOfflineByServer(String server) Sets all players associated with the specified server to offline status.voidUpdates player information.
-
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
Finds a player by database ID and load settings.- Parameters:
id- the player database ID- Returns:
- optional containing player info if found
-
insert
-
update
-
setOfflineByServer
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
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
Gets a paginated list of players with the specified IP address.- Parameters:
ip- the IP address to filter players bylimit- the maximum number of players to returnoffset- the number of players to skip- Returns:
- list of player info matching the IP, ordered by ID descending
-
getAllPlayers
-
insertOrIgnore
Inserts a player with the given ID, or does nothing if a conflict occurs.- Parameters:
id- the player database IDuuid- the player UUIDname- the player name- Throws:
UnsupportedDatabaseOperationException- if not overridden
-