mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 05:47:56 -07:00
a41166bb37
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.
35 lines
1.1 KiB
C++
35 lines
1.1 KiB
C++
// Copyright 2020 Dolphin Emulator Project
|
|
// Licensed under GPLv2+
|
|
// Refer to the license.txt file included.
|
|
|
|
#pragma once
|
|
|
|
#include <optional>
|
|
#include <string>
|
|
|
|
#include <mbedtls/sha1.h>
|
|
|
|
#include "Common/CommonTypes.h"
|
|
#include "DiscIO/Volume.h"
|
|
|
|
namespace DiscIO
|
|
{
|
|
class VolumeDisc : public Volume
|
|
{
|
|
public:
|
|
std::string GetGameID(const Partition& partition = PARTITION_NONE) const override;
|
|
Country GetCountry(const Partition& partition = PARTITION_NONE) const override;
|
|
std::string GetMakerID(const Partition& partition = PARTITION_NONE) const override;
|
|
std::optional<u16> GetRevision(const Partition& partition = PARTITION_NONE) const override;
|
|
std::string GetInternalName(const Partition& partition = PARTITION_NONE) const override;
|
|
std::string GetApploaderDate(const Partition& partition) const override;
|
|
std::optional<u8> GetDiscNumber(const Partition& partition = PARTITION_NONE) const override;
|
|
bool IsNKit() const override;
|
|
|
|
protected:
|
|
Region RegionCodeToRegion(std::optional<u32> region_code) const;
|
|
void AddGamePartitionToSyncHash(mbedtls_sha1_context* context) const;
|
|
};
|
|
|
|
} // namespace DiscIO
|