NetPlay: rename md5 -> game digest

This commit is contained in:
Shawn Hoffman 2022-07-27 18:43:16 -07:00
parent 7d2d5d914b
commit c7ce035a7f
11 changed files with 169 additions and 168 deletions

View File

@ -90,10 +90,10 @@ NetPlayClient::~NetPlayClient()
if (m_is_connected) if (m_is_connected)
{ {
m_should_compute_MD5 = false; m_should_compute_game_digest = false;
m_dialog->AbortMD5(); m_dialog->AbortGameDigest();
if (m_MD5_thread.joinable()) if (m_game_digest_thread.joinable())
m_MD5_thread.join(); m_game_digest_thread.join();
m_do_loop.Clear(); m_do_loop.Clear();
m_thread.join(); m_thread.join();
@ -442,24 +442,24 @@ void NetPlayClient::OnData(sf::Packet& packet)
OnSyncCodes(packet); OnSyncCodes(packet);
break; break;
case MessageID::ComputeMD5: case MessageID::ComputeGameDigest:
OnComputeMD5(packet); OnComputeGameDigest(packet);
break; break;
case MessageID::MD5Progress: case MessageID::GameDigestProgress:
OnMD5Progress(packet); OnGameDigestProgress(packet);
break; break;
case MessageID::MD5Result: case MessageID::GameDigestResult:
OnMD5Result(packet); OnGameDigestResult(packet);
break; break;
case MessageID::MD5Error: case MessageID::GameDigestError:
OnMD5Error(packet); OnGameDigestError(packet);
break; break;
case MessageID::MD5Abort: case MessageID::GameDigestAbort:
OnMD5Abort(); OnGameDigestAbort();
break; break;
default: default:
@ -1419,48 +1419,48 @@ void NetPlayClient::OnSyncCodesDataAR(sf::Packet& packet)
ActionReplay::UpdateSyncedCodes(synced_codes); ActionReplay::UpdateSyncedCodes(synced_codes);
} }
void NetPlayClient::OnComputeMD5(sf::Packet& packet) void NetPlayClient::OnComputeGameDigest(sf::Packet& packet)
{ {
SyncIdentifier sync_identifier; SyncIdentifier sync_identifier;
ReceiveSyncIdentifier(packet, sync_identifier); ReceiveSyncIdentifier(packet, sync_identifier);
ComputeMD5(sync_identifier); ComputeGameDigest(sync_identifier);
} }
void NetPlayClient::OnMD5Progress(sf::Packet& packet) void NetPlayClient::OnGameDigestProgress(sf::Packet& packet)
{ {
PlayerId pid; PlayerId pid;
int progress; int progress;
packet >> pid; packet >> pid;
packet >> progress; packet >> progress;
m_dialog->SetMD5Progress(pid, progress); m_dialog->SetGameDigestProgress(pid, progress);
} }
void NetPlayClient::OnMD5Result(sf::Packet& packet) void NetPlayClient::OnGameDigestResult(sf::Packet& packet)
{ {
PlayerId pid; PlayerId pid;
std::string result; std::string result;
packet >> pid; packet >> pid;
packet >> result; packet >> result;
m_dialog->SetMD5Result(pid, result); m_dialog->SetGameDigestResult(pid, result);
} }
void NetPlayClient::OnMD5Error(sf::Packet& packet) void NetPlayClient::OnGameDigestError(sf::Packet& packet)
{ {
PlayerId pid; PlayerId pid;
std::string error; std::string error;
packet >> pid; packet >> pid;
packet >> error; packet >> error;
m_dialog->SetMD5Result(pid, error); m_dialog->SetGameDigestResult(pid, error);
} }
void NetPlayClient::OnMD5Abort() void NetPlayClient::OnGameDigestAbort()
{ {
m_should_compute_MD5 = false; m_should_compute_game_digest = false;
m_dialog->AbortMD5(); m_dialog->AbortGameDigest();
} }
void NetPlayClient::Send(const sf::Packet& packet, const u8 channel_id) void NetPlayClient::Send(const sf::Packet& packet, const u8 channel_id)
@ -2469,13 +2469,13 @@ static std::string MD5Sum(const std::string& file_path, std::function<bool(int)>
return fmt::format("{:02x}", fmt::join(output, "")); return fmt::format("{:02x}", fmt::join(output, ""));
} }
void NetPlayClient::ComputeMD5(const SyncIdentifier& sync_identifier) void NetPlayClient::ComputeGameDigest(const SyncIdentifier& sync_identifier)
{ {
if (m_should_compute_MD5) if (m_should_compute_game_digest)
return; return;
m_dialog->ShowMD5Dialog(sync_identifier.game_id); m_dialog->ShowGameDigestDialog(sync_identifier.game_id);
m_should_compute_MD5 = true; m_should_compute_game_digest = true;
std::string file; std::string file;
if (sync_identifier == GetSDCardIdentifier()) if (sync_identifier == GetSDCardIdentifier())
@ -2486,26 +2486,26 @@ void NetPlayClient::ComputeMD5(const SyncIdentifier& sync_identifier)
if (file.empty() || !File::Exists(file)) if (file.empty() || !File::Exists(file))
{ {
sf::Packet packet; sf::Packet packet;
packet << MessageID::MD5Error; packet << MessageID::GameDigestError;
packet << "file not found"; packet << "file not found";
Send(packet); Send(packet);
return; return;
} }
if (m_MD5_thread.joinable()) if (m_game_digest_thread.joinable())
m_MD5_thread.join(); m_game_digest_thread.join();
m_MD5_thread = std::thread([this, file]() { m_game_digest_thread = std::thread([this, file]() {
std::string sum = MD5Sum(file, [&](int progress) { std::string sum = MD5Sum(file, [&](int progress) {
sf::Packet packet; sf::Packet packet;
packet << MessageID::MD5Progress; packet << MessageID::GameDigestProgress;
packet << progress; packet << progress;
SendAsync(std::move(packet)); SendAsync(std::move(packet));
return m_should_compute_MD5; return m_should_compute_game_digest;
}); });
sf::Packet packet; sf::Packet packet;
packet << MessageID::MD5Result; packet << MessageID::GameDigestResult;
packet << sum; packet << sum;
SendAsync(std::move(packet)); SendAsync(std::move(packet));
}); });

View File

@ -73,10 +73,10 @@ public:
SyncIdentifierComparison* found = nullptr) = 0; SyncIdentifierComparison* found = nullptr) = 0;
virtual std::string FindGBARomPath(const std::array<u8, 20>& hash, std::string_view title, virtual std::string FindGBARomPath(const std::array<u8, 20>& hash, std::string_view title,
int device_number) = 0; int device_number) = 0;
virtual void ShowMD5Dialog(const std::string& title) = 0; virtual void ShowGameDigestDialog(const std::string& title) = 0;
virtual void SetMD5Progress(int pid, int progress) = 0; virtual void SetGameDigestProgress(int pid, int progress) = 0;
virtual void SetMD5Result(int pid, const std::string& result) = 0; virtual void SetGameDigestResult(int pid, const std::string& result) = 0;
virtual void AbortMD5() = 0; virtual void AbortGameDigest() = 0;
virtual void OnIndexAdded(bool success, std::string error) = 0; virtual void OnIndexAdded(bool success, std::string error) = 0;
virtual void OnIndexRefreshFailed(std::string error) = 0; virtual void OnIndexRefreshFailed(std::string error) = 0;
@ -248,7 +248,7 @@ private:
void Disconnect(); void Disconnect();
bool Connect(); bool Connect();
void SendGameStatus(); void SendGameStatus();
void ComputeMD5(const SyncIdentifier& sync_identifier); void ComputeGameDigest(const SyncIdentifier& sync_identifier);
void DisplayPlayersPing(); void DisplayPlayersPing();
u32 GetPlayersMaxPing() const; u32 GetPlayersMaxPing() const;
@ -291,11 +291,11 @@ private:
void OnSyncCodesDataGecko(sf::Packet& packet); void OnSyncCodesDataGecko(sf::Packet& packet);
void OnSyncCodesNotifyAR(sf::Packet& packet); void OnSyncCodesNotifyAR(sf::Packet& packet);
void OnSyncCodesDataAR(sf::Packet& packet); void OnSyncCodesDataAR(sf::Packet& packet);
void OnComputeMD5(sf::Packet& packet); void OnComputeGameDigest(sf::Packet& packet);
void OnMD5Progress(sf::Packet& packet); void OnGameDigestProgress(sf::Packet& packet);
void OnMD5Result(sf::Packet& packet); void OnGameDigestResult(sf::Packet& packet);
void OnMD5Error(sf::Packet& packet); void OnGameDigestError(sf::Packet& packet);
void OnMD5Abort(); void OnGameDigestAbort();
bool m_is_connected = false; bool m_is_connected = false;
ConnectionState m_connection_state = ConnectionState::Failure; ConnectionState m_connection_state = ConnectionState::Failure;
@ -307,8 +307,8 @@ private:
std::string m_player_name; std::string m_player_name;
bool m_connecting = false; bool m_connecting = false;
TraversalClient* m_traversal_client = nullptr; TraversalClient* m_traversal_client = nullptr;
std::thread m_MD5_thread; std::thread m_game_digest_thread;
bool m_should_compute_MD5 = false; bool m_should_compute_game_digest = false;
Common::Event m_gc_pad_event; Common::Event m_gc_pad_event;
Common::Event m_wii_pad_event; Common::Event m_wii_pad_event;
Common::Event m_first_pad_status_received_event; Common::Event m_first_pad_status_received_event;

View File

@ -168,11 +168,11 @@ enum class MessageID : u8
TimeBase = 0xB0, TimeBase = 0xB0,
DesyncDetected = 0xB1, DesyncDetected = 0xB1,
ComputeMD5 = 0xC0, ComputeGameDigest = 0xC0,
MD5Progress = 0xC1, GameDigestProgress = 0xC1,
MD5Result = 0xC2, GameDigestResult = 0xC2,
MD5Abort = 0xC3, GameDigestAbort = 0xC3,
MD5Error = 0xC4, GameDigestError = 0xC4,
Ready = 0xD0, Ready = 0xD0,
NotReady = 0xD1, NotReady = 0xD1,

View File

@ -1068,13 +1068,13 @@ unsigned int NetPlayServer::OnData(sf::Packet& packet, Client& player)
} }
break; break;
case MessageID::MD5Progress: case MessageID::GameDigestProgress:
{ {
int progress; int progress;
packet >> progress; packet >> progress;
sf::Packet spac; sf::Packet spac;
spac << MessageID::MD5Progress; spac << MessageID::GameDigestProgress;
spac << player.pid; spac << player.pid;
spac << progress; spac << progress;
@ -1082,13 +1082,13 @@ unsigned int NetPlayServer::OnData(sf::Packet& packet, Client& player)
} }
break; break;
case MessageID::MD5Result: case MessageID::GameDigestResult:
{ {
std::string result; std::string result;
packet >> result; packet >> result;
sf::Packet spac; sf::Packet spac;
spac << MessageID::MD5Result; spac << MessageID::GameDigestResult;
spac << player.pid; spac << player.pid;
spac << result; spac << result;
@ -1096,13 +1096,13 @@ unsigned int NetPlayServer::OnData(sf::Packet& packet, Client& player)
} }
break; break;
case MessageID::MD5Error: case MessageID::GameDigestError:
{ {
std::string error; std::string error;
packet >> error; packet >> error;
sf::Packet spac; sf::Packet spac;
spac << MessageID::MD5Error; spac << MessageID::GameDigestError;
spac << player.pid; spac << player.pid;
spac << error; spac << error;
@ -1252,10 +1252,10 @@ bool NetPlayServer::ChangeGame(const SyncIdentifier& sync_identifier,
} }
// called from ---GUI--- thread // called from ---GUI--- thread
bool NetPlayServer::ComputeMD5(const SyncIdentifier& sync_identifier) bool NetPlayServer::ComputeGameDigest(const SyncIdentifier& sync_identifier)
{ {
sf::Packet spac; sf::Packet spac;
spac << MessageID::ComputeMD5; spac << MessageID::ComputeGameDigest;
SendSyncIdentifier(spac, sync_identifier); SendSyncIdentifier(spac, sync_identifier);
SendAsyncToClients(std::move(spac)); SendAsyncToClients(std::move(spac));
@ -1264,10 +1264,10 @@ bool NetPlayServer::ComputeMD5(const SyncIdentifier& sync_identifier)
} }
// called from ---GUI--- thread // called from ---GUI--- thread
bool NetPlayServer::AbortMD5() bool NetPlayServer::AbortGameDigest()
{ {
sf::Packet spac; sf::Packet spac;
spac << MessageID::MD5Abort; spac << MessageID::GameDigestAbort;
SendAsyncToClients(std::move(spac)); SendAsyncToClients(std::move(spac));
return true; return true;

View File

@ -45,8 +45,8 @@ public:
~NetPlayServer(); ~NetPlayServer();
bool ChangeGame(const SyncIdentifier& sync_identifier, const std::string& netplay_name); bool ChangeGame(const SyncIdentifier& sync_identifier, const std::string& netplay_name);
bool ComputeMD5(const SyncIdentifier& sync_identifier); bool ComputeGameDigest(const SyncIdentifier& sync_identifier);
bool AbortMD5(); bool AbortGameDigest();
void SendChatMessage(const std::string& msg); void SendChatMessage(const std::string& msg);
bool DoAllPlayersHaveIPLDump() const; bool DoAllPlayersHaveIPLDump() const;

View File

@ -33,41 +33,6 @@ add_executable(dolphin-emu
CheatSearchWidget.h CheatSearchWidget.h
CheatsManager.cpp CheatsManager.cpp
CheatsManager.h CheatsManager.h
ConvertDialog.cpp
ConvertDialog.h
DiscordHandler.cpp
DiscordHandler.h
DiscordJoinRequestDialog.cpp
DiscordJoinRequestDialog.h
FIFO/FIFOPlayerWindow.cpp
FIFO/FIFOPlayerWindow.h
FIFO/FIFOAnalyzer.cpp
FIFO/FIFOAnalyzer.h
Host.cpp
Host.h
HotkeyScheduler.cpp
HotkeyScheduler.h
Main.cpp
MainWindow.cpp
MainWindow.h
MenuBar.cpp
MenuBar.h
NKitWarningDialog.cpp
NKitWarningDialog.h
RenderWidget.cpp
RenderWidget.h
Resources.cpp
Resources.h
SearchBar.cpp
SearchBar.h
Settings.cpp
Settings.h
ToolBar.cpp
ToolBar.h
Translation.cpp
Translation.h
WiiUpdate.cpp
WiiUpdate.h
Config/ARCodeWidget.cpp Config/ARCodeWidget.cpp
Config/ARCodeWidget.h Config/ARCodeWidget.h
Config/CheatCodeEditor.cpp Config/CheatCodeEditor.cpp
@ -76,12 +41,12 @@ add_executable(dolphin-emu
Config/CheatWarningWidget.h Config/CheatWarningWidget.h
Config/CommonControllersWidget.cpp Config/CommonControllersWidget.cpp
Config/CommonControllersWidget.h Config/CommonControllersWidget.h
Config/ControllerInterface/ControllerInterfaceWindow.cpp
Config/ControllerInterface/ControllerInterfaceWindow.h
Config/ControllerInterface/DualShockUDPClientAddServerDialog.cpp Config/ControllerInterface/DualShockUDPClientAddServerDialog.cpp
Config/ControllerInterface/DualShockUDPClientAddServerDialog.h Config/ControllerInterface/DualShockUDPClientAddServerDialog.h
Config/ControllerInterface/DualShockUDPClientWidget.cpp Config/ControllerInterface/DualShockUDPClientWidget.cpp
Config/ControllerInterface/DualShockUDPClientWidget.h Config/ControllerInterface/DualShockUDPClientWidget.h
Config/ControllerInterface/ControllerInterfaceWindow.cpp
Config/ControllerInterface/ControllerInterfaceWindow.h
Config/ControllerInterface/ServerStringValidator.cpp Config/ControllerInterface/ServerStringValidator.cpp
Config/ControllerInterface/ServerStringValidator.h Config/ControllerInterface/ServerStringValidator.h
Config/ControllersWindow.cpp Config/ControllersWindow.cpp
@ -92,14 +57,14 @@ add_executable(dolphin-emu
Config/FreeLookWidget.h Config/FreeLookWidget.h
Config/FreeLookWindow.cpp Config/FreeLookWindow.cpp
Config/FreeLookWindow.h Config/FreeLookWindow.h
Config/GamecubeControllersWidget.cpp
Config/GamecubeControllersWidget.h
Config/GameConfigEdit.cpp Config/GameConfigEdit.cpp
Config/GameConfigEdit.h Config/GameConfigEdit.h
Config/GameConfigHighlighter.cpp Config/GameConfigHighlighter.cpp
Config/GameConfigHighlighter.h Config/GameConfigHighlighter.h
Config/GameConfigWidget.cpp Config/GameConfigWidget.cpp
Config/GameConfigWidget.h Config/GameConfigWidget.h
Config/GamecubeControllersWidget.cpp
Config/GamecubeControllersWidget.h
Config/GeckoCodeWidget.cpp Config/GeckoCodeWidget.cpp
Config/GeckoCodeWidget.h Config/GeckoCodeWidget.h
Config/Graphics/AdvancedWidget.cpp Config/Graphics/AdvancedWidget.cpp
@ -221,6 +186,8 @@ add_executable(dolphin-emu
Config/VerifyWidget.h Config/VerifyWidget.h
Config/WiimoteControllersWidget.cpp Config/WiimoteControllersWidget.cpp
Config/WiimoteControllersWidget.h Config/WiimoteControllersWidget.h
ConvertDialog.cpp
ConvertDialog.h
Debugger/BreakpointWidget.cpp Debugger/BreakpointWidget.cpp
Debugger/BreakpointWidget.h Debugger/BreakpointWidget.h
Debugger/CodeDiffDialog.cpp Debugger/CodeDiffDialog.cpp
@ -249,6 +216,14 @@ add_executable(dolphin-emu
Debugger/ThreadWidget.h Debugger/ThreadWidget.h
Debugger/WatchWidget.cpp Debugger/WatchWidget.cpp
Debugger/WatchWidget.h Debugger/WatchWidget.h
DiscordHandler.cpp
DiscordHandler.h
DiscordJoinRequestDialog.cpp
DiscordJoinRequestDialog.h
FIFO/FIFOAnalyzer.cpp
FIFO/FIFOAnalyzer.h
FIFO/FIFOPlayerWindow.cpp
FIFO/FIFOPlayerWindow.h
GameList/GameList.cpp GameList/GameList.cpp
GameList/GameList.h GameList/GameList.h
GameList/GameListModel.cpp GameList/GameListModel.cpp
@ -263,14 +238,21 @@ add_executable(dolphin-emu
GCMemcardCreateNewDialog.h GCMemcardCreateNewDialog.h
GCMemcardManager.cpp GCMemcardManager.cpp
GCMemcardManager.h GCMemcardManager.h
QtUtils/BlockUserInputFilter.cpp Host.cpp
QtUtils/BlockUserInputFilter.h Host.h
HotkeyScheduler.cpp
HotkeyScheduler.h
Main.cpp
MainWindow.cpp
MainWindow.h
MenuBar.cpp
MenuBar.h
NetPlay/ChunkedProgressDialog.cpp NetPlay/ChunkedProgressDialog.cpp
NetPlay/ChunkedProgressDialog.h NetPlay/ChunkedProgressDialog.h
NetPlay/GameDigestDialog.cpp
NetPlay/GameDigestDialog.h
NetPlay/GameListDialog.cpp NetPlay/GameListDialog.cpp
NetPlay/GameListDialog.h NetPlay/GameListDialog.h
NetPlay/MD5Dialog.cpp
NetPlay/MD5Dialog.h
NetPlay/NetPlayBrowser.cpp NetPlay/NetPlayBrowser.cpp
NetPlay/NetPlayBrowser.h NetPlay/NetPlayBrowser.h
NetPlay/NetPlayDialog.cpp NetPlay/NetPlayDialog.cpp
@ -279,6 +261,12 @@ add_executable(dolphin-emu
NetPlay/NetPlaySetupDialog.h NetPlay/NetPlaySetupDialog.h
NetPlay/PadMappingDialog.cpp NetPlay/PadMappingDialog.cpp
NetPlay/PadMappingDialog.h NetPlay/PadMappingDialog.h
NKitWarningDialog.cpp
NKitWarningDialog.h
QtUtils/AspectRatioWidget.cpp
QtUtils/AspectRatioWidget.h
QtUtils/BlockUserInputFilter.cpp
QtUtils/BlockUserInputFilter.h
QtUtils/DolphinFileDialog.cpp QtUtils/DolphinFileDialog.cpp
QtUtils/DolphinFileDialog.h QtUtils/DolphinFileDialog.h
QtUtils/DoubleClickEventFilter.cpp QtUtils/DoubleClickEventFilter.cpp
@ -289,13 +277,15 @@ add_executable(dolphin-emu
QtUtils/FileOpenEventFilter.h QtUtils/FileOpenEventFilter.h
QtUtils/FlowLayout.cpp QtUtils/FlowLayout.cpp
QtUtils/FlowLayout.h QtUtils/FlowLayout.h
QtUtils/ImageConverter.cpp
QtUtils/ImageConverter.h
QtUtils/ModalMessageBox.cpp QtUtils/ModalMessageBox.cpp
QtUtils/ModalMessageBox.h QtUtils/ModalMessageBox.h
QtUtils/NonDefaultQPushButton.cpp
QtUtils/NonDefaultQPushButton.h
QtUtils/ParallelProgressDialog.h QtUtils/ParallelProgressDialog.h
QtUtils/PartiallyClosableTabWidget.cpp QtUtils/PartiallyClosableTabWidget.cpp
QtUtils/PartiallyClosableTabWidget.h QtUtils/PartiallyClosableTabWidget.h
QtUtils/ImageConverter.cpp
QtUtils/ImageConverter.h
QtUtils/SignalBlocking.h QtUtils/SignalBlocking.h
QtUtils/UTF8CodePointCountValidator.cpp QtUtils/UTF8CodePointCountValidator.cpp
QtUtils/UTF8CodePointCountValidator.h QtUtils/UTF8CodePointCountValidator.h
@ -305,14 +295,18 @@ add_executable(dolphin-emu
QtUtils/WinIconHelper.h QtUtils/WinIconHelper.h
QtUtils/WrapInScrollArea.cpp QtUtils/WrapInScrollArea.cpp
QtUtils/WrapInScrollArea.h QtUtils/WrapInScrollArea.h
QtUtils/AspectRatioWidget.cpp RenderWidget.cpp
QtUtils/AspectRatioWidget.h RenderWidget.h
QtUtils/NonDefaultQPushButton.cpp
QtUtils/NonDefaultQPushButton.h
ResourcePackManager.cpp ResourcePackManager.cpp
ResourcePackManager.h ResourcePackManager.h
Resources.cpp
Resources.h
RiivolutionBootWidget.cpp RiivolutionBootWidget.cpp
RiivolutionBootWidget.h RiivolutionBootWidget.h
SearchBar.cpp
SearchBar.h
Settings.cpp
Settings.h
Settings/AdvancedPane.cpp Settings/AdvancedPane.cpp
Settings/AdvancedPane.h Settings/AdvancedPane.h
Settings/AudioPane.cpp Settings/AudioPane.cpp
@ -327,26 +321,32 @@ add_executable(dolphin-emu
Settings/InterfacePane.h Settings/InterfacePane.h
Settings/PathPane.cpp Settings/PathPane.cpp
Settings/PathPane.h Settings/PathPane.h
Settings/WiiPane.cpp
Settings/WiiPane.h
Settings/USBDeviceAddToWhitelistDialog.cpp Settings/USBDeviceAddToWhitelistDialog.cpp
Settings/USBDeviceAddToWhitelistDialog.h Settings/USBDeviceAddToWhitelistDialog.h
Settings/WiiPane.cpp
Settings/WiiPane.h
TAS/GCTASInputWindow.cpp TAS/GCTASInputWindow.cpp
TAS/GCTASInputWindow.h TAS/GCTASInputWindow.h
TAS/WiiTASInputWindow.cpp TAS/IRWidget.cpp
TAS/WiiTASInputWindow.h TAS/IRWidget.h
TAS/StickWidget.cpp
TAS/StickWidget.h
TAS/TASCheckBox.cpp TAS/TASCheckBox.cpp
TAS/TASCheckBox.h TAS/TASCheckBox.h
TAS/TASInputWindow.cpp TAS/TASInputWindow.cpp
TAS/TASInputWindow.h TAS/TASInputWindow.h
TAS/TASSlider.cpp TAS/TASSlider.cpp
TAS/TASSlider.h TAS/TASSlider.h
TAS/StickWidget.cpp TAS/WiiTASInputWindow.cpp
TAS/StickWidget.h TAS/WiiTASInputWindow.h
TAS/IRWidget.cpp ToolBar.cpp
TAS/IRWidget.h ToolBar.h
Translation.cpp
Translation.h
Updater.cpp Updater.cpp
Updater.h Updater.h
WiiUpdate.cpp
WiiUpdate.h
) )
if (NOT WIN32) if (NOT WIN32)

View File

@ -156,8 +156,8 @@
<ClCompile Include="MainWindow.cpp" /> <ClCompile Include="MainWindow.cpp" />
<ClCompile Include="MenuBar.cpp" /> <ClCompile Include="MenuBar.cpp" />
<ClCompile Include="NetPlay\ChunkedProgressDialog.cpp" /> <ClCompile Include="NetPlay\ChunkedProgressDialog.cpp" />
<ClCompile Include="NetPlay\GameDigestDialog.cpp" />
<ClCompile Include="NetPlay\GameListDialog.cpp" /> <ClCompile Include="NetPlay\GameListDialog.cpp" />
<ClCompile Include="NetPlay\MD5Dialog.cpp" />
<ClCompile Include="NetPlay\NetPlayBrowser.cpp" /> <ClCompile Include="NetPlay\NetPlayBrowser.cpp" />
<ClCompile Include="NetPlay\NetPlayDialog.cpp" /> <ClCompile Include="NetPlay\NetPlayDialog.cpp" />
<ClCompile Include="NetPlay\NetPlaySetupDialog.cpp" /> <ClCompile Include="NetPlay\NetPlaySetupDialog.cpp" />
@ -345,8 +345,8 @@
<QtMoc Include="MainWindow.h" /> <QtMoc Include="MainWindow.h" />
<QtMoc Include="MenuBar.h" /> <QtMoc Include="MenuBar.h" />
<QtMoc Include="NetPlay\ChunkedProgressDialog.h" /> <QtMoc Include="NetPlay\ChunkedProgressDialog.h" />
<QtMoc Include="NetPlay\GameDigestDialog.h" />
<QtMoc Include="NetPlay\GameListDialog.h" /> <QtMoc Include="NetPlay\GameListDialog.h" />
<QtMoc Include="NetPlay\MD5Dialog.h" />
<QtMoc Include="NetPlay\NetPlayBrowser.h" /> <QtMoc Include="NetPlay\NetPlayBrowser.h" />
<QtMoc Include="NetPlay\NetPlayDialog.h" /> <QtMoc Include="NetPlay\NetPlayDialog.h" />
<QtMoc Include="NetPlay\NetPlaySetupDialog.h" /> <QtMoc Include="NetPlay\NetPlaySetupDialog.h" />

View File

@ -1,7 +1,7 @@
// Copyright 2017 Dolphin Emulator Project // Copyright 2017 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include "DolphinQt/NetPlay/MD5Dialog.h" #include "DolphinQt/NetPlay/GameDigestDialog.h"
#include <algorithm> #include <algorithm>
#include <functional> #include <functional>
@ -36,7 +36,7 @@ static QString GetPlayerNameFromPID(int pid)
return player_name; return player_name;
} }
MD5Dialog::MD5Dialog(QWidget* parent) : QDialog(parent) GameDigestDialog::GameDigestDialog(QWidget* parent) : QDialog(parent)
{ {
CreateWidgets(); CreateWidgets();
ConnectWidgets(); ConnectWidgets();
@ -45,7 +45,7 @@ MD5Dialog::MD5Dialog(QWidget* parent) : QDialog(parent)
setWindowModality(Qt::WindowModal); setWindowModality(Qt::WindowModal);
} }
void MD5Dialog::CreateWidgets() void GameDigestDialog::CreateWidgets()
{ {
m_main_layout = new QVBoxLayout; m_main_layout = new QVBoxLayout;
m_progress_box = new QGroupBox; m_progress_box = new QGroupBox;
@ -61,12 +61,12 @@ void MD5Dialog::CreateWidgets()
setLayout(m_main_layout); setLayout(m_main_layout);
} }
void MD5Dialog::ConnectWidgets() void GameDigestDialog::ConnectWidgets()
{ {
connect(m_button_box, &QDialogButtonBox::rejected, this, &MD5Dialog::reject); connect(m_button_box, &QDialogButtonBox::rejected, this, &GameDigestDialog::reject);
} }
void MD5Dialog::show(const QString& title) void GameDigestDialog::show(const QString& title)
{ {
m_progress_box->setTitle(title); m_progress_box->setTitle(title);
@ -118,7 +118,7 @@ void MD5Dialog::show(const QString& title)
QDialog::show(); QDialog::show();
} }
void MD5Dialog::SetProgress(int pid, int progress) void GameDigestDialog::SetProgress(int pid, int progress)
{ {
QString player_name = GetPlayerNameFromPID(pid); QString player_name = GetPlayerNameFromPID(pid);
@ -130,7 +130,7 @@ void MD5Dialog::SetProgress(int pid, int progress)
m_progress_bars[pid]->setValue(progress); m_progress_bars[pid]->setValue(progress);
} }
void MD5Dialog::SetResult(int pid, const std::string& result) void GameDigestDialog::SetResult(int pid, const std::string& result)
{ {
QString player_name = GetPlayerNameFromPID(pid); QString player_name = GetPlayerNameFromPID(pid);
@ -162,12 +162,12 @@ void MD5Dialog::SetResult(int pid, const std::string& result)
} }
} }
void MD5Dialog::reject() void GameDigestDialog::reject()
{ {
auto server = Settings::Instance().GetNetPlayServer(); auto server = Settings::Instance().GetNetPlayServer();
if (server) if (server)
server->AbortMD5(); server->AbortGameDigest();
QDialog::reject(); QDialog::reject();
} }

View File

@ -16,15 +16,15 @@ class QProgressBar;
class QVBoxLayout; class QVBoxLayout;
class QWidget; class QWidget;
class MD5Dialog : public QDialog class GameDigestDialog : public QDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit MD5Dialog(QWidget* parent); explicit GameDigestDialog(QWidget* parent);
void show(const QString& title); void show(const QString& title);
void SetProgress(int pid, int progress); void SetProgress(int pid, int progress);
void SetResult(int pid, const std::string& md5); void SetResult(int pid, const std::string& result);
void reject() override; void reject() override;

View File

@ -45,8 +45,8 @@
#include "Core/SyncIdentifier.h" #include "Core/SyncIdentifier.h"
#include "DolphinQt/NetPlay/ChunkedProgressDialog.h" #include "DolphinQt/NetPlay/ChunkedProgressDialog.h"
#include "DolphinQt/NetPlay/GameDigestDialog.h"
#include "DolphinQt/NetPlay/GameListDialog.h" #include "DolphinQt/NetPlay/GameListDialog.h"
#include "DolphinQt/NetPlay/MD5Dialog.h"
#include "DolphinQt/NetPlay/PadMappingDialog.h" #include "DolphinQt/NetPlay/PadMappingDialog.h"
#include "DolphinQt/QtUtils/ModalMessageBox.h" #include "DolphinQt/QtUtils/ModalMessageBox.h"
#include "DolphinQt/QtUtils/QueueOnObject.h" #include "DolphinQt/QtUtils/QueueOnObject.h"
@ -100,7 +100,7 @@ NetPlayDialog::NetPlayDialog(const GameListModel& game_list_model,
setWindowIcon(Resources::GetAppIcon()); setWindowIcon(Resources::GetAppIcon());
m_pad_mapping = new PadMappingDialog(this); m_pad_mapping = new PadMappingDialog(this);
m_md5_dialog = new MD5Dialog(this); m_game_digest_dialog = new GameDigestDialog(this);
m_chunked_progress_dialog = new ChunkedProgressDialog(this); m_chunked_progress_dialog = new ChunkedProgressDialog(this);
ResetExternalIP(); ResetExternalIP();
@ -182,19 +182,20 @@ void NetPlayDialog::CreateMainLayout()
m_network_mode_group->addAction(m_golf_mode_action); m_network_mode_group->addAction(m_golf_mode_action);
m_fixed_delay_action->setChecked(true); m_fixed_delay_action->setChecked(true);
m_md5_menu = m_menu_bar->addMenu(tr("Checksum")); m_game_digest_menu = m_menu_bar->addMenu(tr("Checksum"));
m_md5_menu->addAction(tr("Current game"), this, [this] { m_game_digest_menu->addAction(tr("Current game"), this, [this] {
Settings::Instance().GetNetPlayServer()->ComputeMD5(m_current_game_identifier); Settings::Instance().GetNetPlayServer()->ComputeGameDigest(m_current_game_identifier);
}); });
m_md5_menu->addAction(tr("Other game..."), this, [this] { m_game_digest_menu->addAction(tr("Other game..."), this, [this] {
GameListDialog gld(m_game_list_model, this); GameListDialog gld(m_game_list_model, this);
if (gld.exec() != QDialog::Accepted) if (gld.exec() != QDialog::Accepted)
return; return;
Settings::Instance().GetNetPlayServer()->ComputeMD5(gld.GetSelectedGame().GetSyncIdentifier()); Settings::Instance().GetNetPlayServer()->ComputeGameDigest(
gld.GetSelectedGame().GetSyncIdentifier());
}); });
m_md5_menu->addAction(tr("SD Card"), this, [] { m_game_digest_menu->addAction(tr("SD Card"), this, [] {
Settings::Instance().GetNetPlayServer()->ComputeMD5( Settings::Instance().GetNetPlayServer()->ComputeGameDigest(
NetPlay::NetPlayClient::GetSDCardIdentifier()); NetPlay::NetPlayClient::GetSDCardIdentifier());
}); });
@ -506,7 +507,7 @@ void NetPlayDialog::show(std::string nickname, bool use_traversal)
m_data_menu->menuAction()->setVisible(is_hosting); m_data_menu->menuAction()->setVisible(is_hosting);
m_network_menu->menuAction()->setVisible(is_hosting); m_network_menu->menuAction()->setVisible(is_hosting);
m_md5_menu->menuAction()->setVisible(is_hosting); m_game_digest_menu->menuAction()->setVisible(is_hosting);
#ifdef HAS_LIBMGBA #ifdef HAS_LIBMGBA
m_hide_remote_gbas_action->setVisible(is_hosting); m_hide_remote_gbas_action->setVisible(is_hosting);
#else #else
@ -1175,39 +1176,39 @@ void NetPlayDialog::SaveSettings()
Config::SetBase(Config::NETPLAY_NETWORK_MODE, network_mode); Config::SetBase(Config::NETPLAY_NETWORK_MODE, network_mode);
} }
void NetPlayDialog::ShowMD5Dialog(const std::string& title) void NetPlayDialog::ShowGameDigestDialog(const std::string& title)
{ {
QueueOnObject(this, [this, title] { QueueOnObject(this, [this, title] {
m_md5_menu->setEnabled(false); m_game_digest_menu->setEnabled(false);
if (m_md5_dialog->isVisible()) if (m_game_digest_dialog->isVisible())
m_md5_dialog->close(); m_game_digest_dialog->close();
m_md5_dialog->show(QString::fromStdString(title)); m_game_digest_dialog->show(QString::fromStdString(title));
}); });
} }
void NetPlayDialog::SetMD5Progress(int pid, int progress) void NetPlayDialog::SetGameDigestProgress(int pid, int progress)
{ {
QueueOnObject(this, [this, pid, progress] { QueueOnObject(this, [this, pid, progress] {
if (m_md5_dialog->isVisible()) if (m_game_digest_dialog->isVisible())
m_md5_dialog->SetProgress(pid, progress); m_game_digest_dialog->SetProgress(pid, progress);
}); });
} }
void NetPlayDialog::SetMD5Result(int pid, const std::string& result) void NetPlayDialog::SetGameDigestResult(int pid, const std::string& result)
{ {
QueueOnObject(this, [this, pid, result] { QueueOnObject(this, [this, pid, result] {
m_md5_dialog->SetResult(pid, result); m_game_digest_dialog->SetResult(pid, result);
m_md5_menu->setEnabled(true); m_game_digest_menu->setEnabled(true);
}); });
} }
void NetPlayDialog::AbortMD5() void NetPlayDialog::AbortGameDigest()
{ {
QueueOnObject(this, [this] { QueueOnObject(this, [this] {
m_md5_dialog->close(); m_game_digest_dialog->close();
m_md5_menu->setEnabled(true); m_game_digest_menu->setEnabled(true);
}); });
} }

View File

@ -17,7 +17,7 @@
class BootSessionData; class BootSessionData;
class ChunkedProgressDialog; class ChunkedProgressDialog;
class MD5Dialog; class GameDigestDialog;
class PadMappingDialog; class PadMappingDialog;
class QCheckBox; class QCheckBox;
class QComboBox; class QComboBox;
@ -85,10 +85,10 @@ public:
void LoadSettings(); void LoadSettings();
void SaveSettings(); void SaveSettings();
void ShowMD5Dialog(const std::string& title) override; void ShowGameDigestDialog(const std::string& title) override;
void SetMD5Progress(int pid, int progress) override; void SetGameDigestProgress(int pid, int progress) override;
void SetMD5Result(int pid, const std::string& result) override; void SetGameDigestResult(int pid, const std::string& result) override;
void AbortMD5() override; void AbortGameDigest() override;
void ShowChunkedProgressDialog(const std::string& title, u64 data_size, void ShowChunkedProgressDialog(const std::string& title, u64 data_size,
const std::vector<int>& players) override; const std::vector<int>& players) override;
@ -136,7 +136,7 @@ private:
QMenuBar* m_menu_bar; QMenuBar* m_menu_bar;
QMenu* m_data_menu; QMenu* m_data_menu;
QMenu* m_network_menu; QMenu* m_network_menu;
QMenu* m_md5_menu; QMenu* m_game_digest_menu;
QMenu* m_other_menu; QMenu* m_other_menu;
QPushButton* m_game_button; QPushButton* m_game_button;
QPushButton* m_start_button; QPushButton* m_start_button;
@ -159,7 +159,7 @@ private:
QActionGroup* m_network_mode_group; QActionGroup* m_network_mode_group;
QGridLayout* m_main_layout; QGridLayout* m_main_layout;
MD5Dialog* m_md5_dialog; GameDigestDialog* m_game_digest_dialog;
ChunkedProgressDialog* m_chunked_progress_dialog; ChunkedProgressDialog* m_chunked_progress_dialog;
PadMappingDialog* m_pad_mapping; PadMappingDialog* m_pad_mapping;
NetPlay::SyncIdentifier m_current_game_identifier; NetPlay::SyncIdentifier m_current_game_identifier;