mirror of
https://github.com/libretro/RetroArch
synced 2025-03-24 13:43:32 +00:00
Updated rcheevos to 6.5.0
This commit is contained in:
parent
4b2bc29775
commit
3f72e1fd96
4
deps/rcheevos/CHANGELOG.md
vendored
4
deps/rcheevos/CHANGELOG.md
vendored
@ -1,3 +1,7 @@
|
||||
# v6.5.0
|
||||
|
||||
* Added a schema for errors returned by the server
|
||||
|
||||
# v6.4.0
|
||||
|
||||
* Added an enumeration with the console identifiers used in RetroAchievements
|
||||
|
1
deps/rcheevos/README.md
vendored
1
deps/rcheevos/README.md
vendored
@ -502,6 +502,7 @@ enum {
|
||||
* `rc_json_login_t`: The login token for the user, given their user name and password.
|
||||
* `rc_json_patch_t`: The information about a game, given its identifier. It includes arrays with the achievements and leaderboards for the game.
|
||||
* `rc_json_unlocks_t`: The list of achievements already awarded for the player, given the game identifier. Used to avoid the emulator awarding achievements more than once.
|
||||
* `rc_json_error_t`: Error messages returned by the server.
|
||||
|
||||
For each schema there are two functions, for example:
|
||||
|
||||
|
9
deps/rcheevos/include/rjson.h
vendored
9
deps/rcheevos/include/rjson.h
vendored
@ -115,6 +115,15 @@ rc_json_unlocks_t;
|
||||
int rc_json_get_unlocks_size(const char* json);
|
||||
const rc_json_unlocks_t* rc_json_parse_unlocks(void* buffer, const char* json);
|
||||
|
||||
typedef struct {
|
||||
const char* error;
|
||||
char success;
|
||||
}
|
||||
rc_json_error_t;
|
||||
|
||||
int rc_json_get_error_size(const char* json);
|
||||
const rc_json_error_t* rc_json_parse_error(void* buffer, const char* json);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
43
deps/rcheevos/src/rjson/schema.c
vendored
43
deps/rcheevos/src/rjson/schema.c
vendored
@ -551,6 +551,48 @@ const rc_json_unlocks_t* rc_json_parse_unlocks(void* buffer, const char* json) {
|
||||
return (const rc_json_unlocks_t*)rc_json_deserialize(buffer, 0x9b4e2684U, (const uint8_t*)json);
|
||||
}
|
||||
|
||||
static const rc_json_field_meta_t rc_json_field_meta_error[] = {
|
||||
{
|
||||
/* Metadata for field const char* error;. */
|
||||
/* name_hash */ 0x0d2011cfU,
|
||||
/* type_hash */ 0x00000000U,
|
||||
/* offset */ RC_JSON_OFFSETOF(rc_json_error_t, error),
|
||||
/* type */ RC_JSON_TYPE_STRING,
|
||||
/* flags */ 0
|
||||
},
|
||||
{
|
||||
/* Metadata for field char success;. */
|
||||
/* name_hash */ 0x110461deU,
|
||||
/* type_hash */ 0x00000000U,
|
||||
/* offset */ RC_JSON_OFFSETOF(rc_json_error_t, success),
|
||||
/* type */ RC_JSON_TYPE_BOOL,
|
||||
/* flags */ 0
|
||||
},
|
||||
};
|
||||
|
||||
static const rc_json_struct_meta_t rc_json_struct_meta_error = {
|
||||
/* fields */ rc_json_field_meta_error,
|
||||
/* name_hash */ 0x0d2011cfU,
|
||||
/* size */ sizeof(rc_json_error_t),
|
||||
/* alignment */ RC_JSON_ALIGNOF(rc_json_error_t),
|
||||
/* num_fields */ 2
|
||||
};
|
||||
|
||||
int rc_json_get_error_size(const char* json) {
|
||||
size_t size;
|
||||
int res = rc_json_get_size(&size, 0x0d2011cfU, (const uint8_t*)json);
|
||||
|
||||
if (res == RC_JSON_OK) {
|
||||
res = (int)size;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
const rc_json_error_t* rc_json_parse_error(void* buffer, const char* json) {
|
||||
return (const rc_json_error_t*)rc_json_deserialize(buffer, 0x0d2011cfU, (const uint8_t*)json);
|
||||
}
|
||||
|
||||
const rc_json_struct_meta_t* rc_json_resolve_struct(unsigned hash) {
|
||||
|
||||
switch (hash) {
|
||||
@ -561,6 +603,7 @@ const rc_json_struct_meta_t* rc_json_resolve_struct(unsigned hash) {
|
||||
case 0xadc4ac0fU: return &rc_json_struct_meta_patchdata;
|
||||
case 0x0dddd3d5U: return &rc_json_struct_meta_patch;
|
||||
case 0x9b4e2684U: return &rc_json_struct_meta_unlocks;
|
||||
case 0x0d2011cfU: return &rc_json_struct_meta_error;
|
||||
default: return NULL;
|
||||
}
|
||||
}
|
||||
|
7
deps/rcheevos/src/rjson/schema.dej
vendored
7
deps/rcheevos/src/rjson/schema.dej
vendored
@ -73,3 +73,10 @@ struct unlocks/Unlocks {
|
||||
unsigned gameid/GameID;
|
||||
bool hardcore/HardcoreMode;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
struct error/Error {
|
||||
bool success/Success;
|
||||
string error/Error;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user