-changed gamercard section, will now write dutag and

wiinertag in ini by default, other tags can be added in 
the same naming scheme
-fixed and added some debug prints
This commit is contained in:
fix94.1 2012-02-18 13:51:55 +00:00
parent 3c9e16c35e
commit 9fcc0f4d35
6 changed files with 33 additions and 22 deletions

View File

@ -233,7 +233,7 @@ bool Identify(u64 titleid, u32 *ios)
if(!Identify_GenerateTik(&tikBuffer,&tikSize))
{
gprintf("Generating fake ticket...Failed!");
gprintf("Generating fake ticket...Failed!\n");
return false;
}

View File

@ -8,15 +8,19 @@ void CachedList<T>::Load(string path, string containing, string m_lastLanguage)
m_loaded = false;
m_database = sfmt("%s/%s.db", m_cacheDir.c_str(), (make_db_name(path)).c_str());
gprintf("Database file: %s\n", m_database.c_str());
m_wbfsFS = strncasecmp(DeviceHandler::Instance()->PathToFSName(path.c_str()), "WBFS", 4) == 0;
bool update_games = false;
bool update_homebrew = false;
bool update_dml = false;
bool ditimes = false;
if(!m_wbfsFS)
bool music = typeid(T) == typeid(std::string);
if(music)
gprintf("Loading music list from path: %s\n",path.c_str());
else if(!m_wbfsFS)
{
gprintf("Database file: %s\n", m_database.c_str());
update_games = strcasestr(path.c_str(), "wbfs") != NULL && force_update[COVERFLOW_USB];
update_homebrew = strcasestr(path.c_str(), "apps") != NULL && force_update[COVERFLOW_HOMEBREW];
update_dml = strcasestr(path.c_str(), "games") != NULL && force_update[COVERFLOW_DML];
@ -40,15 +44,13 @@ void CachedList<T>::Load(string path, string containing, string m_lastLanguage)
if(m_update) gprintf("Cache of %s is being updated because ", path.c_str());
if(update_lang) gprintf("languages are different!\nOld language string: %s\nNew language string: %s\n", m_lastLanguage.c_str(), m_curLanguage.c_str());
if(noDB) gprintf("a database was not found!\n");
if(mtimes || ditimes) gprintf("the WBFS folder was modified!");
if(mtimes || ditimes) gprintf("the WBFS folder was modified!\n");
}
if(update_games) force_update[COVERFLOW_USB] = false;
if(update_homebrew) force_update[COVERFLOW_HOMEBREW] = false;
if(update_dml) force_update[COVERFLOW_DML] = false;
bool music = typeid(T) == typeid(std::string);
if(m_update || m_wbfsFS || music)
{
gprintf("Calling list to update filelist\n");

View File

@ -31,7 +31,7 @@ extern "C"
{
void MEM2_init(unsigned int mem2Size)
{
if(&_end + 0x100 > APPLOADER_START) gprintf("ZOMG MOVE THE ENTRYPOINT DOWN!");
if(&_end + 0x100 > APPLOADER_START) gprintf("ZOMG MOVE THE ENTRYPOINT DOWN!\n");
g_mem2gp.init(mem2Size);
g_mem2gp.clear();

View File

@ -410,23 +410,30 @@ void CMenu::init(void)
m_category = m_cat.getInt(domain, "category", 0);
m_max_categories = m_cat.getInt(domain, "numcategories", 12);
m_cfg.setString("GAMERCARD", "gamercards", "wiinnertag|dutag");
m_cfg.getString("GAMERCARD", "wiinnertag_url", WIINNERTAG_URL);
m_cfg.getString("GAMERCARD", "wiinnertag_key", "");
m_cfg.getString("GAMERCARD", "dutag_url", DUTAG_URL);
m_cfg.getString("GAMERCARD", "dutag_key", "");
if (m_cfg.getBool("GAMERCARD", "gamercards_enable", false))
{
safe_vector<string> gamercards = stringToVector(m_cfg.getString("GAMERCARD", "gamercards"), '|');
if (gamercards.size() == 0 && m_cfg.getBool("GAMERCARD", "wiinnertag_enable", false))
if (gamercards.size() == 0)
{
gamercards.push_back("wiinnertag");
m_cfg.setString("GAMERCARD", "gamercards", "wiinnertag");
m_cfg.remove("GAMERCARD", "wiinnertag_enable");
gamercards.push_back("dutag");
}
for (safe_vector<string>::iterator itr = gamercards.begin(); itr != gamercards.end(); itr++)
{
gprintf("Found gamercard provider: %s\n",(*itr).c_str());
register_card_provider(
m_cfg.getString("GAMERCARD", sfmt("%s_url", (*itr).c_str())).c_str(),
m_cfg.getString("GAMERCARD", sfmt("%s_key", (*itr).c_str())).c_str()
);
}
}
}
void CMenu::cleanup(bool ios_reload)
{

View File

@ -20,15 +20,17 @@ int amount_of_providers = 0;
u8 register_card_provider(const char *url, const char *key)
{
struct provider *new_providers = (struct provider *) realloc(providers, (amount_of_providers + 1) * sizeof(struct provider));
if (new_providers != NULL)
if (new_providers != NULL && strlen(url) > 0 && strlen(key) > 0)
{
providers = new_providers;
memset(&providers[amount_of_providers], 0, sizeof(struct provider));
strncpy((char *) providers[amount_of_providers].url, url, 128);
strncpy((char *) providers[amount_of_providers].key, key, 48);
amount_of_providers++;
gprintf("Gamercard provider is valid!\n");
return 0;
}
gprintf("Gamertag provider is NOT valid!\n");
return -1;
}

File diff suppressed because one or more lines are too long