diff --git a/src/Client.cc b/src/Client.cc index 89c13eab..a19f0d9f 100644 --- a/src/Client.cc +++ b/src/Client.cc @@ -63,6 +63,7 @@ Client::Client( pending_bb_save_player_index(0), proxy_save_files(false), proxy_suppress_remote_login(false), + proxy_zero_remote_guild_card(false), dol_base_addr(0) { this->last_switch_enabled_command.subcommand = 0; memset(&this->next_connection_addr, 0, sizeof(this->next_connection_addr)); diff --git a/src/Client.hh b/src/Client.hh index 226dd80b..dd1efa54 100644 --- a/src/Client.hh +++ b/src/Client.hh @@ -120,6 +120,7 @@ struct Client { bool proxy_save_files; bool proxy_suppress_remote_login; + bool proxy_zero_remote_guild_card; // DOL file loading state uint32_t dol_base_addr; diff --git a/src/Menu.hh b/src/Menu.hh index 11d98825..2c68aad3 100644 --- a/src/Menu.hh +++ b/src/Menu.hh @@ -60,6 +60,7 @@ namespace ProxyOptionsMenuItemID { constexpr uint32_t SWITCH_ASSIST = 0xAA3333AA; constexpr uint32_t SAVE_FILES = 0xAA4444AA; constexpr uint32_t SUPPRESS_LOGIN = 0xAA5555AA; + constexpr uint32_t SKIP_CARD = 0xAA6666AA; } diff --git a/src/ReceiveCommands.cc b/src/ReceiveCommands.cc index 2ca09ccf..3f243aeb 100644 --- a/src/ReceiveCommands.cc +++ b/src/ReceiveCommands.cc @@ -86,11 +86,15 @@ static void send_client_to_proxy_server(shared_ptr s, shared_ptrswitch_assist = c->switch_assist; session->save_files = c->proxy_save_files; session->suppress_remote_login = c->proxy_suppress_remote_login; - try { - string key = string_printf("proxy_remote_guild_card_number:%" PRIX32, c->license->serial_number); - const auto& entry = client_options_cache.get_or_throw(key); - session->remote_guild_card_number = stoul(entry->data, nullptr, 10); - } catch (const out_of_range&) { } + if (c->proxy_zero_remote_guild_card) { + session->remote_guild_card_number = 0; + } else { + try { + string key = string_printf("proxy_remote_guild_card_number:%" PRIX32, c->license->serial_number); + const auto& entry = client_options_cache.get_or_throw(key); + session->remote_guild_card_number = stoul(entry->data, nullptr, 10); + } catch (const out_of_range&) { } + } send_reconnect(c, s->connect_address_for_client(c), local_port); } @@ -953,6 +957,9 @@ static void on_menu_item_info_request(shared_ptr s, shared_ptr proxy_options_menu_for_client( ret.emplace_back(ProxyOptionsMenuItemID::SUPPRESS_LOGIN, c->proxy_suppress_remote_login ? u"Skip login ON" : u"Skip login OFF", u"Enable or disable\nalternate login\nsequence", 0); + ret.emplace_back(ProxyOptionsMenuItemID::SKIP_CARD, + c->proxy_zero_remote_guild_card ? u"Skip card ON" : u"Skip card OFF", + u"Enable or disable\nGuild Card reset", 0); return ret; } @@ -1233,6 +1243,9 @@ static void on_menu_selection(shared_ptr s, shared_ptr c, goto resend_proxy_options_menu; case ProxyOptionsMenuItemID::SUPPRESS_LOGIN: c->proxy_suppress_remote_login = !c->proxy_suppress_remote_login; + goto resend_proxy_options_menu; + case ProxyOptionsMenuItemID::SKIP_CARD: + c->proxy_zero_remote_guild_card = !c->proxy_zero_remote_guild_card; resend_proxy_options_menu: send_menu(c, s->name.c_str(), MenuID::PROXY_OPTIONS, proxy_options_menu_for_client(c));