Game now kicks players if they access ping.php and get an error message

master
Skylar Ittner 8 years ago
parent af6f4c1bce
commit 46cb98aa7c

@ -201,11 +201,11 @@ function pingServer() {
if (lockGot && gpsaccuracy < requiredaccuracy) { if (lockGot && gpsaccuracy < requiredaccuracy) {
$.getJSON(mkApiUrl('ping') + "?user=" + username + "&lat=" + latitude + "&long=" + longitude, function (data) { $.getJSON(mkApiUrl('ping') + "?user=" + username + "&lat=" + latitude + "&long=" + longitude, function (data) {
if (data.status == "ERROR") { if (data.status == "ERROR") {
navigator.notification.alert("Your account status has changed, and you have been logged out. Reason: " + data.message, "Account Status Changed", "OK"); localStorage.setItem("no_autologin", "true");
localStorage.setItem("no_autologin", true);
username = null; username = null;
password = null; password = null;
openscreen('login'); document.location.href = "index.html";
navigator.notification.alert("Your session status has changed, and you have been logged out. \n\nReason: " + data.message, null, "Sign-in Status Changed", "OK");
} }
}); });
} }
@ -240,4 +240,13 @@ setInterval(pingServer, 5000);
// Show error if it's taking too long // Show error if it's taking too long
setTimeout(function () { setTimeout(function () {
onError(); onError();
}, 15 * 1000); }, 15 * 1000);
setTimeout(function () {
// GPS lock is taking too long, let's GTFO of the loading screen
$('#loading').fadeOut('slow', function () {
$('#no-lock').css('display', 'block');
$('#loading').css('display', 'none');
updateStatusBarColor();
});
}, 30 * 1000);

@ -108,7 +108,7 @@
passset = true; passset = true;
} }
if (userset && passset && localStorage.getItem("no_autologin") !== true) { if (userset && passset && localStorage.getItem("no_autologin") !== "true") {
// Try to login with stored credentials // Try to login with stored credentials
$.post("https://sso.netsyms.com/api/simpleauth.php", $.post("https://sso.netsyms.com/api/simpleauth.php",
{user: localStorage.getItem("username"), pass: localStorage.getItem("password")}, {user: localStorage.getItem("username"), pass: localStorage.getItem("password")},
@ -126,7 +126,7 @@
} else { } else {
$('#loading').css('display', 'none'); $('#loading').css('display', 'none');
// Remove autologin block // Remove autologin block
localStorage.setItem("no_autologin", false); localStorage.setItem("no_autologin", "");
updateStatusBarColor(); updateStatusBarColor();
} }
navigator.splashscreen.hide(); navigator.splashscreen.hide();