RhythmGame 1.4.3
Loading...
Searching...
No Matches
Classes | Public Types | Signals | Public Member Functions | Static Public Member Functions | Static Public Attributes | Properties | Friends | List of all members
resource_managers::Profile Class Referencefinal

#include <Profile.h>

Inheritance diagram for resource_managers::Profile:
Inheritance graph
[legend]
Collaboration diagram for resource_managers::Profile:
Collaboration graph
[legend]

Public Types

enum class  LoginState { NotLoggedIn , LoggingIn , LoggedIn , LoginFailed }
 

Signals

void loginStateChanged ()
 
void tachiLoginStateChanged ()
 
void onlineUserDataChanged ()
 
void tachiDataChanged ()
 
void replayImportOperationChanged ()
 
void scoreImportOperationChanged ()
 

Public Member Functions

 Profile (const std::filesystem::path &mainDbPath, const std::filesystem::path &dbPath, const QMap< QString, qml_components::ThemeFamily > &themeFamilies, QList< QString > assetsPaths, QNetworkAccessManager *networkManager, SongAssetStore *songAssetStore, QObject *parent=nullptr)
 Creates a profile object living in the given database.
 
 ~Profile () override
 
auto getPath () const -> std::filesystem::path
 
auto getPathQString () const -> QString
 
auto getDb () -> db::SqliteCppDb &
 
auto getScoreDb () -> qml_components::ScoreDb *
 
auto getThemeConfig () const -> QQmlPropertyMap *
 
auto getVars () -> Vars *
 
auto getGuid () const -> QString
 
Q_INVOKABLE void login (const QString &email, const QString &password)
 
Q_INVOKABLE void logout ()
 
auto getLoginState () const -> LoginState
 
auto getTachiLoginState () const -> LoginState
 
auto getOnlineUserData () const -> QVariant
 
auto getOnlineUserDataValue () const -> std::optional< OnlineUserData >
 
auto getTachiData () const -> QVariant
 
auto requestArenaTicket () -> ArenaTicketOperation *
 
Q_INVOKABLE qml_components::ScoreSyncOperation * uploadScores ()
 Upload local scores to the server.
 
Q_INVOKABLE qml_components::ScoreSyncOperation * downloadScores ()
 Download scores from the server that are missing locally.
 
Q_INVOKABLE qml_components::ScoreSyncOperation * importBokutachiScores ()
 
Q_INVOKABLE void importReplays (const QString &folderPath)
 Start importing replay files from a folder.
 
auto getReplayImportOperation () const -> qml_components::ReplayImportOperation *
 
Q_INVOKABLE void importScores (const QString &databasePath)
 
auto getScoreImportOperation () const -> qml_components::ReplayImportOperation *
 
auto beginImportOp () -> qml_components::ReplayImportOperation *
 Create and publish a new import operation.
 
auto beginScoreImportOp () -> qml_components::ReplayImportOperation *
 
auto submitScore (const gameplay_logic::BmsScore &score, const gameplay_logic::ChartData &chartData) const -> QNetworkReply *
 

Static Public Member Functions

static auto credentialKey (const QString &guid) -> QString
 

Static Public Attributes

static const QString keychainService = "RhythmGame"
 

Properties

QString path
 
QQmlPropertyMap * themeConfig
 The themes selected for this profile.
 
resource_managers::Vars * vars
 The persistent configuration variables of this profile.
 
qml_components::ScoreDb * scoreDb
 The object used for querying the score database of the profile.
 
QString guid
 The unique identifier of the profile.
 
QVariant onlineUserData
 
QVariant tachiData
 
resource_managers::Profile::LoginState loginState READ getLoginState
 
resource_managers::Profile::LoginState tachiLoginState READ getTachiLoginState
 
qml_components::ReplayImportOperation *replayImportOperation READ getReplayImportOperation
 
qml_components::ReplayImportOperation *scoreImportOperation READ getScoreImportOperation
 

Friends

struct ProfileTestAccess
 

Member Enumeration Documentation

◆ LoginState

Enumerator
NotLoggedIn 
LoggingIn 
LoggedIn 
LoginFailed 

Constructor & Destructor Documentation

◆ Profile()

resource_managers::Profile::Profile ( const std::filesystem::path &  mainDbPath,
const std::filesystem::path &  dbPath,
const QMap< QString, qml_components::ThemeFamily > &  themeFamilies,
QList< QString >  assetsPaths,
QNetworkAccessManager *  networkManager,
SongAssetStore *  songAssetStore,
QObject *  parent = nullptr 
)
explicit

Creates a profile object living in the given database.

If the profile doesn't exist, it will be created.

Parameters
mainDbPathPath to the main song database file. Has to exist.
dbPathPath to the profile's database file. Doesn't have to exist.
themeFamiliesThe available theme families.
assetsPathsPaths to the avatar folders.
networkManagerThe network manager to use for online operations.
parentQObject parent.

◆ ~Profile()

resource_managers::Profile::~Profile ( )
override

Member Function Documentation

◆ beginImportOp()

auto resource_managers::Profile::beginImportOp ( ) -> qml_components::ReplayImportOperation*

Create and publish a new import operation.

Must only be called on the main thread, before starting the worker.

◆ beginScoreImportOp()

