diff --git a/src/ProxyCommands.cc b/src/ProxyCommands.cc index bce1c178..e68e6500 100644 --- a/src/ProxyCommands.cc +++ b/src/ProxyCommands.cc @@ -989,18 +989,20 @@ static HandlerResult S_6x(shared_ptr, static HandlerResult C_GXB_61(shared_ptr, ProxyServer::LinkedSession& session, uint16_t, uint32_t flag, string& data) { - if (session.version == GameVersion::BB) { - auto& pd = check_size_t(data, sizeof(PSOPlayerDataBB), 0xFFFF); - add_color_inplace(pd.info_board.data(), pd.info_board.size()); + if (session.options.enable_chat_filter) { + if (session.version == GameVersion::BB) { + auto& pd = check_size_t(data, sizeof(PSOPlayerDataBB), 0xFFFF); + add_color_inplace(pd.info_board.data(), pd.info_board.size()); - } else { - PSOPlayerDataV3* pd; - if (flag == 4) { // Episode 3 - pd = reinterpret_cast(&check_size_t(data)); } else { - pd = &check_size_t(data, sizeof(PSOPlayerDataV3), 0xFFFF); + PSOPlayerDataV3* pd; + if (flag == 4) { // Episode 3 + pd = reinterpret_cast(&check_size_t(data)); + } else { + pd = &check_size_t(data, sizeof(PSOPlayerDataV3), 0xFFFF); + } + add_color_inplace(pd->info_board.data(), pd->info_board.size()); } - add_color_inplace(pd->info_board.data(), pd->info_board.size()); } // TODO: We should check if the info board text was actually modified and @@ -1009,19 +1011,23 @@ static HandlerResult C_GXB_61(shared_ptr, } static HandlerResult C_GX_D9(shared_ptr, - ProxyServer::LinkedSession&, uint16_t, uint32_t, string& data) { - add_color_inplace(data.data(), data.size()); - // TODO: We should check if the info board text was actually modified and - // return MODIFIED if so. + ProxyServer::LinkedSession& session, uint16_t, uint32_t, string& data) { + if (session.options.enable_chat_filter) { + add_color_inplace(data.data(), data.size()); + // TODO: We should check if the info board text was actually modified and + // return MODIFIED if so. + } return HandlerResult::Type::FORWARD; } static HandlerResult C_B_D9(shared_ptr, - ProxyServer::LinkedSession&, uint16_t, uint32_t, string& data) { - char16_t* text = reinterpret_cast(data.data()); - add_color_inplace(text, data.size() / sizeof(char16_t)); - // TODO: We should check if the info board text was actually modified and - // return HandlerResult::MODIFIED if so. + ProxyServer::LinkedSession& session, uint16_t, uint32_t, string& data) { + if (session.options.enable_chat_filter) { + char16_t* text = reinterpret_cast(data.data()); + add_color_inplace(text, data.size() / sizeof(char16_t)); + // TODO: We should check if the info board text was actually modified and + // return HandlerResult::MODIFIED if so. + } return HandlerResult::Type::FORWARD; } diff --git a/src/ReceiveCommands.cc b/src/ReceiveCommands.cc index 8edf32fd..49f9f8b9 100644 --- a/src/ReceiveCommands.cc +++ b/src/ReceiveCommands.cc @@ -73,7 +73,7 @@ vector quest_download_menu({ static const unordered_map proxy_options_menu_descriptions({ {ProxyOptionsMenuItemID::GO_BACK, u"Return to the\nproxy menu"}, {ProxyOptionsMenuItemID::CHAT_COMMANDS, u"Enable chat\ncommands"}, - {ProxyOptionsMenuItemID::CHAT_FILTER, u"Enable escape\nsequences in\nchat messages"}, + {ProxyOptionsMenuItemID::CHAT_FILTER, u"Enable escape\nsequences in\nchat messages\nand info board"}, {ProxyOptionsMenuItemID::INFINITE_HP, u"Enable automatic HP\nrestoration when\nyou are hit by an\nenemy or trap\n\nCannot revive you\nfrom one-hit kills"}, {ProxyOptionsMenuItemID::INFINITE_TP, u"Enable automatic TP\nrestoration when\nyou cast any\ntechnique"}, {ProxyOptionsMenuItemID::SWITCH_ASSIST, u"Automatically try\nto unlock 2-player\ndoors when you step\non both switches\nsequentially"},