示例#1
0
static void handle_discord_join(const char* secret)
{
   RARCH_LOG("[Discord] join (%s)\n", secret);
   static struct string_list *list =  NULL;
   list = string_split(secret, "|");

   char tmp_hostname[32];
   snprintf(tmp_hostname,
      sizeof(tmp_hostname),
      "%s|%s", list->elems[0].data, list->elems[1].data);

   if (netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_DATA_INITED, NULL))
      deinit_netplay();
   netplay_driver_ctl(RARCH_NETPLAY_CTL_ENABLE_CLIENT, NULL);

   task_push_netplay_crc_scan(atoi(list->elems[3].data),
      list->elems[2].data,
      tmp_hostname, list->elems[4].data);
}
示例#2
0
static int action_select_netplay_connect_room(const char *path,
      const char *label, unsigned type,
      size_t idx)
{
   char tmp_hostname[4115];

   tmp_hostname[0] = '\0';

   if (netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_DATA_INITED, NULL))
      command_event(CMD_EVENT_NETPLAY_DEINIT, NULL);
   netplay_driver_ctl(RARCH_NETPLAY_CTL_ENABLE_CLIENT, NULL);

   if (netplay_room_list[idx - 3].host_method == NETPLAY_HOST_METHOD_MITM)
   {
      snprintf(tmp_hostname,
            sizeof(tmp_hostname),
            "%s|%d",
            netplay_room_list[idx - 3].mitm_address,
            netplay_room_list[idx - 3].mitm_port);
   }
   else
   {
      snprintf(tmp_hostname,
            sizeof(tmp_hostname),
            "%s|%d",
            netplay_room_list[idx - 3].address,
            netplay_room_list[idx - 3].port);
   }

#if 0
   RARCH_LOG("[lobby] connecting to: %s with game: %s/%08x\n",
         tmp_hostname,
         netplay_room_list[idx - 3].gamename,
         netplay_room_list[idx - 3].gamecrc);
#endif

   task_push_netplay_crc_scan(netplay_room_list[idx - 3].gamecrc,
         netplay_room_list[idx - 3].gamename,
         tmp_hostname, netplay_room_list[idx - 3].corename);

   return 0;
}