Commit f2202eee authored by Drahomír Karchňák's avatar Drahomír Karchňák

Registration Resource retuns user_server_selection field, which indicades...

Registration Resource retuns user_server_selection field, which indicades whether or not we got user selected server details.
parent d2bd2838
......@@ -259,14 +259,18 @@ public class RegistrationResource extends ServerResource
final Boolean userServerSelection = request.optBoolean("user_server_selection");
boolean serverSelectionResult = false;
if(userServerSelection) {
final String preferServer = request.optString("prefer_server", null);
if(!Strings.isNullOrEmpty(preferServer)) {
serverSelectionResult = true;
server = getPreferredServer(preferServer, testServerEncryption, ipv6);
}
}
if(server == null) {
serverSelectionResult = false;
server = getNearestServer(errorList, geolat, geolong, geotime, clientIpString,
asCountry, geoIpCountry, serverType, testServerEncryption, ipv6);
}
......@@ -283,7 +287,8 @@ public class RegistrationResource extends ServerResource
}
else
timeWithZone = Helperfunctions.getTimeWithTimeZone(timeZoneId);
answer.put("user_server_selection", serverSelectionResult);
answer.put("test_server_address", server.address);
answer.put("test_server_port", server.port);
answer.put("test_server_name", server.name);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment