Emergency 20 Dokumentation  4.2.0
em5::AccountManager Class Reference

EMERGENCY 5 network manager class. More...

#include <AccountManager.h>

Inheritance diagram for em5::AccountManager:
qsf::Manager

Classes

struct  NewsEntry
 
struct  ProgressHttpPostQueryData
 

Public Types

typedef std::vector< qsf::CookieComponentsSessionCookies
 

Public Member Functions

 AccountManager ()
 Default constructor. More...
 
virtual ~AccountManager ()
 Destructor. More...
 
const std::string & getServerAddress () const
 
void setServerAddress (const std::string &serverAddress)
 
void setSharedSecret (const std::string &sharedSecret)
 
const std::string & getCloudSyncDirectoryAndSlug () const
 
const std::string & getGameSlug () const
 
void setGameSlug (const std::string &gameSlug)
 
const std::string & getSlug () const
 
void setCloudSyncDirectoryAndSlug (const std::string &directory, const std::string &slug)
 
bool isLoggedIn () const
 
void setCloudSyncPaused (bool paused)
 
const SessionCookiesgetSessionCookies () const
 
const OnlineAccountDatagetOnlineAccountData () const
 
std::string getAccountDirectoryPath () const
 
bool save ()
 
bool getConnectionError () const
 
bool startup ()
 
void shutdown ()
 
bool logIn (const std::string &loginName, const std::string &password, bool passwordAlreadyHashed=false)
 
void logOut ()
 
bool setTitle (const qsf::NamedIdentifier &title)
 
bool queryNewsEntry (NewsEntry &entry)
 
void triggerCloudSync (bool forceBlockingAutosaveDownload=false)
 
void tryTriggerCloudSync (bool forceBlockingAutosaveDownload=false)
 
bool isCloudSyncActive () const
 
bool isCloudSyncLocalCopyOutdated () const
 

Static Public Member Functions

static std::string getAccountDirectoryPath (const std::string &screenName)
 
static std::string getAccountTempJsonPath ()
 

Public Attributes

boost::signals2::signal< void(const std::string &, const std::string &, std::string &, qsf::StringQueryParameters &)> LogInStringQueryParameters
 This Boost signal is emitted just before the string parameters are used for log-in, log-in name as first parameter, password as second parameter, login URL as third parameter and current string query parameters as fourth parameter. More...
 
boost::signals2::signal< void(boost::property_tree::wptree &)> LogInResponsePTree
 This Boost signal is emitted after log-in response, can e.g. be used to transform the response to make it compatible with the EMERGENCY 5 account manager, first parameter is server ptree response. More...
 
boost::signals2::signal< void(std::string &, qsf::StringQueryParameters &)> LogOutStringQueryParameters
 This Boost signal is emitted just before the string parameters are used for log-out, log-out URL as first parameter and current string query parameters as second parameter. More...
 
boost::signals2::signal< void(std::string &, qsf::StringQueryParameters &)> QueryNewsEntryStringQueryParameters
 This Boost signal is emitted just before the string parameters are used for query news entry, query news entry URL as first parameter and current string query parameters as second parameter. More...
 
boost::signals2::signal< void(std::string &, qsf::StringQueryParameters &)> CloudListStringQueryParameters
 This Boost signal is emitted just before the string parameters are used for cloud list, cloud list URL as first parameter and current string query parameters as second parameter. More...
 
boost::signals2::signal< void(std::string &, qsf::MultipartFormPostData &)> CloudStoreMultipartFormPostData
 This Boost signal is emitted just before the string parameters are used for cloud store, cloud store URL as first parameter and current multipart form post data as second parameter. More...
 
boost::signals2::signal< void(const std::string &, std::string &, qsf::MultipartFormPostData &)> CloudDeleteMultipartFormPostData
 This Boost signal is emitted just before the string parameters are used for cloud delete, path as first parameter, cloud delete URL as second parameter and current multipart form post data as third parameter. More...
 
boost::signals2::signal< void(const std::string &, std::string &, qsf::MultipartFormPostData &)> CloudLoadMultipartFormPostData
 This Boost signal is emitted just before the string parameters are used for cloud load, path as first parameter, cloud load URL as second parameter and current multipart form post data as third parameter. More...
 
boost::signals2::signal< void(boost::property_tree::ptree &)> CloudResponsePTree
 This Boost signal is emitted just before the cloud ptree response is processed, can e.g. be used to transform the response to make it compatible with the EMERGENCY 5 account manager, first parameter is server ptree response. More...
 

Protected Member Functions

bool notifyAchievementProgress (const Achievement &achievement)
 
bool unlockMedal (const qsf::NamedIdentifier &medal, PlayerProgress::MedalType medalType)
 
bool setTotalScore (uint32 score)
 
uint32 submitHighscore (const std::string &ranking, const std::string &name, uint32 score, const std::string &group)
 
- Protected Member Functions inherited from qsf::Manager
 Manager ()
 Default constructor. More...
 
virtual ~Manager ()
 Destructor. More...
 

Detailed Description

EMERGENCY 5 network manager class.

Member Typedef Documentation

Constructor & Destructor Documentation

em5::AccountManager::AccountManager ( )

Default constructor.

virtual em5::AccountManager::~AccountManager ( )
virtual

Destructor.

Member Function Documentation