auto resource_managers::Profile::beginScoreImportOp ( ) -> qml_components::ReplayImportOperation*

◆ credentialKey()

auto resource_managers::Profile::credentialKey ( const QString &  guid) -> QString
static

◆ downloadScores()

auto resource_managers::Profile::downloadScores ( )

Download scores from the server that are missing locally.

Compares server GUIDs to local storage and downloads each missing score individually. Returns a ScoreSyncOperation that reports progress and per-score errors.

◆ getDb()

auto resource_managers::Profile::getDb ( ) -> db::SqliteCppDb&

◆ getGuid()

auto resource_managers::Profile::getGuid ( ) const -> QString

◆ getLoginState()

auto resource_managers::Profile::getLoginState ( ) const -> LoginState

◆ getOnlineUserData()

auto resource_managers::Profile::getOnlineUserData ( ) const -> QVariant

◆ getOnlineUserDataValue()

auto resource_managers::Profile::getOnlineUserDataValue ( ) const -> std::optional<OnlineUserData>

◆ getPath()

auto resource_managers::Profile::getPath ( ) const -> std::filesystem::path

◆ getPathQString()

auto resource_managers::Profile::getPathQString ( ) const -> QString

◆ getReplayImportOperation()

auto resource_managers::Profile::getReplayImportOperation ( ) const -> qml_components::ReplayImportOperation*

◆ getScoreDb()

auto resource_managers::Profile::getScoreDb ( ) -> qml_components::ScoreDb*

◆ getScoreImportOperation()

auto resource_managers::Profile::getScoreImportOperation ( ) const -> qml_components::ReplayImportOperation*

◆ getTachiData()

auto resource_managers::Profile::getTachiData ( ) const -> QVariant

◆ getTachiLoginState()

auto resource_managers::Profile::getTachiLoginState ( ) const -> LoginState

◆ getThemeConfig()

auto resource_managers::Profile::getThemeConfig ( ) const -> QQmlPropertyMap*

◆ getVars()

auto resource_managers::Profile::getVars ( ) -> Vars*

◆ importBokutachiScores()

auto resource_managers::Profile::importBokutachiScores ( )

◆ importReplays()

void resource_managers::Profile::importReplays ( const QString &  folderPath)

Start importing replay files from a folder.

Runs in the background. Progress is tracked via the replayImportOperation property.

◆ importScores()

void resource_managers::Profile::importScores ( const QString &  databasePath)

Import best scores from an LR2 or beatoraja score database.

◆ login()

void resource_managers::Profile::login ( const QString &  email,
const QString &  password 
)

◆ loginStateChanged

void resource_managers::Profile::loginStateChanged ( )
signal

◆ logout()

void resource_managers::Profile::logout ( )

◆ onlineUserDataChanged

void resource_managers::Profile::onlineUserDataChanged ( )
signal

◆ replayImportOperationChanged

void resource_managers::Profile::replayImportOperationChanged ( )
signal

◆ requestArenaTicket()

auto resource_managers::Profile::requestArenaTicket ( ) -> ArenaTicketOperation*

◆ scoreImportOperationChanged

void resource_managers::Profile::scoreImportOperationChanged ( )
signal

◆ submitScore()

auto resource_managers::Profile::submitScore ( const gameplay_logic::BmsScore &  score,
const gameplay_logic::ChartData &  chartData 
) const -> QNetworkReply*

◆ tachiDataChanged

void resource_managers::Profile::tachiDataChanged ( )
signal

◆ tachiLoginStateChanged

void resource_managers::Profile::tachiLoginStateChanged ( )
signal

◆ uploadScores()

auto resource_managers::Profile::uploadScores ( )

Upload local scores to the server.

Compares local GUIDs to the server and uploads each missing score individually. Returns a ScoreSyncOperation that reports progress and per-score errors.

Friends And Related Symbol Documentation

◆ ProfileTestAccess

friend struct ProfileTestAccess
friend

Member Data Documentation

◆ keychainService

const QString resource_managers::Profile::keychainService = "RhythmGame"
inlinestatic

Property Documentation

◆ getLoginState

resource_managers::Profile::LoginState loginState READ resource_managers::Profile::getLoginState

◆ getReplayImportOperation

qml_components::ReplayImportOperation* replayImportOperation READ resource_managers::Profile::getReplayImportOperation

◆ getScoreImportOperation

qml_components::ReplayImportOperation* scoreImportOperation READ resource_managers::Profile::getScoreImportOperation

◆ getTachiLoginState

resource_managers::Profile::LoginState tachiLoginState READ resource_managers::Profile::getTachiLoginState

◆ guid

QString resource_managers::Profile::guid
read

The unique identifier of the profile.

◆ onlineUserData

QVariant resource_managers::Profile::onlineUserData
read

◆ path

QString resource_managers::Profile::path
read

◆ scoreDb

qml_components::ScoreDb* resource_managers::Profile::scoreDb
read

The object used for querying the score database of the profile.

◆ tachiData

QVariant resource_managers::Profile::tachiData
read

◆ themeConfig

QQmlPropertyMap * resource_managers::Profile::themeConfig
read

The themes selected for this profile.

◆ vars

resource_managers::Vars* resource_managers::Profile::vars
read

The persistent configuration variables of this profile.


The documentation for this class was generated from the following files: