Skip to content
anthony.samms edited this page May 28, 2026 · 1 revision

This documents the scores manager for the simulator. The scores manager can be accessed as a global variable scores_manager.

void py_taiko_import(const fs::path& old_db_path);

Imports scores from a PyTaiko scores database. This happens automatically when a file scores_pytaiko.db is placed in the root path.

std::optional<Score> get_score(std::string& hash, int difficulty, int player_id);

Returns a score from the database, based on the given hash, difficulty, and player_id in the database. returns std::nullopt if no score matching this criteria is found.

Score save_score(std::string& hash, int difficulty, int player_id, Score score);

Saves a score to the database based on the hash, difficulty, and player_id.

void add_path_binding(const fs::path& path, const std::array<std::string, 5>& hashes);

Adds a path binding for quick lookup for hashes.

std::array<std::string, 5>& get_hashes(const fs::path& path);

Returns an array of hashes based on the path.

std::string get_single_hash(const fs::path& path);

Returns a single concatenated string based on the path.

std::optional<fs::path> get_path_by_hash(const std::string& single_hash);

Returns a path based on a concatenated hash. Returns std::nullopt if no path exists.

void add_song(const std::array<std::string, 5>& hash, const std::string& title, const std::string& subtitle);

Adds a song to the database.

void remap_hashes(const std::unordered_map<std::string, std::string>& old_to_new);

Replaces a hash with a new hash.

int add_player(const std::string& name);

Adds a player to the database with specified name. returns a player_id.

Clone this wiki locally