based database and account progress

This commit is contained in:
2025-01-19 21:52:37 +01:00
parent 0731339fe8
commit 3f7205d73e
4 changed files with 176 additions and 64 deletions

View File

@ -120,3 +120,9 @@ func LoadPlayerState(playerID int) (x, y int, err error) {
}
return x, y, err
}
func GetUsername(playerID int) (string, error) {
var username string
err := db.QueryRow("SELECT username FROM players WHERE id = ?", playerID).Scan(&username)
return username, err
}