* change "get the latest version of this title" to version 0xffff instead of 0. this allows getting version of a title that really does have version 0 ( some jap ones for example )

git-svn-id: http://wiiqt.googlecode.com/svn/trunk@6 389f4c8b-5dfe-645f-db0e-df882bc27289
This commit is contained in:
giantpune@gmail.com 2010-12-08 08:47:19 +00:00
parent ca34183e4f
commit d795e3ffdc
3 changed files with 6 additions and 4 deletions

View File

@ -129,7 +129,7 @@ void MainWindow::on_pushButton_GetTitle_clicked()
ShowMessage( "<b>Error converting \"" + ui->lineEdit_tid->text() + "\" to a hex number.</b>" );
return;
}
quint32 ver = 0;
quint32 ver = TITLE_LATEST_VERSION;
if( !ui->lineEdit_version->text().isEmpty() )
{
ver = ui->lineEdit_version->text().toInt( &ok, 10 );

View File

@ -85,7 +85,7 @@ void NusDownloader::StartNextJob()
downloadJob tmdJob;
tmdJob.tid = QString( "%1" ).arg( currentJob.tid, 16, 16, QChar( '0' ) );
tmdJob.index = IDX_TMD;
if( currentJob.version )
if( currentJob.version != TITLE_LATEST_VERSION )
{
tmdJob.name = QString( "tmd.%1" ).arg( currentJob.version );
QByteArray stuff = GetDataFromCache( tmdJob );
@ -150,7 +150,7 @@ void NusDownloader::ReadTmdAndGetTicket( QByteArray ba )
CurrentJobErrored( tr( "TID in TMD doesn't match expected." ) );
return;
}
if( !currentJob.version )
if( currentJob.version == TITLE_LATEST_VERSION )
{
currentJob.version = qFromBigEndian( curTmd.payload()->title_version );
}

View File

@ -10,6 +10,8 @@
#define WIICONNECT24_USER_AGENT "WiiConnect24/1.0FC4plus1 (build 061114161108)"
#define NUS_BASE_URL "http://ccs.shop.wii.com/ccs/download/"
#define TITLE_LATEST_VERSION 0xffff
enum
{
IDX_CETK = 0x9000,
@ -47,7 +49,7 @@ public:
//get a title from NUS. if version is 0, get the latest one
void GetTitle( NusJob job );
void GetTitles( QList<NusJob> jobs );
void Get( quint64 tid, bool decrypt, quint16 version = 0 );
void Get( quint64 tid, bool decrypt, quint16 version = TITLE_LATEST_VERSION );
//TODO! this function is far from complete
//starts getting all the titles involved for a given update