mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-27 05:23:51 +00:00
refactor: name auth security flags, log JSON parse failures
- auth_handler: define kSecurityFlagPin/MatrixCard/Authenticator constants (0x01/0x02/0x04) with why-comment explaining WoW login challenge securityFlags byte, replace all bare hex literals - expansion_profile: log warning on jsonInt() parse failure instead of silently returning default — makes malformed expansion.json diagnosable without debugger
This commit is contained in:
parent
74f0ba010a
commit
a940859e6a
2 changed files with 22 additions and 9 deletions
|
|
@ -58,7 +58,14 @@ std::string jsonValue(const std::string& json, const std::string& key) {
|
|||
int jsonInt(const std::string& json, const std::string& key, int def = 0) {
|
||||
std::string v = jsonValue(json, key);
|
||||
if (v.empty()) return def;
|
||||
try { return std::stoi(v); } catch (...) { return def; }
|
||||
try {
|
||||
return std::stoi(v);
|
||||
} catch (...) {
|
||||
// Non-numeric value for an integer field — fall back to default rather than
|
||||
// crashing, but log it so malformed expansion.json files are diagnosable.
|
||||
wowee::core::Logger::getInstance().warning("jsonInt: failed to parse '", key, "' value '", v, "', using default ", def);
|
||||
return def;
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<uint32_t> jsonUintArray(const std::string& json, const std::string& key) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue