New macro detection features (#7359)

* Adds battle config macro_detection_punishment to ban or jail characters.
* Adds battle config macro_detection_punishment_time to adjust the duration of ban/jail for players who fail the captcha challenges.
* Adds script command macro_detector which invokes the captcha challenge.
* General cleanups to the jail functions to remove duplicate code.
* General cleanups to the macro punishment calls to remove duplicate code.
* Ending SC_JAILED will now properly remove the jail status rather than trying to reset the timer to 1 second resolving any possibility of players getting stuck.
Thanks to @Lemongrass3110!
This commit is contained in:
Aleos
2022-12-13 15:44:42 -05:00
committed by GitHub
parent 5a533a7a12
commit ee2dcf816e
10 changed files with 154 additions and 55 deletions

View File

@@ -26829,6 +26829,25 @@ BUILDIN_FUNC(isdead) {
return SCRIPT_CMD_SUCCESS;
}
BUILDIN_FUNC(macro_detector) {
map_session_data *sd;
if (script_hasdata(st, 2) && script_isstring(st, 2)) { // Character Name
if (!script_nick2sd(2, sd)) {
return SCRIPT_CMD_FAILURE;
}
} else { // Account ID
if (!script_accid2sd(2, sd)) {
return SCRIPT_CMD_FAILURE;
}
}
// Reporter Account ID as -1 for server.
pc_macro_reporter_process(*sd);
return SCRIPT_CMD_SUCCESS;
}
#include "../custom/script.inc"
// declarations that were supposed to be exported from npc_chat.cpp
@@ -27582,6 +27601,8 @@ struct script_function buildin_func[] = {
BUILDIN_DEF(getfame, "?"),
BUILDIN_DEF(getfamerank, "?"),
BUILDIN_DEF(isdead, "?"),
BUILDIN_DEF(macro_detector, "?"),
#include "../custom/script_def.inc"
{NULL,NULL,NULL},