mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-02 06:08:50 +00:00
parent
ea116fbbdf
commit
2b811d8272
899 changed files with 3723 additions and 285 deletions
|
@ -164,7 +164,7 @@ void AutoUpdateChecker::CheckForUpdate(std::string_view update_track,
|
|||
std::string_view version_hash = hash_override.empty() ? Common::GetScmRevGitStr() : hash_override;
|
||||
std::string url = fmt::format("https://dolphin-emu.org/update/check/v1/{}/{}/{}", update_track,
|
||||
version_hash, GetPlatformID());
|
||||
|
||||
/*
|
||||
Common::HttpRequest req{std::chrono::seconds{10}};
|
||||
auto resp = req.Get(url);
|
||||
if (!resp)
|
||||
|
@ -201,17 +201,18 @@ void AutoUpdateChecker::CheckForUpdate(std::string_view update_track,
|
|||
nvi.changelog_html = GenerateChangelog(obj["changelog"].get<picojson::array>());
|
||||
|
||||
OnUpdateAvailable(nvi);
|
||||
*/
|
||||
}
|
||||
|
||||
void AutoUpdateChecker::TriggerUpdate(const AutoUpdateChecker::NewVersionInformation& info,
|
||||
AutoUpdateChecker::RestartMode restart_mode)
|
||||
{
|
||||
// Check to make sure we don't already have an update triggered
|
||||
if (s_update_triggered)
|
||||
/* if (s_update_triggered)
|
||||
{
|
||||
WARN_LOG_FMT(COMMON, "Auto-update: received a redundant trigger request, ignoring");
|
||||
return;
|
||||
}
|
||||
}*/
|
||||
|
||||
s_update_triggered = true;
|
||||
#ifdef OS_SUPPORTS_UPDATER
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
|
||||
#include "UICommon/DiscordPresence.h"
|
||||
|
||||
#include "Common/Hash.h"
|
||||
#include "Common/StringUtil.h"
|
||||
|
||||
#include "Core/Config/NetplaySettings.h"
|
||||
#include "Core/Config/UISettings.h"
|
||||
#include "Core/ConfigManager.h"
|
||||
|
@ -107,11 +110,6 @@ std::string ArtworkForGameId(const std::string& gameid)
|
|||
"GFT", // GFTE01: Mario Golf: Toadstool Tour
|
||||
"RMC", // RMCE01: Mario Kart Wii
|
||||
"GM4", // GM4E01: Mario Kart: Double Dash!!
|
||||
"GMP", // GMPE01: Mario Party 4
|
||||
"GP5", // GP5E01: Mario Party 5
|
||||
"GP6", // GP6E01: Mario Party 6
|
||||
"GP7", // GP7E01: Mario Party 7
|
||||
"RM8", // RM8E01: Mario Party 8
|
||||
"SSQ", // SSQE01: Mario Party 9
|
||||
"GOM", // GOME01: Mario Power Tennis
|
||||
"GYQ", // GYQE01: Mario Superstar Baseball
|
||||
|
@ -190,7 +188,7 @@ void Init()
|
|||
handlers.joinRequest = HandleDiscordJoinRequest;
|
||||
handlers.joinGame = HandleDiscordJoin;
|
||||
// The number is the client ID for Dolphin, it's used for images and the application name
|
||||
Discord_Initialize("455712169795780630", &handlers, 1, nullptr);
|
||||
Discord_Initialize("888655408623943731", &handlers, 1, nullptr);
|
||||
UpdateDiscordPresence();
|
||||
#endif
|
||||
}
|
||||
|
@ -227,31 +225,26 @@ void UpdateDiscordPresence(int party_size, SecretType type, const std::string& s
|
|||
DiscordRichPresence discord_presence = {};
|
||||
if (game_artwork.empty())
|
||||
{
|
||||
discord_presence.largeImageKey = "dolphin_logo";
|
||||
discord_presence.largeImageText = "Dolphin is an emulator for the GameCube and the Wii.";
|
||||
discord_presence.largeImageKey = "dolphin";
|
||||
}
|
||||
else
|
||||
{
|
||||
discord_presence.largeImageKey = game_artwork.c_str();
|
||||
discord_presence.largeImageText = title.c_str();
|
||||
discord_presence.smallImageKey = "dolphin_logo";
|
||||
discord_presence.smallImageText = "Dolphin is an emulator for the GameCube and the Wii.";
|
||||
discord_presence.smallImageKey = "dolphin";
|
||||
}
|
||||
discord_presence.details = title.empty() ? "Not in-game" : title.c_str();
|
||||
discord_presence.startTimestamp = std::time(nullptr);
|
||||
|
||||
if (party_size > 0)
|
||||
{
|
||||
if (party_size < 4)
|
||||
{
|
||||
discord_presence.state = "In a party";
|
||||
discord_presence.partySize = party_size;
|
||||
discord_presence.partyMax = 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
// others can still join to spectate
|
||||
discord_presence.state = "In a full party";
|
||||
discord_presence.partySize = party_size;
|
||||
// Note: joining still works without partyMax
|
||||
}
|
||||
|
|
|
@ -269,17 +269,8 @@ void SetUserDirectory(std::string custom_path)
|
|||
// Get Documents path in case we need it.
|
||||
// TODO: Maybe use WIL when it's available?
|
||||
PWSTR my_documents = nullptr;
|
||||
bool my_documents_found =
|
||||
SUCCEEDED(SHGetKnownFolderPath(FOLDERID_Documents, KF_FLAG_DEFAULT, nullptr, &my_documents));
|
||||
|
||||
if (local) // Case 1-2
|
||||
user_path = File::GetExeDirectory() + DIR_SEP USERDATA_DIR DIR_SEP;
|
||||
else if (configPath) // Case 3
|
||||
user_path = TStrToUTF8(configPath.get());
|
||||
else if (my_documents_found) // Case 4
|
||||
user_path = TStrToUTF8(my_documents) + DIR_SEP "Dolphin Emulator" DIR_SEP;
|
||||
else // Case 5
|
||||
user_path = File::GetExeDirectory() + DIR_SEP USERDATA_DIR DIR_SEP;
|
||||
user_path = File::GetExeDirectory() + DIR_SEP USERDATA_DIR DIR_SEP;
|
||||
|
||||
CoTaskMemFree(my_documents);
|
||||
#else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue