fixed bug that caused the xml to not be downloaded on some wiis.

Added option to download txtcode if none is found.  The error checking for this is really weak so you might get a "file not found" page saved as a cheat text.  But its bettor than nothing.
This commit is contained in:
giantpune 2009-07-16 08:29:01 +00:00
parent 9c8243aec2
commit 9a77dbd9e6
22 changed files with 289 additions and 23 deletions

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-15 23:05-0400\n"
"POT-Creation-Date: 2009-07-16 03:53-0400\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -138,6 +138,9 @@ msgstr "Klokke"
msgid "Close"
msgstr ""
msgid "Code Download"
msgstr ""
msgid "Console"
msgstr ""
@ -276,6 +279,9 @@ msgstr "Downloade Boxart billede?"
msgid "Download Discart image?"
msgstr ""
msgid "Download Now"
msgstr ""
msgid "Download finished"
msgstr "Download færdig"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-15 23:05-0400\n"
"POT-Creation-Date: 2009-07-16 03:53-0400\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -138,6 +138,9 @@ msgstr "Klok"
msgid "Close"
msgstr "Sluiten"
msgid "Code Download"
msgstr ""
msgid "Console"
msgstr "Console"
@ -276,6 +279,9 @@ msgstr "Hoesjes downloaden?"
msgid "Download Discart image?"
msgstr ""
msgid "Download Now"
msgstr ""
msgid "Download finished"
msgstr "Downloaden voltooid"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-15 23:05-0400\n"
"POT-Creation-Date: 2009-07-16 03:53-0400\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -138,6 +138,9 @@ msgstr ""
msgid "Close"
msgstr ""
msgid "Code Download"
msgstr ""
msgid "Console"
msgstr ""
@ -276,6 +279,9 @@ msgstr ""
msgid "Download Discart image?"
msgstr ""
msgid "Download Now"
msgstr ""
msgid "Download finished"
msgstr ""

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-15 23:05-0400\n"
"POT-Creation-Date: 2009-07-16 03:53-0400\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -138,6 +138,9 @@ msgstr "Kello"
msgid "Close"
msgstr ""
msgid "Code Download"
msgstr ""
msgid "Console"
msgstr ""
@ -276,6 +279,9 @@ msgstr "Lataa kansikuva?"
msgid "Download Discart image?"
msgstr ""
msgid "Download Now"
msgstr ""
msgid "Download finished"
msgstr "Lataus valmistunut"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-15 23:05-0400\n"
"POT-Creation-Date: 2009-07-16 03:53-0400\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -138,6 +138,9 @@ msgstr "Horloge"
msgid "Close"
msgstr "Fermer"
msgid "Code Download"
msgstr ""
msgid "Console"
msgstr "Console"
@ -276,6 +279,9 @@ msgstr "Télécharger les jaquettes ?"
msgid "Download Discart image?"
msgstr ""
msgid "Download Now"
msgstr ""
msgid "Download finished"
msgstr "Téléchargement terminé"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-15 23:05-0400\n"
"POT-Creation-Date: 2009-07-16 03:53-0400\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -138,6 +138,9 @@ msgstr "Uhr"
msgid "Close"
msgstr "Schließen"
msgid "Code Download"
msgstr ""
msgid "Console"
msgstr ""
@ -276,6 +279,9 @@ msgstr "Download Boxart Bilder?"
msgid "Download Discart image?"
msgstr ""
msgid "Download Now"
msgstr ""
msgid "Download finished"
msgstr "Download abgeschlossen"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-15 23:05-0400\n"
"POT-Creation-Date: 2009-07-16 03:53-0400\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -138,6 +138,9 @@ msgstr "Orologio"
msgid "Close"
msgstr ""
msgid "Code Download"
msgstr ""
msgid "Console"
msgstr "Console"
@ -276,6 +279,9 @@ msgstr "Scaricamento Immagine Boxart?"
msgid "Download Discart image?"
msgstr ""
msgid "Download Now"
msgstr ""
msgid "Download finished"
msgstr "Scaricamento Completato"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-15 23:05-0400\n"
"POT-Creation-Date: 2009-07-16 03:53-0400\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -138,6 +138,9 @@ msgstr "Clock"
msgid "Close"
msgstr "閉じる"
msgid "Code Download"
msgstr ""
msgid "Console"
msgstr ""
@ -276,6 +279,9 @@ msgstr "Boxart イメージをダウンロードしますか?"
msgid "Download Discart image?"
msgstr ""
msgid "Download Now"
msgstr ""
msgid "Download finished"
msgstr "ダウンロードを終了しました"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-15 23:05-0400\n"
"POT-Creation-Date: 2009-07-16 03:53-0400\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -138,6 +138,9 @@ msgstr "시계"
msgid "Close"
msgstr ""
msgid "Code Download"
msgstr ""
msgid "Console"
msgstr ""
@ -276,6 +279,9 @@ msgstr "박스 이미지를 다운로드 할까요?"
msgid "Download Discart image?"
msgstr ""
msgid "Download Now"
msgstr ""
msgid "Download finished"
msgstr "다운로드 완료"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-15 23:05-0400\n"
"POT-Creation-Date: 2009-07-16 03:53-0400\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -138,6 +138,9 @@ msgstr "Klokke"
msgid "Close"
msgstr "Lukk"
msgid "Code Download"
msgstr ""
msgid "Console"
msgstr ""
@ -276,6 +279,9 @@ msgstr "Last ned cover bilde?"
msgid "Download Discart image?"
msgstr ""
msgid "Download Now"
msgstr ""
msgid "Download finished"
msgstr "Nedlasting ferdig"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-15 23:05-0400\n"
"POT-Creation-Date: 2009-07-16 03:53-0400\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -138,6 +138,9 @@ msgstr "Relógio"
msgid "Close"
msgstr "Fechar"
msgid "Code Download"
msgstr ""
msgid "Console"
msgstr ""
@ -276,6 +279,9 @@ msgstr "Baixar imagem da Caixa?"
msgid "Download Discart image?"
msgstr ""
msgid "Download Now"
msgstr ""
msgid "Download finished"
msgstr "Pronto"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-15 23:05-0400\n"
"POT-Creation-Date: 2009-07-16 03:53-0400\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -138,6 +138,9 @@ msgstr "Relógio"
msgid "Close"
msgstr "Fechar"
msgid "Code Download"
msgstr ""
msgid "Console"
msgstr ""
@ -276,6 +279,9 @@ msgstr "Descarregar imagem da Caixa?"
msgid "Download Discart image?"
msgstr ""
msgid "Download Now"
msgstr ""
msgid "Download finished"
msgstr "Download Terminado"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-15 23:05-0400\n"
"POT-Creation-Date: 2009-07-16 03:53-0400\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -138,6 +138,9 @@ msgstr "Часы"
msgid "Close"
msgstr "Закрыть"
msgid "Code Download"
msgstr ""
msgid "Console"
msgstr ""
@ -276,6 +279,9 @@ msgstr "Скачать обложку диска?"
msgid "Download Discart image?"
msgstr ""
msgid "Download Now"
msgstr ""
msgid "Download finished"
msgstr "Скачивание завершено"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-15 23:05-0400\n"
"POT-Creation-Date: 2009-07-16 03:53-0400\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -138,6 +138,9 @@ msgstr "时钟"
msgid "Close"
msgstr ""
msgid "Code Download"
msgstr ""
msgid "Console"
msgstr ""
@ -276,6 +279,9 @@ msgstr "下载封面图片?"
msgid "Download Discart image?"
msgstr ""
msgid "Download Now"
msgstr ""
msgid "Download finished"
msgstr "下载完成"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-15 23:05-0400\n"
"POT-Creation-Date: 2009-07-16 03:53-0400\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -138,6 +138,9 @@ msgstr "Reloj"
msgid "Close"
msgstr "Cerrar"
msgid "Code Download"
msgstr ""
msgid "Console"
msgstr "Consola"
@ -276,6 +279,9 @@ msgstr "¿Descargar Imágenes?"
msgid "Download Discart image?"
msgstr ""
msgid "Download Now"
msgstr ""
msgid "Download finished"
msgstr "Descarga completa"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-15 23:05-0400\n"
"POT-Creation-Date: 2009-07-16 03:53-0400\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -138,6 +138,9 @@ msgstr "Klocka"
msgid "Close"
msgstr ""
msgid "Code Download"
msgstr ""
msgid "Console"
msgstr ""
@ -276,6 +279,9 @@ msgstr "Ladda ner omslagsbild?"
msgid "Download Discart image?"
msgstr ""
msgid "Download Now"
msgstr ""
msgid "Download finished"
msgstr "Nedladdning klar"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-15 23:05-0400\n"
"POT-Creation-Date: 2009-07-16 03:53-0400\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -138,6 +138,9 @@ msgstr "時鐘"
msgid "Close"
msgstr "關閉"
msgid "Code Download"
msgstr ""
msgid "Console"
msgstr ""
@ -276,6 +279,9 @@ msgstr "下載外盒封面圖片?"
msgid "Download Discart image?"
msgstr ""
msgid "Download Now"
msgstr ""
msgid "Download finished"
msgstr "下載完成"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-15 23:05-0400\n"
"POT-Creation-Date: 2009-07-16 03:53-0400\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -138,6 +138,9 @@ msgstr "Saat"
msgid "Close"
msgstr ""
msgid "Code Download"
msgstr ""
msgid "Console"
msgstr ""
@ -276,6 +279,9 @@ msgstr "Kutu resmini indirmek ister misiniz?"
msgid "Download Discart image?"
msgstr ""
msgid "Download Now"
msgstr ""
msgid "Download finished"
msgstr "Indirme tamamlandi"

