oops i broke analysis

This commit is contained in:
GDColon 2020-09-29 21:58:25 -04:00
parent 1884d58e46
commit 2375d0fcac
3 changed files with 8 additions and 5 deletions

View file

@ -1,4 +1,4 @@
const pako = require('zlib')
const zlib = require('zlib')
const properties = require('../misc/objectProperties.json')
const init = require('../misc/initialProperties.json')
const colorStuff = require('../misc/colorProperties.json')
@ -16,7 +16,7 @@ if (unencrypted) rawData = level.data
else {
let buffer;
try { buffer = zlib.gzipSync(levelString).toString() }
try { buffer = zlib.unzipSync(levelString).toString() }
catch(e) { return res.send("-1") }
rawData = buffer.toString('utf8')
}

View file

@ -163,6 +163,7 @@ fetch(target).then(res => res.json()).then(lvl => {
if (history) {
$('#autoMode').remove()
$('#lastPage').hide()
if (!lvl.username) return window.location.href = window.location.href.replace("comments", "search")
@ -211,8 +212,10 @@ if (page == 0) {
}
else {
$('#pageDown').show()
$('#firstPage').show()
$('#refreshButton').hide()
if (!history) {
$('#firstPage').show()
$('#refreshButton').hide()
}
}
fetch(`../api${!history ? window.location.pathname : "/comments/" + lvl.playerID}?count=${compact && !auto ? 20 : 10}&page=${page}${history ? "&type=commentHistory" : ""}&${mode}`).then(res => res.json()).then(res => {

View file

@ -183,7 +183,7 @@ $('#difficultytext').html('[[DIFFICULTY]]'.replace(' ', "<br>"))
$('#levelInfo').html($('#levelInfo').html()
.replace('[[ORIGINALINFO]]', [[COPIEDID]] == "0" ? "" : `<br>Original: <a class="youCanClickThis" href="/[[COPIEDID]]"><span style="color:aqua">[[COPIEDID]]</span></a>`)
.replace('[[OBJECTINFO]]', '[[OBJECTS]]' == "0" ? "" : `<br>Objects: <span style="color:yellow">[[OBJECTS]]</span>`)
.replace('[[OBJECTINFO]]', '[[OBJECTS]]' == "0" ? "" : `<br>Objects: <span style="color:yellow">${'[[OBJECTS]]' == "65535" ? "65535+" : '[[OBJECTS]]'}</span>`)
.replace('[[REQUESTED]]', [[STARSREQUESTED]] == "0" ? "" : `<br>Stars Requested: <span style="color:yellow">[[STARSREQUESTED]]</span>`))
if (!'[[UPLOADED]]'.startsWith('[')) {