mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-22 18:30:32 +00:00
pull in bf0c0764a2905f91bb69c8aa273677b012fa89f0
This commit is contained in:
parent
837c1f65f9
commit
dd4018cb0a
2 changed files with 22 additions and 2 deletions
|
@ -969,6 +969,9 @@ void CEXISlippi::prepareFrameData(u8* payload)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Hides frame index message on waiting for game screen
|
||||||
|
// OSD::AddTypedMessage(OSD::MessageType::FrameIndex, "", 0, OSD::Color::CYAN);
|
||||||
|
|
||||||
// If a new replay should be played, terminate the current game
|
// If a new replay should be played, terminate the current game
|
||||||
auto isNewReplay = g_replayComm->isNewReplay();
|
auto isNewReplay = g_replayComm->isNewReplay();
|
||||||
if (isNewReplay)
|
if (isNewReplay)
|
||||||
|
|
|
@ -99,11 +99,19 @@ SlippiGameReporter::SlippiGameReporter(SlippiUser* user, const std::string curre
|
||||||
|
|
||||||
m_user = user;
|
m_user = user;
|
||||||
|
|
||||||
|
run_thread = true;
|
||||||
|
reporting_thread = std::thread(&SlippiGameReporter::ReportThreadHandler, this);
|
||||||
|
|
||||||
static const mbedtls_md_info_t* s_md5_info = mbedtls_md_info_from_type(MBEDTLS_MD_MD5);
|
static const mbedtls_md_info_t* s_md5_info = mbedtls_md_info_from_type(MBEDTLS_MD_MD5);
|
||||||
m_md5_thread = std::thread([this, current_file_name]() {
|
m_md5_thread = std::thread([this, current_file_name]() {
|
||||||
|
if (!run_thread)
|
||||||
|
return;
|
||||||
|
|
||||||
std::array<u8, 16> md5_array;
|
std::array<u8, 16> md5_array;
|
||||||
mbedtls_md_file(s_md5_info, current_file_name.c_str(), md5_array.data());
|
mbedtls_md_file(s_md5_info, current_file_name.c_str(), md5_array.data());
|
||||||
this->m_iso_hash = std::string(md5_array.begin(), md5_array.end());
|
this->m_iso_hash = std::string(md5_array.begin(), md5_array.end());
|
||||||
|
if (!run_thread)
|
||||||
|
return;
|
||||||
|
|
||||||
if (known_desync_isos.find(this->m_iso_hash) != known_desync_isos.end() &&
|
if (known_desync_isos.find(this->m_iso_hash) != known_desync_isos.end() &&
|
||||||
known_desync_isos.at(this->m_iso_hash))
|
known_desync_isos.at(this->m_iso_hash))
|
||||||
|
@ -127,6 +135,9 @@ SlippiGameReporter::~SlippiGameReporter()
|
||||||
if (reporting_thread.joinable())
|
if (reporting_thread.joinable())
|
||||||
reporting_thread.join();
|
reporting_thread.join();
|
||||||
|
|
||||||
|
if (m_md5_thread.joinable())
|
||||||
|
m_md5_thread.join();
|
||||||
|
|
||||||
if (m_curl)
|
if (m_curl)
|
||||||
{
|
{
|
||||||
curl_slist_free_all(m_curl_header_list);
|
curl_slist_free_all(m_curl_header_list);
|
||||||
|
@ -282,6 +293,12 @@ void SlippiGameReporter::ReportThreadHandler()
|
||||||
|
|
||||||
// Parse the response
|
// Parse the response
|
||||||
auto r = json::parse(resp);
|
auto r = json::parse(resp);
|
||||||
|
if (!r.is_object())
|
||||||
|
{
|
||||||
|
ERROR_LOG_FMT(SLIPPI, "JSON was not an object. {}", resp);
|
||||||
|
Common::SleepCurrentThread(errorSleepMs);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
bool success = r.value("success", false);
|
bool success = r.value("success", false);
|
||||||
if (!success)
|
if (!success)
|
||||||
{
|
{
|
||||||
|
@ -368,8 +385,8 @@ void SlippiGameReporter::ReportCompletion(std::string matchId, u8 endMode)
|
||||||
if (res != 0)
|
if (res != 0)
|
||||||
{
|
{
|
||||||
ERROR_LOG_FMT(SLIPPI_ONLINE,
|
ERROR_LOG_FMT(SLIPPI_ONLINE,
|
||||||
"[GameReport] Got error executing completion request. Err code: {}",
|
"[GameReport] Got error executing completion request. Err code: {}. Msg: {}",
|
||||||
static_cast<u8>(res));
|
static_cast<u8>(res), m_curl_err_buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue