mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Make netplay's "same game" check more robust
Instead of comparing the game ID, revision, disc number and name, we can compare a hash of important parts of the disc including all the aforementioned data but also additional data such as the FST. The primary reason why I'm making this change is to let us catch more desyncs before they happen, but this should also fix https://bugs.dolphin-emu.org/issues/12115. As a bonus, the UI can now distinguish the case where a client doesn't have the game at all from the case where a client has the wrong version of the game.
This commit is contained in:
@ -403,9 +403,7 @@ void GameList::ShowContextMenu(const QPoint&)
|
||||
|
||||
QAction* netplay_host = new QAction(tr("Host with NetPlay"), menu);
|
||||
|
||||
connect(netplay_host, &QAction::triggered, [this, game] {
|
||||
emit NetPlayHost(QString::fromStdString(game->GetUniqueIdentifier()));
|
||||
});
|
||||
connect(netplay_host, &QAction::triggered, [this, game] { emit NetPlayHost(*game); });
|
||||
|
||||
connect(&Settings::Instance(), &Settings::EmulationStateChanged, menu, [=](Core::State state) {
|
||||
netplay_host->setEnabled(state == Core::State::Uninitialized);
|
||||
|
@ -47,7 +47,7 @@ public:
|
||||
|
||||
signals:
|
||||
void GameSelected();
|
||||
void NetPlayHost(const QString& game_id);
|
||||
void NetPlayHost(const UICommon::GameFile& game);
|
||||
void SelectionChanged(std::shared_ptr<const UICommon::GameFile> game_file);
|
||||
void OpenGeneralSettings();
|
||||
|
||||
|
@ -313,16 +313,6 @@ std::shared_ptr<const UICommon::GameFile> GameListModel::GetGameFile(int index)
|
||||
return m_games[index];
|
||||
}
|
||||
|
||||
QString GameListModel::GetPath(int index) const
|
||||
{
|
||||
return QString::fromStdString(m_games[index]->GetFilePath());
|
||||
}
|
||||
|
||||
QString GameListModel::GetUniqueIdentifier(int index) const
|
||||
{
|
||||
return QString::fromStdString(m_games[index]->GetUniqueIdentifier());
|
||||
}
|
||||
|
||||
void GameListModel::AddGame(const std::shared_ptr<const UICommon::GameFile>& game)
|
||||
{
|
||||
beginInsertRows(QModelIndex(), m_games.size(), m_games.size());
|
||||
|
@ -37,10 +37,6 @@ public:
|
||||
int columnCount(const QModelIndex& parent) const override;
|
||||
|
||||
std::shared_ptr<const UICommon::GameFile> GetGameFile(int index) const;
|
||||
// Path of the game at the specified index.
|
||||
QString GetPath(int index) const;
|
||||
// Unique identifier of the game at the specified index.
|
||||
QString GetUniqueIdentifier(int index) const;
|
||||
bool ShouldDisplayGameListItem(int index) const;
|
||||
void SetSearchTerm(const QString& term);
|
||||
|
||||
|
Reference in New Issue
Block a user