mirror of
https://github.com/libretro/RetroArch
synced 2025-04-24 15:02:35 +00:00
Merge pull request #2244 from leiradel/master
even better error handling
This commit is contained in:
commit
c943822002
13
cheevos.c
13
cheevos.c
@ -560,7 +560,7 @@ static int new_cheevo( cheevos_readud_t* ud )
|
|||||||
cheevo->badge = dupstr( &ud->badge );
|
cheevo->badge = dupstr( &ud->badge );
|
||||||
cheevo->points = strtol( ud->points.string, NULL, 10 );
|
cheevo->points = strtol( ud->points.string, NULL, 10 );
|
||||||
cheevo->dirty = 0;
|
cheevo->dirty = 0;
|
||||||
cheevo->active = flags == 3;
|
cheevo->active = 1; /* flags == 3; */
|
||||||
cheevo->modified = 0;
|
cheevo->modified = 0;
|
||||||
|
|
||||||
if ( !cheevo->title || !cheevo->description || !cheevo->author || !cheevo->badge )
|
if ( !cheevo->title || !cheevo->description || !cheevo->author || !cheevo->badge )
|
||||||
@ -1328,9 +1328,10 @@ static int cheevos_login( void )
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
RARCH_LOG( "CHEEVOS error getting user token\n" );
|
RARCH_LOG( "CHEEVOS error getting user token\n" );
|
||||||
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1338,8 +1339,8 @@ int cheevos_get_by_game_id( const char** json, unsigned game_id )
|
|||||||
{
|
{
|
||||||
char request[ 256 ];
|
char request[ 256 ];
|
||||||
|
|
||||||
cheevos_login();
|
if ( !cheevos_login() )
|
||||||
|
{
|
||||||
snprintf(
|
snprintf(
|
||||||
request, sizeof( request ),
|
request, sizeof( request ),
|
||||||
"http://retroachievements.org/dorequest.php?r=patch&u=%s&g=%u&f=3&l=1&t=%s",
|
"http://retroachievements.org/dorequest.php?r=patch&u=%s&g=%u&f=3&l=1&t=%s",
|
||||||
@ -1356,6 +1357,8 @@ int cheevos_get_by_game_id( const char** json, unsigned game_id )
|
|||||||
}
|
}
|
||||||
|
|
||||||
RARCH_LOG( "CHEEVOS error getting achievements for game id %u\n", game_id );
|
RARCH_LOG( "CHEEVOS error getting achievements for game id %u\n", game_id );
|
||||||
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1439,5 +1442,5 @@ int cheevos_get_by_content( const char** json, const void* data, size_t size )
|
|||||||
game_id = cheevos_get_game_id( hash );
|
game_id = cheevos_get_game_id( hash );
|
||||||
}
|
}
|
||||||
|
|
||||||
return cheevos_get_by_game_id( json, game_id );
|
return game_id ? cheevos_get_by_game_id( json, game_id ) : -1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user