- sourceflow small_covers can now go in a subfolder with the same name as the theme. which makes them change when the theme is changed.

- added notification messages when you delete a cover or banner on manager cover banner menu.
- download cover menu changes: title is now 'Downloads'. removed 'missing' button and changed 'all' to 'download' because there was no difference between all and missing. it always downloads missing covers. in the future i plan to add custom banners download which will download all missing custom GC banners.
This commit is contained in:
Fledge68 2018-11-23 15:31:04 -06:00
parent 354bddc664
commit cef988d763
10 changed files with 544 additions and 604 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 MiB

After

Width:  |  Height:  |  Size: 3.4 MiB

View File

@ -153,11 +153,7 @@ void writeStub()
DCFlushRange((void*)0x80001800, StubSize);
/* And free the memory again */
#ifdef APP_WIIFLOW
if(Stub != wfstub_bin)
#else
if(Stub != stub_bin)
#endif
if(Stub != NULL)
free(Stub);
}

View File

@ -1609,7 +1609,7 @@ void CMenu::_mainLoopCommon(bool withCF, bool adjusting)
if(m_thrdWorking)
{
musicPaused = true;
MusicPlayer.Pause();
MusicPlayer.Pause();//note - bg music is paused but sound thread is still running. so banner gamesound still plays
m_btnMgr.tick();
m_vid.prepare();
m_vid.setup2DProjection(false, true);
@ -2174,22 +2174,10 @@ void CMenu::_initCF(void)
if(!CoverFlow.empty())
{
bool path = false;
if((m_source_cnt > 1 && m_cfg.getInt("MULTI", "current_item_type", 1) == TYPE_PLUGIN) || m_sourceflow || m_current_view == COVERFLOW_HOMEBREW)
if(m_sourceflow || m_current_view == COVERFLOW_HOMEBREW ||
(m_source_cnt > 1 && m_cfg.getInt("MULTI", "current_item_type", TYPE_PLUGIN) == TYPE_PLUGIN) ||
(m_source_cnt == 1 && m_current_view == COVERFLOW_PLUGIN && m_cfg.getInt(PLUGIN_DOMAIN, "current_item_type", TYPE_PLUGIN) == TYPE_PLUGIN))
path = true;
if(m_current_view == COVERFLOW_PLUGIN && !m_sourceflow && m_source_cnt == 1)
{
switch(m_cfg.getInt(PLUGIN_DOMAIN, "current_item_type", TYPE_PLUGIN))
{
case TYPE_CHANNEL:
case TYPE_EMUCHANNEL:
case TYPE_GC_GAME:
case TYPE_WII_GAME:
path = false;
break;
default:
path = true;
}
}
if(!CoverFlow.findId(m_cfg.getString(_domainFromView(), "current_item").c_str(), true, path))
CoverFlow.defaultLoad();
CoverFlow.startCoverLoader();
@ -2709,11 +2697,16 @@ const char *CMenu::getFrontPath(const dir_discHdr *element)
return NULL;
const char *coverPath = fmt("%s/front_covers/%s", m_sourceDir.c_str(), coverImg);
if(m_cfg.getBool(SOURCEFLOW_DOMAIN, "smallbox") || !fsop_FileExist(coverPath))
{
string themeName = m_cfg.getString("GENERAL", "theme", "default");
coverPath = fmt("%s/small_covers/%s/%s", m_sourceDir.c_str(), themeName.c_str(), coverImg);
if(!fsop_FileExist(coverPath))
{
coverPath = fmt("%s/small_covers/%s", m_sourceDir.c_str(), coverImg);
if(!fsop_FileExist(coverPath))
return element->path;
}
}
return coverPath;
}
return fmt("%s/%s.png", m_picDir.c_str(), element->id);

View File

@ -313,8 +313,8 @@ private:
s16 m_downloadPrioVal;
enum CoverPrio
{
C_TYPE_PRIOA = (1<<0),
C_TYPE_PRIOB = (1<<1),
C_TYPE_PRIOA = (1<<0),//C_TYPE_ACUSTM
C_TYPE_PRIOB = (1<<1),//C_TYPE_BCUSTM
C_TYPE_EN = (1<<2),
C_TYPE_JA = (1<<3),
C_TYPE_FR = (1<<4),
@ -327,8 +327,8 @@ private:
C_TYPE_KO = (1<<11),
C_TYPE_ZHCN = (1<<12),
C_TYPE_AU = (1<<13),
C_TYPE_ONOR = (1<<14),
C_TYPE_ONCU = (1<<15),
C_TYPE_ONOR = (1<<14),//C_TYPE_ONCU
C_TYPE_ONCU = (1<<15),//C_TYPE_ANB
};
enum CoverType
@ -722,7 +722,6 @@ private:
volatile bool m_thrdNetwork;
float m_thrdStep;
float m_thrdStepLen;
string m_coverDLGameId;
mutex_t m_mutex;
wstringEx m_thrdMessage;
volatile float m_thrdProgress;
@ -1152,7 +1151,7 @@ private:
//
void _setThrdMsg(const wstringEx &msg, float progress);
void _setDumpMsg(const wstringEx &msg, float progress, float fileprog);
int _coverDownloader(bool missingOnly);
int _coverDownloader();
void _downloadProgress(void *obj, int size, int position);
int _gametdbDownloaderAsync();

View File

@ -85,6 +85,7 @@ void CMenu::_CoverBanner(void)
{
_hideCoverBanner();
RemoveCover(id);
error(_t("deltcover", L"Cover is deleted."));
_showCoverBanner();
}
else if(m_btnMgr.selected(m_coverbnrBtnDlBanner))
@ -105,6 +106,7 @@ void CMenu::_CoverBanner(void)
fsop_deleteFile(fmt("%s/%s.bnr", m_customBnrDir.c_str(), id));
fsop_deleteFile(fmt("%s/%.3s.bnr", m_bnrCacheDir.c_str(), id));
fsop_deleteFile(fmt("%s/%.3s.bnr", m_customBnrDir.c_str(), id));
error(_t("deltbanner", L"Banner is deleted."));
m_newGame = true;
_showCoverBanner();
}

View File

@ -31,6 +31,7 @@ static const char FMT_CPIC_URL[] = "http://art.gametdb.com/{console}/cover2/{loc
static block download = { 0, 0 };
static bool settingsmenu = false;
static string m_coverDLGameId;
void CMenu::_hideSettings(bool instant)
{
@ -77,6 +78,7 @@ void CMenu::_showSettings()
if(m_downloadLblUser[i] != -1)
m_btnMgr.show(m_downloadLblUser[i]);
m_btnMgr.show(m_downloadLblSetTitle);
m_btnMgr.show(m_downloadBtnBack);
m_btnMgr.show(m_downloadLblCoverPrio);
m_btnMgr.show(m_downloadLblPrio);
m_btnMgr.show(m_downloadBtnPrioM);
@ -142,8 +144,7 @@ void CMenu::_showSettings()
else
m_btnMgr.show(m_downloadBtnAU);
m_btnMgr.show(m_downloadBtnBack);
//
if( m_downloadPrioVal&C_TYPE_ONOR )
{
m_btnMgr.setText(m_downloadLblPrio, _t("dl24", L"Custom only"));
@ -185,9 +186,9 @@ void CMenu::_showSettings()
void CMenu::_hideDownload(bool instant)
{
m_btnMgr.hide(m_downloadLblTitle, instant);
m_btnMgr.hide(m_downloadBtnBack, instant);
m_btnMgr.hide(m_downloadBtnCancel, instant);
m_btnMgr.hide(m_downloadBtnAll, instant);
m_btnMgr.hide(m_downloadBtnMissing, instant);
m_btnMgr.hide(m_downloadLblCoverSet, instant);
m_btnMgr.hide(m_downloadBtnCoverSet, instant);
m_btnMgr.hide(m_downloadBtnGameTDBDownload, instant);
@ -211,7 +212,6 @@ void CMenu::_showDownload(void)
m_btnMgr.show(m_downloadBtnBack);
m_btnMgr.show(m_downloadLblCovers);
m_btnMgr.show(m_downloadBtnAll);
m_btnMgr.show(m_downloadBtnMissing);
m_btnMgr.show(m_downloadLblCoverSet);
m_btnMgr.show(m_downloadBtnCoverSet);
m_btnMgr.show(m_downloadLblGameTDBDownload);
@ -229,7 +229,6 @@ void CMenu::_download(string gameId)
bool dl_finished = false;
SetupInput();
_showDownload();
m_btnMgr.setText(m_downloadBtnCancel, _t("dl1", L"Cancel"));
while(!m_exit)
{
@ -261,19 +260,17 @@ void CMenu::_download(string gameId)
m_btnMgr.down();
if(BTN_A_PRESSED || !gameId.empty())
{
if(m_btnMgr.selected(m_downloadBtnAll) || m_btnMgr.selected(m_downloadBtnMissing) || !gameId.empty())
if(m_btnMgr.selected(m_downloadBtnAll) || !gameId.empty())
{
m_refreshGameList = true;// not needed instead just initcf()
bool dlAll = m_btnMgr.selected(m_downloadBtnAll);
_hideSettings();
m_btnMgr.hide(m_downloadLblCovers);
m_btnMgr.hide(m_downloadBtnAll);
m_btnMgr.hide(m_downloadBtnMissing);
m_btnMgr.hide(m_downloadLblGameTDBDownload);
m_btnMgr.hide(m_downloadBtnGameTDBDownload);
m_btnMgr.hide(m_downloadLblCoverSet);
m_btnMgr.hide(m_downloadBtnCoverSet);
m_btnMgr.hide(m_downloadBtnBack);
m_btnMgr.setProgress(m_wbfsPBar, 0.f, true);
m_btnMgr.setText(m_wbfsLblMessage, L"0%");
@ -283,8 +280,10 @@ void CMenu::_download(string gameId)
m_btnMgr.show(m_wbfsLblDialog);
_start_pThread();
int ret = _coverDownloader(dlAll);
int ret = _coverDownloader();
_stop_pThread();
if(ret == 0)
{
if(countFlat == 0)
{
m_thrdMessage = wfmt(_fmt("dlmsg5", L"%i/%i files downloaded."), count, n);
@ -295,8 +294,8 @@ void CMenu::_download(string gameId)
m_thrdMessage = wfmt(_fmt("dlmsg9", L"%i/%i files downloaded. %i are front covers only."), count + countFlat, n, countFlat);
m_btnMgr.setText(m_wbfsLblDialog, m_thrdMessage);
}
if(ret == -1)
}
else if(ret == -1)
m_btnMgr.setText(m_wbfsLblDialog, _t("dlmsg27", L"Not enough memory!"));
else if(ret == -2)
m_btnMgr.setText(m_wbfsLblDialog, _t("dlmsg2", L"Network initialization failed!"));
@ -310,7 +309,6 @@ void CMenu::_download(string gameId)
else if(m_btnMgr.selected(m_downloadBtnGameTDBDownload))
{
m_refreshGameList = true;// to refresh titles
_hideSettings();
m_btnMgr.hide(m_downloadLblCovers);
m_btnMgr.hide(m_downloadBtnAll);
m_btnMgr.hide(m_downloadBtnMissing);
@ -318,6 +316,7 @@ void CMenu::_download(string gameId)
m_btnMgr.hide(m_downloadBtnGameTDBDownload);
m_btnMgr.hide(m_downloadLblCoverSet);
m_btnMgr.hide(m_downloadBtnCoverSet);
m_btnMgr.hide(m_downloadBtnBack);
m_btnMgr.setProgress(m_wbfsPBar, 0.f, true);
m_btnMgr.setText(m_wbfsLblMessage, L"0%");
@ -554,11 +553,10 @@ void CMenu::_initDownloadMenu()
m_downloadLblTitle = _addTitle("DOWNLOAD/TITLE", theme.titleFont, L"", 0, 10, 640, 60, theme.titleFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE);
m_downloadLblCovers = _addLabel("DOWNLOAD/COVERS", theme.btnFont, L"", 20, 125, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_downloadBtnAll = _addButton("DOWNLOAD/ALL_BTN", theme.btnFont, L"", 420, 130, 200, 48, theme.btnFontColor);
m_downloadBtnMissing = _addButton("DOWNLOAD/MISSING_BTN", theme.btnFont, L"", 420, 190, 200, 48, theme.btnFontColor);
m_downloadLblCoverSet = _addLabel("DOWNLOAD/COVERSSET", theme.btnFont, L"", 20, 245, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_downloadBtnCoverSet = _addButton("DOWNLOAD/COVERSET_BTN", theme.btnFont, L"", 420, 250, 200, 48, theme.btnFontColor);
m_downloadLblGameTDBDownload = _addLabel("DOWNLOAD/GAMETDB_DOWNLOAD", theme.btnFont, L"", 20, 305, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_downloadBtnGameTDBDownload = _addButton("DOWNLOAD/GAMETDB_DOWNLOAD_BTN", theme.btnFont, L"", 420, 310, 200, 48, theme.btnFontColor);
m_downloadLblCoverSet = _addLabel("DOWNLOAD/COVERSSET", theme.btnFont, L"", 20, 185, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_downloadBtnCoverSet = _addButton("DOWNLOAD/COVERSET_BTN", theme.btnFont, L"", 420, 190, 200, 48, theme.btnFontColor);
m_downloadLblGameTDBDownload = _addLabel("DOWNLOAD/GAMETDB_DOWNLOAD", theme.btnFont, L"", 20, 245, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_downloadBtnGameTDBDownload = _addButton("DOWNLOAD/GAMETDB_DOWNLOAD_BTN", theme.btnFont, L"", 420, 250, 200, 48, theme.btnFontColor);
m_downloadLblGameTDB = _addLabel("DOWNLOAD/GAMETDB", theme.lblFont, L"", 20, 390, 370, 60, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_downloadBtnCancel = _addButton("DOWNLOAD/CANCEL_BTN", theme.btnFont, L"", 420, 400, 200, 48, theme.btnFontColor);
m_downloadPBar = _addProgressBar("DOWNLOAD/PROGRESS_BAR", 40, 200, 560, 20);
@ -602,7 +600,6 @@ void CMenu::_initDownloadMenu()
_setHideAnim(m_downloadLblTitle, "DOWNLOAD/TITLE", 0, 0, -2.f, 0.f);
_setHideAnim(m_downloadLblCovers, "DOWNLOAD/COVERS", 50, 0, -2.f, 0.f);
_setHideAnim(m_downloadBtnAll, "DOWNLOAD/ALL_BTN", -50, 0, 1.f, 0.f);
_setHideAnim(m_downloadBtnMissing, "DOWNLOAD/MISSING_BTN", -50, 0, 1.f, 0.f);
_setHideAnim(m_downloadLblCoverSet, "DOWNLOAD/COVERSSET", 50, 0, -2.f, 0.f);
_setHideAnim(m_downloadBtnCoverSet, "DOWNLOAD/COVERSET_BTN", -50, 0, 1.f, 0.f);
_setHideAnim(m_downloadLblGameTDBDownload, "DOWNLOAD/GAMETDB_DOWNLOAD", 50, 0, -2.f, 0.f);
@ -652,10 +649,9 @@ void CMenu::_initDownloadMenu()
void CMenu::_textDownload(void)
{
m_btnMgr.setText(m_downloadLblTitle, _t("dl5", L"Download"));
m_btnMgr.setText(m_downloadLblTitle, _t("dl5", L"Downloads"));
m_btnMgr.setText(m_downloadLblCovers, _t("dl8", L"Covers"));
m_btnMgr.setText(m_downloadBtnAll, _t("dl3", L"All"));
m_btnMgr.setText(m_downloadBtnMissing, _t("dl4", L"Missing"));
m_btnMgr.setText(m_downloadBtnAll, _t("dl6", L"Download"));
m_btnMgr.setText(m_downloadLblCoverSet, _t("dl15", L"Cover download settings"));
m_btnMgr.setText(m_downloadBtnCoverSet, _t("dl16", L"Set"));
m_btnMgr.setText(m_downloadLblGameTDBDownload, _t("dl12", L"GameTDB"));
@ -829,7 +825,7 @@ static string makeURL(const string format, const string gameId, const string cou
return url;
}
/*
static bool checkPNGBuf(u8 *data)
{
if(data == NULL)
@ -856,7 +852,7 @@ static bool checkPNGFile(const char *filename)
}
return ret;
}
*/
void CMenu::_setThrdMsg(const wstringEx &msg, float progress)
{
if (m_thrdStop) return;
@ -878,7 +874,7 @@ void CMenu::_downloadProgress(void *obj, int size, int position)
}
}
int CMenu::_coverDownloader(bool download_all)
int CMenu::_coverDownloader()
{
count = 0;
countFlat = 0;
@ -895,34 +891,17 @@ int CMenu::_coverDownloader(bool download_all)
vector<string> fmtURLCBox = stringToVector(m_cfg.getString("GENERAL", "url_custom_full_covers", FMT_CBPIC_URL), '|');
vector<string> fmtURLCFlat = stringToVector(m_cfg.getString("GENERAL", "url_custom_flat_covers", FMT_CPIC_URL), '|');
char path[256];
char id[7];
vector<string> coverIDList;
/* create list of cover ID's that need downloading */
if(m_coverDLGameId.empty())
{
//coverIDList.reserve(m_gameList.size());
for(u32 i = 0; i < m_gameList.size(); ++i)
{
m_thrdMessage = _t("dlmsg7", L"Listing covers to download...");
m_thrdMessageAdded = true;
memset(&path, 0, sizeof(path));
memset(&id, 0, sizeof(id));
if(m_gameList[i].type == TYPE_PLUGIN || m_gameList[i].type == TYPE_HOMEBREW)
continue;
else
{
strncpy(id, m_gameList[i].id, 6);
strncpy(path, fmt("%s/%s.png", m_boxPicDir.c_str(), id), 255);
}
if(download_all || (strlen(path) > 0 && !fsop_FileExist(path)))
{
if(strlen(id) > 0)
coverIDList.push_back(id);
}
if(!fsop_FileExist(fmt("%s/%s.png", m_boxPicDir.c_str(), m_gameList[i].id)))
coverIDList.push_back(m_gameList[i].id);
}
}
else
@ -955,6 +934,7 @@ int CMenu::_coverDownloader(bool download_all)
/* download covers in the list */
u32 CoverType = 0;
string url;
char path[256];
for(u32 i = 0; i < coverIDList.size(); ++i)
{
@ -990,12 +970,6 @@ int CMenu::_coverDownloader(bool download_all)
if(m_downloadPrioVal & C_TYPE_ONOR)
original = false;
if(!success && original)
{
memset(&path, 0, sizeof(path));
strncpy(path, fmt("%s/%s.png", m_boxPicDir.c_str(), coverID.c_str()), 255);
/* if cover png doesn't already exist download it */
if(strlen(path) > 0 && !checkPNGFile(path))
{
/* each fmtURL may have more than one URL */
for(u8 j = 0; !success && j < fmtURLBox.size(); ++j)
@ -1100,7 +1074,6 @@ int CMenu::_coverDownloader(bool download_all)
download = downloadfile(url.c_str());
}
}
/* if none of the downloads succeeded */
if(download.data == NULL || download.size == 0)// || !checkPNGBuf(download.data))
continue;
@ -1108,6 +1081,7 @@ int CMenu::_coverDownloader(bool download_all)
/* a download succeeded */
/* save cover png */
strncpy(path, fmt("%s/%s.png", m_boxPicDir.c_str(), coverID.c_str()), 255);
update_pThread(1);
m_thrdMessage = wfmt(_fmt("dlmsg4", L"Saving %s"), path);
m_thrdMessageAdded = true;
@ -1126,19 +1100,12 @@ int CMenu::_coverDownloader(bool download_all)
success = true;
}
}
}
break;
case CBOX:
if(m_downloadPrioVal & C_TYPE_ONCU)
custom = true;
c_altCase = c_gameTDB.GetCaseVersions(coverID.c_str());
if(!success && c_gameTDB.IsLoaded() && c_altCase > 1 && custom)
{
memset(&path, 0, sizeof(path));
strncpy(path, fmt("%s/%s.png", m_boxPicDir.c_str(), coverID.c_str()), 255);
/* if cover png doesn't already exist download it */
if(strlen(path) > 0 && !checkPNGFile(path))
{
/* each fmtURL may have more than one URL */
for(u8 j = 0; !success && j < fmtURLCBox.size(); ++j)
@ -1252,6 +1219,7 @@ int CMenu::_coverDownloader(bool download_all)
/* a download succeeded */
/* save cover png */
strncpy(path, fmt("%s/%s.png", m_boxPicDir.c_str(), coverID.c_str()), 255);
update_pThread(1);
m_thrdMessage = wfmt(_fmt("dlmsg4", L"Saving %s"), path);
m_thrdMessageAdded = true;
@ -1270,17 +1238,11 @@ int CMenu::_coverDownloader(bool download_all)
success = true;
}
}
}
break;
case FLAT:
if(m_downloadPrioVal & C_TYPE_ONOR)
original = false;
if(!success && original)
{
memset(&path, 0, sizeof(path));
strncpy(path, fmt("%s/%s.png", m_picDir.c_str(), coverID.c_str()), 255);
if(strlen(path) > 0 && !checkPNGFile(path))
{
for(u8 j = 0; !success && j < fmtURLFlat.size(); ++j)
{
@ -1389,6 +1351,7 @@ int CMenu::_coverDownloader(bool download_all)
continue;
/*download succeeded - save png */
strncpy(path, fmt("%s/%s.png", m_boxPicDir.c_str(), coverID.c_str()), 255);
update_pThread(1);
m_thrdMessage = wfmt(_fmt("dlmsg4", L"Saving %s"), path);
m_thrdMessageAdded = true;
@ -1407,17 +1370,11 @@ int CMenu::_coverDownloader(bool download_all)
success = true;
}
}
}
break;
case CFLAT:
if(m_downloadPrioVal & C_TYPE_ONCU)
custom = true;
if(!success && c_gameTDB.IsLoaded() && c_altCase > 1 && custom)
{
memset(&path, 0, sizeof(path));
strncpy(path, fmt("%s/%s.png", m_picDir.c_str(), coverID.c_str()), 255);
if(strlen(path) > 0 && !checkPNGFile(path))
{
for(u8 j = 0; !success && j < fmtURLCFlat.size(); ++j)
{
@ -1530,6 +1487,7 @@ int CMenu::_coverDownloader(bool download_all)
continue;
/* save png */
strncpy(path, fmt("%s/%s.png", m_boxPicDir.c_str(), coverID.c_str()), 255);
update_pThread(1);
m_thrdMessage = wfmt(_fmt("dlmsg4", L"Saving %s"), path);
m_thrdMessageAdded = true;
@ -1548,7 +1506,6 @@ int CMenu::_coverDownloader(bool download_all)
success = true;
}
}
}
break;
}
}

View File

@ -266,20 +266,7 @@ void CMenu::_setCurrentItem(const dir_discHdr *hdr)
const char *title = CoverFlow.getFilenameId(hdr, true);// with extension
m_cfg.setString(_domainFromView(), "current_item", title);
if(m_current_view == COVERFLOW_PLUGIN && m_source_cnt == 1)
{
m_cfg.setInt(PLUGIN_DOMAIN, "current_item_type", hdr->type);
switch(hdr->type)
{
case TYPE_CHANNEL:
case TYPE_EMUCHANNEL:
case TYPE_GC_GAME:
case TYPE_WII_GAME:
m_cfg.setBool(PLUGIN_DOMAIN, "current_item_id", true);
break;
default:
m_cfg.setBool(PLUGIN_DOMAIN, "current_item_id", false);
}
}
if(m_source_cnt > 1)
m_cfg.setInt("MULTI", "current_item_type", hdr->type);
}

View File

@ -434,6 +434,7 @@ int CMenu::main(void)
if(strcmp(prevTheme, m_cfg.getString("GENERAL", "theme").c_str()) != 0)
{
/* new theme - exit wiiflow and reload */
fsop_deleteFolder(fmt("%s/sourceflow", m_cacheDir.c_str()));
m_reload = true;
break;
}

View File

@ -7,6 +7,7 @@
* to complete a request
*/
const struct block emptyblock = {0, NULL};
//The maximum amount of bytes to send per net_write() call
//#define NET_BUFFER_SIZE 1024
#define NET_BUFFER_SIZE 3600
@ -16,7 +17,8 @@ static u8 retryloop = 0;
// Write our message to the server
static s32 send_message(s32 server, char *msg)
{
s32 bytes_transferred = 0, remaining = strlen(msg);
s32 bytes_transferred = 0;
s32 remaining = strlen(msg);
while (remaining)
{
if((bytes_transferred = net_write(server, msg, remaining > NET_BUFFER_SIZE ? NET_BUFFER_SIZE : remaining)) > 0)
@ -142,7 +144,8 @@ struct block read_message(s32 connection)
}
/* Downloads the contents of a URL to memory
* This method is not threadsafe (because networking is not threadsafe on the Wii) */
* This method is not threadsafe (because networking is not threadsafe on the Wii)
*/
struct block downloadfile(const char *url)
{
//Check if the url starts with "http://", if not it is not considered a valid url

View File

@ -233,6 +233,8 @@ cheat4=Download not found.
commodore=Commodore 64
custom=Custom
def=Default
deltcover=Cover is deleted.
deltbanner=Banner is deleted.
disabled=Disabled
dl1=Cancel
dl10=Please donate\nto GameTDB.com
@ -253,7 +255,7 @@ dl24=Custom only
dl25=All
dl3=All
dl4=Missing
dl5=Download
dl5=Downloads
dl6=Download
dl8=Covers
dlmsg1=Initializing network...