mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 08:09:26 +01:00
split adding the ticket to its own function (installing a wad)
This commit is contained in:
parent
1f83078b5f
commit
3fb42f6bb6
@ -536,20 +536,14 @@ u64 CNANDContentManager::Install_WiiWAD(std::string &fileName)
|
||||
|
||||
pTMDFile.Close();
|
||||
|
||||
|
||||
|
||||
|
||||
//Extract and copy WAD's ticket to ticket directory
|
||||
std::string TicketFileName = Common::GetTicketFileName(TitleID);
|
||||
|
||||
File::CreateFullPath(TicketFileName);
|
||||
File::IOFile pTicketFile(TicketFileName, "wb");
|
||||
if (!pTicketFile)
|
||||
if (!Add_Ticket(TitleID, ContentLoader.GetTIK(), ContentLoader.GetTIKSize()))
|
||||
{
|
||||
PanicAlertT("WAD installation failed: error creating %s", TicketFileName.c_str());
|
||||
PanicAlertT("WAD installation failed: error creating ticket");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (ContentLoader.GetTIK())
|
||||
{
|
||||
pTicketFile.WriteBytes(ContentLoader.GetTIK(), ContentLoader.GetTIKSize());
|
||||
}
|
||||
|
||||
cUIDsys::AccessInstance().AddTitle(TitleID);
|
||||
@ -558,6 +552,18 @@ u64 CNANDContentManager::Install_WiiWAD(std::string &fileName)
|
||||
return TitleID;
|
||||
}
|
||||
|
||||
bool Add_Ticket(u64 TitleID, const u8 *p_tik, u32 tikSize)
|
||||
{
|
||||
std::string TicketFileName = Common::GetTicketFileName(TitleID);
|
||||
File::CreateFullPath(TicketFileName);
|
||||
File::IOFile pTicketFile(TicketFileName, "wb");
|
||||
if (!pTicketFile || !p_tik)
|
||||
{
|
||||
//PanicAlertT("WAD installation failed: error creating %s", TicketFileName.c_str());
|
||||
return false;
|
||||
}
|
||||
return pTicketFile.WriteBytes(p_tik, tikSize);
|
||||
}
|
||||
|
||||
} // namespace end
|
||||
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
namespace DiscIO
|
||||
{
|
||||
|
||||
bool Add_Ticket(u64 TitleID, const u8 *p_tik, u32 tikSize);
|
||||
struct SNANDContent
|
||||
{
|
||||
u32 m_ContentID;
|
||||
|
Loading…
x
Reference in New Issue
Block a user