mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-01 22:30:42 -07:00
troubleshooter: log soft id (#436)
## Link to GitHub Issue, if one exists n/a ## Description of change Log soft ID (game datecode etc) at the top of auto-troubleshooter output
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
#include "games/mfc/mfc.h"
|
#include "games/mfc/mfc.h"
|
||||||
#include "hooks/avshook.h"
|
#include "hooks/avshook.h"
|
||||||
#include "util/detour.h"
|
#include "util/detour.h"
|
||||||
|
#include "util/deferlog.h"
|
||||||
#include "util/fileutils.h"
|
#include "util/fileutils.h"
|
||||||
#include "util/libutils.h"
|
#include "util/libutils.h"
|
||||||
#include "util/logging.h"
|
#include "util/logging.h"
|
||||||
@@ -568,6 +569,7 @@ namespace avs {
|
|||||||
soft_id_code << EA3_EXT;
|
soft_id_code << EA3_EXT;
|
||||||
std::string soft_id_code_str = soft_id_code.str();
|
std::string soft_id_code_str = soft_id_code.str();
|
||||||
log_info("avs-ea3", "soft id code: {}", soft_id_code_str);
|
log_info("avs-ea3", "soft id code: {}", soft_id_code_str);
|
||||||
|
deferredlogs::set_softid(soft_id_code_str);
|
||||||
|
|
||||||
// set soft ID code
|
// set soft ID code
|
||||||
avs::core::avs_std_setenv("/env/profile/soft_id_code", soft_id_code_str.c_str());
|
avs::core::avs_std_setenv("/env/profile/soft_id_code", soft_id_code_str.c_str());
|
||||||
|
|||||||
@@ -18,6 +18,14 @@ namespace deferredlogs {
|
|||||||
std::mutex deferred_errors_mutex;
|
std::mutex deferred_errors_mutex;
|
||||||
std::vector<std::vector<std::string>> deferred_errors;
|
std::vector<std::vector<std::string>> deferred_errors;
|
||||||
|
|
||||||
|
std::mutex softid_mutex;
|
||||||
|
std::string softid;
|
||||||
|
|
||||||
|
void set_softid(const std::string& softid_new) {
|
||||||
|
std::lock_guard<std::mutex> lock(softid_mutex);
|
||||||
|
softid = softid_new;
|
||||||
|
}
|
||||||
|
|
||||||
void defer_error_messages(std::initializer_list<std::string> messages) {
|
void defer_error_messages(std::initializer_list<std::string> messages) {
|
||||||
std::lock_guard<std::mutex> lock(deferred_errors_mutex);
|
std::lock_guard<std::mutex> lock(deferred_errors_mutex);
|
||||||
deferred_errors.emplace_back(messages);
|
deferred_errors.emplace_back(messages);
|
||||||
@@ -45,6 +53,17 @@ namespace deferredlogs {
|
|||||||
msg += "/-------------------------- spice2x auto-troubleshooter -----------------------\\\n";
|
msg += "/-------------------------- spice2x auto-troubleshooter -----------------------\\\n";
|
||||||
msg += "\n";
|
msg += "\n";
|
||||||
msg += " spice2x version: " + to_string(VERSION_STRING_CFG) + "\n";
|
msg += " spice2x version: " + to_string(VERSION_STRING_CFG) + "\n";
|
||||||
|
|
||||||
|
// soft ID
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(softid_mutex);
|
||||||
|
if (!softid.empty()) {
|
||||||
|
msg += " game version: " + softid + "\n";
|
||||||
|
} else {
|
||||||
|
msg += " game version: unknown\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
msg += "\n";
|
msg += "\n";
|
||||||
|
|
||||||
if (is_crash) {
|
if (is_crash) {
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ namespace deferredlogs {
|
|||||||
// some shared error messages
|
// some shared error messages
|
||||||
extern const std::initializer_list<std::string> SUPERSTEP_SOUND_ERROR_MESSAGE;
|
extern const std::initializer_list<std::string> SUPERSTEP_SOUND_ERROR_MESSAGE;
|
||||||
|
|
||||||
|
void set_softid(const std::string& softid);
|
||||||
void defer_error_messages(std::initializer_list<std::string> messages);
|
void defer_error_messages(std::initializer_list<std::string> messages);
|
||||||
void dump_to_logger(bool is_crash=false);
|
void dump_to_logger(bool is_crash=false);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user