Skip to content

Commit

Permalink
Merge pull request #3263 from guilherme-gm/rodex-warns
Browse files Browse the repository at this point in the history
Add date checks and warns to RoDEX mail box and enable it by default
  • Loading branch information
MishimaHaruna authored Dec 28, 2023
2 parents 3345da4 + f192f57 commit 11d7d1b
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 4 deletions.
7 changes: 3 additions & 4 deletions conf/map/battle/feature.conf
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,9 @@ features: {
rodex: true

// Allow usage of "Account Mail" box in RoDEX?
// Requires: 2016-03-16aRagexeRE or later
// This is disabled in client-side in some client versions
// Disabled by default
rodex_use_accountmail: false
// Requires: 2016-03-16aRagexeRE (+ patch) or later, 2016-03-23aRagexe or later, any zero client
// For RE clients, it requires client patching and you must also uncomment ENABLE_RODEX_ACCOUNT_MAIL_RE_PATCH in src/config/core.h
rodex_use_accountmail: true

// Allow Homunculus autofeeding
// true: enable (Default)
Expand Down
3 changes: 3 additions & 0 deletions doc/script_commands.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9718,6 +9718,9 @@ For examples of usage, see /doc/sample/npc_rodex.txt
rodex_sendmail2 and rodex_sendmail_acc2 are more flexible versions.
Check getitem2 command for more information of the extra parameters.

Important: rodex_sendmail_acc (and rodex_sendmail_acc2) requires clients from 2016-03-23 or newer.
Additionally, it requires enabling "rodex_use_accountmail" on conf/map/battle/feature.conf.

---------------------------------------
//=====================================
7 - Instance-Related Commands
Expand Down
4 changes: 4 additions & 0 deletions src/config/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@
/// Uncomment for use with Nemo patch ExtendOldCashShopPreview
//#define ENABLE_OLD_CASHSHOP_PREVIEW_PATCH

/// Uncomment to allow RE clients to enable RoDEX "Account Mail".
/// RE clients requires Nemo patch for RoDEX Account Mail to work.
//#define ENABLE_RODEX_ACCOUNT_MAIL_RE_PATCH

/// Uncomment to allow flinch animation and walk delay to be synced
/// Reduces positional lag when getting hit
//#define WALKDELAY_SYNC
Expand Down
12 changes: 12 additions & 0 deletions src/map/battle.c
Original file line number Diff line number Diff line change
Expand Up @@ -8013,6 +8013,18 @@ static void battle_adjust_conf(void)
}
#endif

#if !(PACKETVER_MAIN_NUM >= 20160323 || (PACKETVER_RE_NUM >= 20160316 && defined(ENABLE_RODEX_ACCOUNT_MAIL_RE_PATCH)) || defined(PACKETVER_ZERO))
if (battle_config.feature_rodex_use_accountmail == 1) {
#ifndef BUILDBOT /* Don't show these warnings to CI */
ShowWarning("conf/map/battle/feature.conf:features/rodex_use_accountmail RoDEX account mail is enabled but it requires 2016-03-16 RagexeRE / 2016-03-23 Ragexe or newer, disabling...\n");
#ifdef PACKETVER_RE
ShowWarning("conf/map/battle/feature.conf:features/rodex_use_accountmail For RE clients, you should also enable ENABLE_RODEX_ACCOUNT_MAIL_RE_PATCH\n");
#endif // PACKETVER_RE
#endif // !BUILDBOT
battle_config.feature_rodex_use_accountmail = 0;
}
#endif // date check

#if !(PACKETVER_MAIN_NUM >= 20161130 || PACKETVER_RE_NUM >= 20161109 || defined(PACKETVER_ZERO))
if (battle_config.enable_refinery_ui == 1) {
ShowWarning("conf/map/battle/feature.conf refinery ui is enabled but it requires PACKETVER 2016-11-09 RagexeRE/2016-11-30 Ragexe or newer, disabling...\n");
Expand Down
3 changes: 3 additions & 0 deletions src/map/script.c
Original file line number Diff line number Diff line change
Expand Up @@ -27269,6 +27269,9 @@ static bool buildin_rodex_sendmail_sub(struct script_state *st, struct rodex_mes
int receiver_id = script_getnum(st, 2);

if (strcmp(func_name, "rodex_sendmail_acc") == 0 || strcmp(func_name, "rodex_sendmail_acc2") == 0) {
if (battle_config.feature_rodex_use_accountmail == 0)
ShowWarning("script:rodex_sendmail_acc: You are sending an account mail while \"feature_rodex_use_accountmail\" is disabled. Players may not be able to view it.\n");

if (receiver_id < START_ACCOUNT_NUM || receiver_id > END_ACCOUNT_NUM) {
ShowError("script:rodex_sendmail: Invalid receiver account ID %d passed!\n", receiver_id);
return false;
Expand Down

0 comments on commit 11d7d1b

Please sign in to comment.