Randomly choose an SDL server and recognize malicious domain without prefix

This commit is contained in:
Duke Leto
2021-05-03 13:36:47 -04:00
parent e2770675b5
commit f601767811
3 changed files with 37 additions and 21 deletions

View File

@@ -155,9 +155,21 @@ void ConnectionLoader::doAutoConnect()
QString response = litelib_process_response(resp);
if (response.toUpper().trimmed() != "OK") {
QString resp = "Error when connecting to " + config->server + ": " + response;
showError(resp);
return;
config->server = Settings::getRandomServer();
resp = litelib_initialize_existing(
config->dangerous,
config->server.toStdString().c_str()
);
response = litelib_process_response(resp);
if (response.toUpper().trimmed() != "OK") {
QString resp = "Error when connecting to " + config->server + ": " + response;
showError(resp);
return;
} else {
qDebug() << __func__ << ": Successfully connected to random server: " << config->server << " !!!";
}
} else {
qDebug() << __func__ << ": Successfully connected to " << config->server << " !!!";
}