View File

@ -1 +1 @@
<pd><ViewState><e p="gui\source\mload" x="true"></e><e p="gui\source\settings" x="true"></e><e p="gui\source" x="true"></e><e p="gui\source\images" x="false"></e><e p="gui\source\libwbfs" x="true"></e><e p="gui\source\libwiigui" x="true"></e><e p="gui\source\patches" x="true"></e><e p="gui\source\prompts" x="true"></e><e p="gui\source\banner" x="false"></e><e p="gui\source\cheats" x="false"></e><e p="gui\source\network" x="true"></e><e p="gui\source\unzip" x="false"></e><e p="gui\source\usbloader" x="false"></e><e p="gui\source\xml" x="true"></e><e p="gui\source\fonts" x="false"></e><e p="gui\source\sounds" x="false"></e><e p="gui\source\wad" x="false"></e><e p="gui" x="true"></e><e p="gui\source\language" x="true"></e></ViewState></pd>
<pd><ViewState><e p="gui\source\mload" x="true"></e><e p="gui\source\settings" x="true"></e><e p="gui\source" x="true"></e><e p="gui\source\images" x="false"></e><e p="gui\source\libwbfs" x="true"></e><e p="gui\source\libwiigui" x="true"></e><e p="gui\source\patches" x="true"></e><e p="gui\source\prompts" x="true"></e><e p="gui\source\banner" x="false"></e><e p="gui\source\cheats" x="true"></e><e p="gui\source\network" x="true"></e><e p="gui\source\unzip" x="false"></e><e p="gui\source\usbloader" x="false"></e><e p="gui\source\xml" x="true"></e><e p="gui\source\fonts" x="false"></e><e p="gui\source\sounds" x="false"></e><e p="gui\source\wad" x="false"></e><e p="gui" x="true"></e><e p="gui\source\language" x="true"></e></ViewState></pd>

