From 7855323bc680506e0f2a8fa96394c332f8b80b8f Mon Sep 17 00:00:00 2001 From: William JCM Date: Sun, 21 Jun 2020 08:52:26 +0200 Subject: [PATCH] MassManager: fix the active slot detection issue. It's now replaced with a more stable version. Also bumped tested version up. --- GUI/MainFrame.cpp | 2 +- GUI/MainFrame.fbp | 4 ++-- GUI/MainFrame.h | 2 +- MassManager/MassManager.cpp | 4 +++- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/GUI/MainFrame.cpp b/GUI/MainFrame.cpp index cd6a7fc..b9ef7dc 100644 --- a/GUI/MainFrame.cpp +++ b/GUI/MainFrame.cpp @@ -186,7 +186,7 @@ MainFrame::MainFrame( wxWindow* parent, wxWindowID id, const wxString& title, co bSizerMainPanel->Add( bSizerGameStatus, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - _aboutText = new wxStaticText( _mainPanel, wxID_ANY, wxT("This version of the application was tested on M.A.S.S. Builder early access version 0.3.7.\nIt may or may not work with other versions of the game.\nMade for the M.A.S.S. Builder community by Guillaume Jacquemin."), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL ); + _aboutText = new wxStaticText( _mainPanel, wxID_ANY, wxT("This version of the application was tested on M.A.S.S. Builder early access version 0.4.1.\nIt may or may not work with other versions of the game.\nMade for the M.A.S.S. Builder community by Guillaume Jacquemin."), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL ); _aboutText->Wrap( -1 ); bSizerMainPanel->Add( _aboutText, 0, wxEXPAND|wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL, 5 ); diff --git a/GUI/MainFrame.fbp b/GUI/MainFrame.fbp index d7b98ab..0fac677 100644 --- a/GUI/MainFrame.fbp +++ b/GUI/MainFrame.fbp @@ -48,7 +48,7 @@ -1,-1 wxCAPTION|wxCLOSE_BOX|wxMINIMIZE_BOX|wxSYSTEM_MENU ; ; forward_declare - M.A.S.S. Manager 1.1.0 + M.A.S.S. Manager 1.1.1 @@ -1968,7 +1968,7 @@ 0 0 wxID_ANY - This version of the application was tested on M.A.S.S. Builder early access version 0.3.7. It may or may not work with other versions of the game. Made for the M.A.S.S. Builder community by Guillaume Jacquemin. + This version of the application was tested on M.A.S.S. Builder early access version 0.4.1. It may or may not work with other versions of the game. Made for the M.A.S.S. Builder community by Guillaume Jacquemin. 0 0 diff --git a/GUI/MainFrame.h b/GUI/MainFrame.h index e762465..6ab7a09 100644 --- a/GUI/MainFrame.h +++ b/GUI/MainFrame.h @@ -96,7 +96,7 @@ class MainFrame : public wxFrame public: - MainFrame( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("M.A.S.S. Manager 1.1.0"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxCAPTION|wxCLOSE_BOX|wxMINIMIZE_BOX|wxSYSTEM_MENU|wxCLIP_CHILDREN|wxTAB_TRAVERSAL ); + MainFrame( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("M.A.S.S. Manager 1.1.1"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxCAPTION|wxCLOSE_BOX|wxMINIMIZE_BOX|wxSYSTEM_MENU|wxCLIP_CHILDREN|wxTAB_TRAVERSAL ); ~MainFrame(); diff --git a/MassManager/MassManager.cpp b/MassManager/MassManager.cpp index 566e1b1..9109281 100644 --- a/MassManager/MassManager.cpp +++ b/MassManager/MassManager.cpp @@ -40,6 +40,8 @@ constexpr unsigned char steamid_locator[] = { 'A', 'c', 'c', 'o', 'u', 'n', 't', constexpr unsigned char active_slot_locator[] = { 'A', 'c', 't', 'i', 'v', 'e', 'F', 'r', 'a', 'm', 'e', 'S', 'l', 'o', 't', '\0', 0x0C, '\0', '\0', '\0', 'I', 'n', 't', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'y', '\0' }; +constexpr unsigned char credits_locator[] = { 'C', 'r', 'e', 'd', 'i', 't', '\0', 0x0C, '\0', '\0', '\0', 'I', 'n', 't', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'y', '\0' }; + MassManager::MassManager() { _ready = findSaveDirectory() && findSteamId() && findScreenshotDirectory(); @@ -126,7 +128,7 @@ auto MassManager::getActiveSlot() -> char{ auto iter = std::search(mmap.begin(), mmap.end(), &active_slot_locator[0], &active_slot_locator[31]); if(iter == mmap.end()) { - if(std::strncmp(&mmap[0x3F6], "Credit", 6) == 0) { + if(std::search(mmap.begin(), mmap.end(), &credits_locator[0], &credits_locator[22]) != mmap.end()) { _activeSlot = 0; } else {