static void _quickplay_updated_list(void *args) { struct cb_args *a = (struct cb_args *) args; struct mission *m = mission_list_get(a->mission_name); if (m != NULL) { _xmpp_iq_gameroom_quickplay( a->uid, m->mission_key, a->type, a->game_mode, a->channel_switches, a->tries, a->cb, a->args); } else { eprintf("Failed to open quickplay room (Expired missions)\n"); } free(a->mission_key); a->mission_key = NULL; free(a->mission_name); a->mission_name = NULL; free(a->game_mode); a->game_mode = NULL; free(a->uid); a->uid = NULL; free(a); }
void cmd_open ( const char *mission_name ) { if ( mission_name == NULL ) mission_name = "trainingmission"; if ( strlen ( mission_name ) != 36 ) /* not an uuid */ { struct mission *m = mission_list_get ( mission_name ); if ( m != NULL ) { int is_pvp = strstr ( m->mode, "pvp" ) != NULL; int were_in_pvp = strstr ( session.online.channel, "pvp" ) != NULL; if ( is_pvp && !were_in_pvp ) xmpp_iq_join_channel ( "pvp_pro_5", NULL, NULL ); else if ( !is_pvp && were_in_pvp ) xmpp_iq_join_channel ( "pve_2", NULL, NULL ); if ( is_pvp ) xmpp_iq_gameroom_open ( m->mission_key, ROOM_PVP_PUBLIC, NULL, NULL ); else xmpp_iq_gameroom_open ( m->mission_key, ROOM_PVE_PRIVATE, NULL, NULL ); } else { LOGPRINT ( KRED "NO SUCH MAP OR MISSION\n" ); } } else { xmpp_iq_gameroom_open ( mission_name, ROOM_PVE_PRIVATE, NULL, NULL ); } }
static void _open_updated_list(void *args) { struct cb_args *a = (struct cb_args *) args; struct mission *m = mission_list_get(a->mission_name); if (m != NULL) { _xmpp_iq_gameroom_open(m->mission_key, a->type, a->tries, a->fun, a->args); } else { eprintf("Failed to open room (Expired missions)\n"); } free(a->mission_key); a->mission_key = NULL; free(a->mission_name); a->mission_name = NULL; free(a); }