mirror of
https://github.com/libretro/RetroArch
synced 2025-02-06 00:39:53 +00:00
prevent retroachievements cheating exploit
Revert "prevent retroachievements cheating exploit" and reimplement it in a better way This reverts commit d323338caa4882925d184f5ee7a506bfa8c78c1e.
This commit is contained in:
parent
baa6330b13
commit
c07744564a
@ -288,6 +288,7 @@ static cheevos_locals_t cheevos_locals =
|
||||
bool cheevos_loaded = false;
|
||||
bool cheevos_hardcore_active = false;
|
||||
bool cheevos_hardcore_paused = false;
|
||||
bool cheevos_state_loaded_flag = false;
|
||||
int cheats_are_enabled = 0;
|
||||
int cheats_were_enabled = 0;
|
||||
|
||||
|
@ -155,8 +155,10 @@ cheevos_console_t cheevos_get_console(void);
|
||||
extern bool cheevos_loaded;
|
||||
extern bool cheevos_hardcore_active;
|
||||
extern bool cheevos_hardcore_paused;
|
||||
extern bool cheevos_state_loaded_flag;
|
||||
extern int cheats_are_enabled;
|
||||
extern int cheats_were_enabled;
|
||||
;
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
|
@ -1675,6 +1675,9 @@ static bool command_event_main_state(unsigned cmd)
|
||||
case CMD_EVENT_LOAD_STATE:
|
||||
if (content_load_state(state_path, false, false))
|
||||
{
|
||||
#ifdef HAVE_CHEEVOS
|
||||
cheevos_state_loaded_flag = true;
|
||||
#endif
|
||||
ret = true;
|
||||
#ifdef HAVE_NETWORKING
|
||||
netplay_driver_ctl(RARCH_NETPLAY_CTL_LOAD_SAVESTATE, NULL);
|
||||
|
@ -3711,7 +3711,7 @@ MSG_HASH(
|
||||
)
|
||||
MSG_HASH(
|
||||
MSG_CHEEVOS_HARDCORE_MODE_ENABLE,
|
||||
"Hardcore Mode Enabled, savestate & rewind were disabled."
|
||||
"Achievements Hardcore Mode Enabled, savestate & rewind were disabled."
|
||||
)
|
||||
MSG_HASH(
|
||||
MSG_COMPARING_WITH_KNOWN_MAGIC_NUMBERS,
|
||||
@ -7542,3 +7542,7 @@ MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_INPUT_META_STREAMING_TOGGLE,
|
||||
"Streaming toggle"
|
||||
)
|
||||
MSG_HASH(
|
||||
MSG_CHEEVOS_HARDCORE_MODE_DISABLED,
|
||||
"Savestate loaded, Achievements Hardcore Mode disabled for the current session."
|
||||
)
|
||||
|
@ -2107,6 +2107,7 @@ enum msg_hash_enums
|
||||
MSG_CHEAT_SEARCH_ADD_MATCH_SUCCESS,
|
||||
MSG_CHEAT_SEARCH_ADD_MATCH_FAIL,
|
||||
MSG_CHEAT_SEARCH_DELETE_MATCH_SUCCESS,
|
||||
MSG_CHEEVOS_HARDCORE_MODE_DISABLED,
|
||||
|
||||
MSG_LAST
|
||||
};
|
||||
|
@ -3156,6 +3156,12 @@ static enum runloop_state runloop_check_state(
|
||||
&& settings->bools.cheevos_hardcore_mode_enable
|
||||
&& cheevos_loaded && !cheevos_hardcore_paused;
|
||||
|
||||
if (cheevos_hardcore_active && cheevos_state_loaded_flag)
|
||||
{
|
||||
cheevos_hardcore_paused = true;
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEEVOS_HARDCORE_MODE_DISABLED), 0, 180, true);
|
||||
}
|
||||
|
||||
if (!cheevos_hardcore_active)
|
||||
#endif
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user