From cfb882f4fc303fefa331a5807f843bbdc9879aa8 Mon Sep 17 00:00:00 2001 From: radius Date: Sat, 28 Jan 2017 22:12:34 -0500 Subject: [PATCH] add support for no content cores --- network/netplay/netplay_frontend.c | 2 +- tasks/task_netplay_find_content.c | 25 ++++++++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/network/netplay/netplay_frontend.c b/network/netplay/netplay_frontend.c index ced97d8cee..9c1872b9ca 100644 --- a/network/netplay/netplay_frontend.c +++ b/network/netplay/netplay_frontend.c @@ -441,7 +441,7 @@ static void netplay_announce() "gamename=%s&gamecrc=%d&port=%d", url, settings->username, system->info.library_name, system->info.library_version, - path_basename(path_get(RARCH_PATH_BASENAME)),*content_crc_ptr, + !string_is_empty(path_basename(path_get(RARCH_PATH_BASENAME))) ? path_basename(path_get(RARCH_PATH_BASENAME)) : "N/A",*content_crc_ptr, settings->netplay.port); task_push_http_transfer(buf, true, NULL, netplay_announce_cb, NULL); diff --git a/tasks/task_netplay_find_content.c b/tasks/task_netplay_find_content.c index a727cbdb5b..0793df645e 100644 --- a/tasks/task_netplay_find_content.c +++ b/tasks/task_netplay_find_content.c @@ -56,6 +56,7 @@ static void netplay_crc_scan_callback(void *task_data, if (!state) return; + fflush(stdout); if (!string_is_empty(state->core_path) && !string_is_empty(state->content_path)) { command_event(CMD_EVENT_NETPLAY_INIT_DIRECT_DEFERRED, state->hostname); @@ -66,6 +67,16 @@ static void netplay_crc_scan_callback(void *task_data, CONTENT_MODE_LOAD_CONTENT_WITH_NEW_CORE_FROM_MENU, NULL, NULL); } + else if(string_is_equal(state->content_path, "N/A")) + { + printf("Content: %s Core: %s\n", state->content_path, state->core_path); + task_push_content_load_default( + state->core_path, NULL, + NULL, + CORE_TYPE_PLAIN, + CONTENT_MODE_LOAD_NOTHING_WITH_NEW_CORE_FROM_MENU, + NULL, NULL); + } else { /* TO-DO: Inform the user no compatible core or content was found */ @@ -100,7 +111,7 @@ static void task_netplay_crc_scan_handler(retro_task_t *task) if (state->lpl_list->size == 0) goto no_playlists; - + /* content with no CRC uses 00000000*/ if (!string_is_equal(state->content_crc, "00000000|crc")) { @@ -139,6 +150,15 @@ static void task_netplay_crc_scan_handler(retro_task_t *task) free(playlist); } } + else if(string_is_equal(state->content_path, "N/A")) + { + state->found = true; + task_set_data(task, state); + task_set_progress(task, 100); + task_set_title(task, strdup("Compatible content found")); + task_set_finished(task, true); + return; + } else { RARCH_LOG("Using filename matching\n"); @@ -231,6 +251,9 @@ bool task_push_netplay_crc_scan(uint32_t crc, char* name, /* check if the core name matches. TO-DO :we could try to load the core too to check if the version string matches too */ +#if 0 + printf("Info: %s State: %s", info->list[i].core_name, state->core_name); +#endif if(string_is_equal(info->list[i].core_name, state->core_name)) { strlcpy(state->core_path, info->list[i].path, sizeof(state->core_path));