static std::string em5::AccountManager::getAccountDirectoryPath ( const std::string &  screenName)
static
std::string em5::AccountManager::getAccountDirectoryPath ( ) const
static std::string em5::AccountManager::getAccountTempJsonPath ( )
static
const std::string& em5::AccountManager::getCloudSyncDirectoryAndSlug ( ) const
bool em5::AccountManager::getConnectionError ( ) const
const std::string& em5::AccountManager::getGameSlug ( ) const
const OnlineAccountData& em5::AccountManager::getOnlineAccountData ( ) const
const std::string& em5::AccountManager::getServerAddress ( ) const
const SessionCookies& em5::AccountManager::getSessionCookies ( ) const
const std::string& em5::AccountManager::getSlug ( ) const
bool em5::AccountManager::isCloudSyncActive ( ) const

Returns true while the cloud sync is active (comparing or transferring)

bool em5::AccountManager::isCloudSyncLocalCopyOutdated ( ) const

Returns true while the cloud sync is active and not all locally outdated or missing files have been transferred yet

bool em5::AccountManager::isLoggedIn ( ) const
bool em5::AccountManager::logIn ( const std::string &  loginName,
const std::string &  password,
bool  passwordAlreadyHashed = false 
)
void em5::AccountManager::logOut ( )
bool em5::AccountManager::notifyAchievementProgress ( const Achievement achievement)
protected
bool em5::AccountManager::queryNewsEntry ( NewsEntry entry)
bool em5::AccountManager::save ( )
void em5::AccountManager::setCloudSyncDirectoryAndSlug ( const std::string &  directory,
const std::string &  slug 
)
void em5::AccountManager::setCloudSyncPaused ( bool  paused)
void em5::AccountManager::setGameSlug ( const std::string &  gameSlug)
void em5::AccountManager::setServerAddress ( const std::string &  serverAddress)
void em5::AccountManager::setSharedSecret ( const std::string &  sharedSecret)
bool em5::AccountManager::setTitle ( const qsf::NamedIdentifier title)
bool em5::AccountManager::setTotalScore ( uint32  score)
protected
void em5::AccountManager::shutdown ( )
bool em5::AccountManager::startup ( )
uint32 em5::AccountManager::submitHighscore ( const std::string &  ranking,
const std::string &  name,
uint32  score,
const std::string &  group 
)
protected
void em5::AccountManager::triggerCloudSync ( bool  forceBlockingAutosaveDownload = false)

Triggers a new synchronization cycle - if cloud sync is already synchronizing it will rescan all files after finishing the current synchronization

void em5::AccountManager::tryTriggerCloudSync ( bool  forceBlockingAutosaveDownload = false)

Triggers a new synchronization cycle - but only in case we're currently logged in

bool em5::AccountManager::unlockMedal ( const qsf::NamedIdentifier medal,
PlayerProgress::MedalType  medalType 
)
protected

Member Data Documentation

boost::signals2::signal<void (const std::string&, std::string&, qsf::MultipartFormPostData&)> em5::AccountManager::CloudDeleteMultipartFormPostData

This Boost signal is emitted just before the string parameters are used for cloud delete, path as first parameter, cloud delete URL as second parameter and current multipart form post data as third parameter.

boost::signals2::signal<void (std::string&, qsf::StringQueryParameters&)> em5::AccountManager::CloudListStringQueryParameters

This Boost signal is emitted just before the string parameters are used for cloud list, cloud list URL as first parameter and current string query parameters as second parameter.

boost::signals2::signal<void (const std::string&, std::string&, qsf::MultipartFormPostData&)> em5::AccountManager::CloudLoadMultipartFormPostData

This Boost signal is emitted just before the string parameters are used for cloud load, path as first parameter, cloud load URL as second parameter and current multipart form post data as third parameter.

boost::signals2::signal<void (boost::property_tree::ptree&)> em5::AccountManager::CloudResponsePTree

This Boost signal is emitted just before the cloud ptree response is processed, can e.g. be used to transform the response to make it compatible with the EMERGENCY 5 account manager, first parameter is server ptree response.

boost::signals2::signal<void (std::string&, qsf::MultipartFormPostData&)> em5::AccountManager::CloudStoreMultipartFormPostData

This Boost signal is emitted just before the string parameters are used for cloud store, cloud store URL as first parameter and current multipart form post data as second parameter.

boost::signals2::signal<void (boost::property_tree::wptree&)> em5::AccountManager::LogInResponsePTree

This Boost signal is emitted after log-in response, can e.g. be used to transform the response to make it compatible with the EMERGENCY 5 account manager, first parameter is server ptree response.

boost::signals2::signal<void (const std::string&, const std::string&, std::string&, qsf::StringQueryParameters&)> em5::AccountManager::LogInStringQueryParameters

This Boost signal is emitted just before the string parameters are used for log-in, log-in name as first parameter, password as second parameter, login URL as third parameter and current string query parameters as fourth parameter.

boost::signals2::signal<void (std::string&, qsf::StringQueryParameters&)> em5::AccountManager::LogOutStringQueryParameters

This Boost signal is emitted just before the string parameters are used for log-out, log-out URL as first parameter and current string query parameters as second parameter.

boost::signals2::signal<void (std::string&, qsf::StringQueryParameters&)> em5::AccountManager::QueryNewsEntryStringQueryParameters

This Boost signal is emitted just before the string parameters are used for query news entry, query news entry URL as first parameter and current string query parameters as second parameter.


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