for(; !player->app->f_exit;)
{
/* connect */
- if(mvcp_connect(handle->command) == mvcp_ok)
+ if(mvcp_connect(handle->command) != mvcp_ok)
{
- g_warning("player_thread_proc: failed to connect to server %s (player=%d, unit=%d)\n",
- player->app->players.host, player->idx, player->unit);
+ g_warning("player_thread_proc: failed to connect to server %s:%d (player=%d, unit=%d)\n",
+ player->app->players.host, player->app->players.port, player->idx, player->unit);
sleep(1);
continue;
};
void player_run(instance_t* app, int idx)
{
player_handle_t* handle = malloc(sizeof(player_handle_t));
- handle->parser = mvcp_parser_init_remote(app->players.host, 5250);
+ handle->parser = mvcp_parser_init_remote(app->players.host, app->players.port);
handle->status = mvcp_init(handle->parser);
handle->command = mvcp_init(handle->parser);
app->players.item[idx].handle = handle;