|
| PlayerProfile (const core::stringw &name, bool is_guest=false) |
| Constructor to create a new player that didn't exist before.
|
|
| PlayerProfile (const XMLNode *node) |
| Constructor to deserialize player data that was saved to a XML file.
|
|
void | save (UTFWriter &out) |
| Writes the data for this player to the specified UTFWriter.
|
|
void | loadRemainingData (const XMLNode *node) |
| This function loads the achievement and story mode data.
|
|
void | initRemainingData () |
| Initialises the story- and achievement data structure in case of the first start of STK.
|
|
void | incrementUseFrequency () |
| Increments how often that account was used.
|
|
int | getUseFrequency () const |
|
bool | operator< (const PlayerProfile &other) |
| Comparison used to sort players.
|
|
void | raceFinished () |
| Notification of a finished race, which can trigger fulfilling challenges.
|
|
void | saveSession (int user_id, const std::string &token) |
| Saves the online data, so that it will automatically re-connect next time this profile is loaded.
|
|
void | clearSession (bool save=true) |
| Unsets any saved session data.
|
|
void | addIcon () |
| Creates an icon for a player if non exist so far.
|
|
virtual void | setUserDetails (std::shared_ptr< Online::HTTPRequest > request, const std::string &action, const std::string &url_path="") const =0 |
| Abstract virtual classes, to be implemented by the OnlinePlayer.
|
|
virtual uint32_t | getOnlineId () const =0 |
|
virtual PlayerProfile::OnlineState | getOnlineState () const =0 |
|
virtual Online::OnlineProfile * | getProfile () const =0 |
|
virtual void | requestPoll () const =0 |
|
virtual void | requestSavedSession ()=0 |
|
virtual void | requestSignIn (const irr::core::stringw &username, const irr::core::stringw &password)=0 |
|
virtual void | signIn (bool success, const XMLNode *input)=0 |
|
virtual void | signOut (bool success, const XMLNode *input, const irr::core::stringw &info)=0 |
|
virtual void | requestSignOut ()=0 |
|
virtual bool | isLoggedIn () const |
|
const std::string | getIconFilename () const |
| Returns the name of the icon file for this player.
|
|
void | setName (const core::stringw &name) |
| Sets the name of this player.
|
|
const core::stringw & | getName () const |
| Returns the name of this player.
|
|
bool | isGuestAccount () const |
| Returns true if this player is a guest account.
|
|
const core::stringw & | getLastOnlineName () const |
| Returns the last used online name.
|
|
void | setLastOnlineName (const core::stringw &name) |
| Sets the last used online name.
|
|
unsigned int | getUniqueID () const |
| Returns the unique id of this player.
|
|
bool | isLocked (const std::string &feature) const |
| Returnes if the feature (kart, track) is locked.
|
|
void | computeActive () |
| Returns all active challenges.
|
|
std::vector< const ChallengeData * > | getRecentlyCompletedChallenges () |
| Returns the list of recently completed challenges.
|
|
void | setCurrentChallenge (const std::string &name) |
| Sets the currently active challenge.
|
|
void | grandPrixFinished () |
| Callback when a GP is finished (to test if a challenge was fulfilled).
|
|
unsigned int | getNumCompletedChallenges () const |
|
unsigned int | getPoints () const |
|
unsigned int | getPointsBefore () const |
|
unsigned int | getNextUnlockPoints () const |
|
void | setFirstTime (bool b) |
|
bool | isFirstTime () const |
|
void | setFinished () |
|
bool | isFinished () const |
|
void | setSpeedrunFinished () |
|
bool | isSpeedrunFinished () |
|
void | setStoryModeTimer (int ms) |
|
int | getStoryModeTimer () |
|
void | setSpeedrunTimer (int ms) |
|
int | getSpeedrunTimer () |
|
void | clearUnlocked () |
|
const ChallengeStatus * | getCurrentChallengeStatus () const |
| Returns the current challenge for this player.
|
|
const ChallengeStatus * | getChallengeStatus (const std::string &id) |
|
unsigned int | getNumEasyTrophies () const |
|
unsigned int | getNumMediumTrophies () const |
|
unsigned int | getNumHardTrophies () const |
|
unsigned int | getNumBestTrophies () const |
|
AchievementsStatus * | getAchievementsStatus () |
|
bool | hasSavedSession () const |
| Returns true if a session was saved for this player.
|
|
StoryModeStatus * | getStoryModeStatus () |
|
int | getSavedUserId () const |
| If a session was saved, return the id of the saved user.
|
|
const std::string & | getSavedToken () const |
| If a session was saved, return the token to use.
|
|
bool | wasOnlineLastTime () const |
| Returns if the last time this player was used it was used online or offline.
|
|
void | setWasOnlineLastTime (bool b) |
| Sets if this player was logged in last time it was used.
|
|
bool | rememberPassword () const |
| Returns if the last time this player was used it was used online or offline.
|
|
void | setRememberPassword (bool b) |
| Sets if this player was logged in last time it was used.
|
|
void | setDefaultKartColor (float c) |
|
float | getDefaultKartColor () const |
|
|
core::stringw | m_local_name |
| The name of the player (wide string, so it can be in native language).
|
|
bool | m_is_guest_account |
| True if this account is a guest account.
|
|
int | m_use_frequency |
| Counts how often this player was used (always -1 for guests).
|
|
unsigned int | m_unique_id |
| A unique number for this player, used to link it to challenges etc.
|
|
std::string | m_icon_filename |
| Absolute path of the icon file for this player.
|
|
bool | m_saved_session |
| True if this user has a saved session.
|
|
int | m_saved_user_id |
| If a session was saved, this will be the online user id to use.
|
|
std::string | m_saved_token |
| The token of the saved session.
|
|
core::stringw | m_last_online_name |
| The online user name used last (empty if not used online).
|
|
bool | m_last_was_online |
| True if the last time this player was used as online.
|
|
bool | m_remember_password |
| True if the login data are saved.
|
|
float | m_default_kart_color |
| Default kart color (in hue) used in game, 0.0f to use the original.
|
|
StoryModeStatus * | m_story_mode_status |
| The complete challenge state.
|
|
AchievementsStatus * | m_achievements_status |
|
Class for managing player profiles (name, usage frequency, etc.).
All PlayerProfiles are managed by the PlayerManager. A PlayerProfile keeps track of the story mode progress using an instance of StoryModeStatus, and achievements with AchievementsStatus. All data is saved in the players.xml file. This class also defines the interface for handling online data. All of the online handling is done in the derived class OnlinePlayerProfile, where the interface is fully implemented.