mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2025-07-03 16:25:35 +00:00
add explanative debug messages to parse errors in GetPidVid
This commit is contained in:
parent
dff94a41be
commit
13a86d3e77
@ -34,13 +34,15 @@ static std::optional<std::pair<int, int>> GetPidVid(const std::string& str) {
|
||||
|
||||
if (pid.find_first_not_of("0123456789") == std::string::npos && vid.find_first_not_of("0123456789") == std::string::npos) {
|
||||
try {
|
||||
int PID = stoi(pid);
|
||||
int VID = stoi(vid);
|
||||
int PID = std::stoi(pid);
|
||||
int VID = std::stoi(vid);
|
||||
return { { PID, VID } };
|
||||
} catch (const std::exception&) {
|
||||
beammp_debugf("Invalid packet: Could not parse pid/vid from packet, as one or both are not valid numbers: '{}'", str);
|
||||
return std::nullopt;
|
||||
}
|
||||
}
|
||||
beammp_debugf("Invalid packet: Could not parse pid/vid from packet: '{}'", str);
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user