mirror of
https://github.com/J-D-K/JKSV.git
synced 2026-08-20 09:25:02 -05:00
remote::Storage just barely working.
This commit is contained in:
@@ -73,22 +73,22 @@ data::TitleInfo::TitleInfo(uint64_t applicationID, NsApplicationControlData &con
|
||||
m_icon = sdl::TextureManager::create_load_texture(entry->name, m_data.icon, sizeof(m_data.icon));
|
||||
}
|
||||
|
||||
uint64_t data::TitleInfo::get_application_id(void) const
|
||||
uint64_t data::TitleInfo::get_application_id() const
|
||||
{
|
||||
return m_applicationID;
|
||||
}
|
||||
|
||||
NsApplicationControlData *data::TitleInfo::get_control_data(void)
|
||||
NsApplicationControlData *data::TitleInfo::get_control_data()
|
||||
{
|
||||
return &m_data;
|
||||
}
|
||||
|
||||
bool data::TitleInfo::has_control_data(void) const
|
||||
bool data::TitleInfo::has_control_data() const
|
||||
{
|
||||
return m_hasData;
|
||||
}
|
||||
|
||||
const char *data::TitleInfo::get_title(void)
|
||||
const char *data::TitleInfo::get_title()
|
||||
{
|
||||
NacpLanguageEntry *entry = nullptr;
|
||||
if (R_FAILED(nacpGetLanguageEntry(&m_data.nacp, &entry)))
|
||||
@@ -98,12 +98,12 @@ const char *data::TitleInfo::get_title(void)
|
||||
return entry->name;
|
||||
}
|
||||
|
||||
const char *data::TitleInfo::get_path_safe_title(void)
|
||||
const char *data::TitleInfo::get_path_safe_title() const
|
||||
{
|
||||
return m_pathSafeTitle;
|
||||
}
|
||||
|
||||
const char *data::TitleInfo::get_publisher(void)
|
||||
const char *data::TitleInfo::get_publisher()
|
||||
{
|
||||
NacpLanguageEntry *Entry = nullptr;
|
||||
if (R_FAILED(nacpGetLanguageEntry(&m_data.nacp, &Entry)))
|
||||
@@ -113,7 +113,7 @@ const char *data::TitleInfo::get_publisher(void)
|
||||
return Entry->author;
|
||||
}
|
||||
|
||||
uint64_t data::TitleInfo::get_save_data_owner_id(void) const
|
||||
uint64_t data::TitleInfo::get_save_data_owner_id() const
|
||||
{
|
||||
return m_data.nacp.save_data_owner_id;
|
||||
}
|
||||
@@ -312,9 +312,9 @@ int64_t data::TitleInfo::get_journal_size_max(uint8_t saveType) const
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool data::TitleInfo::has_save_data_type(uint8_t saveType)
|
||||
bool data::TitleInfo::has_save_data_type(uint8_t saveType) const
|
||||
{
|
||||
NacpStruct *nacp = &m_data.nacp;
|
||||
const NacpStruct *nacp = &m_data.nacp;
|
||||
|
||||
// I'm not 100% sure this is the best way to test for this.
|
||||
switch (saveType)
|
||||
@@ -352,7 +352,7 @@ bool data::TitleInfo::has_save_data_type(uint8_t saveType)
|
||||
return false;
|
||||
}
|
||||
|
||||
sdl::SharedTexture data::TitleInfo::get_icon(void) const
|
||||
sdl::SharedTexture data::TitleInfo::get_icon() const
|
||||
{
|
||||
return m_icon;
|
||||
}
|
||||
@@ -369,7 +369,7 @@ void data::TitleInfo::set_path_safe_title(const char *newPathSafe, size_t newPat
|
||||
std::memcpy(m_pathSafeTitle, newPathSafe, newPathLength);
|
||||
}
|
||||
|
||||
void data::TitleInfo::get_create_path_safe_title(void)
|
||||
void data::TitleInfo::get_create_path_safe_title()
|
||||
{
|
||||
// Avoid calling this function over and over.
|
||||
uint64_t applicationID = TitleInfo::get_application_id();
|
||||
|
||||
@@ -70,7 +70,7 @@ void data::User::add_data(const FsSaveDataInfo *saveInfo, const PdmPlayStatistic
|
||||
m_userData.push_back(std::make_pair(applicationID, std::make_pair(*saveInfo, *playStats)));
|
||||
}
|
||||
|
||||
void data::User::clear_data_entries(void)
|
||||
void data::User::clear_data_entries()
|
||||
{
|
||||
m_userData.clear();
|
||||
}
|
||||
@@ -80,32 +80,32 @@ void data::User::erase_data(int index)
|
||||
m_userData.erase(m_userData.begin() + index);
|
||||
}
|
||||
|
||||
void data::User::sort_data(void)
|
||||
void data::User::sort_data()
|
||||
{
|
||||
std::sort(m_userData.begin(), m_userData.end(), sort_user_data);
|
||||
}
|
||||
|
||||
AccountUid data::User::get_account_id(void) const
|
||||
AccountUid data::User::get_account_id() const
|
||||
{
|
||||
return m_accountID;
|
||||
}
|
||||
|
||||
FsSaveDataType data::User::get_account_save_type(void) const
|
||||
FsSaveDataType data::User::get_account_save_type() const
|
||||
{
|
||||
return m_saveType;
|
||||
}
|
||||
|
||||
const char *data::User::get_nickname(void) const
|
||||
const char *data::User::get_nickname() const
|
||||
{
|
||||
return m_nickname;
|
||||
}
|
||||
|
||||
const char *data::User::get_path_safe_nickname(void) const
|
||||
const char *data::User::get_path_safe_nickname() const
|
||||
{
|
||||
return m_pathSafeNickname;
|
||||
}
|
||||
|
||||
size_t data::User::get_total_data_entries(void) const
|
||||
size_t data::User::get_total_data_entries() const
|
||||
{
|
||||
return m_userData.size();
|
||||
}
|
||||
@@ -150,7 +150,7 @@ FsSaveDataInfo *data::User::get_save_info_by_id(uint64_t applicationID)
|
||||
return &findTitle->second.first;
|
||||
}
|
||||
|
||||
data::UserSaveInfoList &data::User::get_user_save_info_list(void)
|
||||
data::UserSaveInfoList &data::User::get_user_save_info_list()
|
||||
{
|
||||
return m_userData;
|
||||
}
|
||||
@@ -168,12 +168,12 @@ PdmPlayStatistics *data::User::get_play_stats_by_id(uint64_t applicationID)
|
||||
return &findTitle->second.second;
|
||||
}
|
||||
|
||||
SDL_Texture *data::User::get_icon(void)
|
||||
SDL_Texture *data::User::get_icon()
|
||||
{
|
||||
return m_icon->get();
|
||||
}
|
||||
|
||||
sdl::SharedTexture data::User::get_shared_icon(void)
|
||||
sdl::SharedTexture data::User::get_shared_icon()
|
||||
{
|
||||
return m_icon;
|
||||
}
|
||||
@@ -194,7 +194,7 @@ void data::User::erase_save_info_by_id(uint64_t applicationID)
|
||||
m_userData.erase(targetEntry);
|
||||
}
|
||||
|
||||
void data::User::load_user_data(void)
|
||||
void data::User::load_user_data()
|
||||
{
|
||||
// Pull these from config quick.
|
||||
bool accountSystemSaves = config::get_by_key(config::keys::LIST_ACCOUNT_SYS_SAVES);
|
||||
@@ -297,7 +297,7 @@ void data::User::load_account(AccountProfile &profile, AccountProfileBase &profi
|
||||
}
|
||||
}
|
||||
|
||||
void data::User::create_account(void)
|
||||
void data::User::create_account()
|
||||
{
|
||||
// This is needed a lot here.
|
||||
std::string accountIDString = stringutil::get_formatted_string("Acc_%08X", m_accountID.uid[0] & 0xFFFFFFFF);
|
||||
|
||||
@@ -41,20 +41,20 @@ namespace
|
||||
|
||||
// Declarations here. Definitions at bottom. These should appear in the order called.
|
||||
/// @brief Loads users from the system and creates the system users.
|
||||
static bool load_create_user_accounts(void);
|
||||
static bool load_create_user_accounts();
|
||||
|
||||
/// @brief Loads the application records from NS.
|
||||
static void load_application_records(void);
|
||||
static void load_application_records();
|
||||
|
||||
/// @brief Imports external SVI(Control Data) files.
|
||||
static void import_svi_files(void);
|
||||
static void import_svi_files();
|
||||
|
||||
/// @brief Attempts to read the cache file from the SD.
|
||||
/// @return True on success. False on failure.
|
||||
static bool read_cache_file(void);
|
||||
static bool read_cache_file();
|
||||
|
||||
/// @brief Creates the cache file on the SD card.
|
||||
static void create_cache_file(void);
|
||||
static void create_cache_file();
|
||||
|
||||
bool data::initialize(bool clearCache)
|
||||
{
|
||||
@@ -137,7 +137,7 @@ bool data::title_exists_in_map(uint64_t applicationID)
|
||||
return s_titleInfoMap.find(applicationID) != s_titleInfoMap.end();
|
||||
}
|
||||
|
||||
std::unordered_map<uint64_t, data::TitleInfo> &data::get_title_info_map(void)
|
||||
std::unordered_map<uint64_t, data::TitleInfo> &data::get_title_info_map()
|
||||
{
|
||||
return s_titleInfoMap;
|
||||
}
|
||||
@@ -157,7 +157,7 @@ void data::get_title_info_by_type(FsSaveDataType saveType, std::vector<data::Tit
|
||||
}
|
||||
}
|
||||
|
||||
static bool load_create_user_accounts(void)
|
||||
static bool load_create_user_accounts()
|
||||
{
|
||||
// For saving total accounts found.
|
||||
int total = 0;
|
||||
@@ -206,7 +206,7 @@ static bool load_create_user_accounts(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
static void load_application_records(void)
|
||||
static void load_application_records()
|
||||
{
|
||||
// Record struct/buffer.
|
||||
NsApplicationRecord record = {0};
|
||||
@@ -223,7 +223,7 @@ static void load_application_records(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void import_svi_files(void)
|
||||
static void import_svi_files()
|
||||
{
|
||||
// Path.
|
||||
fslib::Path sviPath = config::get_working_directory() / "svi";
|
||||
@@ -271,7 +271,7 @@ static void import_svi_files(void)
|
||||
}
|
||||
}
|
||||
|
||||
static bool read_cache_file(void)
|
||||
static bool read_cache_file()
|
||||
{
|
||||
// Try opening the cache file.
|
||||
fslib::File cache(PATH_CACHE_PATH, FsOpenMode_Read);
|
||||
@@ -311,7 +311,7 @@ static bool read_cache_file(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
static void create_cache_file(void)
|
||||
static void create_cache_file()
|
||||
{
|
||||
// First try creating and opening the file.
|
||||
fslib::File cache(PATH_CACHE_PATH, FsOpenMode_Create | FsOpenMode_Write);
|
||||
|
||||
Reference in New Issue
Block a user