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:
JosJuice
2020-06-07 22:58:03 +02:00
parent 25ebc3c07c
commit a41166bb37
34 changed files with 502 additions and 148 deletions

View File

@ -45,7 +45,8 @@ public:
void Update() override;
void AppendChat(const std::string& msg) override;
void OnMsgChangeGame(const std::string& filename) override;
void OnMsgChangeGame(const NetPlay::SyncIdentifier& sync_identifier,
const std::string& netplay_name) override;
void OnMsgStartGame() override;
void OnMsgStopGame() override;
void OnMsgPowerButton() override;
@ -65,13 +66,14 @@ public:
void OnIndexRefreshFailed(const std::string error) override;
bool IsRecording() override;
std::string FindGame(const std::string& game) override;
std::shared_ptr<const UICommon::GameFile> FindGameFile(const std::string& game) override;
std::shared_ptr<const UICommon::GameFile>
FindGameFile(const NetPlay::SyncIdentifier& sync_identifier,
NetPlay::SyncIdentifierComparison* found = nullptr) override;
void LoadSettings();
void SaveSettings();
void ShowMD5Dialog(const std::string& file_identifier) override;
void ShowMD5Dialog(const std::string& title) override;
void SetMD5Progress(int pid, int progress) override;
void SetMD5Result(int pid, const std::string& result) override;
void AbortMD5() override;
@ -145,7 +147,8 @@ private:
MD5Dialog* m_md5_dialog;
ChunkedProgressDialog* m_chunked_progress_dialog;
PadMappingDialog* m_pad_mapping;
std::string m_current_game;
NetPlay::SyncIdentifier m_current_game_identifier;
std::string m_current_game_name;
Common::Lazy<std::string> m_external_ip_address;
std::string m_nickname;
GameListModel* m_game_list_model = nullptr;