return Math.floor(Date.now() / 1000);
}
+////////////////////////////////////////////////////////////////
+// Begin display update code.
+////////////////////////////////////////////////////////////////
+
+// Version and flag constants:
+const TELE_VERSION = 1;
+const TELE_FLAG_ALIVE = 1;
+
// Timestamp of last activity, used for NoSleep timeout:
var last_active = tnow();
//// pause and error bar status:
- if ( !(tele.tele_flags & 1) ) { // TELE_FLAG_ALIVE
+ if ( !(tele.tele_flags & TELE_FLAG_ALIVE) ) {
if ( tnow() - last_active > 300 ) // 5 minutes NoSleep timeout
disableNoSleep();
pausebar.style.display = 'none';
errbar.innerHTML = 'Game offline';
return;
}
- else if ( tele.tele_version !== 1 ) { // TELE_VERSION
+ else if ( tele.tele_version !== TELE_VERSION ) {
errbar.style.display = 'block';
errbar.innerHTML = 'Version mismatch';
} else {
xhttp.onreadystatechange = update_cb;
window.setInterval(loadDoc, 333);
+////////////////////////////////////////////////////////////////
+// End display update code.
+////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
// Begin disable mobile sleep.