check for DONTUPDATE

This commit is contained in:
Astra 2018-04-24 23:07:04 -04:00
parent e5855c27d2
commit 204e49e124
1 changed files with 27 additions and 26 deletions

View File

@ -111,45 +111,46 @@
); );
// check for epapi updates // check for epapi updates
(function () { if (!fs.existsSync($api.data + '/DONTUPDATE'))
(function () {
// fetch the latest build of epapi
fetch('https://endpwn.github.io/epapi/epapi.js?_=' + Date.now()).then(x => x.text()).then(x => {
// check the version // fetch the latest build of epapi
if (kparse(x).version > $api.version) { fetch('https://endpwn.github.io/epapi/epapi.js?_=' + Date.now()).then(x => x.text()).then(x => {
// if the version on the server is newer, pester the user // check the version
$api.ui.showDialog({ if (kparse(x).version > $api.version) {
title: 'EndPwn3: EPAPI Update Available', // if the version on the server is newer, pester the user
body: 'An update to EPAPI has been released. It is recommended that you restart your client in order to gain access to new features and maintain compatibility.', $api.ui.showDialog({
confirmText: 'Restart Now', cancelText: 'Later',
// user pressed "Restart Now" title: 'EndPwn3: EPAPI Update Available',
onConfirm: () => { body: 'An update to EPAPI has been released. It is recommended that you restart your client in order to gain access to new features and maintain compatibility.',
confirmText: 'Restart Now', cancelText: 'Later',
// refresh the page if we're running in a browser, reboot the app if we're running outside of lite mode // user pressed "Restart Now"
if ($api.lite) location.reload(); onConfirm: () => {
else reload();
}, // refresh the page if we're running in a browser, reboot the app if we're running outside of lite mode
if ($api.lite) location.reload();
else reload();
// they pressed "Later", for some reason },
onCancel: () => {
// bother them again in 6 hrs (* 60 min * 60 sec * 1000 ms) // they pressed "Later", for some reason
setTimeout(arguments.callee, 6 * 60 * 60 * 1000); onCancel: () => {
} // bother them again in 6 hrs (* 60 min * 60 sec * 1000 ms)
setTimeout(arguments.callee, 6 * 60 * 60 * 1000);
}); }
} });
}); }
})(); });
})();
}); });