clean up update logic some more

This commit is contained in:
Nikhil Narayana 2022-05-31 22:17:44 -07:00
commit 4d57b3b605
4 changed files with 6 additions and 21 deletions

View file

@ -2932,18 +2932,6 @@ void CEXISlippi::handleLogOutRequest()
user->LogOut();
}
void CEXISlippi::handleUpdateAppRequest()
{
#ifdef __APPLE__
CriticalAlertT("Automatic updates are not available for macOS, please get the latest update from "
"slippi.gg/netplay.");
#else
Host_LowerWindow();
user->UpdateApp();
Host_Exit();
#endif
}
void CEXISlippi::prepareOnlineStatus()
{
m_read_queue.clear();
@ -3198,7 +3186,7 @@ void CEXISlippi::DMAWrite(u32 _uAddr, u32 _uSize)
handleChatMessage(&memPtr[bufLoc + 1]);
break;
case CMD_UPDATE:
handleUpdateAppRequest();
user->UpdateApp();
break;
case CMD_GET_NEW_SEED:
prepareNewSeed();

View file

@ -185,7 +185,6 @@ private:
bool shouldAdvanceOnlineFrame(s32 frame);
void handleLogInRequest();
void handleLogOutRequest();
void handleUpdateAppRequest();
void prepareOnlineStatus();
void handleConnectionCleanup();
void prepareNewSeed();

View file

@ -178,19 +178,19 @@ void SlippiUser::OpenLogInPage()
RunSystemCommand(command);
}
bool SlippiUser::UpdateApp()
void SlippiUser::UpdateApp()
{
#if defined(__APPLE__) || defined(_WIN32)
CriticalAlertT("Dolphin auto updates are not available on standalone builds. Migrate to "
"the Slippi Launcher at your earliest convenience");
return false;
return;
#else
const char* appimage_path = getenv("APPIMAGE");
const char* appmount_path = getenv("APPDIR");
if (!appimage_path)
{
CriticalAlertT("Automatic updates are not available for non-AppImage Linux builds.");
return false;
return;
}
std::string path(appimage_path);
std::string mount_path(appmount_path);
@ -198,7 +198,7 @@ bool SlippiUser::UpdateApp()
WARN_LOG(SLIPPI, "Executing app update command: %s", command.c_str());
RunSystemCommand(command);
CriticalAlertT("Dolphin failed to update, please head over to the Slippi Discord for support.");
return true;
return;
#endif
}
@ -261,8 +261,6 @@ std::string SlippiUser::getUserFilePath()
#if defined(__APPLE__)
std::string user_file_path =
File::GetBundleDirectory() + "/Contents/Resources" + DIR_SEP + "user.json";
#elif defined(_WIN32)
std::string user_file_path = File::GetExeDirectory() + DIR_SEP + "user.json";
#else
std::string user_file_path = File::GetUserPath(F_USERJSON_IDX);
#endif

View file

@ -28,7 +28,7 @@ public:
bool AttemptLogin();
void OpenLogInPage();
bool UpdateApp();
void UpdateApp();
void ListenForLogIn();
void LogOut();
void OverwriteLatestVersion(std::string version);