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(); 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() void CEXISlippi::prepareOnlineStatus()
{ {
m_read_queue.clear(); m_read_queue.clear();
@ -3198,7 +3186,7 @@ void CEXISlippi::DMAWrite(u32 _uAddr, u32 _uSize)
handleChatMessage(&memPtr[bufLoc + 1]); handleChatMessage(&memPtr[bufLoc + 1]);
break; break;
case CMD_UPDATE: case CMD_UPDATE:
handleUpdateAppRequest(); user->UpdateApp();
break; break;
case CMD_GET_NEW_SEED: case CMD_GET_NEW_SEED:
prepareNewSeed(); prepareNewSeed();

View file

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

View file

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

View file

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