diff --git a/README.md b/README.md index a1521712..01ff3e9f 100644 --- a/README.md +++ b/README.md @@ -306,6 +306,7 @@ Some commands only work on the game server and not on the proxy server. The chat * `$secid `: Sets your override section ID. After running this command, any games you create will use your override section ID for rare drops instead of your character's actual section ID. To revert to your actual section id, run `$secid` with no name after it. On the proxy server, this will not work if the remote server controls item drops (e.g. on BB, or on Schtserv with server drops enabled). If the server does not allow cheat mode anywhere (that is, "CheatModeBehavior" is "Off" in config.json), this command does nothing. * `$rand `: Sets your override random seed (specified as a 32-bit hex value). This will make any games you create use the given seed for rare enemies. This also makes item drops deterministic in Blue Burst games hosted by newserv. On the proxy server, this command can cause desyncs with other players in the same game, since they will not see the overridden random seed. To remove the override, run `$rand` with no arguments. If the server does not allow cheat mode anywhere (that is, "CheatModeBehavior" is "Off" in config.json), this command does nothing. * `$ln [name-or-type]`: Sets the lobby number. Visible only to you. This command exists because some non-lobby maps can be loaded as lobbies with invalid lobby numbers. See the "GC lobby types" and "Ep3 lobby types" entries in the information menu for acceptable values here. Note that non-lobby maps do not have a lobby counter, so there's no way to exit the lobby without using either `$ln` again or `$exit`. On the game server, `$ln` reloads the lobby immediately; on the proxy server, it doesn't take effect until you load another lobby yourself (which means you'll like have to use `$exit` to escape). Run this command with no argument to return to the default lobby. + * `$swa`: Enables or disables switch assist. When enabled, the server will attempt to automatically unlock two-player doors in non-quest games if you step on both switches sequentially. * `$exit`: If you're in a lobby, sends you to the main menu (which ends your proxy session, if you're in one). If you're in a game or spectator team, sends you to the lobby (but does not end your proxy session if you're in one). Does nothing if you're in a non-Episode 3 game and no quest is in progress. * `$patch `: Run a patch on your client. `` must exactly match the name of a patch on the server. @@ -340,7 +341,6 @@ Some commands only work on the game server and not on the proxy server. The chat * `$warpme `: Warps yourself to the given floor. * `$warpall `: Warps everyone in the game to the given floor. You must be the leader to use this command, unless you're on the proxy server. * `$next`: Warps yourself to the next floor. - * `$swa`: Enables or disables switch assist. When enabled, the server will attempt to automatically unlock two-player doors in solo games if you step on both switches sequentially. * `$item ` (or `$i `): Create an item. `desc` may be a description of the item (e.g. "Hell Saber +5 0/10/25/0/10") or a string of hex data specifying the item code. Item codes are 16 hex bytes; at least 2 bytes must be specified, and all unspecified bytes are zeroes. If you are on the proxy server, you must not be using Blue Burst for this command to work. On the game server, this command works for all versions. * `$unset `: In an Episode 3 battle, removes one of your set cards from the field. `` is the index of the set card as it appears on your screen - 1 is the card next to your SC's icon, 2 is the card to the right of 1, etc. This does not cause a Hunters-side SC to lose HP, as they normally do when their items are destroyed. diff --git a/src/ChatCommands.cc b/src/ChatCommands.cc index be4eb084..055d2f33 100644 --- a/src/ChatCommands.cc +++ b/src/ChatCommands.cc @@ -219,9 +219,6 @@ static void proxy_command_lobby_info(shared_ptr ses, } vector cheats_tokens; - if (ses->config.check_flag(Client::Flag::SWITCH_ASSIST_ENABLED)) { - cheats_tokens.emplace_back("SWA"); - } if (ses->config.check_flag(Client::Flag::INFINITE_HP_ENABLED)) { cheats_tokens.emplace_back("HP"); } @@ -234,14 +231,17 @@ static void proxy_command_lobby_info(shared_ptr ses, } vector behaviors_tokens; + if (ses->config.check_flag(Client::Flag::SWITCH_ASSIST_ENABLED)) { + behaviors_tokens.emplace_back("SWA"); + } if (ses->config.check_flag(Client::Flag::PROXY_SAVE_FILES)) { - behaviors_tokens.emplace_back("SAVE"); + behaviors_tokens.emplace_back("SF"); } if (ses->config.check_flag(Client::Flag::PROXY_SUPPRESS_REMOTE_LOGIN)) { behaviors_tokens.emplace_back("SL"); } if (ses->config.check_flag(Client::Flag::PROXY_BLOCK_FUNCTION_CALLS)) { - behaviors_tokens.emplace_back("BFC"); + behaviors_tokens.emplace_back("BF"); } if (!behaviors_tokens.empty()) { msg += "\n$C7Flags: $C6"; @@ -1504,7 +1504,6 @@ static void server_command_switch_assist(shared_ptr c, const std::string auto s = c->require_server_state(); auto l = c->require_lobby(); check_is_game(l, true); - check_cheats_enabled(l, c); c->config.toggle_flag(Client::Flag::SWITCH_ASSIST_ENABLED); send_text_message_printf(c, "$C6Switch assist %s", @@ -1513,7 +1512,6 @@ static void server_command_switch_assist(shared_ptr c, const std::string static void proxy_command_switch_assist(shared_ptr ses, const std::string&) { auto s = ses->require_server_state(); - check_cheats_allowed(s, ses); ses->config.toggle_flag(Client::Flag::SWITCH_ASSIST_ENABLED); send_text_message_printf(ses->client_channel, "$C6Switch assist %s", ses->config.check_flag(Client::Flag::SWITCH_ASSIST_ENABLED) ? "enabled" : "disabled"); diff --git a/src/Client.hh b/src/Client.hh index 979092c7..46c6c257 100644 --- a/src/Client.hh +++ b/src/Client.hh @@ -59,9 +59,9 @@ public: SHOULD_SEND_ARTIFICIAL_ITEM_STATE = 0x0001000000000000, SHOULD_SEND_ARTIFICIAL_FLAG_STATE = 0x0002000000000000, SHOULD_SEND_ENABLE_SAVE = 0x0004000000000000, + SWITCH_ASSIST_ENABLED = 0x0000000100000000, // Cheat mode flags - SWITCH_ASSIST_ENABLED = 0x0000000100000000, INFINITE_HP_ENABLED = 0x0000000200000000, INFINITE_TP_ENABLED = 0x0000000400000000, DEBUG_ENABLED = 0x0000000800000000, diff --git a/src/ReceiveCommands.cc b/src/ReceiveCommands.cc index 9037f241..8c907ec7 100644 --- a/src/ReceiveCommands.cc +++ b/src/ReceiveCommands.cc @@ -53,14 +53,18 @@ static shared_ptr proxy_options_menu_for_client(shared_ptrconfig.override_lobby_event != 0xFF), + "Block events", "Disable seasonal\nevents in the lobby\nand in games"); + add_option(ProxyOptionsMenuItemID::BLOCK_PATCHES, Client::Flag::PROXY_BLOCK_FUNCTION_CALLS, + "Block patches", "Disable patches sent\nby the remote server"); + add_option(ProxyOptionsMenuItemID::SWITCH_ASSIST, Client::Flag::SWITCH_ASSIST_ENABLED, + "Switch assist", "Automatically try\nto unlock 2-player\ndoors when you step\non both switches\nsequentially"); if ((s->cheat_mode_behavior != ServerState::BehaviorSwitch::OFF) || (c->license->flags & License::Flag::CHEAT_ANYWHERE)) { if (!is_ep3(c->version())) { add_option(ProxyOptionsMenuItemID::INFINITE_HP, Client::Flag::INFINITE_HP_ENABLED, "Infinite HP", "Enable automatic HP\nrestoration when\nyou are hit by an\nenemy or trap\n\nCannot revive you\nfrom one-hit kills"); add_option(ProxyOptionsMenuItemID::INFINITE_TP, Client::Flag::INFINITE_TP_ENABLED, "Infinite TP", "Enable automatic TP\nrestoration when\nyou cast any\ntechnique"); - add_option(ProxyOptionsMenuItemID::SWITCH_ASSIST, Client::Flag::SWITCH_ASSIST_ENABLED, - "Switch assist", "Automatically try\nto unlock 2-player\ndoors when you step\non both switches\nsequentially"); } else { // Note: This option's text is the maximum possible length for any menu item add_option(ProxyOptionsMenuItemID::EP3_INFINITE_MESETA, Client::Flag::PROXY_EP3_INFINITE_MESETA_ENABLED, @@ -71,10 +75,6 @@ static shared_ptr proxy_options_menu_for_client(shared_ptrconfig.override_lobby_event != 0xFF), - "Block events", "Disable seasonal\nevents in the lobby\nand in games"); - add_option(ProxyOptionsMenuItemID::BLOCK_PATCHES, Client::Flag::PROXY_BLOCK_FUNCTION_CALLS, - "Block patches", "Disable patches sent\nby the remote server"); if (s->proxy_allow_save_files) { add_option(ProxyOptionsMenuItemID::SAVE_FILES, Client::Flag::PROXY_SAVE_FILES, "Save files", "Save local copies of\nfiles from the\nremote server\n(quests, etc.)"); diff --git a/src/ReceiveSubcommands.cc b/src/ReceiveSubcommands.cc index 60e99236..17bae742 100644 --- a/src/ReceiveSubcommands.cc +++ b/src/ReceiveSubcommands.cc @@ -1047,8 +1047,7 @@ static void on_switch_state_changed(shared_ptr c, uint8_t command, uint8 forward_subcommand(c, command, flag, data, size); if (cmd.flags && cmd.header.object_id != 0xFFFF) { - bool player_cheats_enabled = l->check_flag(Lobby::Flag::CHEATS_ENABLED) || (c->license->flags & License::Flag::CHEAT_ANYWHERE); - if (player_cheats_enabled && + if (!l->quest && c->config.check_flag(Client::Flag::SWITCH_ASSIST_ENABLED) && (c->last_switch_enabled_command.header.subcommand == 0x05)) { c->log.info("[Switch assist] Replaying previous enable command");