From 9d2f845418c02bc83e3230527db00049a2d037c4 Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Sat, 4 Jun 2022 22:56:18 -0700 Subject: [PATCH] add optin to delete saved license info --- src/Menu.hh | 1 + src/ReceiveCommands.cc | 5 +++++ src/ServerState.cc | 2 ++ 3 files changed, 8 insertions(+) diff --git a/src/Menu.hh b/src/Menu.hh index 84391753..032ccbec 100644 --- a/src/Menu.hh +++ b/src/Menu.hh @@ -32,6 +32,7 @@ namespace MainMenuItemID { constexpr uint32_t PATCHES = 0x11666611; constexpr uint32_t PROGRAMS = 0x11777711; constexpr uint32_t DISCONNECT = 0x11888811; + constexpr uint32_t CLEAR_LICENSE = 0x11999911; } namespace InformationMenuItemID { diff --git a/src/ReceiveCommands.cc b/src/ReceiveCommands.cc index f00bd9c7..1ce2411d 100644 --- a/src/ReceiveCommands.cc +++ b/src/ReceiveCommands.cc @@ -789,6 +789,11 @@ void process_menu_selection(shared_ptr s, shared_ptr c, c->should_disconnect = true; break; + case MainMenuItemID::CLEAR_LICENSE: + send_command(c, 0x9A, 0x04); + c->should_disconnect = true; + break; + default: send_message_box(c, u"Incorrect menu item ID."); break; diff --git a/src/ServerState.cc b/src/ServerState.cc index 954f0ac4..88ea1808 100644 --- a/src/ServerState.cc +++ b/src/ServerState.cc @@ -347,6 +347,8 @@ void ServerState::create_menus(shared_ptr config_json) { } this->main_menu.emplace_back(MainMenuItemID::DISCONNECT, u"Disconnect", u"Disconnect", 0); + this->main_menu.emplace_back(MainMenuItemID::CLEAR_LICENSE, u"Clear license", + u"Disconnect with an\ninvalid license error\nso you can enter a\ndifferent serial\nnumber, access key,\nor password", 0); try { this->welcome_message = decode_sjis(d.at("WelcomeMessage")->as_string());