mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2026-04-07 00:06:08 +00:00
fix download code, error checking
This commit is contained in:
@@ -58,7 +58,7 @@ std::string Login(const std::string& fields) {
|
||||
try {
|
||||
std::string Buffer = HTTP::Post("https://auth.beammp.com/userlogin", fields);
|
||||
|
||||
if (Buffer == "-1") {
|
||||
if (Buffer.empty()) {
|
||||
return GetFail("Failed to communicate with the auth system!");
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ void CheckLocalKey() {
|
||||
|
||||
nlohmann::json d = nlohmann::json::parse(Buffer, nullptr, false);
|
||||
|
||||
if (Buffer == "-1" || Buffer.at(0) != '{' || d.is_discarded()) {
|
||||
if (Buffer.empty() || Buffer.at(0) != '{' || d.is_discarded()) {
|
||||
error(Buffer);
|
||||
info("Invalid answer from authentication servers.");
|
||||
UpdateKey(nullptr);
|
||||
|
||||
Reference in New Issue
Block a user