Hook up 'Update Cheats' - cheats.zip on buildbot needs to be

updated so that it no longer has a rootsubdir 'cht'
This commit is contained in:
twinaphex 2015-06-24 16:55:18 +02:00
parent badaae7198
commit d88738e28d
2 changed files with 29 additions and 0 deletions

View File

@ -1268,6 +1268,12 @@ static int action_ok_download_generic(const char *path,
fill_pathname_join(s, settings->network.buildbot_assets_url,
"frontend/autoconf.zip", sizeof(s));
}
else if (!strcmp(type_msg, "cb_update_cheats"))
{
path = "cheats.zip";
fill_pathname_join(s, settings->network.buildbot_assets_url,
"frontend/cheats.zip", sizeof(s));
}
else
{
fill_pathname_join(s, settings->network.buildbot_url,
@ -1309,6 +1315,16 @@ static int action_ok_update_assets(const char *path,
return 0;
}
static int action_ok_update_cheats(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
#ifdef HAVE_NETWORKING
action_ok_download_generic(path, label, type, idx, entry_idx,
"cb_update_cheats");
#endif
return 0;
}
static int action_ok_update_autoconfig_profiles(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
@ -1692,6 +1708,9 @@ static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs,
case MENU_LABEL_UPDATE_ASSETS:
cbs->action_ok = action_ok_update_assets;
break;
case MENU_LABEL_UPDATE_CHEATS:
cbs->action_ok = action_ok_update_cheats;
break;
case MENU_LABEL_UPDATE_AUTOCONFIG_PROFILES:
cbs->action_ok = action_ok_update_autoconfig_profiles;
break;

View File

@ -30,6 +30,7 @@
#define CB_CORE_UPDATER_LIST 0x32fd4f01U
#define CB_UPDATE_ASSETS 0xbf85795eU
#define CB_UPDATE_AUTOCONFIG_PROFILES 0x28ada67dU
#define CB_UPDATE_CHEATS 0xc360fec3U
extern char core_updater_path[PATH_MAX_LENGTH];
@ -140,6 +141,12 @@ static int cb_update_autoconfig_profiles(void *data, size_t len)
return cb_generic_download(data, len, settings->input.autoconfig_dir);
}
static int cb_update_cheats(void *data, size_t len)
{
settings_t *settings = config_get_ptr();
return cb_generic_download(data, len, settings->cheat_database);
}
static int rarch_main_data_http_con_iterate_transfer(http_handle_t *http)
{
if (!net_http_connection_iterate(http->connection.handle))
@ -214,6 +221,9 @@ static int cb_http_conn_default(void *data_, size_t len)
case CB_UPDATE_AUTOCONFIG_PROFILES:
http->cb = &cb_update_autoconfig_profiles;
break;
case CB_UPDATE_CHEATS:
http->cb = &cb_update_cheats;
break;
}
}