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