mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 05:19:56 +00:00
Don't log warnings on missing RA login secret. Also don't even check unless a username has been set.
This commit is contained in:
parent
828328b50d
commit
cd79d120d8
@ -80,5 +80,7 @@ void NativeShutdown();
|
||||
|
||||
void PostLoadConfig();
|
||||
|
||||
void NativeSaveSecret(const char *nameOfSecret, const std::string &data);
|
||||
// Returns false on failure. Shouldn't really happen, though.
|
||||
bool NativeSaveSecret(const char *nameOfSecret, const std::string &data);
|
||||
// On failure, returns an empty string. Good enough since any real secret is non-empty.
|
||||
std::string NativeLoadSecret(const char *nameOfSecret);
|
||||
|
@ -536,8 +536,8 @@ void Idle() {
|
||||
if (g_rcClient && IsLoggedIn()) {
|
||||
return; // All good.
|
||||
}
|
||||
if (!HasToken() || g_isLoggingIn) {
|
||||
// Didn't login yet or is in the process of logging in. Also OK.
|
||||
if (g_Config.sAchievementsUserName.empty() || g_isLoggingIn || !HasToken()) {
|
||||
// Didn't try to login yet or is in the process of logging in. Also OK.
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1465,18 +1465,21 @@ static Path GetSecretPath(const char *nameOfSecret) {
|
||||
}
|
||||
|
||||
// name should be simple alphanumerics to avoid problems on Windows.
|
||||
void NativeSaveSecret(const char *nameOfSecret, const std::string &data) {
|
||||
bool NativeSaveSecret(const char *nameOfSecret, const std::string &data) {
|
||||
Path path = GetSecretPath(nameOfSecret);
|
||||
if (!File::WriteDataToFile(false, data.data(), (unsigned int)data.size(), path)) {
|
||||
WARN_LOG(SYSTEM, "Failed to write secret '%s' to path '%s'", nameOfSecret, path.c_str());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// On failure, returns an empty string. Good enough since any real secret is non-empty.
|
||||
std::string NativeLoadSecret(const char *nameOfSecret) {
|
||||
Path path = GetSecretPath(nameOfSecret);
|
||||
std::string data;
|
||||
if (!File::ReadFileToString(false, path, data)) {
|
||||
WARN_LOG(SYSTEM, "Failed to read secret '%s' from path '%s'", nameOfSecret, path.c_str());
|
||||
data.clear(); // just to be sure.
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user