View File

@ -62,12 +62,21 @@ int CheatMenu(const char * gameID)
GCTCheats c;
int check = c.openTxtfile(txtfilename);
int download =0;
//char tmp[10];
switch(check)
{
case -1: WindowPrompt(tr("Error"),tr("Cheatfile is blank"),tr("OK"));
break;
case 0: WindowPrompt(tr("Error"),tr("No Cheatfile found"),tr("OK"));
case 0: download = WindowPrompt(tr("Error"),tr("No Cheatfile found"),tr("OK"),tr("Download Now"));
//snprintf(tmp, sizeof(tmp), "%i",download);
//WindowPrompt(0,tmp,tr("OK"),tr("Download Now"));
if (download==0)
download = CodeDownload(gameID);
break;
case 1:
int cntcheats = c.getCnt();

View File

@ -2368,7 +2368,8 @@ int ProgressUpdateWindow()
//make the URL to get XML based on our games
char XMLurl[2032];
char filename[10];
strncat (XMLurl, "http://wiitdb.com/wiitdb.zip?ID=", 32);
//strncat (XMLurl, "http://wiitdb.com/wiitdb.zip?ID=", 32);
strcpy (XMLurl, "http://wiitdb.com/wiitdb.zip?ID=");
unsigned int i;
for (i = 0; i < gameCnt ; i++)
{
@ -2508,6 +2509,9 @@ int ProgressUpdateWindow()
return 1;
}
#else ///////////////////this is only used if the dol is being compiled for a full channel
int ProgressUpdateWindow()
{
@ -2624,7 +2628,8 @@ int ProgressUpdateWindow()
//make the URL to get XML based on our games
char XMLurl[2032];
char filename[10];
strncat (XMLurl, "http://wiitdb.com/wiitdb.zip?ID=", 32);
//strncat (XMLurl, "http://wiitdb.com/wiitdb.zip?ID=", 32);
strcpy (XMLurl, "http://wiitdb.com/wiitdb.zip?ID=");
unsigned int i;
for (i = 0; i < gameCnt ; i++)
{
@ -2804,6 +2809,149 @@ int ProgressUpdateWindow()
}
#endif
int CodeDownload(const char *id)
{
int ret = 0;
GuiWindow promptWindow(472,320);
promptWindow.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
promptWindow.SetPosition(0, -10);
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, Settings.sfxvolume);
GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, Settings.sfxvolume);
char imgPath[100];
snprintf(imgPath, sizeof(imgPath), "%sbutton_dialogue_box.png", CFG.theme_path);
GuiImageData btnOutline(imgPath, button_dialogue_box_png);
snprintf(imgPath, sizeof(imgPath), "%sdialogue_box.png", CFG.theme_path);
GuiImageData dialogBox(imgPath, dialogue_box_png);
GuiTrigger trigA;
trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
GuiImage dialogBoxImg(&dialogBox);
if (Settings.wsprompt == yes){
dialogBoxImg.SetWidescreen(CFG.widescreen);}
char title[50];
sprintf(title, "%s", tr("Code Download"));
GuiText titleTxt(title, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
titleTxt.SetPosition(0,50);
char msg[50];
sprintf(msg, "%s", tr("Initializing Network"));
GuiText msgTxt(msg, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
msgTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
msgTxt.SetPosition(0,140);
char msg2[50] = " ";
GuiText msg2Txt(msg2, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
msg2Txt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
msg2Txt.SetPosition(0, 50);
GuiText btn1Txt(tr("Cancel"), 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiImage btn1Img(&btnOutline);
if (Settings.wsprompt == yes){
btn1Txt.SetWidescreen(CFG.widescreen);
btn1Img.SetWidescreen(CFG.widescreen);}
GuiButton btn1(&btn1Img,&btn1Img, 2, 4, 0, -40, &trigA, &btnSoundOver, &btnClick,1);
btn1.SetLabel(&btn1Txt);
btn1.SetState(STATE_SELECTED);
promptWindow.Append(&dialogBoxImg);
promptWindow.Append(&titleTxt);
promptWindow.Append(&msgTxt);
promptWindow.Append(&msg2Txt);
promptWindow.Append(&btn1);
promptWindow.SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_IN, 50);
HaltGui();
mainWindow->SetState(STATE_DISABLED);
mainWindow->Append(&promptWindow);
mainWindow->ChangeFocus(&promptWindow);
ResumeGui();
struct stat st;
if(stat(Settings.TxtCheatcodespath, &st) != 0) {
if(subfoldercreate(Settings.TxtCheatcodespath) != 1) {
WindowPrompt(tr("Error !"),tr("Can't create directory"),tr("OK"));
ret = -1;
goto exit;
}
}
while (!IsNetworkInit()) {
VIDEO_WaitVSync();
Initialize_Network();
if (IsNetworkInit()) {
msgTxt.SetText(GetNetworkIP());
} else {
msgTxt.SetText(tr("Could not initialize network!"));
}
if(btn1.GetState() == STATE_CLICKED) {
ret = -1;
btn1.ResetState();
goto exit;
}
}
if(IsNetworkInit() && ret >= 0) {
FILE * pfile;
char txtpath[150];
snprintf(txtpath, sizeof(txtpath), "%s%s.txt", Settings.TxtCheatcodespath,id);
char codeurl[150];
snprintf(codeurl, sizeof(codeurl), "http://usbgecko.com/codes/codes/R/%s.txt",id);
struct block file = downloadfile(codeurl);
if (file.size == 333)
{
strcat(codeurl, " is not on the server.");
WindowPrompt(tr("Error"),codeurl,"Ok");
ret =-1;
goto exit;
}
if(file.data != NULL){
pfile = fopen(txtpath, "wb");
fwrite(file.data,1,file.size,pfile);
fclose(pfile);
free(file.data);
ret = 1;
strcat(txtpath, " has been Saved. The text has not been verified. Some of the code may not work right with each other. If you experience trouble, open the text in a real text editor for more information.");
WindowPrompt(0,txtpath,"Ok");
}
else
{
strcat(codeurl, " could not be downloaded.");
WindowPrompt(tr("Error"),codeurl,"Ok");
ret =-1;
}
CloseConnection();
}
exit:
promptWindow.SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_OUT, 50);
while(promptWindow.GetEffect() > 0) usleep(50);
HaltGui();
mainWindow->Remove(&promptWindow);
mainWindow->SetState(STATE_DEFAULT);
ResumeGui();
return ret;
}
char * GetMissingFiles()
{
return (char *) missingFiles;

View File

@ -26,5 +26,6 @@ int ProgressDownloadWindow(int choice2);
int ProgressUpdateWindow();
char * GetMissingFiles();
int WindowScreensaver();
int CodeDownload(const char *id);
#endif