From f52b0c71a9434f4682527df8d8e7b74086ca6de6 Mon Sep 17 00:00:00 2001 From: "lustar.mii" Date: Wed, 22 Jul 2009 15:09:11 +0000 Subject: [PATCH] Added check to prevent the full wiitdb.zip from being loaded. If you have the file but don't see any info use the Update All feature or the custom URL from the .txt file mentioned previously. --- source/prompts/PromptWindows.cpp | 30 +++++++++++++++++++----------- source/xml/xml.c | 14 ++++++++++---- 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/source/prompts/PromptWindows.cpp b/source/prompts/PromptWindows.cpp index c22d8753..7773d0b8 100644 --- a/source/prompts/PromptWindows.cpp +++ b/source/prompts/PromptWindows.cpp @@ -1950,14 +1950,16 @@ ProgressDownloadWindow(int choice2) sprintf(URLFile,"%sJA/%s",server3d,missingFiles[i]); break; case 'K': - case 'T': - case 'Q': + //case 'T': + //case 'Q': sprintf(URLFile,"%sKO/%s",server3d,missingFiles[i]); break; + case 'P': case 'D': case 'F': case 'I': - case 'P': + case 'S': + case 'H': case 'X': case 'Y': sprintf(URLFile,"%s%s/%s",server3d,sysLanguage,missingFiles[i]); @@ -1998,14 +2000,16 @@ ProgressDownloadWindow(int choice2) sprintf(URLFile,"%sJA/%s",serverDisc,missingFiles[i]); break; case 'K': - case 'T': - case 'Q': + //case 'T': + //case 'Q': sprintf(URLFile,"%sKO/%s",serverDisc,missingFiles[i]); break; + case 'P': case 'D': case 'F': case 'I': - case 'P': + case 'S': + case 'H': case 'X': case 'Y': sprintf(URLFile,"%s%s/%s",serverDisc,sysLanguage,missingFiles[i]); @@ -2044,14 +2048,16 @@ ProgressDownloadWindow(int choice2) sprintf(URLFile,"%sJA/%s",server2d,missingFiles[i]); break; case 'K': - case 'T': - case 'Q': + //case 'T': + //case 'Q': sprintf(URLFile,"%sKO/%s",server2d,missingFiles[i]); break; + case 'P': case 'D': case 'F': case 'I': - case 'P': + case 'S': + case 'H': case 'X': case 'Y': sprintf(URLFile,"%s%s/%s",server2d,sysLanguage,missingFiles[i]); @@ -2952,9 +2958,11 @@ void GetLanguageToLangCode(char *langcode) { case CONF_LANG_DUTCH: sprintf(langcode, "NL"); break; -/* case CONF_LANG_PORTUGUESE: + /* + case CONF_LANG_PORTUGUESE: sprintf(langcode, "PO"); - break;*/ + break; + */ case CONF_LANG_SIMP_CHINESE: sprintf(langcode, "EN"); // default to EN for chinese break; diff --git a/source/xml/xml.c b/source/xml/xml.c index 3d8b1601..51f38710 100644 --- a/source/xml/xml.c +++ b/source/xml/xml.c @@ -16,7 +16,7 @@ Load game information from XML - Lustar /* config */ static bool xmldebug = false; static char xmlcfg_filename[100] = "wiitdb.zip"; - +static int xmlmaxsize = 1572864; extern struct SSettings Settings; // for loader GX @@ -150,6 +150,12 @@ bool OpenXMLFile(char *filename) unz_file_info zipfileinfo; unzGetCurrentFileInfo(unzfile, &zipfileinfo, NULL, 0, NULL, 0, NULL, 0); int zipfilebuffersize = zipfileinfo.uncompressed_size; + if (zipfilebuffersize >= xmlmaxsize) { + unzCloseCurrentFile(unzfile); + unzClose(unzfile); + return false; + } + char * zipfilebuffer = malloc(zipfilebuffersize); memset(zipfilebuffer, 0, zipfilebuffersize); if (zipfilebuffer == NULL) { @@ -576,13 +582,13 @@ bool LoadGameInfoFromXML(char* gameid, char* langtxt) if (gameid[3] == 'J') strlcpy(gameinfo.region,"NTSC-J",sizeof(gameinfo.region)); if (gameid[3] == 'K') strlcpy(gameinfo.region,"NTSC-K",sizeof(gameinfo.region)); if (gameid[3] == 'P') strlcpy(gameinfo.region,"PAL",sizeof(gameinfo.region)); - if (gameid[3] == 'X') strlcpy(gameinfo.region,"PAL-X",sizeof(gameinfo.region)); + if (gameid[3] == 'X') strlcpy(gameinfo.region,"PAL",sizeof(gameinfo.region)); + if (gameid[3] == 'Y') strlcpy(gameinfo.region,"PAL",sizeof(gameinfo.region)); if (gameid[3] == 'D') strlcpy(gameinfo.region,"PAL",sizeof(gameinfo.region)); - if (gameid[3] == 'G') strlcpy(gameinfo.region,"PAL",sizeof(gameinfo.region)); if (gameid[3] == 'F') strlcpy(gameinfo.region,"PAL",sizeof(gameinfo.region)); if (gameid[3] == 'S') strlcpy(gameinfo.region,"PAL",sizeof(gameinfo.region)); if (gameid[3] == 'I') strlcpy(gameinfo.region,"PAL",sizeof(gameinfo.region)); - if (gameid[3] == 'N') strlcpy(gameinfo.region,"PAL",sizeof(gameinfo.region)); + if (gameid[3] == 'H') strlcpy(gameinfo.region,"PAL",sizeof(gameinfo.region)); } // free memory