mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-28 11:49:06 +00: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:
parent
25ebc3c07c
commit
a41166bb37
34 changed files with 502 additions and 148 deletions
|
@ -11,6 +11,8 @@
|
|||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include <mbedtls/sha1.h>
|
||||
|
||||
#include "Common/Assert.h"
|
||||
#include "Common/ColorUtil.h"
|
||||
#include "Common/CommonTypes.h"
|
||||
|
@ -137,6 +139,19 @@ bool VolumeGC::IsDatelDisc() const
|
|||
return !GetBootDOLOffset(*this, PARTITION_NONE).has_value();
|
||||
}
|
||||
|
||||
std::array<u8, 20> VolumeGC::GetSyncHash() const
|
||||
{
|
||||
mbedtls_sha1_context context;
|
||||
mbedtls_sha1_init(&context);
|
||||
mbedtls_sha1_starts_ret(&context);
|
||||
|
||||
AddGamePartitionToSyncHash(&context);
|
||||
|
||||
std::array<u8, 20> hash;
|
||||
mbedtls_sha1_finish_ret(&context, hash.data());
|
||||
return hash;
|
||||
}
|
||||
|
||||
VolumeGC::ConvertedGCBanner VolumeGC::LoadBannerFile() const
|
||||
{
|
||||
GCBanner banner_file;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue